@nativescript/core
Version:
A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.
33 lines (32 loc) • 1.23 kB
TypeScript
import { Observable } from '../data/observable';
/**
* Manages internal framework global state
*/
export declare class NativeScriptGlobalState {
events: Observable;
launched: boolean;
appEventWiring: Array<any>;
private _appInstanceReady;
private _setLaunched;
constructor();
get appInstanceReady(): boolean;
set appInstanceReady(value: boolean);
/**
* Ability for classes to initialize app event handling early even before the app instance is ready during boot cycle avoiding boot race conditions
* @param callback wire up any global event handling inside the callback
*/
addEventWiring(callback: () => void): void;
/**
* Marks the app as launched. Idempotent, and safe to call directly: not every launch
* path raises the legacy `launch` event, so the subscription cannot be relied on.
*/
setLaunched(): void;
}
export declare function getNativeScriptGlobals(): {
events: { [Key in keyof import("../data/observable").Observable]: import("../data/observable").Observable[Key]; };
launched: boolean;
appEventWiring: Array<any>;
appInstanceReady: boolean;
addEventWiring(callback: () => void): void;
setLaunched(): void;
};