mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 03:01:51 +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 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) => {
|
||||
try {
|
||||
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 {
|
||||
const javaFile = new java.io.File(path);
|
||||
const stream = new java.io.FileOutputStream(javaFile);
|
||||
|
Reference in New Issue
Block a user