mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: clean up Application types
This commit is contained in:
@@ -13,22 +13,45 @@ export interface NativeScriptError extends Error {
|
||||
}
|
||||
|
||||
export interface ApplicationEventData extends EventData {
|
||||
/**
|
||||
* UIApplication or undefined, unless otherwise specified. Prefer explicit
|
||||
* properties where possible.
|
||||
*/
|
||||
ios?: any;
|
||||
/**
|
||||
* androidx.appcompat.app.AppCompatActivity or undefined, unless otherwise
|
||||
* specified. Prefer explicit properties where possible.
|
||||
*/
|
||||
android?: any;
|
||||
eventName: string;
|
||||
/**
|
||||
* Careful with this messy type. A significant refactor is needed to make it
|
||||
* strictly extend EventData['object'], which is an Observable. It's used in
|
||||
* various ways:
|
||||
* - By font-scale: the Application module, typeof import('.')
|
||||
* - Within index.android.ts: AndroidApplication
|
||||
* - Within index.ios.ts: iOSApplication
|
||||
*/
|
||||
object: any;
|
||||
}
|
||||
|
||||
export interface LaunchEventData extends ApplicationEventData {
|
||||
/**
|
||||
* The value stored into didFinishLaunchingWithOptions notification's
|
||||
* userInfo under 'UIApplicationLaunchOptionsLocalNotificationKey';
|
||||
* otherwise, null.
|
||||
*/
|
||||
ios: unknown;
|
||||
root?: View | null;
|
||||
savedInstanceState?: any /* android.os.Bundle */;
|
||||
}
|
||||
|
||||
export interface OrientationChangedEventData extends ApplicationEventData {
|
||||
android: any /* globalAndroid.app.Application */;
|
||||
newValue: 'portrait' | 'landscape' | 'unknown';
|
||||
}
|
||||
|
||||
export interface SystemAppearanceChangedEventData extends ApplicationEventData {
|
||||
android: any /* globalAndroid.app.Application */;
|
||||
newValue: 'light' | 'dark';
|
||||
}
|
||||
|
||||
@@ -42,15 +65,14 @@ export interface DiscardedErrorEventData extends ApplicationEventData {
|
||||
error: NativeScriptError;
|
||||
}
|
||||
|
||||
export interface CssChangedEventData extends EventData {
|
||||
export interface CssChangedEventData extends ApplicationEventData {
|
||||
cssFile?: string;
|
||||
cssText?: string;
|
||||
}
|
||||
|
||||
export interface AndroidActivityEventData {
|
||||
export interface AndroidActivityEventData extends ApplicationEventData {
|
||||
activity: any /* androidx.appcompat.app.AppCompatActivity */;
|
||||
eventName: string;
|
||||
object: any;
|
||||
object: any /* AndroidApplication */;
|
||||
}
|
||||
|
||||
export interface AndroidActivityBundleEventData extends AndroidActivityEventData {
|
||||
@@ -84,6 +106,6 @@ export interface RootViewControllerImpl {
|
||||
contentController: any;
|
||||
}
|
||||
|
||||
export interface LoadAppCSSEventData extends EventData {
|
||||
export interface LoadAppCSSEventData extends ApplicationEventData {
|
||||
cssFile: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user