mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 18:12:09 +08:00
feat(android): types for API Level 30 and cleanup (#9219)
API Level 30 is now included. Also the `native` namespace used for Android/Java typings no longer collides with integrations. BREAKING CHANGE: If you were using`native.Array` for any of your own custom plugin typings, you can switch them to `androidNative.Array` BEFORE: ``` public writeAsync(path: string, bytes: native.Array<number>) ... ``` AFTER: ``` public writeAsync(path: string, bytes: androidNative.Array<number>) ... ```
This commit is contained in:
@ -269,7 +269,7 @@ export class FileSystemAccess {
|
|||||||
|
|
||||||
public write = this.writeSync.bind(this);
|
public write = this.writeSync.bind(this);
|
||||||
|
|
||||||
public writeAsync(path: string, bytes: native.Array<number>): Promise<void> {
|
public writeAsync(path: string, bytes: androidNative.Array<number>): Promise<void> {
|
||||||
return new Promise<void>((resolve, reject) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
org.nativescript.widgets.Async.File.write(
|
org.nativescript.widgets.Async.File.write(
|
||||||
@ -291,7 +291,7 @@ export class FileSystemAccess {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public writeSync(path: string, bytes: native.Array<number>, onError?: (error: any) => any) {
|
public writeSync(path: string, bytes: androidNative.Array<number>, onError?: (error: any) => any) {
|
||||||
try {
|
try {
|
||||||
const javaFile = new java.io.File(path);
|
const javaFile = new java.io.File(path);
|
||||||
const stream = new java.io.FileOutputStream(javaFile);
|
const stream = new java.io.FileOutputStream(javaFile);
|
||||||
|
@ -204,7 +204,7 @@ function refreshBorderDrawable(this: void, view: View, borderDrawable: org.nativ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createNativeCSSValueArray(css: string): native.Array<org.nativescript.widgets.CSSValue> {
|
function createNativeCSSValueArray(css: string): androidNative.Array<org.nativescript.widgets.CSSValue> {
|
||||||
if (!css) {
|
if (!css) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/types-android",
|
"name": "@nativescript/types-android",
|
||||||
"version": "7.2.0",
|
"version": "7.3.0-rc.0",
|
||||||
"description": "NativeScript Types for Android.",
|
"description": "NativeScript Types for Android.",
|
||||||
"homepage": "https://nativescript.org",
|
"homepage": "https://nativescript.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
3
packages/types-android/src/lib/android-30.d.ts
vendored
Normal file
3
packages/types-android/src/lib/android-30.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/// <reference path="./android/android-platform-30.d.ts" />
|
||||||
|
/// <reference path="./android/androidx-30.d.ts" />
|
||||||
|
/// <reference path="./android/common.d.ts" />
|
@ -18,6 +18,7 @@ interface ArrayConstructor {
|
|||||||
create(type: any, count: number): any;
|
create(type: any, count: number): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module native { export class Array<T> { constructor(); length: number; [index: number]: T; } }
|
declare module androidNative { export class Array<T> { constructor(); length: number; [index: number]: T; } }
|
||||||
|
|
||||||
import globalAndroid = android;
|
import globalAndroid = android;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
132754
packages/types-android/src/lib/android/android-platform-30.d.ts
vendored
Normal file
132754
packages/types-android/src/lib/android/android-platform-30.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
8047
packages/types-android/src/lib/android/androidx-17.d.ts
vendored
8047
packages/types-android/src/lib/android/androidx-17.d.ts
vendored
File diff suppressed because it is too large
Load Diff
8568
packages/types-android/src/lib/android/androidx-23.d.ts
vendored
8568
packages/types-android/src/lib/android/androidx-23.d.ts
vendored
File diff suppressed because it is too large
Load Diff
8776
packages/types-android/src/lib/android/androidx-26.d.ts
vendored
8776
packages/types-android/src/lib/android/androidx-26.d.ts
vendored
File diff suppressed because it is too large
Load Diff
8760
packages/types-android/src/lib/android/androidx-28.d.ts
vendored
8760
packages/types-android/src/lib/android/androidx-28.d.ts
vendored
File diff suppressed because it is too large
Load Diff
8802
packages/types-android/src/lib/android/androidx-29.d.ts
vendored
8802
packages/types-android/src/lib/android/androidx-29.d.ts
vendored
File diff suppressed because it is too large
Load Diff
42351
packages/types-android/src/lib/android/androidx-30.d.ts
vendored
Normal file
42351
packages/types-android/src/lib/android/androidx-30.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/types-ios",
|
"name": "@nativescript/types-ios",
|
||||||
"version": "7.2.0",
|
"version": "7.3.0-rc.0",
|
||||||
"description": "NativeScript Types for iOS.",
|
"description": "NativeScript Types for iOS.",
|
||||||
"homepage": "https://nativescript.org",
|
"homepage": "https://nativescript.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/types",
|
"name": "@nativescript/types",
|
||||||
"version": "7.2.0",
|
"version": "7.3.0-rc.0",
|
||||||
"description": "NativeScript Types for all supported platforms.",
|
"description": "NativeScript Types for all supported platforms.",
|
||||||
"homepage": "https://nativescript.org",
|
"homepage": "https://nativescript.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -12,7 +12,7 @@
|
|||||||
],
|
],
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nativescript/types-ios": "7.2.0",
|
"@nativescript/types-ios": "7.3.0-rc.0",
|
||||||
"@nativescript/types-android": "7.2.0"
|
"@nativescript/types-android": "7.3.0-rc.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user