mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor: improved core barrel exports and Application class (#10286)
BREAKING CHANGES:
`Application.orientation` is no longer a function.
Migration: Remove `()` from the `Application.orientation()` call:
```diff
import { Application } from "@nativescript/core";
-console.log(Application.orientation());
+console.log(Application.orientation);
```
`Application.systemAppearance` is no longer a function.
Migration: Remove `()` from the `Application.systemAppearance()` call:
```diff
import { Application } from "@nativescript/core";
-console.log(Application.systemAppearance());
+console.log(Application.systemAppearance);
```
This commit is contained in:
committed by
Nathan Walker
parent
963d0243de
commit
f64355ba7a
@@ -1,18 +1,23 @@
|
||||
import { iOSNativeHelper } from './native-helper';
|
||||
import { Trace } from '../trace';
|
||||
import { ios as iOSUtils } from './native-helper';
|
||||
|
||||
export { dataDeserialize, dataSerialize, iOSNativeHelper } from './native-helper';
|
||||
export * from './layout-helper';
|
||||
export { clearInterval, clearTimeout, setInterval, setTimeout } from '../timer';
|
||||
export * from './common';
|
||||
export { Source } from './debug';
|
||||
export * from './constants';
|
||||
export * from './debug';
|
||||
export * from './layout-helper';
|
||||
export * from './macrotask-scheduler';
|
||||
export * from './mainthread-helper';
|
||||
export * from './native-helper';
|
||||
export * from './types';
|
||||
|
||||
export function openFile(filePath: string): boolean {
|
||||
try {
|
||||
const appPath = iOSNativeHelper.getCurrentAppPath();
|
||||
const path = iOSNativeHelper.isRealDevice() ? filePath.replace('~', appPath) : filePath;
|
||||
const appPath = iOSUtils.getCurrentAppPath();
|
||||
const path = iOSUtils.isRealDevice() ? filePath.replace('~', appPath) : filePath;
|
||||
|
||||
const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path));
|
||||
controller.delegate = iOSNativeHelper.createUIDocumentInteractionControllerDelegate();
|
||||
controller.delegate = iOSUtils.createUIDocumentInteractionControllerDelegate();
|
||||
|
||||
return controller.presentPreviewAnimated(true);
|
||||
} catch (e) {
|
||||
@@ -45,7 +50,7 @@ export function openUrl(location: string): boolean {
|
||||
}
|
||||
|
||||
export function isRealDevice(): boolean {
|
||||
return iOSNativeHelper.isRealDevice();
|
||||
return iOSUtils.isRealDevice();
|
||||
}
|
||||
|
||||
export const ad = 0;
|
||||
|
||||
Reference in New Issue
Block a user