@nativescript/core
Version:
A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.
82 lines (81 loc) • 4.69 kB
TypeScript
import { CoreTypes } from '../core-types';
import type { View } from '../ui/core/view';
import { NavigationEntry } from '../ui/frame/frame-common';
import { ApplicationCommon } from './application-common';
import { CommonA11YServiceEnabledObservable, AndroidAccessibilityEvent } from '../accessibility/accessibility-common';
import type { AndroidApplication as IAndroidApplication } from './application';
export declare class AndroidApplication extends ApplicationCommon implements IAndroidApplication {
static readonly activityCreatedEvent = "activityCreated";
static readonly activityDestroyedEvent = "activityDestroyed";
static readonly activityStartedEvent = "activityStarted";
static readonly activityPausedEvent = "activityPaused";
static readonly activityResumedEvent = "activityResumed";
static readonly activityStoppedEvent = "activityStopped";
static readonly saveActivityStateEvent = "saveActivityState";
static readonly activityResultEvent = "activityResult";
static readonly activityBackPressedEvent = "activityBackPressed";
static readonly activityNewIntentEvent = "activityNewIntent";
static readonly activityRequestPermissionsEvent = "activityRequestPermissions";
readonly activityCreatedEvent = "activityCreated";
readonly activityDestroyedEvent = "activityDestroyed";
readonly activityStartedEvent = "activityStarted";
readonly activityPausedEvent = "activityPaused";
readonly activityResumedEvent = "activityResumed";
readonly activityStoppedEvent = "activityStopped";
readonly saveActivityStateEvent = "saveActivityState";
readonly activityResultEvent = "activityResult";
readonly activityBackPressedEvent = "activityBackPressed";
readonly activityNewIntentEvent = "activityNewIntent";
readonly activityRequestPermissionsEvent = "activityRequestPermissions";
private _nativeApp;
private _context;
private _packageName;
private lifecycleCallbacks;
private componentCallbacks;
init(nativeApp: android.app.Application): void;
private _registeredReceivers;
private _registeredReceiversById;
private _nextReceiverId;
private _pendingReceiverRegistrations;
private _registerPendingReceivers;
onConfigurationChanged(configuration: android.content.res.Configuration): void;
getNativeApplication(): globalAndroid.app.Application;
get nativeApp(): android.app.Application;
run(entry?: string | NavigationEntry): void;
get startActivity(): androidx.appcompat.app.AppCompatActivity;
get foregroundActivity(): androidx.appcompat.app.AppCompatActivity;
setStartActivity(value: androidx.appcompat.app.AppCompatActivity): void;
setForegroundActivity(value: androidx.appcompat.app.AppCompatActivity): void;
get paused(): boolean;
get backgrounded(): boolean;
get context(): globalAndroid.content.Context;
get packageName(): string;
registerBroadcastReceiver(intentFilter: string, onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void, flags?: number): () => void;
private _registerReceiver;
unregisterBroadcastReceiver(intentFilter: string): void;
getRegisteredBroadcastReceiver(intentFilter: string): android.content.BroadcastReceiver | undefined;
getRegisteredBroadcastReceivers(intentFilter: string): android.content.BroadcastReceiver[];
getRootView(): View;
resetRootView(entry?: NavigationEntry | string): void;
getSystemAppearance(): 'light' | 'dark';
private getSystemAppearanceValue;
getLayoutDirection(): CoreTypes.LayoutDirectionType;
private getLayoutDirectionValue;
getOrientation(): "portrait" | "landscape" | "unknown";
private getOrientationValue;
get android(): this;
}
export * from './application-common';
export declare const Application: AndroidApplication;
export declare const iOSApplication: any;
export declare function getCurrentFontScale(): number;
export declare function getAndroidAccessibilityManager(): android.view.accessibility.AccessibilityManager | null;
export declare class AccessibilityServiceEnabledObservable extends CommonA11YServiceEnabledObservable {
constructor();
}
export declare function ensureClasses(): void;
export declare function updateCurrentHelperClasses(applyRootCssClass: (cssClasses: string[], newCssClass: string) => void): void;
export declare function initAccessibilityCssHelper(): void;
export declare function isAccessibilityServiceEnabled(): boolean;
export declare function updateAccessibilityProperties(view: View): void;
export declare function sendAccessibilityEvent(view: View, eventType: AndroidAccessibilityEvent, text?: string): void;