@akylas/nativescript 9.1.4 → 9.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/application/application-common.d.ts +9 -3
  2. package/application/application-common.js +16 -3
  3. package/application/application-common.js.map +1 -1
  4. package/application/application.android.js +2 -6
  5. package/application/application.android.js.map +1 -1
  6. package/application/application.ios.js +8 -12
  7. package/application/application.ios.js.map +1 -1
  8. package/application/helpers-common.d.ts +2 -0
  9. package/application/helpers-common.js +23 -0
  10. package/application/helpers-common.js.map +1 -1
  11. package/config/config.interface.d.ts +1 -1
  12. package/config/config.interface.js.map +1 -1
  13. package/css-mediaquery/index.d.ts +6 -1
  14. package/css-mediaquery/index.js +31 -2
  15. package/css-mediaquery/index.js.map +1 -1
  16. package/debugger/webinspector-network.d.ts +29 -0
  17. package/fetch/index.d.ts +79 -0
  18. package/fetch/index.js +408 -0
  19. package/fetch/index.js.map +1 -0
  20. package/file-system/file-system-access.android.d.ts +1 -0
  21. package/file-system/file-system-access.android.js +18 -21
  22. package/file-system/file-system-access.android.js.map +1 -1
  23. package/global-types.d.ts +1 -1
  24. package/globals/index.js +4 -4
  25. package/globals/index.js.map +1 -1
  26. package/http/http-request/index.android.js +5 -1
  27. package/http/http-request/index.android.js.map +1 -1
  28. package/http/http-request-internal/http-request-internal-common.d.ts +1 -0
  29. package/http/http-request-internal/http-request-internal-common.js +9 -0
  30. package/http/http-request-internal/http-request-internal-common.js.map +1 -1
  31. package/http/http-request-internal/index.android.js +7 -5
  32. package/http/http-request-internal/index.android.js.map +1 -1
  33. package/http/http-request-internal/index.ios.js +33 -16
  34. package/http/http-request-internal/index.ios.js.map +1 -1
  35. package/image-source/index.ios.js +7 -6
  36. package/image-source/index.ios.js.map +1 -1
  37. package/index.d.ts +1 -1
  38. package/js-libs/easysax/easysax.d.ts +49 -7
  39. package/js-libs/easysax/easysax.js +631 -747
  40. package/js-libs/easysax/easysax.js.map +1 -0
  41. package/media-query-list/index.js +57 -15
  42. package/media-query-list/index.js.map +1 -1
  43. package/module-name-resolver/helpers.d.ts +1 -1
  44. package/module-name-resolver/helpers.js.map +1 -1
  45. package/module-name-resolver/index.d.ts +2 -2
  46. package/module-name-resolver/index.js.map +1 -1
  47. package/native-window/native-window.ios.js +3 -5
  48. package/native-window/native-window.ios.js.map +1 -1
  49. package/package.json +2 -3
  50. package/timer/index.android.js +2 -1
  51. package/timer/index.android.js.map +1 -1
  52. package/ui/action-bar/index.android.js +5 -4
  53. package/ui/action-bar/index.android.js.map +1 -1
  54. package/ui/animation/index.ios.js +6 -1
  55. package/ui/animation/index.ios.js.map +1 -1
  56. package/ui/builder/binding-builder.d.ts +8 -0
  57. package/ui/builder/binding-builder.js +12 -0
  58. package/ui/builder/binding-builder.js.map +1 -1
  59. package/ui/builder/component-builder/index.d.ts +7 -4
  60. package/ui/builder/component-builder/index.js +13 -7
  61. package/ui/builder/component-builder/index.js.map +1 -1
  62. package/ui/builder/index.d.ts +16 -2
  63. package/ui/builder/index.js +52 -12
  64. package/ui/builder/index.js.map +1 -1
  65. package/ui/button/index.android.js +4 -3
  66. package/ui/button/index.android.js.map +1 -1
  67. package/ui/content-view/index.js +2 -0
  68. package/ui/content-view/index.js.map +1 -1
  69. package/ui/core/bindable/bindable-types.d.ts +15 -0
  70. package/ui/core/bindable/bindable-types.js.map +1 -1
  71. package/ui/core/bindable/index.d.ts +1 -1
  72. package/ui/core/bindable/index.js +12 -7
  73. package/ui/core/bindable/index.js.map +1 -1
  74. package/ui/core/view/index.android.js +11 -9
  75. package/ui/core/view/index.android.js.map +1 -1
  76. package/ui/date-picker/index.android.js +1 -1
  77. package/ui/date-picker/index.android.js.map +1 -1
  78. package/ui/editable-text-base/index.android.d.ts +2 -0
  79. package/ui/editable-text-base/index.android.js +15 -6
  80. package/ui/editable-text-base/index.android.js.map +1 -1
  81. package/ui/editable-text-base/index.d.ts +8 -0
  82. package/ui/frame/fragment.transitions.android.d.ts +8 -5
  83. package/ui/frame/fragment.transitions.android.js +16 -18
  84. package/ui/frame/fragment.transitions.android.js.map +1 -1
  85. package/ui/frame/index.android.d.ts +1 -0
  86. package/ui/frame/index.android.js +10 -4
  87. package/ui/frame/index.android.js.map +1 -1
  88. package/ui/gestures/index.android.js +18 -9
  89. package/ui/gestures/index.android.js.map +1 -1
  90. package/ui/gestures/index.ios.js +6 -6
  91. package/ui/gestures/index.ios.js.map +1 -1
  92. package/ui/image/index.android.js +1 -1
  93. package/ui/image/index.android.js.map +1 -1
  94. package/ui/image-cache/index.android.js +1 -2
  95. package/ui/image-cache/index.android.js.map +1 -1
  96. package/ui/index.d.ts +1 -1
  97. package/ui/index.js.map +1 -1
  98. package/ui/list-picker/index.android.d.ts +1 -0
  99. package/ui/list-picker/index.android.js +6 -5
  100. package/ui/list-picker/index.android.js.map +1 -1
  101. package/ui/list-view/index.android.js +17 -9
  102. package/ui/list-view/index.android.js.map +1 -1
  103. package/ui/page/index.ios.js +7 -3
  104. package/ui/page/index.ios.js.map +1 -1
  105. package/ui/search-bar/index.android.js +2 -2
  106. package/ui/search-bar/index.android.js.map +1 -1
  107. package/ui/segmented-bar/index.android.js +8 -8
  108. package/ui/segmented-bar/index.android.js.map +1 -1
  109. package/ui/slider/index.android.js +1 -2
  110. package/ui/slider/index.android.js.map +1 -1
  111. package/ui/styling/background-common.js +2 -2
  112. package/ui/styling/background-common.js.map +1 -1
  113. package/ui/styling/background.d.ts +1 -1
  114. package/ui/styling/background.ios.d.ts +1 -1
  115. package/ui/styling/background.ios.js +1 -1
  116. package/ui/styling/background.ios.js.map +1 -1
  117. package/ui/styling/style/index.d.ts +13 -2
  118. package/ui/styling/style/index.js.map +1 -1
  119. package/ui/styling/style-scope.js +6 -0
  120. package/ui/styling/style-scope.js.map +1 -1
  121. package/ui/switch/index.android.js +1 -1
  122. package/ui/switch/index.android.js.map +1 -1
  123. package/ui/tab-view/index.android.js +9 -16
  124. package/ui/tab-view/index.android.js.map +1 -1
  125. package/ui/tab-view/index.ios.js +2 -2
  126. package/ui/tab-view/index.ios.js.map +1 -1
  127. package/ui/text-base/index.android.js +1 -1
  128. package/ui/text-base/index.android.js.map +1 -1
  129. package/ui/text-base/index.ios.js +1 -1
  130. package/ui/text-base/index.ios.js.map +1 -1
  131. package/ui/time-picker/index.android.js +1 -1
  132. package/ui/time-picker/index.android.js.map +1 -1
  133. package/ui/transition/page-transition.android.js +0 -44
  134. package/ui/transition/page-transition.android.js.map +1 -1
  135. package/ui/web-view/index.android.js +1 -1
  136. package/ui/web-view/index.android.js.map +1 -1
  137. package/utils/android-runtime-version.d.ts +12 -0
  138. package/utils/android-runtime-version.js +36 -0
  139. package/utils/android-runtime-version.js.map +1 -0
  140. package/utils/native-helper-for-android.js +3 -1
  141. package/utils/native-helper-for-android.js.map +1 -1
  142. package/xhr/index.d.ts +5 -4
  143. package/xhr/index.js +18 -18
  144. package/xhr/index.js.map +1 -1
  145. package/xml/index.d.ts +2 -2
  146. package/xml/index.js +1 -1
  147. package/xml/index.js.map +1 -1
  148. package/LICENSE +0 -19
  149. package/fetch/index.mjs +0 -535
@@ -112,7 +112,8 @@ export declare class ApplicationCommon {
112
112
  * so it also fires on a background launch where no window is created.
113
113
  *
114
114
  * Guaranteed ordering: `ready` -> `windowOpen` -> raw connect/create events -> content
115
- * resolution (the legacy `launch` bridge runs here, for the first window only) ->
115
+ * resolution (the legacy `launch` bridge runs here, for the first window and the first
116
+ * one after `exit`) ->
116
117
  * `contentLoaded` -> `activate`/`displayed`.
117
118
  */
118
119
  readonly readyEvent = "ready";
@@ -334,12 +335,17 @@ export declare class ApplicationCommon {
334
335
  * @internal - raises `ready` at most once per JS context.
335
336
  */
336
337
  notifyReady(): void;
338
+ /**
339
+ * @internal - raises `exit` and re-arms the legacy `launch` bridge, since the process
340
+ * can outlive the exit and open a new first window.
341
+ */
342
+ notifyExit(data?: Partial<ApplicationEventData>): void;
337
343
  /**
338
344
  * @internal - produces the content for a window that has none.
339
345
  *
340
346
  * Resolution order: the window content resolver, then the legacy `launch` event
341
- * (offered to the first window that asks for content and to no other), then the
342
- * application main entry. A resolver or a `launch` handler returning `null` takes
347
+ * (offered to the first window that asks for content, and again to the first one after
348
+ * `exit`), then the application main entry. A resolver or a `launch` handler returning `null` takes
343
349
  * ownership of the content, so nothing else is tried. A missing main entry leaves
344
350
  * the window empty instead of throwing, because content can still arrive later
345
351
  * through `run()`/`resetRootView()`.
@@ -56,7 +56,8 @@ export class ApplicationCommon {
56
56
  * so it also fires on a background launch where no window is created.
57
57
  *
58
58
  * Guaranteed ordering: `ready` -> `windowOpen` -> raw connect/create events -> content
59
- * resolution (the legacy `launch` bridge runs here, for the first window only) ->
59
+ * resolution (the legacy `launch` bridge runs here, for the first window and the first
60
+ * one after `exit`) ->
60
61
  * `contentLoaded` -> `activate`/`displayed`.
61
62
  */
62
63
  this.readyEvent = 'ready';
@@ -506,12 +507,24 @@ export class ApplicationCommon {
506
507
  android: this.android,
507
508
  });
508
509
  }
