@nativescript/core
Version:
A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.
81 lines (80 loc) • 3.11 kB
TypeScript
import { View } from '../ui/core/view';
import { NavigationEntry } from '../ui/frame/frame-interfaces';
import type { iOSApplication as IiOSApplication } from './application';
import { ApplicationCommon } from './application-common';
declare class CADisplayLinkTarget extends NSObject {
private _owner;
static initWithOwner(owner: WeakRef<iOSApplication>): CADisplayLinkTarget;
onDisplayed(link: CADisplayLink): void;
static ObjCExposedMethods: {
onDisplayed: {
returns: interop.Type<void>;
params: (typeof CADisplayLink)[];
};
};
}
declare class NotificationObserver extends NSObject {
private _onReceiveCallback;
static initWithCallback(onReceiveCallback: (notification: NSNotification) => void): NotificationObserver;
onReceive(notification: NSNotification): void;
static ObjCExposedMethods: {
onReceive: {
returns: interop.Type<void>;
params: (typeof NSNotification)[];
};
};
}
export declare class iOSApplication extends ApplicationCommon implements IiOSApplication {
private _delegate;
private _delegateHandlers;
private _window;
private _notificationObservers;
private _rootView;
displayedOnce: boolean;
displayedLinkTarget: CADisplayLinkTarget;
displayedLink: CADisplayLink;
/**
* @internal - should not be constructed by the user.
*/
constructor();
getRootView(): View;
resetRootView(view?: View): void;
run(entry?: string | NavigationEntry): void;
private runAsMainApp;
private runAsEmbeddedApp;
private getViewController;
private setViewControllerView;
setMaxRefreshRate(options?: {
min?: number;
max?: number;
preferred?: number;
}): void;
get rootController(): UIViewController;
get nativeApp(): UIApplication;
get window(): UIWindow;
get delegate(): UIApplicationDelegate & {
prototype: UIApplicationDelegate;
};
set delegate(value: UIApplicationDelegate | unknown);
addDelegateHandler<T extends keyof UIApplicationDelegate>(methodName: T, handler: (typeof UIApplicationDelegate.prototype)[T]): void;
getNativeApplication(): UIApplication;
addNotificationObserver(notificationName: string, onReceiveCallback: (notification: NSNotification) => void): NotificationObserver;
removeNotificationObserver(observer: any, notificationName: string): void;
protected getSystemAppearance(): 'light' | 'dark';
private getSystemAppearanceValue;
protected getOrientation(): "portrait" | "landscape" | "unknown";
private getOrientationValue;
private notifyAppStarted;
_onLivesync(context?: ModuleContext): void;
private setWindowContent;
private didFinishLaunchingWithOptions;
private didBecomeActive;
private didEnterBackground;
private willTerminate;
private didReceiveMemoryWarning;
private didChangeStatusBarOrientation;
get ios(): this;
}
export * from './application-common';
export declare const Application: iOSApplication;
export declare const AndroidApplication: any;