| 180 | } |
| 181 | |
| 182 | export class ApplicationCommon { |
| 183 | readonly launchEvent = 'launch'; |
| 184 | readonly suspendEvent = 'suspend'; |
| 185 | readonly displayedEvent = 'displayed'; |
| 186 | readonly backgroundEvent = 'background'; |
| 187 | readonly foregroundEvent = 'foreground'; |
| 188 | readonly resumeEvent = 'resume'; |
| 189 | readonly exitEvent = 'exit'; |
| 190 | readonly lowMemoryEvent = 'lowMemory'; |
| 191 | readonly uncaughtErrorEvent = 'uncaughtError'; |
| 192 | readonly discardedErrorEvent = 'discardedError'; |
| 193 | readonly orientationChangedEvent = 'orientationChanged'; |
| 194 | readonly systemAppearanceChangedEvent = 'systemAppearanceChanged'; |
| 195 | readonly layoutDirectionChangedEvent = 'layoutDirectionChanged'; |
| 196 | readonly fontScaleChangedEvent = 'fontScaleChanged'; |
| 197 | readonly livesyncEvent = 'livesync'; |
| 198 | readonly loadAppCssEvent = 'loadAppCss'; |
| 199 | readonly cssChangedEvent = 'cssChanged'; |
| 200 | readonly initRootViewEvent = 'initRootView'; |
| 201 | |
| 202 | // Expose statically for backwards compat on AndroidApplication.on etc. |
| 203 | /** |
| 204 | * @deprecated Use `Application.android.on()` instead. |
| 205 | */ |
| 206 | static on: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents); |
| 207 | /** |
| 208 | * @deprecated Use `Application.android.once()` instead. |
| 209 | */ |
| 210 | static once: ApplicationEvents['on'] = globalEvents.once.bind(globalEvents); |
| 211 | /** |
| 212 | * @deprecated Use `Application.android.off()` instead. |
| 213 | */ |
| 214 | static off: ApplicationEvents['off'] = globalEvents.off.bind(globalEvents); |
| 215 | /** |
| 216 | * @deprecated Use `Application.android.notify()` instead. |
| 217 | */ |
| 218 | static notify: ApplicationEvents['notify'] = globalEvents.notify.bind(globalEvents); |
| 219 | /** |
| 220 | * @deprecated Use `Application.android.hasListeners()` instead. |
| 221 | */ |
| 222 | static hasListeners: ApplicationEvents['hasListeners'] = globalEvents.hasListeners.bind(globalEvents); |
| 223 | |
| 224 | // Application events go through the global events. |
| 225 | on: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents); |
| 226 | once: ApplicationEvents['on'] = globalEvents.once.bind(globalEvents); |
| 227 | off: ApplicationEvents['off'] = globalEvents.off.bind(globalEvents); |
| 228 | notify: ApplicationEvents['notify'] = globalEvents.notify.bind(globalEvents); |
| 229 | hasListeners: ApplicationEvents['hasListeners'] = globalEvents.hasListeners.bind(globalEvents); |
| 230 | |
| 231 | private _orientation: 'portrait' | 'landscape' | 'unknown'; |
| 232 | private _systemAppearance: 'dark' | 'light' | null; |
| 233 | private _layoutDirection: CoreTypes.LayoutDirectionType | null; |
| 234 | private _inBackground: boolean = false; |
| 235 | private _suspended: boolean = false; |
| 236 | private _cssFile = './app.css'; |
| 237 | |
| 238 | protected mainEntry: NavigationEntry; |
| 239 | |