Repository navigation
Expand file tree
/
Copy pathapplication.d.ts
More file actions
194 lines (169 loc) · 8.98 KB
/
Copy pathapplication.d.ts
File metadata and controls
194 lines (169 loc) · 8.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
import { ApplicationCommon } from './application-common';
export * from './application-common';
export * from './application-interfaces';
export const Application: ApplicationCommon;
export class AndroidApplication extends ApplicationCommon {
/**
* @deprecated Use `Application.android.activityCreatedEvent` instead.
*/
static readonly activityCreatedEvent = 'activityCreated';
/**
* @deprecated Use `Application.android.activityDestroyedEvent` instead.
*/
static readonly activityDestroyedEvent = 'activityDestroyed';
/**
* @deprecated Use `Application.android.activityStartedEvent` instead.
*/
static readonly activityStartedEvent = 'activityStarted';
/**
* @deprecated Use `Application.android.activityPausedEvent` instead.
*/
static readonly activityPausedEvent = 'activityPaused';
/**
* @deprecated Use `Application.android.activityResumedEvent` instead.
*/
static readonly activityResumedEvent = 'activityResumed';
/**
* @deprecated Use `Application.android.activityStoppedEvent` instead.
*/
static readonly activityStoppedEvent = 'activityStopped';
/**
* @deprecated Use `Application.android.saveActivityStateEvent` instead.
*/
static readonly saveActivityStateEvent = 'saveActivityState';
/**
* @deprecated Use `Application.android.activityResultEvent` instead.
*/
static readonly activityResultEvent = 'activityResult';
/**
* @deprecated Use `Application.android.activityBackPressedEvent` instead.
*/
static readonly activityBackPressedEvent = 'activityBackPressed';
/**
* @deprecated Use `Application.android.activityNewIntentEvent` instead.
*/
static readonly activityNewIntentEvent = 'activityNewIntent';
/**
* @deprecated Use `Application.android.activityRequestPermissionsEvent` instead.
*/
static readonly activityRequestPermissionsEvent = 'activityRequestPermissions';
readonly activityCreatedEvent = AndroidApplication.activityCreatedEvent;
readonly activityDestroyedEvent = AndroidApplication.activityDestroyedEvent;
readonly activityStartedEvent = AndroidApplication.activityStartedEvent;
readonly activityPausedEvent = AndroidApplication.activityPausedEvent;
readonly activityResumedEvent = AndroidApplication.activityResumedEvent;
readonly activityStoppedEvent = AndroidApplication.activityStoppedEvent;
readonly saveActivityStateEvent = AndroidApplication.saveActivityStateEvent;
readonly activityResultEvent = AndroidApplication.activityResultEvent;
readonly activityBackPressedEvent = AndroidApplication.activityBackPressedEvent;
readonly activityNewIntentEvent = AndroidApplication.activityNewIntentEvent;
readonly activityRequestPermissionsEvent = AndroidApplication.activityRequestPermissionsEvent;
getNativeApplication(): android.app.Application;
/**
* @internal
*/
init(nativeApp: android.app.Application): void;
/**
* The [android Application](http://developer.android.com/reference/android/app/Application.html) object instance provided to the init of the module.
*/
get nativeApp(): android.app.Application;
/**
* @deprecated Use `Utils.android.getPackageName()` instead.
*/
get packageName(): string;
/**
* The main (start) Activity for the application.
*/
get startActivity(): androidx.appcompat.app.AppCompatActivity;
/**
* The currently active (loaded) [android Activity](http://developer.android.com/reference/android/app/Activity.html).
*
* This property is automatically updated upon Activity events.
*/
get foregroundActivity(): androidx.appcompat.app.AppCompatActivity;
/**
* @deprecated Use `Utils.android.getApplicationContext()` instead.
*/
get context(): android.content.Context;
/**
* @deprecated Use `Application.inBackground` instead.
*/
get backgrounded(): boolean;
/**
* @deprecated Use `Application.suspended` instead.
*/
get paused(): boolean;
/**
* Register a BroadcastReceiver to be run in the main activity thread. The receiver will be called with any broadcast Intent that matches filter, in the main application thread.
* For more information, please visit 'http://developer.android.com/reference/android/content/Context.html#registerReceiver%28android.content.BroadcastReceiver,%20android.content.IntentFilter%29'
* @param intentFilter A string containing the intent filter.
* @param onReceiveCallback A callback function that will be called each time the receiver receives a broadcast.
*/
registerBroadcastReceiver(intentFilter: string, onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void): void;
/**
* Unregister a previously registered BroadcastReceiver.
* For more information, please visit 'http://developer.android.com/reference/android/content/Context.html#unregisterReceiver(android.content.BroadcastReceiver)'
* @param intentFilter A string containing the intent filter with which the receiver was originally registered.
*/
unregisterBroadcastReceiver(intentFilter: string): void;
/**
* Get a registered BroadcastReceiver, then you can get the result code of BroadcastReceiver in onReceiveCallback method.
* @param intentFilter A string containing the intent filter.
*/
getRegisteredBroadcastReceiver(intentFilter: string): android.content.BroadcastReceiver;
on(event: 'activityCreated', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any): void;
on(event: 'activityDestroyed', callback: (args: AndroidActivityEventData) => void, thisArg?: any): void;
on(event: 'activityStarted', callback: (args: AndroidActivityEventData) => void, thisArg?: any): void;
on(event: 'activityPaused', callback: (args: AndroidActivityEventData) => void, thisArg?: any): void;
on(event: 'activityResumed', callback: (args: AndroidActivityEventData) => void, thisArg?: any): void;
on(event: 'activityStopped', callback: (args: AndroidActivityEventData) => void, thisArg?: any): void;
on(event: 'saveActivityState', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any): void;
on(event: 'activityResult', callback: (args: AndroidActivityResultEventData) => void, thisArg?: any): void;
on(event: 'activityBackPressed', callback: (args: AndroidActivityBackPressedEventData) => void, thisArg?: any): void;
on(event: 'activityNewIntent', callback: (args: AndroidActivityNewIntentEventData) => void, thisArg?: any): void;
on(event: 'activityRequestPermissions', callback: (args: AndroidActivityRequestPermissionsEventData) => void, thisArg?: any): void;
}
export class iOSApplication extends ApplicationCommon {
/**
* The root view controller for the application.
*/
get rootController(): UIViewController;
/**
* The [UIApplication](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/index.html).
*/
get nativeApp(): UIApplication;
/**
* The key window.
*/
get window(): UIWindow;
/**
* The [UIApplicationDelegate](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/index.html) class.
*/
get delegate(): UIApplicationDelegate & { prototype: UIApplicationDelegate };
/**
* Sets a custom [UIApplicationDelegate](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/index.html) class.
*/
set delegate(value: UIApplicationDelegate | unknown);
/**
* Adds a delegate handler for the specified delegate method name. This method does not replace an existing handler,
* but rather adds the new handler to the existing chain of handlers.
* @param methodName The name of the delegate method to add a handler for.
* @param handler A function that will be called when the specified delegate method is called.
*/
addDelegateHandler<T extends keyof UIApplicationDelegate>(methodName: T, handler: (typeof UIApplicationDelegate.prototype)[T]): void;
/**
* Adds an observer to the default notification center for the specified notification.
* For more information, please visit 'https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/#//apple_ref/occ/instm/NSNotificationCenter/addObserver:selector:name:object:'
* @param notificationName A string containing the name of the notification.
* @param onReceiveCallback A callback function that will be called each time the observer receives a notification.
*/
addNotificationObserver(notificationName: string, onReceiveCallback: (notification: NSNotification) => void): NotificationObserver;
/**
* Removes the observer for the specified notification from the default notification center.
* For more information, please visit 'https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/#//apple_ref/occ/instm/NSNotificationCenter/addObserver:selector:name:object:'
* @param observer The observer that was returned from the addNotificationObserver method.
* @param notificationName A string containing the name of the notification.
* @param onReceiveCallback A callback function that will be called each time the observer receives a notification.
*/
removeNotificationObserver(observer: any, notificationName: string);
}