510
+ /**
511
+ * @internal - raises `exit` and re-arms the legacy `launch` bridge, since the process
512
+ * can outlive the exit and open a new first window.
513
+ */
514
+ notifyExit(data) {
515
+ this._launchBridgeConsumed = false;
516
+ this.notify({
517
+ eventName: this.exitEvent,
518
+ object: this,
519
+ ...data,
520
+ });
521
+ }
509
522
  /**
510
523
  * @internal - produces the content for a window that has none.
511
524
  *
512
525
  * Resolution order: the window content resolver, then the legacy `launch` event
513
- * (offered to the first window that asks for content and to no other), then the
514
- * application main entry. A resolver or a `launch` handler returning `null` takes
526
+ * (offered to the first window that asks for content, and again to the first one after
527
+ * `exit`), then the application main entry. A resolver or a `launch` handler returning `null` takes
515
528
  * ownership of the content, so nothing else is tried. A missing main entry leaves
516
529
  * the window empty instead of throwing, because content can still arrive later
517
530
  * through `run()`/`resetRootView()`.
@@ -1 +1 @@
1
- {"version":3,"file":"application-common.js","sourceRoot":"","sources":["../../../../packages/core/application/application-common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ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Device, Screen } from '../platform';\nimport { profile } from '../profiling';\nimport { Trace } from '../trace';\nimport { clearResolverCache, prepareAppForModuleResolver, _setResolver } from '../module-name-resolver/helpers';\nimport { Builder } from '../ui/builder';\nimport * as bindableResources from '../ui/core/bindable/bindable-resources';\nimport type { View } from '../ui/core/view';\nimport type { Frame } from '../ui/frame';\nimport type { NavigationEntry } from '../ui/frame/frame-interfaces';\nimport type { StyleScope } from '../ui/styling/style-scope';\nimport type { AndroidApplication as AndroidApplicationType, iOSApplication as iOSApplicationType } from '.';\nimport type { ApplicationEventData, CssChangedEventData, DiscardedErrorEventData, FontScaleChangedEventData, InitRootViewEventData, LaunchEventData, LoadAppCSSEventData, NativeScriptError, OrientationChangedEventData, SystemAppearanceChangedEventData, LayoutDirectionChangedEventData, UnhandledErrorEventData, SceneOpenURLContextsEventData, SceneContinueUserActivityEventData, ScenePerformActionForShortcutItemEventData } from './application-interfaces';\nimport { getActiveWindow, getAppMainEntry, getAutoSystemAppearanceChanged, isAppInBackground, setActiveWindow, setAppInBackground, setAppMainEntry, setAutoSystemAppearanceChanged } from './helpers-common';\nimport { getNativeScriptGlobals } from '../globals/global-utils';\nimport { SDK_VERSION } from '../utils/constants';\nimport type { NativeWindow, NativeWindowEventData, PrimaryWindowChangedEventData, WindowBase, WindowCloseEventData, WindowContentRequest, WindowContentResolver, WindowLayoutDirectionChangedEventData, WindowOpenEventData, WindowOpenOptions, WindowOrientationChangedEventData, WindowRole, WindowSystemAppearanceChangedEventData } from '../native-window';\nimport { NativeWindowEvents, WindowEvents } from '../native-window/native-window-interfaces';\n\nconst ORIENTATION_CSS_CLASSES = CSSUtils.ORIENTATION_CSS_CLASSES;\nconst SYSTEM_APPEARANCE_CSS_CLASSES = CSSUtils.SYSTEM_APPEARANCE_CSS_CLASSES;\nconst LAYOUT_DIRECTION_CSS_CLASSES = CSSUtils.LAYOUT_DIRECTION_CSS_CLASSES;\n\nconst globalEvents = getNativeScriptGlobals().events;\n\n// Scene lifecycle event names\n/**\n * @deprecated Use `NativeWindowEvents` from `@nativescript/core/native-window` instead.\n */\nexport const SceneEvents = {\n\t/** @deprecated Use `NativeWindowEvents.sceneWillConnect` instead. */\n\tsceneWillConnect: 'sceneWillConnect',\n\t/** @deprecated Use `NativeWindowEvents.sceneDidActivate` instead. */\n\tsceneDidActivate: 'sceneDidActivate',\n\t/** @deprecated Use `NativeWindowEvents.sceneWillResignActive` instead. */\n\tsceneWillResignActive: 'sceneWillResignActive',\n\t/** @deprecated Use `NativeWindowEvents.sceneWillEnterForeground` instead. */\n\tsceneWillEnterForeground: 'sceneWillEnterForeground',\n\t/** @deprecated Use `NativeWindowEvents.sceneDidEnterBackground` instead. */\n\tsceneDidEnterBackground: 'sceneDidEnterBackground',\n\t/** @deprecated Use `NativeWindowEvents.sceneDidDisconnect` instead. */\n\tsceneDidDisconnect: 'sceneDidDisconnect',\n\t/** @deprecated Use the Application 'windowOpen' event and NativeWindow.setContent() instead. */\n\tsceneContentSetup: 'sceneContentSetup',\n};\n\nexport type SceneEventName = (typeof SceneEvents)[keyof typeof SceneEvents];\n\n// helper interface to correctly type Application event handlers\ninterface ApplicationEvents {\n\toff(eventNames: string, callback?: any, thisArg?: any): void;\n\tnotify<T = ApplicationEventData>(eventData: T): void;\n\thasListeners(eventName: string): boolean;\n\n\tonce(eventNames: string, callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\ton(eventNames: string, callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\t/**\n\t * This event is raised when application css is changed.\n\t */\n\ton(event: 'cssChanged', callback: (args: CssChangedEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * Event raised then livesync operation is performed.\n\t */\n\ton(event: 'livesync', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised on application launchEvent.\n\t */\n\ton(event: 'launch', callback: (args: LaunchEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised once the JS context is initialized.\n\t */\n\ton(event: 'ready', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised after the application has performed most of its startup actions.\n\t * Its intent is to be suitable for measuring app startup times.\n\t * @experimental\n\t */\n\ton(event: 'displayed', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the Application is suspended.\n\t */\n\ton(event: 'suspend', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the Application is resumed after it has been suspended.\n\t */\n\ton(event: 'resume', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the Application is about to exit.\n\t *\n\t * On Android it is raised when the last window closes; the process may stay alive.\n\t * On iOS it is raised when the process itself terminates.\n\t */\n\ton(event: 'exit', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when there is low memory on the target device.\n\t */\n\ton(event: 'lowMemory', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when an uncaught error occurs while the application is running.\n\t */\n\ton(event: 'uncaughtError', callback: (args: UnhandledErrorEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when an discarded error occurs while the application is running.\n\t */\n\ton(event: 'discardedError', callback: (args: DiscardedErrorEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the orientation of the application changes.\n\t */\n\ton(event: 'orientationChanged', callback: (args: OrientationChangedEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the operating system appearance changes\n\t * between light and dark theme (for Android);\n\t * between light and dark mode (for iOS) and vice versa.\n\t */\n\ton(event: 'systemAppearanceChanged', callback: (args: SystemAppearanceChangedEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the operating system layout direction changes\n\t * between ltr and rtl.\n\t */\n\ton(event: 'layoutDirectionChanged', callback: (args: LayoutDirectionChangedEventData) => void, thisArg?: any): void;\n\n\ton(event: 'fontScaleChanged', callback: (args: FontScaleChangedEventData) => void, thisArg?: any): void;\n\n\ton(event: 'windowOpen', callback: (args: WindowOpenEventData) => void, thisArg?: any): void;\n\ton(event: 'windowClose', callback: (args: WindowCloseEventData) => void, thisArg?: any): void;\n\ton(event: 'primaryWindowChanged', callback: (args: PrimaryWindowChangedEventData) => void, thisArg?: any): void;\n\n\ton(event: 'sceneOpenURLContexts', callback: (args: SceneOpenURLContextsEventData) => void, thisArg?: any): void;\n\ton(event: 'sceneContinueUserActivity', callback: (args: SceneContinueUserActivityEventData) => void, thisArg?: any): void;\n\ton(event: 'scenePerformActionForShortcutItem', callback: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any): void;\n}\n\nexport class ApplicationCommon {\n\t/**\n\t * @deprecated Use the 'ready' event for application initialization and Application.setWindowContentResolver() to provide window UI. 'launch' continues to fire before the first window's content is created, and its 'root' property is still honored, for backwards compatibility. It never fires for additional windows. In a scene-based app it fires with the first window's content, so a background launch that connects no scene does not raise it.\n\t */\n\treadonly launchEvent = 'launch';\n\t/**\n\t * Raised once per JS context, as soon as the context is initialized. It is never deferred,\n\t * so it also fires on a background launch where no window is created.\n\t *\n\t * Guaranteed ordering: `ready` -> `windowOpen` -> raw connect/create events -> content\n\t * resolution (the legacy `launch` bridge runs here, for the first window only) ->\n\t * `contentLoaded` -> `activate`/`displayed`.\n\t */\n\treadonly readyEvent = 'ready';\n\t/**\n\t * Reflects whole-app state: with multiple windows it is raised once the app itself is\n\t * no longer in the foreground, not when an individual window backgrounds. Listen on a\n\t * NativeWindow for per-window state.\n\t */\n\treadonly suspendEvent = 'suspend';\n\treadonly displayedEvent = 'displayed';\n\treadonly backgroundEvent = 'background';\n\treadonly foregroundEvent = 'foreground';\n\treadonly resumeEvent = 'resume';\n\t/**\n\t * On Android, raised when the last window closes; the process may stay alive.\n\t * On iOS, raised when the process itself terminates.\n\t */\n\treadonly exitEvent = 'exit';\n\treadonly lowMemoryEvent = 'lowMemory';\n\treadonly uncaughtErrorEvent = 'uncaughtError';\n\treadonly discardedErrorEvent = 'discardedError';\n\treadonly orientationChangedEvent = 'orientationChanged';\n\treadonly systemAppearanceChangedEvent = 'systemAppearanceChanged';\n\treadonly layoutDirectionChangedEvent = 'layoutDirectionChanged';\n\treadonly fontScaleChangedEvent = 'fontScaleChanged';\n\treadonly livesyncEvent = 'livesync';\n\treadonly loadAppCssEvent = 'loadAppCss';\n\treadonly cssChangedEvent = 'cssChanged';\n\treadonly initRootViewEvent = 'initRootView';\n\treadonly windowOpenEvent = WindowEvents.windowOpen;\n\treadonly windowCloseEvent = WindowEvents.windowClose;\n\treadonly primaryWindowChangedEvent = WindowEvents.primaryWindowChanged;\n\n\t// Expose statically for backwards compat on AndroidApplication.on etc.\n\t/**\n\t * @deprecated Use `Application.android.on()` instead.\n\t */\n\tstatic on: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents);\n\t/**\n\t * @deprecated Use `Application.android.once()` instead.\n\t */\n\tstatic once: ApplicationEvents['on'] = globalEvents.once.bind(globalEvents);\n\t/**\n\t * @deprecated Use `Application.android.off()` instead.\n\t */\n\tstatic off: ApplicationEvents['off'] = globalEvents.off.bind(globalEvents);\n\t/**\n\t * @deprecated Use `Application.android.notify()` instead.\n\t */\n\tstatic notify: ApplicationEvents['notify'] = globalEvents.notify.bind(globalEvents);\n\t/**\n\t * @deprecated Use `Application.android.hasListeners()` instead.\n\t */\n\tstatic hasListeners: ApplicationEvents['hasListeners'] = globalEvents.hasListeners.bind(globalEvents);\n\n\t// Application events go through the global events.\n\ton: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents);\n\toff: ApplicationEvents['off'] = globalEvents.off.bind(globalEvents);\n\tonce: ApplicationEvents['once'] = globalEvents.once.bind(globalEvents);\n\tnotify: ApplicationEvents['notify'] = globalEvents.notify.bind(globalEvents);\n\thasListeners: ApplicationEvents['hasListeners'] = globalEvents.hasListeners.bind(globalEvents);\n\n\tprivate _orientation: 'portrait' | 'landscape' | 'unknown';\n\tprivate _systemAppearance: 'dark' | 'light' | null;\n\tprivate _layoutDirection: CoreTypes.LayoutDirectionType | null;\n\tprivate _inBackground: boolean = false;\n\tprivate _suspended: boolean = false;\n\tprivate _cssFile = './app.css';\n\tprivate _readyNotified = false;\n\tprivate _appCssLoaded = false;\n\tprivate _launchBridgeConsumed = false;\n\tprivate _windowContentResolver: WindowContentResolver | null = null;\n\n\tprotected mainEntry: NavigationEntry;\n\n\tpublic started = false;\n\t/**\n\t * Boolean to enable/disable systemAppearanceChanged\n\t */\n\tpublic get autoSystemAppearanceChanged(): boolean {\n\t\treturn getAutoSystemAppearanceChanged();\n\t}\n\n\tpublic set autoSystemAppearanceChanged(value: boolean) {\n\t\tsetAutoSystemAppearanceChanged(value);\n\t}\n\n\t/**\n\t * @internal - should not be constructed by the user.\n\t */\n\tconstructor() {\n\t\tgetNativeScriptGlobals().appInstanceReady = true;\n\n\t\tglobal.__onUncaughtError = (error: NativeScriptError) => {\n\t\t\tthis.notify({\n\t\t\t\teventName: this.uncaughtErrorEvent,\n\t\t\t\tobject: this,\n\t\t\t\tandroid: error,\n\t\t\t\tios: error,\n\t\t\t\terror: error,\n\t\t\t} as DiscardedErrorEventData);\n\t\t};\n\n\t\tglobal.__onDiscardedError = (error: NativeScriptError) => {\n\t\t\tthis.notify({\n\t\t\t\teventName: this.discardedErrorEvent,\n\t\t\t\tobject: this,\n\t\t\t\terror: error,\n\t\t\t} as DiscardedErrorEventData);\n\t\t};\n\n\t\tglobal.__onLiveSync = (context?: ModuleContext) => {\n\t\t\tif (this.suspended) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst rootView = this.getRootView();\n\t\t\tthis.livesync(rootView, context);\n\t\t};\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tlivesync(rootView: View, context?: ModuleContext) {\n\t\tthis.notify({ eventName: this.livesyncEvent, object: this });\n\t\tconst liveSyncCore = global.__onLiveSyncCore;\n\t\tlet reapplyAppStyles = false;\n\n\t\t// ModuleContext is available only for Hot Module Replacement\n\t\tif (context && context.path) {\n\t\t\tconst styleExtensions = ['css', 'scss'];\n\t\t\tconst appStylesFullFileName = this.getCssFileName();\n\t\t\tconst appStylesFileName = appStylesFullFileName.substring(0, appStylesFullFileName.lastIndexOf('.') + 1);\n\t\t\treapplyAppStyles = styleExtensions.some((ext) => context.path === appStylesFileName.concat(ext));\n\t\t}\n\n\t\t// Handle application styles\n\t\tif (rootView && reapplyAppStyles) {\n\t\t\trootView._onCssStateChange();\n\t\t} else if (liveSyncCore) {\n\t\t\tliveSyncCore(context);\n\t\t}\n\t}\n\n\t/**\n\t * Applies the the `newCssClass` to the `rootView` and removes all other css classes from `cssClasses`\n\t * previously applied to the `rootView`.\n\t * @param rootView\n\t * @param cssClasses\n\t * @param newCssClass\n\t * @param skipCssUpdate\n\t */\n\tapplyCssClass(rootView: View, cssClasses: string[], newCssClass: string, skipCssUpdate: boolean = false): void {\n\t\tif (!rootView.cssClasses.has(newCssClass)) {\n\t\t\tcssClasses.forEach((cssClass) => this.removeCssClass(rootView, cssClass));\n\t\t\tthis.addCssClass(rootView, newCssClass);\n\t\t\tthis.increaseStyleScopeApplicationCssSelectorVersion(rootView);\n\n\t\t\tif (!skipCssUpdate) {\n\t\t\t\trootView._onCssStateChange();\n\t\t\t}\n\n\t\t\tif (Trace.isEnabled()) {\n\t\t\t\tconst rootCssClasses = Array.from(rootView.cssClasses);\n\t\t\t\tTrace.write(`Applying root css class: ${newCssClass}. rootView css classes: ${rootCssClasses.join(' ')}`, Trace.categories.Style);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate addCssClass(rootView: View, cssClass: string) {\n\t\tCSSUtils.pushToSystemCssClasses(cssClass);\n\t\trootView.cssClasses.add(cssClass);\n\t}\n\n\tprivate removeCssClass(rootView: View, cssClass: string) {\n\t\tCSSUtils.removeSystemCssClass(cssClass);\n\t\trootView.cssClasses.delete(cssClass);\n\t}\n\n\t/**\n\t * Same as {@link applyCssClass}, minus the system class list: window-scoped classes\n\t * must not leak into it, because it seeds every window's root view.\n\t */\n\tprivate applyWindowScopedCssClass(rootView: View, cssClasses: string[], newCssClass: string): void {\n\t\tif (rootView.cssClasses.has(newCssClass)) {\n\t\t\treturn;\n\t\t}\n\n\t\tcssClasses.forEach((cssClass) => rootView.cssClasses.delete(cssClass));\n\t\trootView.cssClasses.add(newCssClass);\n\t\tthis.increaseStyleScopeApplicationCssSelectorVersion(rootView);\n\t}\n\n\t/**\n\t * The modal registry is process-wide, so only the modals presented over this root\n\t * view may follow its window-scoped classes.\n\t */\n\tprivate getOwnedModalViews(rootView: View): View[] {\n\t\treturn (<Array<View>>rootView._getRootModalViews()).filter((modalView) => modalView._getRootModalHost() === rootView);\n\t}\n\n\tpublic increaseStyleScopeApplicationCssSelectorVersion(rootView: View) {\n\t\tconst styleScope: StyleScope = rootView._styleScope ?? (rootView as Frame)?.currentPage?._styleScope;\n\n\t\tif (styleScope) {\n\t\t\tstyleScope._increaseApplicationCssSelectorVersion();\n\t\t}\n\t}\n\n\tprivate setRootViewCSSClasses(rootView: View, window?: NativeWindow): void {\n\t\tconst platform = Device.os.toLowerCase();\n\t\tconst deviceType = Device.deviceType.toLowerCase();\n\t\tconst orientation = window ? window.orientation() : this.orientation();\n\t\tconst systemAppearance = window ? window.systemAppearance() : this.systemAppearance();\n\t\tconst layoutDirection = window ? window.layoutDirection() : this.layoutDirection();\n\n\t\tif (platform) {\n\t\t\tCSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}`);\n\n\t\t\t// SDK Version CSS classes\n\t\t\t// Add exact version class (e.g., .ns-ios-26 or .ns-android-36)\n\t\t\t// this acts like 'gte' for that major version range\n\t\t\t// e.g., if user wants iOS 27, they can add .ns-ios-27 specifiers\n\t\t\tCSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}-${Math.floor(SDK_VERSION)}`);\n\t\t}\n\n\t\tif (deviceType) {\n\t\t\tCSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${deviceType}`);\n\t\t}\n\n\t\trootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);\n\t\tconst rootViewCssClasses = CSSUtils.getSystemCssClasses();\n\t\trootViewCssClasses.forEach((c) => rootView.cssClasses.add(c));\n\n\t\t// Two windows can disagree on these, so they never reach the process-wide\n\t\t// system class list — see CSSUtils.WINDOW_SCOPED_CSS_CLASSES.\n\t\tif (orientation) {\n\t\t\trootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${orientation}`);\n\t\t}\n\n\t\tif (systemAppearance) {\n\t\t\trootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${systemAppearance}`);\n\t\t}\n\n\t\tif (layoutDirection) {\n\t\t\trootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${layoutDirection}`);\n\t\t}\n\n\t\tthis.increaseStyleScopeApplicationCssSelectorVersion(rootView);\n\t\trootView._onCssStateChange();\n\n\t\tif (Trace.isEnabled()) {\n\t\t\tconst rootCssClasses = Array.from(rootView.cssClasses);\n\t\t\tTrace.write(`Setting root css classes: ${rootCssClasses.join(' ')}`, Trace.categories.Style);\n\t\t}\n\t}\n\n\t/**\n\t * iOS Only\n\t * Dynamically change the preferred frame rate\n\t * For devices (iOS 15+) which support min/max/preferred frame rate you can specify ranges\n\t * For devices (iOS < 15), you can specify the max frame rate\n\t * see: https://developer.apple.com/documentation/quartzcore/optimizing_promotion_refresh_rates_for_iphone_13_pro_and_ipad_pro\n\t * To use, ensure your Info.plist has:\n\t * ```xml\n\t * <key>CADisableMinimumFrameDurationOnPhone</key>\n\t * <true/>\n\t * ```\n\t * @param options { min?: number; max?: number; preferred?: number }\n\t */\n\tsetMaxRefreshRate(options?: { min?: number; max?: number; preferred?: number }) {\n\t\t// implement in platform specific files (iOS only for now)\n\t}\n\n\t/**\n\t * @returns The main entry of the application\n\t */\n\tgetMainEntry() {\n\t\treturn getAppMainEntry();\n\t}\n\n\t/**\n\t * Sets the callback that supplies the UI for windows that need content.\n\t * Pass `null` to remove a previously set resolver.\n\t */\n\tsetWindowContentResolver(resolver: WindowContentResolver | null): void {\n\t\tthis._windowContentResolver = resolver ?? null;\n\t}\n\n\t/**\n\t * @returns The callback currently supplying window content, if any.\n\t */\n\tgetWindowContentResolver(): WindowContentResolver | null {\n\t\treturn this._windowContentResolver;\n\t}\n\n\t// --- NativeWindow registry ---\n\n\tprotected _windows: NativeWindow[] = [];\n\n\t/**\n\t * Get the primary NativeWindow.\n\t */\n\tget primaryWindow(): NativeWindow | undefined {\n\t\treturn this._windows.find((nw) => nw.isPrimary);\n\t}\n\n\t/**\n\t * Get the NativeWindow the user is currently interacting with - the one that activated most\n\t * recently and is still attached. Falls back to the primary window while no window holds\n\t * activation, which is the case before the first window activates and on a platform that\n\t * never raises `activate`.\n\t */\n\tget activeWindow(): NativeWindow | undefined {\n\t\tconst active = getActiveWindow();\n\t\tif (active && active.state === 'attached' && this._windows.indexOf(active) !== -1) {\n\t\t\treturn active;\n\t\t}\n\n\t\treturn this.primaryWindow;\n\t}\n\n\t/**\n\t * Get the active windows, filtered by role.\n\t *\n\t * Defaults to the view-carrying app windows (`application` and `embedded`).\n\t * Pass `'all'` to include every registered surface, including ones that carry no view tree.\n\t */\n\tgetWindows(role: 'all'): WindowBase[];\n\tgetWindows(role?: WindowRole | WindowRole[]): NativeWindow[];\n\tgetWindows(role?: WindowRole | WindowRole[] | 'all'): WindowBase[];\n\tgetWindows(role?: WindowRole | WindowRole[] | 'all'): WindowBase[] {\n\t\tif (role === 'all') {\n\t\t\treturn [...this._windows];\n\t\t}\n\t\tconst roles: WindowRole[] = role ? (Array.isArray(role) ? role : [role]) : ['application', 'embedded'];\n\t\treturn this._windows.filter((nw) => roles.indexOf(nw.role) !== -1);\n\t}\n\n\t/**\n\t * Get a registered NativeWindow by its id.\n\t */\n\tgetWindowById(id: string): NativeWindow | undefined {\n\t\treturn this._windows.find((nw) => nw.id === id);\n\t}\n\n\t/**\n\t * Opens a new window.\n\t *\n\t * @param options Options for the new window, including data to hand to it.\n\t */\n\topenWindow(options?: WindowOpenOptions): void {\n\t\tthrow new Error('openWindow() is not supported on this platform.');\n\t}\n\n\t/**\n\t * @internal - Get all registered NativeWindows, whatever their role.\n\t */\n\t_getWindows(): NativeWindow[] {\n\t\treturn [...this._windows];\n\t}\n\n\t/**\n\t * @internal - Register a NativeWindow created by the platform lifecycle.\n\t */\n\t_registerWindow(nativeWindow: NativeWindow): void {\n\t\tthis._windows.push(nativeWindow);\n\n\t\t// A closing window drops its own listeners, so this is never explicitly removed.\n\t\tnativeWindow.on(NativeWindowEvents.activate, this.onWindowActivated, this);\n\n\t\tif (nativeWindow.isPrimary) {\n\t\t\tthis.trackPrimaryWindowTraits(nativeWindow);\n\t\t}\n\n\t\tthis._onWindowRegistered(nativeWindow);\n\n\t\tthis.notify({\n\t\t\teventName: this.windowOpenEvent,\n\t\t\tobject: this,\n\t\t\twindow: nativeWindow,\n\t\t});\n\t}\n\n\t/**\n\t * @internal - retire the windows behind discarded window-session ids.\n\t *\n\t * A session id can only stand in for a window whose native surface is already gone.\n\t * iOS reports sessions discarded while the app was not running on the next launch,\n\t * and such an id can name the session driving the app now, so an id match alone is\n\t * no evidence that the window is finished with. Retiring an attached window tears\n\t * down the UI in use - its root view unloads and nothing ever reloads it - so only\n\t * detached windows are retired. Ids matching no window are ignored: they routinely\n\t * belong to windows this JS context has never seen.\n\t */\n\t_retireDiscardedWindows(ids: string[]): void {\n\t\tfor (const id of ids) {\n\t\t\tconst nativeWindow = id ? this.getWindowById(id) : undefined;\n\n\t\t\tif (!nativeWindow) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (nativeWindow.state === 'attached') {\n\t\t\t\tTrace.write(`Ignoring a discarded session for window '${id}': its surface is still attached.`, Trace.categories.NativeLifecycle, Trace.messageType.warn);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.close);\n\t\t\tthis._unregisterWindow(nativeWindow);\n\t\t}\n\t}\n\n\t/**\n\t * @internal - Unregister a NativeWindow when its native surface is gone for good.\n\t */\n\t_unregisterWindow(nativeWindow: NativeWindow): void {\n\t\tif (!nativeWindow._surfaceGone) {\n\t\t\tTrace.write(`Unregistering window '${nativeWindow.id}' while its native surface is still live. A window may only be retired once the platform has reported the surface gone.`, Trace.categories.NativeLifecycle, Trace.messageType.error);\n\t\t}\n\n\t\tconst idx = this._windows.indexOf(nativeWindow);\n\t\tif (idx >= 0) {\n\t\t\tthis._windows.splice(idx, 1);\n\t\t}\n\n\t\tif (getActiveWindow() === nativeWindow) {\n\t\t\tsetActiveWindow(undefined);\n\t\t}\n\n\t\tthis.notify({\n\t\t\teventName: this.windowCloseEvent,\n\t\t\tobject: this,\n\t\t\twindow: nativeWindow,\n\t\t});\n\n\t\t// If primary was removed, promote the next window that can actually host content\n\t\tif (nativeWindow.isPrimary) {\n\t\t\tnativeWindow._setIsPrimary(false);\n\n\t\t\tconst promoted = this.getWindows().find((nw) => nw.state === 'attached');\n\t\t\tthis.trackPrimaryWindowTraits(promoted);\n\n\t\t\tif (promoted) {\n\t\t\t\tpromoted._setIsPrimary(true);\n\t\t\t\tthis._onPrimaryWindowPromoted(promoted);\n\t\t\t\tthis.notify({\n\t\t\t\t\teventName: this.primaryWindowChangedEvent,\n\t\t\t\t\tobject: this,\n\t\t\t\t\twindow: promoted,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tnativeWindow._destroy();\n\t}\n\n\t/**\n\t * Hook for platform-specific bookkeeping right after a window joins the registry,\n\t * before `windowOpen` is raised.\n\t */\n\tprotected _onWindowRegistered(nativeWindow: NativeWindow): void {\n\t\t// noop\n\t}\n\n\t/**\n\t * Hook for platform-specific bookkeeping right after a window takes over the primary\n\t * role, before `primaryWindowChanged` is raised.\n\t */\n\tprotected _onPrimaryWindowPromoted(nativeWindow: NativeWindow): void {\n\t\t// noop\n\t}\n\n\t// --- Primary window traits ---\n\n\tprivate _traitsWindow: NativeWindow | null = null;\n\n\t/**\n\t * Points the application-level orientation, appearance and layout direction at the\n\t * primary window, which owns those values now that each window has its own.\n\t */\n\tprivate trackPrimaryWindowTraits(nativeWindow: NativeWindow | undefined): void {\n\t\tconst target = nativeWindow ?? null;\n\t\tif (this._traitsWindow === target) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previous = this._traitsWindow;\n\t\tif (previous) {\n\t\t\tprevious.off(NativeWindowEvents.orientationChanged, this.onWindowOrientationChanged, this);\n\t\t\tprevious.off(NativeWindowEvents.systemAppearanceChanged, this.onWindowSystemAppearanceChanged, this);\n\t\t\tprevious.off(NativeWindowEvents.layoutDirectionChanged, this.onWindowLayoutDirectionChanged, this);\n\t\t}\n\n\t\tthis._traitsWindow = target;\n\n\t\tif (!target) {\n\t\t\treturn;\n\t\t}\n\n\t\ttarget.on(NativeWindowEvents.orientationChanged, this.onWindowOrientationChanged, this);\n\t\ttarget.on(NativeWindowEvents.systemAppearanceChanged, this.onWindowSystemAppearanceChanged, this);\n\t\ttarget.on(NativeWindowEvents.layoutDirectionChanged, this.onWindowLayoutDirectionChanged, this);\n\n\t\tthis.syncTraitsFromWindow(target);\n\t}\n\n\t/**\n\t * Adopts the window's values. The very first window seeds them quietly — there is no\n\t * previous application state for it to differ from — while a later promotion raises\n\t * the change events, because app code observed the outgoing window's values.\n\t */\n\tprivate syncTraitsFromWindow(nativeWindow: NativeWindow): void {\n\t\tconst orientation = nativeWindow.orientation();\n\t\tif (orientation) {\n\t\t\tif (this._orientation === undefined) {\n\t\t\t\tthis._orientation = orientation;\n\t\t\t} else {\n\t\t\t\tthis.setOrientation(orientation);\n\t\t\t}\n\t\t}\n\n\t\tconst systemAppearance = nativeWindow.systemAppearance();\n\t\tif (systemAppearance) {\n\t\t\tif (this._systemAppearance === undefined) {\n\t\t\t\tthis._systemAppearance = systemAppearance;\n\t\t\t} else {\n\t\t\t\tthis.setSystemAppearance(systemAppearance);\n\t\t\t}\n\t\t}\n\n\t\tconst layoutDirection = nativeWindow.layoutDirection();\n\t\tif (layoutDirection) {\n\t\t\tif (this._layoutDirection === undefined) {\n\t\t\t\tthis._layoutDirection = layoutDirection;\n\t\t\t} else {\n\t\t\t\tthis.setLayoutDirection(layoutDirection);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onWindowActivated(data: NativeWindowEventData): void {\n\t\tsetActiveWindow(data.window);\n\t}\n\n\tprivate onWindowOrientationChanged(data: WindowOrientationChangedEventData): void {\n\t\tthis.setOrientation(data.newValue);\n\t}\n\n\tprivate onWindowSystemAppearanceChanged(data: WindowSystemAppearanceChangedEventData): void {\n\t\tthis.setSystemAppearance(data.newValue);\n\t}\n\n\tprivate onWindowLayoutDirectionChanged(data: WindowLayoutDirectionChangedEventData): void {\n\t\tthis.setLayoutDirection(data.newValue);\n\t}\n\n\t/**\n\t * @internal - raises `ready` at most once per JS context.\n\t */\n\tnotifyReady(): void {\n\t\tif (this._readyNotified) {\n\t\t\treturn;\n\t\t}\n\t\tthis._readyNotified = true;\n\t\tgetNativeScriptGlobals().setLaunched();\n\n\t\tthis.notify(<ApplicationEventData>{\n\t\t\teventName: this.readyEvent,\n\t\t\tobject: this,\n\t\t\tios: this.ios,\n\t\t\tandroid: this.android,\n\t\t});\n\t}\n\n\t/**\n\t * @internal - produces the content for a window that has none.\n\t *\n\t * Resolution order: the window content resolver, then the legacy `launch` event\n\t * (offered to the first window that asks for content and to no other), then the\n\t * application main entry. A resolver or a `launch` handler returning `null` takes\n\t * ownership of the content, so nothing else is tried. A missing main entry leaves\n\t * the window empty instead of throwing, because content can still arrive later\n\t * through `run()`/`resetRootView()`.\n\t *\n\t * @param options.install `false` returns the resolved view instead of applying it,\n\t * for platform pipelines that install the root view on the native surface themselves.\n\t * @param options.launchData platform payload merged into the legacy `launch` event args.\n\t * @returns The resolved view, or `null` when no content was produced.\n\t */\n\t_resolveWindowContent(window: NativeWindow, request: WindowContentRequest, options?: { install?: boolean; launchData?: any }): View | null {\n\t\tconst content = this.resolveWindowContent(request, options?.launchData);\n\n\t\tif (content == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (options?.install === false) {\n\t\t\treturn this.buildContentView(content);\n\t\t}\n\n\t\twindow.setContent(content);\n\n\t\treturn window.rootView;\n\t}\n\n\tprivate resolveWindowContent(request: WindowContentRequest, launchData?: any): View | NavigationEntry | string | null | undefined {\n\t\tconst launchBridgeAvailable = !this._launchBridgeConsumed;\n\t\tthis._launchBridgeConsumed = true;\n\n\t\tconst resolver = this._windowContentResolver;\n\t\tif (resolver) {\n\t\t\tconst resolved = resolver(request);\n\n\t\t\t// `null` means the resolver supplies the content itself; only `undefined` falls through.\n\t\t\tif (resolved !== undefined) {\n\t\t\t\tthis._ensureAppCssLoaded();\n\n\t\t\t\treturn resolved;\n\t\t\t}\n\t\t}\n\n\t\tif (launchBridgeAvailable) {\n\t\t\tconst root = this.notifyLaunch(launchData);\n\n\t\t\tif (root === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (root) {\n\t\t\t\treturn root;\n\t\t\t}\n\t\t}\n\n\t\tthis._ensureAppCssLoaded();\n\n\t\tconst mainEntry = getAppMainEntry();\n\n\t\treturn mainEntry ? Builder.createViewFromEntry(mainEntry) : undefined;\n\t}\n\n\tprivate buildContentView(content: View | NavigationEntry | string): View {\n\t\tif (typeof content === 'string') {\n\t\t\treturn Builder.createViewFromEntry({ moduleName: content });\n\t\t}\n\n\t\tconst entry = content as NavigationEntry;\n\n\t\treturn entry.moduleName || entry.create ? Builder.createViewFromEntry(entry) : (content as View);\n\t}\n\n\t/**\n\t * Loads the app CSS once per JS context. On the legacy `launch` path this has to run\n\t * after the handlers, which are allowed to call `setCssFileName()`.\n\t */\n\tprivate _ensureAppCssLoaded(): void {\n\t\tif (this._appCssLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tthis._appCssLoaded = true;\n\n\t\tthis.loadAppCss();\n\t}\n\n\t@profile\n\tprotected notifyLaunch(additionalLanchEventData?: any): View | null {\n\t\tthis._launchBridgeConsumed = true;\n\n\t\tconst launchArgs: LaunchEventData = {\n\t\t\teventName: this.launchEvent,\n\t\t\tobject: this,\n\t\t\tios: this.ios,\n\t\t\tandroid: this.android,\n\t\t\t...additionalLanchEventData,\n\t\t};\n\t\tthis.notify(launchArgs);\n\t\tthis._ensureAppCssLoaded();\n\n\t\treturn launchArgs.root;\n\t}\n\n\t@profile\n\tcreateRootView(view?: View, fireLaunchEvent = false, additionalLanchEventData?: any) {\n\t\tlet rootView = view;\n\n\t\tif (!rootView) {\n\t\t\tif (fireLaunchEvent) {\n\t\t\t\trootView = this.notifyLaunch(additionalLanchEventData);\n\n\t\t\t\t// useful for integrations that would like to set rootView asynchronously after app launch\n\t\t\t\tif (rootView === null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!rootView) {\n\t\t\t\t// try to navigate to the mainEntry (if specified)\n\t\t\t\tif (!getAppMainEntry()) {\n\t\t\t\t\tthrow new Error('Main entry is missing. App cannot be started. Verify app bootstrap.');\n\t\t\t\t}\n\n\t\t\t\trootView = Builder.createViewFromEntry(getAppMainEntry());\n\t\t\t}\n\t\t}\n\n\t\treturn rootView;\n\t}\n\n\tgetRootView(): View {\n\t\tthrow new Error('getRootView() Not implemented.');\n\t}\n\n\tresetRootView(entry?: NavigationEntry | string) {\n\t\tsetAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);\n\t\t// rest of implementation is platform specific\n\t}\n\n\t/**\n\t * @param window the window the root view belongs to. Supplies the window-scoped CSS\n\t * classes; without it they come from the primary window.\n\t */\n\tinitRootView(rootView: View, window?: NativeWindow) {\n\t\tthis.setRootViewCSSClasses(rootView, window);\n\t\t// ensure css is \"loaded\" on the rootview so that user rootview can access css variables right away\n\t\trootView._onCssStateChange(true);\n\t\tthis.notify(<InitRootViewEventData>{ eventName: this.initRootViewEvent, rootView });\n\t}\n\n\t/**\n\t * Get application level static resources.\n\t */\n\tgetResources() {\n\t\treturn bindableResources.get();\n\t}\n\n\t/**\n\t * Set application level static resources.\n\t */\n\tsetResources(res: any) {\n\t\tbindableResources.set(res);\n\t}\n\n\t/**\n\t * Sets css file name for the application.\n\t */\n\tsetCssFileName(cssFileName: string) {\n\t\tthis._cssFile = cssFileName;\n\t\tthis.notify(<CssChangedEventData>{\n\t\t\teventName: this.cssChangedEvent,\n\t\t\tobject: this,\n\t\t\tcssFile: cssFileName,\n\t\t});\n\t}\n\n\t/**\n\t * Gets css file name for the application.\n\t */\n\tgetCssFileName(): string {\n\t\treturn this._cssFile;\n\t}\n\n\t/**\n\t * Loads immediately the app.css.\n\t * By default the app.css file is loaded shortly after \"loaded\".\n\t * For the Android snapshot the CSS can be parsed during the snapshot generation,\n\t * as the CSS does not depend on runtime APIs, and loadAppCss will be called explicitly.\n\t */\n\tloadAppCss(): void {\n\t\ttry {\n\t\t\tthis.notify(<LoadAppCSSEventData>{\n\t\t\t\teventName: this.loadAppCssEvent,\n\t\t\t\tobject: this,\n\t\t\t\tios: this.ios,\n\t\t\t\tandroid: this.android,\n\t\t\t\tcssFile: this.getCssFileName(),\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (Trace.isEnabled()) {\n\t\t\t\tTrace.write(`The app CSS file ${this.getCssFileName()} couldn't be loaded!`, Trace.categories.Style, Trace.messageType.warn);\n\t\t\t}\n\t\t}\n\t}\n\n\taddCss(cssText: string, attributeScoped?: boolean): void {\n\t\tthis.notify(<CssChangedEventData>{\n\t\t\teventName: this.cssChangedEvent,\n\t\t\tobject: this,\n\t\t\tcssText: cssText,\n\t\t});\n\t\tif (!attributeScoped) {\n\t\t\tconst rootView = this.getRootView();\n\t\t\tif (rootView) {\n\t\t\t\trootView._onCssStateChange();\n\t\t\t}\n\t\t}\n\t}\n\n\trun(entry?: string | NavigationEntry) {\n\t\tthrow new Error('run() Not implemented.');\n\t}\n\n\tprotected getOrientation(): 'portrait' | 'landscape' | 'unknown' {\n\t\t// override in platform specific Application class\n\t\tthrow new Error('getOrientation() not implemented');\n\t}\n\n\tprotected setOrientation(value: 'portrait' | 'landscape' | 'unknown', degrees?: number) {\n\t\tif (this._orientation === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._orientation = value;\n\n\t\t// Update metrics early enough regardless of the existence of root view\n\t\t// Also, CSS will use the correct size values during update trigger\n\t\tScreen.mainScreen._updateMetrics();\n\n\t\tthis.orientationChanged(this.getRootView(), value);\n\t\tthis.notify(<OrientationChangedEventData>{\n\t\t\teventName: this.orientationChangedEvent,\n\t\t\tandroid: this.android,\n\t\t\tios: this.ios,\n\t\t\tnewValue: value,\n\t\t\tdegrees,\n\t\t\tobject: this,\n\t\t});\n\t}\n\n\t/**\n\t * @deprecated Use Application.primaryWindow?.orientation() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.\n\t */\n\torientation(): 'portrait' | 'landscape' | 'unknown' {\n\t\treturn this.primaryWindow?.orientation() ?? (this._orientation ??= this.getOrientation());\n\t}\n\n\torientationChanged(rootView: View, newOrientation: 'portrait' | 'landscape' | 'unknown'): void {\n\t\tif (!rootView) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newOrientationCssClass = `${CSSUtils.CLASS_PREFIX}${newOrientation}`;\n\t\tthis.applyWindowScopedCssClass(rootView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);\n\n\t\tthis.getOwnedModalViews(rootView).forEach((rootModalView) => {\n\t\t\tthis.applyWindowScopedCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);\n\n\t\t\t// Trigger state change for root modal view classes and media queries\n\t\t\trootModalView._onCssStateChange();\n\t\t});\n\n\t\t// Trigger state change for root view classes and media queries\n\t\trootView._onCssStateChange();\n\t}\n\n\tgetNativeApplication(): any {\n\t\t// override in platform specific Application class\n\t\tthrow new Error('getNativeApplication() not implemented');\n\t}\n\n\thasLaunched(): boolean {\n\t\treturn getNativeScriptGlobals().launched;\n\t}\n\n\tprotected getSystemAppearance(): 'dark' | 'light' | null {\n\t\t// override in platform specific Application class\n\t\tthrow new Error('getSystemAppearance() not implemented');\n\t}\n\n\tprotected setSystemAppearance(value: 'dark' | 'light') {\n\t\tif (this._systemAppearance === value) {\n\t\t\treturn;\n\t\t}\n\t\tthis._systemAppearance = value;\n\t\tconst args = <SystemAppearanceChangedEventData>{\n\t\t\teventName: this.systemAppearanceChangedEvent,\n\t\t\tandroid: this.android,\n\t\t\tios: this.ios,\n\t\t\tnewValue: value,\n\t\t\tcancel: false,\n\t\t\tobject: this,\n\t\t};\n\t\tthis.notify(args);\n\t\tif (args.cancel === false && this.autoSystemAppearanceChanged) {\n\t\t\tthis.systemAppearanceChanged(this.getRootView(), value);\n\t\t}\n\t}\n\n\t/**\n\t * @deprecated Use Application.primaryWindow?.systemAppearance() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.\n\t */\n\tsystemAppearance(): 'dark' | 'light' | null {\n\t\treturn this.primaryWindow?.systemAppearance() ?? (this._systemAppearance ??= this.getSystemAppearance());\n\t}\n\n\t/**\n\t * enable/disable systemAppearanceChanged\n\t */\n\tsetAutoSystemAppearanceChanged(value: boolean): void {\n\t\tsetAutoSystemAppearanceChanged(value);\n\t}\n\n\t/**\n\t * Updates root view classes including those of modals\n\t * @param rootView the root view\n\t * @param newSystemAppearance the new appearance change\n\t */\n\tsystemAppearanceChanged(rootView: View, newSystemAppearance: 'dark' | 'light'): void {\n\t\tif (!rootView) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newSystemAppearanceCssClass = `${CSSUtils.CLASS_PREFIX}${newSystemAppearance}`;\n\t\tthis.applyWindowScopedCssClass(rootView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass);\n\n\t\tthis.getOwnedModalViews(rootView).forEach((rootModalView) => {\n\t\t\tthis.applyWindowScopedCssClass(rootModalView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass);\n\n\t\t\t// Trigger state change for root modal view classes and media queries\n\t\t\trootModalView._onCssStateChange();\n\t\t});\n\n\t\t// Trigger state change for root view classes and media queries\n\t\trootView._onCssStateChange();\n\t}\n\n\tprotected getLayoutDirection(): CoreTypes.LayoutDirectionType | null {\n\t\t// override in platform specific Application class\n\t\tthrow new Error('getLayoutDirection() not implemented');\n\t}\n\n\tprotected setLayoutDirection(value: CoreTypes.LayoutDirectionType) {\n\t\tif (this._layoutDirection === value) {\n\t\t\treturn;\n\t\t}\n\t\tthis._layoutDirection = value;\n\t\tthis.layoutDirectionChanged(this.getRootView(), value);\n\t\tthis.notify(<LayoutDirectionChangedEventData>{\n\t\t\teventName: this.layoutDirectionChangedEvent,\n\t\t\tandroid: this.android,\n\t\t\tios: this.ios,\n\t\t\tnewValue: value,\n\t\t\tobject: this,\n\t\t});\n\t}\n\n\t/**\n\t * @deprecated Use Application.primaryWindow?.layoutDirection() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.\n\t */\n\tlayoutDirection(): CoreTypes.LayoutDirectionType | null {\n\t\treturn this.primaryWindow?.layoutDirection() ?? (this._layoutDirection ??= this.getLayoutDirection());\n\t}\n\n\t/**\n\t * Updates root view classes including those of modals\n\t * @param rootView the root view\n\t * @param newLayoutDirection the new layout direction change\n\t */\n\tlayoutDirectionChanged(rootView: View, newLayoutDirection: CoreTypes.LayoutDirectionType): void {\n\t\tif (!rootView) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newLayoutDirectionCssClass = `${CSSUtils.CLASS_PREFIX}${newLayoutDirection}`;\n\t\tthis.applyWindowScopedCssClass(rootView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass);\n\n\t\tthis.getOwnedModalViews(rootView).forEach((rootModalView) => {\n\t\t\tthis.applyWindowScopedCssClass(rootModalView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass);\n\n\t\t\t// Trigger state change for root modal view classes and media queries\n\t\t\trootModalView._onCssStateChange();\n\t\t});\n\n\t\t// Trigger state change for root view classes and media queries\n\t\trootView._onCssStateChange();\n\t}\n\n\tget inBackground() {\n\t\treturn isAppInBackground();\n\t}\n\n\tsetInBackground(value: boolean, additonalData?: any) {\n\t\tsetAppInBackground(value);\n\n\t\tthis.notify(<ApplicationEventData>{\n\t\t\teventName: value ? this.backgroundEvent : this.foregroundEvent,\n\t\t\tobject: this,\n\t\t\tios: this.ios,\n\n\t\t\t...additonalData,\n\t\t});\n\t}\n\n\tget suspended() {\n\t\treturn this._suspended;\n\t}\n\n\tsetSuspended(value: boolean, additonalData?: any) {\n\t\tthis._suspended = value;\n\n\t\tthis.notify(<ApplicationEventData>{\n\t\t\teventName: value ? this.suspendEvent : this.resumeEvent,\n\t\t\tobject: this,\n\t\t\tios: this.ios,\n\t\t\tandroid: this.android,\n\n\t\t\t...additonalData,\n\t\t});\n\t}\n\n\tget android(): AndroidApplicationType {\n\t\treturn undefined;\n\t}\n\n\tget ios(): iOSApplicationType {\n\t\treturn undefined;\n\t}\n\n\tget AndroidApplication() {\n\t\treturn this.android;\n\t}\n\n\tget iOSApplication() {\n\t\treturn this.ios;\n\t}\n}\n\nprepareAppForModuleResolver(() => {\n\tApplicationCommon.on('livesync', (args) => clearResolverCache());\n\tApplicationCommon.on('orientationChanged', (args) => {\n\t\t_setResolver(undefined);\n\t});\n});\n"]}
1
+ {"version":3,"file":"application-common.js","sourceRoot":"","sources":["../../../../packages/core/application/application-common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAChH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,iBAAiB,MAAM,wCAAwC,CAAC;AAO5E,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,8BAA8B,EAAE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,CAAC;IAED,IAAI,kBAAkB;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,IAAI,cAAc;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC;IACjB,CAAC;;AA9+BD,uEAAuE;AACvE;;GAEG;AACI,oBAAE,GAA4B,YAAY,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,AAA9D,CAA+D;AACxE;;GAEG;AACI,sBAAI,GAA4B,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,AAAhE,CAAiE;AAC5E;;GAEG;AACI,qBAAG,GAA6B,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,AAAhE,CAAiE;AAC3E;;GAEG;AACI,wBAAM,GAAgC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,AAAtE,CAAuE;AACpF;;GAEG;AACI,8BAAY,GAAsC,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,AAAlF,CAAmF;AAonB5F;IADT,OAAO;qDAeP;AAGD;IADC,OAAO;uDAyBP;AAgUF,2BAA2B,CAAC,GAAG,EAAE;IAChC,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACjE,iBAAiB,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,IAAI,EAAE,EAAE;QACnD,YAAY,CAAC,SAAS,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { CoreTypes } from '../core-types';\nimport { CSSUtils } from '../css/system-classes';\nimport { Device, Screen } from '../platform';\nimport { profile } from '../profiling';\nimport { Trace } from '../trace';\nimport { clearResolverCache, prepareAppForModuleResolver, _setResolver } from '../module-name-resolver/helpers';\nimport { Builder } from '../ui/builder';\nimport * as bindableResources from '../ui/core/bindable/bindable-resources';\nimport type { View } from '../ui/core/view';\nimport type { Frame } from '../ui/frame';\nimport type { NavigationEntry } from '../ui/frame/frame-interfaces';\nimport type { StyleScope } from '../ui/styling/style-scope';\nimport type { AndroidApplication as AndroidApplicationType, iOSApplication as iOSApplicationType } from '.';\nimport type { ApplicationEventData, CssChangedEventData, DiscardedErrorEventData, FontScaleChangedEventData, InitRootViewEventData, LaunchEventData, LoadAppCSSEventData, NativeScriptError, OrientationChangedEventData, SystemAppearanceChangedEventData, LayoutDirectionChangedEventData, UnhandledErrorEventData, SceneOpenURLContextsEventData, SceneContinueUserActivityEventData, ScenePerformActionForShortcutItemEventData } from './application-interfaces';\nimport { getActiveWindow, getAppMainEntry, getAutoSystemAppearanceChanged, isAppInBackground, setActiveWindow, setAppInBackground, setAppMainEntry, setAutoSystemAppearanceChanged } from './helpers-common';\nimport { getNativeScriptGlobals } from '../globals/global-utils';\nimport { SDK_VERSION } from '../utils/constants';\nimport type { NativeWindow, NativeWindowEventData, PrimaryWindowChangedEventData, WindowBase, WindowCloseEventData, WindowContentRequest, WindowContentResolver, WindowLayoutDirectionChangedEventData, WindowOpenEventData, WindowOpenOptions, WindowOrientationChangedEventData, WindowRole, WindowSystemAppearanceChangedEventData } from '../native-window';\nimport { NativeWindowEvents, WindowEvents } from '../native-window/native-window-interfaces';\n\nconst ORIENTATION_CSS_CLASSES = CSSUtils.ORIENTATION_CSS_CLASSES;\nconst SYSTEM_APPEARANCE_CSS_CLASSES = CSSUtils.SYSTEM_APPEARANCE_CSS_CLASSES;\nconst LAYOUT_DIRECTION_CSS_CLASSES = CSSUtils.LAYOUT_DIRECTION_CSS_CLASSES;\n\nconst globalEvents = getNativeScriptGlobals().events;\n\n// Scene lifecycle event names\n/**\n * @deprecated Use `NativeWindowEvents` from `@nativescript/core/native-window` instead.\n */\nexport const SceneEvents = {\n\t/** @deprecated Use `NativeWindowEvents.sceneWillConnect` instead. */\n\tsceneWillConnect: 'sceneWillConnect',\n\t/** @deprecated Use `NativeWindowEvents.sceneDidActivate` instead. */\n\tsceneDidActivate: 'sceneDidActivate',\n\t/** @deprecated Use `NativeWindowEvents.sceneWillResignActive` instead. */\n\tsceneWillResignActive: 'sceneWillResignActive',\n\t/** @deprecated Use `NativeWindowEvents.sceneWillEnterForeground` instead. */\n\tsceneWillEnterForeground: 'sceneWillEnterForeground',\n\t/** @deprecated Use `NativeWindowEvents.sceneDidEnterBackground` instead. */\n\tsceneDidEnterBackground: 'sceneDidEnterBackground',\n\t/** @deprecated Use `NativeWindowEvents.sceneDidDisconnect` instead. */\n\tsceneDidDisconnect: 'sceneDidDisconnect',\n\t/** @deprecated Use the Application 'windowOpen' event and NativeWindow.setContent() instead. */\n\tsceneContentSetup: 'sceneContentSetup',\n};\n\nexport type SceneEventName = (typeof SceneEvents)[keyof typeof SceneEvents];\n\n// helper interface to correctly type Application event handlers\ninterface ApplicationEvents {\n\toff(eventNames: string, callback?: any, thisArg?: any): void;\n\tnotify<T = ApplicationEventData>(eventData: T): void;\n\thasListeners(eventName: string): boolean;\n\n\tonce(eventNames: string, callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\ton(eventNames: string, callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\t/**\n\t * This event is raised when application css is changed.\n\t */\n\ton(event: 'cssChanged', callback: (args: CssChangedEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * Event raised then livesync operation is performed.\n\t */\n\ton(event: 'livesync', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised on application launchEvent.\n\t */\n\ton(event: 'launch', callback: (args: LaunchEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised once the JS context is initialized.\n\t */\n\ton(event: 'ready', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised after the application has performed most of its startup actions.\n\t * Its intent is to be suitable for measuring app startup times.\n\t * @experimental\n\t */\n\ton(event: 'displayed', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the Application is suspended.\n\t */\n\ton(event: 'suspend', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the Application is resumed after it has been suspended.\n\t */\n\ton(event: 'resume', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the Application is about to exit.\n\t *\n\t * On Android it is raised when the last window closes; the process may stay alive.\n\t * On iOS it is raised when the process itself terminates.\n\t */\n\ton(event: 'exit', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when there is low memory on the target device.\n\t */\n\ton(event: 'lowMemory', callback: (args: ApplicationEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when an uncaught error occurs while the application is running.\n\t */\n\ton(event: 'uncaughtError', callback: (args: UnhandledErrorEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when an discarded error occurs while the application is running.\n\t */\n\ton(event: 'discardedError', callback: (args: DiscardedErrorEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the orientation of the application changes.\n\t */\n\ton(event: 'orientationChanged', callback: (args: OrientationChangedEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the operating system appearance changes\n\t * between light and dark theme (for Android);\n\t * between light and dark mode (for iOS) and vice versa.\n\t */\n\ton(event: 'systemAppearanceChanged', callback: (args: SystemAppearanceChangedEventData) => void, thisArg?: any): void;\n\n\t/**\n\t * This event is raised when the operating system layout direction changes\n\t * between ltr and rtl.\n\t */\n\ton(event: 'layoutDirectionChanged', callback: (args: LayoutDirectionChangedEventData) => void, thisArg?: any): void;\n\n\ton(event: 'fontScaleChanged', callback: (args: FontScaleChangedEventData) => void, thisArg?: any): void;\n\n\ton(event: 'windowOpen', callback: (args: WindowOpenEventData) => void, thisArg?: any): void;\n\ton(event: 'windowClose', callback: (args: WindowCloseEventData) => void, thisArg?: any): void;\n\ton(event: 'primaryWindowChanged', callback: (args: PrimaryWindowChangedEventData) => void, thisArg?: any): void;\n\n\ton(event: 'sceneOpenURLContexts', callback: (args: SceneOpenURLContextsEventData) => void, thisArg?: any): void;\n\ton(event: 'sceneContinueUserActivity', callback: (args: SceneContinueUserActivityEventData) => void, thisArg?: any): void;\n\ton(event: 'scenePerformActionForShortcutItem', callback: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any): void;\n}\n\nexport class ApplicationCommon {\n\t/**\n\t * @deprecated Use the 'ready' event for application initialization and Application.setWindowContentResolver() to provide window UI. 'launch' continues to fire before the first window's content is created, and its 'root' property is still honored, for backwards compatibility. It never fires for additional windows. In a scene-based app it fires with the first window's content, so a background launch that connects no scene does not raise it.\n\t */\n\treadonly launchEvent = 'launch';\n\t/**\n\t * Raised once per JS context, as soon as the context is initialized. It is never deferred,\n\t * so it also fires on a background launch where no window is created.\n\t *\n\t * Guaranteed ordering: `ready` -> `windowOpen` -> raw connect/create events -> content\n\t * resolution (the legacy `launch` bridge runs here, for the first window and the first\n\t * one after `exit`) ->\n\t * `contentLoaded` -> `activate`/`displayed`.\n\t */\n\treadonly readyEvent = 'ready';\n\t/**\n\t * Reflects whole-app state: with multiple windows it is raised once the app itself is\n\t * no longer in the foreground, not when an individual window backgrounds. Listen on a\n\t * NativeWindow for per-window state.\n\t */\n\treadonly suspendEvent = 'suspend';\n\treadonly displayedEvent = 'displayed';\n\treadonly backgroundEvent = 'background';\n\treadonly foregroundEvent = 'foreground';\n\treadonly resumeEvent = 'resume';\n\t/**\n\t * On Android, raised when the last window closes; the process may stay alive.\n\t * On iOS, raised when the process itself terminates.\n\t */\n\treadonly exitEvent = 'exit';\n\treadonly lowMemoryEvent = 'lowMemory';\n\treadonly uncaughtErrorEvent = 'uncaughtError';\n\treadonly discardedErrorEvent = 'discardedError';\n\treadonly orientationChangedEvent = 'orientationChanged';\n\treadonly systemAppearanceChangedEvent = 'systemAppearanceChanged';\n\treadonly layoutDirectionChangedEvent = 'layoutDirectionChanged';\n\treadonly fontScaleChangedEvent = 'fontScaleChanged';\n\treadonly livesyncEvent = 'livesync';\n\treadonly loadAppCssEvent = 'loadAppCss';\n\treadonly cssChangedEvent = 'cssChanged';\n\treadonly initRootViewEvent = 'initRootView';\n\treadonly windowOpenEvent = WindowEvents.windowOpen;\n\treadonly windowCloseEvent = WindowEvents.windowClose;\n\treadonly primaryWindowChangedEvent = WindowEvents.primaryWindowChanged;\n\n\t// Expose statically for backwards compat on AndroidApplication.on etc.\n\t/**\n\t * @deprecated Use `Application.android.on()` instead.\n\t */\n\tstatic on: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents);\n\t/**\n\t * @deprecated Use `Application.android.once()` instead.\n\t */\n\tstatic once: ApplicationEvents['on'] = globalEvents.once.bind(globalEvents);\n\t/**\n\t * @deprecated Use `Application.android.off()` instead.\n\t */\n\tstatic off: ApplicationEvents['off'] = globalEvents.off.bind(globalEvents);\n\t/**\n\t * @deprecated Use `Application.android.notify()` instead.\n\t */\n\tstatic notify: ApplicationEvents['notify'] = globalEvents.notify.bind(globalEvents);\n\t/**\n\t * @deprecated Use `Application.android.hasListeners()` instead.\n\t */\n\tstatic hasListeners: ApplicationEvents['hasListeners'] = globalEvents.hasListeners.bind(globalEvents);\n\n\t// Application events go through the global events.\n\ton: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents);\n\toff: ApplicationEvents['off'] = globalEvents.off.bind(globalEvents);\n\tonce: ApplicationEvents['once'] = globalEvents.once.bind(globalEvents);\n\tnotify: ApplicationEvents['notify'] = globalEvents.notify.bind(globalEvents);\n\thasListeners: ApplicationEvents['hasListeners'] = globalEvents.hasListeners.bind(globalEvents);\n\n\tprivate _orientation: 'portrait' | 'landscape' | 'unknown';\n\tprivate _systemAppearance: 'dark' | 'light' | null;\n\tprivate _layoutDirection: CoreTypes.LayoutDirectionType | null;\n\tprivate _inBackground: boolean = false;\n\tprivate _suspended: boolean = false;\n\tprivate _cssFile = './app.css';\n\tprivate _readyNotified = false;\n\tprivate _appCssLoaded = false;\n\tprivate _launchBridgeConsumed = false;\n\tprivate _windowContentResolver: WindowContentResolver | null = null;\n\n\tprotected mainEntry: NavigationEntry;\n\n\tpublic started = false;\n\t/**\n\t * Boolean to enable/disable systemAppearanceChanged\n\t */\n\tpublic get autoSystemAppearanceChanged(): boolean {\n\t\treturn getAutoSystemAppearanceChanged();\n\t}\n\n\tpublic set autoSystemAppearanceChanged(value: boolean) {\n\t\tsetAutoSystemAppearanceChanged(value);\n\t}\n\n\t/**\n\t * @internal - should not be constructed by the user.\n\t */\n\tconstructor() {\n\t\tgetNativeScriptGlobals().appInstanceReady = true;\n\n\t\tglobal.__onUncaughtError = (error: NativeScriptError) => {\n\t\t\tthis.notify({\n\t\t\t\teventName: this.uncaughtErrorEvent,\n\t\t\t\tobject: this,\n\t\t\t\tandroid: error,\n\t\t\t\tios: error,\n\t\t\t\terror: error,\n\t\t\t} as DiscardedErrorEventData);\n\t\t};\n\n\t\tglobal.__onDiscardedError = (error: NativeScriptError) => {\n\t\t\tthis.notify({\n\t\t\t\teventName: this.discardedErrorEvent,\n\t\t\t\tobject: this,\n\t\t\t\terror: error,\n\t\t\t} as DiscardedErrorEventData);\n\t\t};\n\n\t\tglobal.__onLiveSync = (context?: ModuleContext) => {\n\t\t\tif (this.suspended) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst rootView = this.getRootView();\n\t\t\tthis.livesync(rootView, context);\n\t\t};\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tlivesync(rootView: View, context?: ModuleContext) {\n\t\tthis.notify({ eventName: this.livesyncEvent, object: this });\n\t\tconst liveSyncCore = global.__onLiveSyncCore;\n\t\tlet reapplyAppStyles = false;\n\n\t\t// ModuleContext is available only for Hot Module Replacement\n\t\tif (context && context.path) {\n\t\t\tconst styleExtensions = ['css', 'scss'];\n\t\t\tconst appStylesFullFileName = this.getCssFileName();\n\t\t\tconst appStylesFileName = appStylesFullFileName.substring(0, appStylesFullFileName.lastIndexOf('.') + 1);\n\t\t\treapplyAppStyles = styleExtensions.some((ext) => context.path === appStylesFileName.concat(ext));\n\t\t}\n\n\t\t// Handle application styles\n\t\tif (rootView && reapplyAppStyles) {\n\t\t\trootView._onCssStateChange();\n\t\t} else if (liveSyncCore) {\n\t\t\tliveSyncCore(context);\n\t\t}\n\t}\n\n\t/**\n\t * Applies the the `newCssClass` to the `rootView` and removes all other css classes from `cssClasses`\n\t * previously applied to the `rootView`.\n\t * @param rootView\n\t * @param cssClasses\n\t * @param newCssClass\n\t * @param skipCssUpdate\n\t */\n\tapplyCssClass(rootView: View, cssClasses: string[], newCssClass: string, skipCssUpdate: boolean = false): void {\n\t\tif (!rootView.cssClasses.has(newCssClass)) {\n\t\t\tcssClasses.forEach((cssClass) => this.removeCssClass(rootView, cssClass));\n\t\t\tthis.addCssClass(rootView, newCssClass);\n\t\t\tthis.increaseStyleScopeApplicationCssSelectorVersion(rootView);\n\n\t\t\tif (!skipCssUpdate) {\n\t\t\t\trootView._onCssStateChange();\n\t\t\t}\n\n\t\t\tif (Trace.isEnabled()) {\n\t\t\t\tconst rootCssClasses = Array.from(rootView.cssClasses);\n\t\t\t\tTrace.write(`Applying root css class: ${newCssClass}. rootView css classes: ${rootCssClasses.join(' ')}`, Trace.categories.Style);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate addCssClass(rootView: View, cssClass: string) {\n\t\tCSSUtils.pushToSystemCssClasses(cssClass);\n\t\trootView.cssClasses.add(cssClass);\n\t}\n\n\tprivate removeCssClass(rootView: View, cssClass: string) {\n\t\tCSSUtils.removeSystemCssClass(cssClass);\n\t\trootView.cssClasses.delete(cssClass);\n\t}\n\n\t/**\n\t * Same as {@link applyCssClass}, minus the system class list: window-scoped classes\n\t * must not leak into it, because it seeds every window's root view.\n\t */\n\tprivate applyWindowScopedCssClass(rootView: View, cssClasses: string[], newCssClass: string): void {\n\t\tif (rootView.cssClasses.has(newCssClass)) {\n\t\t\treturn;\n\t\t}\n\n\t\tcssClasses.forEach((cssClass) => rootView.cssClasses.delete(cssClass));\n\t\trootView.cssClasses.add(newCssClass);\n\t\tthis.increaseStyleScopeApplicationCssSelectorVersion(rootView);\n\t}\n\n\t/**\n\t * The modal registry is process-wide, so only the modals presented over this root\n\t * view may follow its window-scoped classes.\n\t */\n\tprivate getOwnedModalViews(rootView: View): View[] {\n\t\treturn (<Array<View>>rootView._getRootModalViews()).filter((modalView) => modalView._getRootModalHost() === rootView);\n\t}\n\n\tpublic increaseStyleScopeApplicationCssSelectorVersion(rootView: View) {\n\t\tconst styleScope: StyleScope = rootView._styleScope ?? (rootView as Frame)?.currentPage?._styleScope;\n\n\t\tif (styleScope) {\n\t\t\tstyleScope._increaseApplicationCssSelectorVersion();\n\t\t}\n\t}\n\n\tprivate setRootViewCSSClasses(rootView: View, window?: NativeWindow): void {\n\t\tconst platform = Device.os.toLowerCase();\n\t\tconst deviceType = Device.deviceType.toLowerCase();\n\t\tconst orientation = window ? window.orientation() : this.orientation();\n\t\tconst systemAppearance = window ? window.systemAppearance() : this.systemAppearance();\n\t\tconst layoutDirection = window ? window.layoutDirection() : this.layoutDirection();\n\n\t\tif (platform) {\n\t\t\tCSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}`);\n\n\t\t\t// SDK Version CSS classes\n\t\t\t// Add exact version class (e.g., .ns-ios-26 or .ns-android-36)\n\t\t\t// this acts like 'gte' for that major version range\n\t\t\t// e.g., if user wants iOS 27, they can add .ns-ios-27 specifiers\n\t\t\tCSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}-${Math.floor(SDK_VERSION)}`);\n\t\t}\n\n\t\tif (deviceType) {\n\t\t\tCSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${deviceType}`);\n\t\t}\n\n\t\trootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);\n\t\tconst rootViewCssClasses = CSSUtils.getSystemCssClasses();\n\t\trootViewCssClasses.forEach((c) => rootView.cssClasses.add(c));\n\n\t\t// Two windows can disagree on these, so they never reach the process-wide\n\t\t// system class list — see CSSUtils.WINDOW_SCOPED_CSS_CLASSES.\n\t\tif (orientation) {\n\t\t\trootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${orientation}`);\n\t\t}\n\n\t\tif (systemAppearance) {\n\t\t\trootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${systemAppearance}`);\n\t\t}\n\n\t\tif (layoutDirection) {\n\t\t\trootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${layoutDirection}`);\n\t\t}\n\n\t\tthis.increaseStyleScopeApplicationCssSelectorVersion(rootView);\n\t\trootView._onCssStateChange();\n\n\t\tif (Trace.isEnabled()) {\n\t\t\tconst rootCssClasses = Array.from(rootView.cssClasses);\n\t\t\tTrace.write(`Setting root css classes: ${rootCssClasses.join(' ')}`, Trace.categories.Style);\n\t\t}\n\t}\n\n\t/**\n\t * iOS Only\n\t * Dynamically change the preferred frame rate\n\t * For devices (iOS 15+) which support min/max/preferred frame rate you can specify ranges\n\t * For devices (iOS < 15), you can specify the max frame rate\n\t * see: https://developer.apple.com/documentation/quartzcore/optimizing_promotion_refresh_rates_for_iphone_13_pro_and_ipad_pro\n\t * To use, ensure your Info.plist has:\n\t * ```xml\n\t * <key>CADisableMinimumFrameDurationOnPhone</key>\n\t * <true/>\n\t * ```\n\t * @param options { min?: number; max?: number; preferred?: number }\n\t */\n\tsetMaxRefreshRate(options?: { min?: number; max?: number; preferred?: number }) {\n\t\t// implement in platform specific files (iOS only for now)\n\t}\n\n\t/**\n\t * @returns The main entry of the application\n\t */\n\tgetMainEntry() {\n\t\treturn getAppMainEntry();\n\t}\n\n\t/**\n\t * Sets the callback that supplies the UI for windows that need content.\n\t * Pass `null` to remove a previously set resolver.\n\t */\n\tsetWindowContentResolver(resolver: WindowContentResolver | null): void {\n\t\tthis._windowContentResolver = resolver ?? null;\n\t}\n\n\t/**\n\t * @returns The callback currently supplying window content, if any.\n\t */\n\tgetWindowContentResolver(): WindowContentResolver | null {\n\t\treturn this._windowContentResolver;\n\t}\n\n\t// --- NativeWindow registry ---\n\n\tprotected _windows: NativeWindow[] = [];\n\n\t/**\n\t * Get the primary NativeWindow.\n\t */\n\tget primaryWindow(): NativeWindow | undefined {\n\t\treturn this._windows.find((nw) => nw.isPrimary);\n\t}\n\n\t/**\n\t * Get the NativeWindow the user is currently interacting with - the one that activated most\n\t * recently and is still attached. Falls back to the primary window while no window holds\n\t * activation, which is the case before the first window activates and on a platform that\n\t * never raises `activate`.\n\t */\n\tget activeWindow(): NativeWindow | undefined {\n\t\tconst active = getActiveWindow();\n\t\tif (active && active.state === 'attached' && this._windows.indexOf(active) !== -1) {\n\t\t\treturn active;\n\t\t}\n\n\t\treturn this.primaryWindow;\n\t}\n\n\t/**\n\t * Get the active windows, filtered by role.\n\t *\n\t * Defaults to the view-carrying app windows (`application` and `embedded`).\n\t * Pass `'all'` to include every registered surface, including ones that carry no view tree.\n\t */\n\tgetWindows(role: 'all'): WindowBase[];\n\tgetWindows(role?: WindowRole | WindowRole[]): NativeWindow[];\n\tgetWindows(role?: WindowRole | WindowRole[] | 'all'): WindowBase[];\n\tgetWindows(role?: WindowRole | WindowRole[] | 'all'): WindowBase[] {\n\t\tif (role === 'all') {\n\t\t\treturn [...this._windows];\n\t\t}\n\t\tconst roles: WindowRole[] = role ? (Array.isArray(role) ? role : [role]) : ['application', 'embedded'];\n\t\treturn this._windows.filter((nw) => roles.indexOf(nw.role) !== -1);\n\t}\n\n\t/**\n\t * Get a registered NativeWindow by its id.\n\t */\n\tgetWindowById(id: string): NativeWindow | undefined {\n\t\treturn this._windows.find((nw) => nw.id === id);\n\t}\n\n\t/**\n\t * Opens a new window.\n\t *\n\t * @param options Options for the new window, including data to hand to it.\n\t */\n\topenWindow(options?: WindowOpenOptions): void {\n\t\tthrow new Error('openWindow() is not supported on this platform.');\n\t}\n\n\t/**\n\t * @internal - Get all registered NativeWindows, whatever their role.\n\t */\n\t_getWindows(): NativeWindow[] {\n\t\treturn [...this._windows];\n\t}\n\n\t/**\n\t * @internal - Register a NativeWindow created by the platform lifecycle.\n\t */\n\t_registerWindow(nativeWindow: NativeWindow): void {\n\t\tthis._windows.push(nativeWindow);\n\n\t\t// A closing window drops its own listeners, so this is never explicitly removed.\n\t\tnativeWindow.on(NativeWindowEvents.activate, this.onWindowActivated, this);\n\n\t\tif (nativeWindow.isPrimary) {\n\t\t\tthis.trackPrimaryWindowTraits(nativeWindow);\n\t\t}\n\n\t\tthis._onWindowRegistered(nativeWindow);\n\n\t\tthis.notify({\n\t\t\teventName: this.windowOpenEvent,\n\t\t\tobject: this,\n\t\t\twindow: nativeWindow,\n\t\t});\n\t}\n\n\t/**\n\t * @internal - retire the windows behind discarded window-session ids.\n\t *\n\t * A session id can only stand in for a window whose native surface is already gone.\n\t * iOS reports sessions discarded while the app was not running on the next launch,\n\t * and such an id can name the session driving the app now, so an id match alone is\n\t * no evidence that the window is finished with. Retiring an attached window tears\n\t * down the UI in use - its root view unloads and nothing ever reloads it - so only\n\t * detached windows are retired. Ids matching no window are ignored: they routinely\n\t * belong to windows this JS context has never seen.\n\t */\n\t_retireDiscardedWindows(ids: string[]): void {\n\t\tfor (const id of ids) {\n\t\t\tconst nativeWindow = id ? this.getWindowById(id) : undefined;\n\n\t\t\tif (!nativeWindow) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (nativeWindow.state === 'attached') {\n\t\t\t\tTrace.write(`Ignoring a discarded session for window '${id}': its surface is still attached.`, Trace.categories.NativeLifecycle, Trace.messageType.warn);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.close);\n\t\t\tthis._unregisterWindow(nativeWindow);\n\t\t}\n\t}\n\n\t/**\n\t * @internal - Unregister a NativeWindow when its native surface is gone for good.\n\t */\n\t_unregisterWindow(nativeWindow: NativeWindow): void {\n\t\tif (!nativeWindow._surfaceGone) {\n\t\t\tTrace.write(`Unregistering window '${nativeWindow.id}' while its native surface is still live. A window may only be retired once the platform has reported the surface gone.`, Trace.categories.NativeLifecycle, Trace.messageType.error);\n\t\t}\n\n\t\tconst idx = this._windows.indexOf(nativeWindow);\n\t\tif (idx >= 0) {\n\t\t\tthis._windows.splice(idx, 1);\n\t\t}\n\n\t\tif (getActiveWindow() === nativeWindow) {\n\t\t\tsetActiveWindow(undefined);\n\t\t}\n\n\t\tthis.notify({\n\t\t\teventName: this.windowCloseEvent,\n\t\t\tobject: this,\n\t\t\twindow: nativeWindow,\n\t\t});\n\n\t\t// If primary was removed, promote the next window that can actually host content\n\t\tif (nativeWindow.isPrimary) {\n\t\t\tnativeWindow._setIsPrimary(false);\n\n\t\t\tconst promoted = this.getWindows().find((nw) => nw.state === 'attached');\n\t\t\tthis.trackPrimaryWindowTraits(promoted);\n\n\t\t\tif (promoted) {\n\t\t\t\tpromoted._setIsPrimary(true);\n\t\t\t\tthis._onPrimaryWindowPromoted(promoted);\n\t\t\t\tthis.notify({\n\t\t\t\t\teventName: this.primaryWindowChangedEvent,\n\t\t\t\t\tobject: this,\n\t\t\t\t\twindow: promoted,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tnativeWindow._destroy();\n\t}\n\n\t/**\n\t * Hook for platform-specific bookkeeping right after a window joins the registry,\n\t * before `windowOpen` is raised.\n\t */\n\tprotected _onWindowRegistered(nativeWindow: NativeWindow): void {\n\t\t// noop\n\t}\n\n\t/**\n\t * Hook for platform-specific bookkeeping right after a window takes over the primary\n\t * role, before `primaryWindowChanged` is raised.\n\t */\n\tprotected _onPrimaryWindowPromoted(nativeWindow: NativeWindow): void {\n\t\t// noop\n\t}\n\n\t// --- Primary window traits ---\n\n\tprivate _traitsWindow: NativeWindow | null = null;\n\n\t/**\n\t * Points the application-level orientation, appearance and layout direction at the\n\t * primary window, which owns those values now that each window has its own.\n\t */\n\tprivate trackPrimaryWindowTraits(nativeWindow: NativeWindow | undefined): void {\n\t\tconst target = nativeWindow ?? null;\n\t\tif (this._traitsWindow === target) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previous = this._traitsWindow;\n\t\tif (previous) {\n\t\t\tprevious.off(NativeWindowEvents.orientationChanged, this.onWindowOrientationChanged, this);\n\t\t\tprevious.off(NativeWindowEvents.systemAppearanceChanged, this.onWindowSystemAppearanceChanged, this);\n\t\t\tprevious.off(NativeWindowEvents.layoutDirectionChanged, this.onWindowLayoutDirectionChanged, this);\n\t\t}\n\n\t\tthis._traitsWindow = target;\n\n\t\tif (!target) {\n\t\t\treturn;\n\t\t}\n\n\t\ttarget.on(NativeWindowEvents.orientationChanged, this.onWindowOrientationChanged, this);\n\t\ttarget.on(NativeWindowEvents.systemAppearanceChanged, this.onWindowSystemAppearanceChanged, this);\n\t\ttarget.on(NativeWindowEvents.layoutDirectionChanged, this.onWindowLayoutDirectionChanged, this);\n\n\t\tthis.syncTraitsFromWindow(target);\n\t}\n\n\t/**\n\t * Adopts the window's values. The very first window seeds them quietly — there is no\n\t * previous application state for it to differ from — while a later promotion raises\n\t * the change events, because app code observed the outgoing window's values.\n\t */\n\tprivate syncTraitsFromWindow(nativeWindow: NativeWindow): void {\n\t\tconst orientation = nativeWindow.orientation();\n\t\tif (orientation) {\n\t\t\tif (this._orientation === undefined) {\n\t\t\t\tthis._orientation = orientation;\n\t\t\t} else {\n\t\t\t\tthis.setOrientation(orientation);\n\t\t\t}\n\t\t}\n\n\t\tconst systemAppearance = nativeWindow.systemAppearance();\n\t\tif (systemAppearance) {\n\t\t\tif (this._systemAppearance === undefined) {\n\t\t\t\tthis._systemAppearance = systemAppearance;\n\t\t\t} else {\n\t\t\t\tthis.setSystemAppearance(systemAppearance);\n\t\t\t}\n\t\t}\n\n\t\tconst layoutDirection = nativeWindow.layoutDirection();\n\t\tif (layoutDirection) {\n\t\t\tif (this._layoutDirection === undefined) {\n\t\t\t\tthis._layoutDirection = layoutDirection;\n\t\t\t} else {\n\t\t\t\tthis.setLayoutDirection(layoutDirection);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onWindowActivated(data: NativeWindowEventData): void {\n\t\tsetActiveWindow(data.window);\n\t}\n\n\tprivate onWindowOrientationChanged(data: WindowOrientationChangedEventData): void {\n\t\tthis.setOrientation(data.newValue);\n\t}\n\n\tprivate onWindowSystemAppearanceChanged(data: WindowSystemAppearanceChangedEventData): void {\n\t\tthis.setSystemAppearance(data.newValue);\n\t}\n\n\tprivate onWindowLayoutDirectionChanged(data: WindowLayoutDirectionChangedEventData): void {\n\t\tthis.setLayoutDirection(data.newValue);\n\t}\n\n\t/**\n\t * @internal - raises `ready` at most once per JS context.\n\t */\n\tnotifyReady(): void {\n\t\tif (this._readyNotified) {\n\t\t\treturn;\n\t\t}\n\t\tthis._readyNotified = true;\n\t\tgetNativeScriptGlobals().setLaunched();\n\n\t\tthis.notify(<ApplicationEventData>{\n\t\t\teventName: this.readyEvent,\n\t\t\tobject: this,\n\t\t\tios: this.ios,\n\t\t\tandroid: this.android,\n\t\t});\n\t}\n\n\t/**\n\t * @internal - raises `exit` and re-arms the legacy `launch` bridge, since the process\n\t * can outlive the exit and open a new first window.\n\t */\n\tnotifyExit(data?: Partial<ApplicationEventData>): void {\n\t\tthis._launchBridgeConsumed = false;\n\n\t\tthis.notify(<ApplicationEventData>{\n\t\t\teventName: this.exitEvent,\n\t\t\tobject: this,\n\t\t\t...data,\n\t\t});\n\t}\n\n\t/**\n\t * @internal - produces the content for a window that has none.\n\t *\n\t * Resolution order: the window content resolver, then the legacy `launch` event\n\t * (offered to the first window that asks for content, and again to the first one after\n\t * `exit`), then the application main entry. A resolver or a `launch` handler returning `null` takes\n\t * ownership of the content, so nothing else is tried. A missing main entry leaves\n\t * the window empty instead of throwing, because content can still arrive later\n\t * through `run()`/`resetRootView()`.\n\t *\n\t * @param options.install `false` returns the resolved view instead of applying it,\n\t * for platform pipelines that install the root view on the native surface themselves.\n\t * @param options.launchData platform payload merged into the legacy `launch` event args.\n\t * @returns The resolved view, or `null` when no content was produced.\n\t */\n\t_resolveWindowContent(window: NativeWindow, request: WindowContentRequest, options?: { install?: boolean; launchData?: any }): View | null {\n\t\tconst content = this.resolveWindowContent(request, options?.launchData);\n\n\t\tif (content == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (options?.install === false) {\n\t\t\treturn this.buildContentView(content);\n\t\t}\n\n\t\twindow.setContent(content);\n\n\t\treturn window.rootView;\n\t}\n\n\tprivate resolveWindowContent(request: WindowContentRequest, launchData?: any): View | NavigationEntry | string | null | undefined {\n\t\tconst launchBridgeAvailable = !this._launchBridgeConsumed;\n\t\tthis._launchBridgeConsumed = true;\n\n\t\tconst resolver = this._windowContentResolver;\n\t\tif (resolver) {\n\t\t\tconst resolved = resolver(request);\n\n\t\t\t// `null` means the resolver supplies the content itself; only `undefined` falls through.\n\t\t\tif (resolved !== undefined) {\n\t\t\t\tthis._ensureAppCssLoaded();\n\n\t\t\t\treturn resolved;\n\t\t\t}\n\t\t}\n\n\t\tif (launchBridgeAvailable) {\n\t\t\tconst root = this.notifyLaunch(launchData);\n\n\t\t\tif (root === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (root) {\n\t\t\t\treturn root;\n\t\t\t}\n\t\t}\n\n\t\tthis._ensureAppCssLoaded();\n\n\t\tconst mainEntry = getAppMainEntry();\n\n\t\treturn mainEntry ? Builder.createViewFromEntry(mainEntry) : undefined;\n\t}\n\n\tprivate buildContentView(content: View | NavigationEntry | string): View {\n\t\tif (typeof content === 'string') {\n\t\t\treturn Builder.createViewFromEntry({ moduleName: content });\n\t\t}\n\n\t\tconst entry = content as NavigationEntry;\n\n\t\treturn entry.moduleName || entry.create ? Builder.createViewFromEntry(entry) : (content as View);\n\t}\n\n\t/**\n\t * Loads the app CSS once per JS context. On the legacy `launch` path this has to run\n\t * after the handlers, which are allowed to call `setCssFileName()`.\n\t */\n\tprivate _ensureAppCssLoaded(): void {\n\t\tif (this._appCssLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tthis._appCssLoaded = true;\n\n\t\tthis.loadAppCss();\n\t}\n\n\t@profile\n\tprotected notifyLaunch(additionalLanchEventData?: any): View | null {\n\t\tthis._launchBridgeConsumed = true;\n\n\t\tconst launchArgs: LaunchEventData = {\n\t\t\teventName: this.launchEvent,\n\t\t\tobject: this,\n\t\t\tios: this.ios,\n\t\t\tandroid: this.android,\n\t\t\t...additionalLanchEventData,\n\t\t};\n\t\tthis.notify(launchArgs);\n\t\tthis._ensureAppCssLoaded();\n\n\t\treturn launchArgs.root;\n\t}\n\n\t@profile\n\tcreateRootView(view?: View, fireLaunchEvent = false, additionalLanchEventData?: any) {\n\t\tlet rootView = view;\n\n\t\tif (!rootView) {\n\t\t\tif (fireLaunchEvent) {\n\t\t\t\trootView = this.notifyLaunch(additionalLanchEventData);\n\n\t\t\t\t// useful for integrations that would like to set rootView asynchronously after app launch\n\t\t\t\tif (rootView === null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!rootView) {\n\t\t\t\t// try to navigate to the mainEntry (if specified)\n\t\t\t\tif (!getAppMainEntry()) {\n\t\t\t\t\tthrow new Error('Main entry is missing. App cannot be started. Verify app bootstrap.');\n\t\t\t\t}\n\n\t\t\t\trootView = Builder.createViewFromEntry(getAppMainEntry());\n\t\t\t}\n\t\t}\n\n\t\treturn rootView;\n\t}\n\n\tgetRootView(): View {\n\t\tthrow new Error('getRootView() Not implemented.');\n\t}\n\n\tresetRootView(entry?: NavigationEntry | string) {\n\t\tsetAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);\n\t\t// rest of implementation is platform specific\n\t}\n\n\t/**\n\t * @param window the window the root view belongs to. Supplies the window-scoped CSS\n\t * classes; without it they come from the primary window.\n\t */\n\tinitRootView(rootView: View, window?: NativeWindow) {\n\t\tthis.setRootViewCSSClasses(rootView, window);\n\t\t// ensure css is \"loaded\" on the rootview so that user rootview can access css variables right away\n\t\trootView._onCssStateChange(true);\n\t\tthis.notify(<InitRootViewEventData>{ eventName: this.initRootViewEvent, rootView });\n\t}\n\n\t/**\n\t * Get application level static resources.\n\t */\n\tgetResources() {\n\t\treturn bindableResources.get();\n\t}\n\n\t/**\n\t * Set application level static resources.\n\t */\n\tsetResources(res: any) {\n\t\tbindableResources.set(res);\n\t}\n\n\t/**\n\t * Sets css file name for the application.\n\t */\n\tsetCssFileName(cssFileName: string) {\n\t\tthis._cssFile = cssFileName;\n\t\tthis.notify(<CssChangedEventData>{\n\t\t\teventName: this.cssChangedEvent,\n\t\t\tobject: this,\n\t\t\tcssFile: cssFileName,\n\t\t});\n\t}\n\n\t/**\n\t * Gets css file name for the application.\n\t */\n\tgetCssFileName(): string {\n\t\treturn this._cssFile;\n\t}\n\n\t/**\n\t * Loads immediately the app.css.\n\t * By default the app.css file is loaded shortly after \"loaded\".\n\t * For the Android snapshot the CSS can be parsed during the snapshot generation,\n\t * as the CSS does not depend on runtime APIs, and loadAppCss will be called explicitly.\n\t */\n\tloadAppCss(): void {\n\t\ttry {\n\t\t\tthis.notify(<LoadAppCSSEventData>{\n\t\t\t\teventName: this.loadAppCssEvent,\n\t\t\t\tobject: this,\n\t\t\t\tios: this.ios,\n\t\t\t\tandroid: this.android,\n\t\t\t\tcssFile: this.getCssFileName(),\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (Trace.isEnabled()) {\n\t\t\t\tTrace.write(`The app CSS file ${this.getCssFileName()} couldn't be loaded!`, Trace.categories.Style, Trace.messageType.warn);\n\t\t\t}\n\t\t}\n\t}\n\n\taddCss(cssText: string, attributeScoped?: boolean): void {\n\t\tthis.notify(<CssChangedEventData>{\n\t\t\teventName: this.cssChangedEvent,\n\t\t\tobject: this,\n\t\t\tcssText: cssText,\n\t\t});\n\t\tif (!attributeScoped) {\n\t\t\tconst rootView = this.getRootView();\n\t\t\tif (rootView) {\n\t\t\t\trootView._onCssStateChange();\n\t\t\t}\n\t\t}\n\t}\n\n\trun(entry?: string | NavigationEntry) {\n\t\tthrow new Error('run() Not implemented.');\n\t}\n\n\tprotected getOrientation(): 'portrait' | 'landscape' | 'unknown' {\n\t\t// override in platform specific Application class\n\t\tthrow new Error('getOrientation() not implemented');\n\t}\n\n\tprotected setOrientation(value: 'portrait' | 'landscape' | 'unknown', degrees?: number) {\n\t\tif (this._orientation === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._orientation = value;\n\n\t\t// Update metrics early enough regardless of the existence of root view\n\t\t// Also, CSS will use the correct size values during update trigger\n\t\tScreen.mainScreen._updateMetrics();\n\n\t\tthis.orientationChanged(this.getRootView(), value);\n\t\tthis.notify(<OrientationChangedEventData>{\n\t\t\teventName: this.orientationChangedEvent,\n\t\t\tandroid: this.android,\n\t\t\tios: this.ios,\n\t\t\tnewValue: value,\n\t\t\tdegrees,\n\t\t\tobject: this,\n\t\t});\n\t}\n\n\t/**\n\t * @deprecated Use Application.primaryWindow?.orientation() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.\n\t */\n\torientation(): 'portrait' | 'landscape' | 'unknown' {\n\t\treturn this.primaryWindow?.orientation() ?? (this._orientation ??= this.getOrientation());\n\t}\n\n\torientationChanged(rootView: View, newOrientation: 'portrait' | 'landscape' | 'unknown'): void {\n\t\tif (!rootView) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newOrientationCssClass = `${CSSUtils.CLASS_PREFIX}${newOrientation}`;\n\t\tthis.applyWindowScopedCssClass(rootView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);\n\n\t\tthis.getOwnedModalViews(rootView).forEach((rootModalView) => {\n\t\t\tthis.applyWindowScopedCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);\n\n\t\t\t// Trigger state change for root modal view classes and media queries\n\t\t\trootModalView._onCssStateChange();\n\t\t});\n\n\t\t// Trigger state change for root view classes and media queries\n\t\trootView._onCssStateChange();\n\t}\n\n\tgetNativeApplication(): any {\n\t\t// override in platform specific Application class\n\t\tthrow new Error('getNativeApplication() not implemented');\n\t}\n\n\thasLaunched(): boolean {\n\t\treturn getNativeScriptGlobals().launched;\n\t}\n\n\tprotected getSystemAppearance(): 'dark' | 'light' | null {\n\t\t// override in platform specific Application class\n\t\tthrow new Error('getSystemAppearance() not implemented');\n\t}\n\n\tprotected setSystemAppearance(value: 'dark' | 'light') {\n\t\tif (this._systemAppearance === value) {\n\t\t\treturn;\n\t\t}\n\t\tthis._systemAppearance = value;\n\t\tconst args = <SystemAppearanceChangedEventData>{\n\t\t\teventName: this.systemAppearanceChangedEvent,\n\t\t\tandroid: this.android,\n\t\t\tios: this.ios,\n\t\t\tnewValue: value,\n\t\t\tcancel: false,\n\t\t\tobject: this,\n\t\t};\n\t\tthis.notify(args);\n\t\tif (args.cancel === false && this.autoSystemAppearanceChanged) {\n\t\t\tthis.systemAppearanceChanged(this.getRootView(), value);\n\t\t}\n\t}\n\n\t/**\n\t * @deprecated Use Application.primaryWindow?.systemAppearance() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.\n\t */\n\tsystemAppearance(): 'dark' | 'light' | null {\n\t\treturn this.primaryWindow?.systemAppearance() ?? (this._systemAppearance ??= this.getSystemAppearance());\n\t}\n\n\t/**\n\t * enable/disable systemAppearanceChanged\n\t */\n\tsetAutoSystemAppearanceChanged(value: boolean): void {\n\t\tsetAutoSystemAppearanceChanged(value);\n\t}\n\n\t/**\n\t * Updates root view classes including those of modals\n\t * @param rootView the root view\n\t * @param newSystemAppearance the new appearance change\n\t */\n\tsystemAppearanceChanged(rootView: View, newSystemAppearance: 'dark' | 'light'): void {\n\t\tif (!rootView) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newSystemAppearanceCssClass = `${CSSUtils.CLASS_PREFIX}${newSystemAppearance}`;\n\t\tthis.applyWindowScopedCssClass(rootView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass);\n\n\t\tthis.getOwnedModalViews(rootView).forEach((rootModalView) => {\n\t\t\tthis.applyWindowScopedCssClass(rootModalView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass);\n\n\t\t\t// Trigger state change for root modal view classes and media queries\n\t\t\trootModalView._onCssStateChange();\n\t\t});\n\n\t\t// Trigger state change for root view classes and media queries\n\t\trootView._onCssStateChange();\n\t}\n\n\tprotected getLayoutDirection(): CoreTypes.LayoutDirectionType | null {\n\t\t// override in platform specific Application class\n\t\tthrow new Error('getLayoutDirection() not implemented');\n\t}\n\n\tprotected setLayoutDirection(value: CoreTypes.LayoutDirectionType) {\n\t\tif (this._layoutDirection === value) {\n\t\t\treturn;\n\t\t}\n\t\tthis._layoutDirection = value;\n\t\tthis.layoutDirectionChanged(this.getRootView(), value);\n\t\tthis.notify(<LayoutDirectionChangedEventData>{\n\t\t\teventName: this.layoutDirectionChangedEvent,\n\t\t\tandroid: this.android,\n\t\t\tios: this.ios,\n\t\t\tnewValue: value,\n\t\t\tobject: this,\n\t\t});\n\t}\n\n\t/**\n\t * @deprecated Use Application.primaryWindow?.layoutDirection() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.\n\t */\n\tlayoutDirection(): CoreTypes.LayoutDirectionType | null {\n\t\treturn this.primaryWindow?.layoutDirection() ?? (this._layoutDirection ??= this.getLayoutDirection());\n\t}\n\n\t/**\n\t * Updates root view classes including those of modals\n\t * @param rootView the root view\n\t * @param newLayoutDirection the new layout direction change\n\t */\n\tlayoutDirectionChanged(rootView: View, newLayoutDirection: CoreTypes.LayoutDirectionType): void {\n\t\tif (!rootView) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newLayoutDirectionCssClass = `${CSSUtils.CLASS_PREFIX}${newLayoutDirection}`;\n\t\tthis.applyWindowScopedCssClass(rootView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass);\n\n\t\tthis.getOwnedModalViews(rootView).forEach((rootModalView) => {\n\t\t\tthis.applyWindowScopedCssClass(rootModalView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass);\n\n\t\t\t// Trigger state change for root modal view classes and media queries\n\t\t\trootModalView._onCssStateChange();\n\t\t});\n\n\t\t// Trigger state change for root view classes and media queries\n\t\trootView._onCssStateChange();\n\t}\n\n\tget inBackground() {\n\t\treturn isAppInBackground();\n\t}\n\n\tsetInBackground(value: boolean, additonalData?: any) {\n\t\tsetAppInBackground(value);\n\n\t\tthis.notify(<ApplicationEventData>{\n\t\t\teventName: value ? this.backgroundEvent : this.foregroundEvent,\n\t\t\tobject: this,\n\t\t\tios: this.ios,\n\n\t\t\t...additonalData,\n\t\t});\n\t}\n\n\tget suspended() {\n\t\treturn this._suspended;\n\t}\n\n\tsetSuspended(value: boolean, additonalData?: any) {\n\t\tthis._suspended = value;\n\n\t\tthis.notify(<ApplicationEventData>{\n\t\t\teventName: value ? this.suspendEvent : this.resumeEvent,\n\t\t\tobject: this,\n\t\t\tios: this.ios,\n\t\t\tandroid: this.android,\n\n\t\t\t...additonalData,\n\t\t});\n\t}\n\n\tget android(): AndroidApplicationType {\n\t\treturn undefined;\n\t}\n\n\tget ios(): iOSApplicationType {\n\t\treturn undefined;\n\t}\n\n\tget AndroidApplication() {\n\t\treturn this.android;\n\t}\n\n\tget iOSApplication() {\n\t\treturn this.ios;\n\t}\n}\n\nprepareAppForModuleResolver(() => {\n\tApplicationCommon.on('livesync', (args) => clearResolverCache());\n\tApplicationCommon.on('orientationChanged', (args) => {\n\t\t_setResolver(undefined);\n\t});\n});\n"]}
@@ -105,11 +105,7 @@ function initNativeScriptLifecycleCallbacks() {
105
105
  activity: activity,
106
106
  });
107
107
  if (activity.isFinishing() && Application.android._getWindows().length === 0) {
108
- Application.android.notify({
109
- eventName: Application.exitEvent,
110
- object: Application.android,
111
- android: activity,
112
- });
108
+ Application.android.notifyExit({ android: activity });
113
109
  }
114
110
  gc();
115
111
  };
@@ -355,7 +351,7 @@ const BroadcastReceiver = lazy(() => {
355
351
  function BroadcastReceiverImpl(onReceiveCallback) {
356
352
  var _this = _super.call(this) || this;
357
353
  _this._onReceiveCallback = onReceiveCallback;
358
- return global.__native(_this);
354
+ return _this;
359
355
  }
360
356
  BroadcastReceiverImpl.prototype.onReceive = function (context, intent) {
361
357
  if (this._onReceiveCallback) {