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:
Nathan Walker
2021-02-27 12:45:49 -08:00
committed by GitHub
parent c5c8615529
commit ebcc0e2cc0
27 changed files with 256952 additions and 51108 deletions

View File

@ -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);