NativeScript 9.1 Released → V8 14.9, Vite 8 HMR, built for rapid agentic visual iteration
Dig in

Defined in: native-window/index.d.ts:35

Cross-platform base for any window surface.

Carries identity, role, state, lifecycle events and the native accessors. Surfaces that host a NativeScript view tree are NativeWindow instances.

Extends ​

Extended by ​

Constructors ​

Constructor ​

ts
new WindowBase(): WindowBase;

Returns ​

WindowBase

Inherited from ​

Observable.constructor

Properties ​

android? ​

ts
readonly optional android?: {
  activity: AppCompatActivity;
};

Defined in: native-window/index.d.ts:71

The Android surface backing this window, or undefined when not running on Android or when the activity is already gone.

activity ​

ts
readonly activity: AppCompatActivity;

id ​

ts
readonly id: string;

Defined in: native-window/index.d.ts:41

Stable identifier of this window, unique for the lifetime of the JS context. Survives a detach/re-attach, so it can be used to correlate a window across an iOS scene reconnect or an Android activity recreation.


ios? ​

ts
readonly optional ios?: {
  scene?: UIWindowScene;
  uiWindow: UIWindow;
};

Defined in: native-window/index.d.ts:65

The iOS surface backing this window, or undefined when not running on iOS. scene is absent for apps still on the pre-scene (window-only) lifecycle.

scene? ​

ts
readonly optional scene?: UIWindowScene;

uiWindow ​

ts
readonly uiWindow: UIWindow;

isPrimary ​

ts
readonly isPrimary: boolean;

Defined in: native-window/index.d.ts:59

Whether this is the application's primary window.

At most one window is primary at a time. When the primary window closes another attached window is promoted and primaryWindowChanged is raised on the Application.


role ​

ts
readonly role: WindowRole;

Defined in: native-window/index.d.ts:46

The purpose this window surface serves.


state ​

ts
readonly state: WindowState;

Defined in: native-window/index.d.ts:51

Where this window currently sits in its lifecycle.


propertyChangeEvent ​

ts
static propertyChangeEvent: string;

Defined in: data/observable/index.ts

String value used when hooking to propertyChange event.

Ns Event ​

propertyChange

Inherited from ​

Observable.propertyChangeEvent

Methods ​

_createPropertyChangeData() ​

ts
_createPropertyChangeData(
   propertyName: string, 
   value: any, 
   oldValue?: any): PropertyChangeData;

Defined in: data/observable/index.ts

This method is intended to be overriden by inheritors to provide additional implementation.

Parameters ​

ParameterType
propertyNamestring
valueany
oldValue?any

Returns ​

PropertyChangeData

Inherited from ​

Observable._createPropertyChangeData


_emit() ​

ts
_emit(eventName: string): void;

Defined in: data/observable/index.ts

Parameters ​

ParameterType
eventNamestring

Returns ​

void

Inherited from ​

Observable._emit


addEventListener() ​

ts
addEventListener(
   eventName: string, 
   callback: (data: EventData) => void, 
   thisArg?: any, 
   once?: boolean): void;

Defined in: data/observable/index.ts

Adds a listener for the specified event name.

Parameters ​

ParameterTypeDescription
eventNamestringName of the event to attach to.
callback(data: EventData) => voidA function to be called when some of the specified event(s) is raised.
thisArg?anyAn optional parameter which when set will be used as "this" in callback method call.
once?booleanAn optional parameter which when set will cause the event listener to fire once.

Returns ​

void

Inherited from ​

Observable.addEventListener


close() ​

ts
abstract close(): void;

Defined in: native-window/index.d.ts:79

Closes this window.

Ends the window session: the native surface is dismissed, close is raised and the window is dropped from the Application registry.

Returns ​

void


get() ​

ts
get(name: string): any;

Defined in: data/observable/index.ts

Gets the value of the specified property.

Parameters ​

ParameterType
namestring

Returns ​

any

Inherited from ​

Observable.get


hasListeners() ​

ts
hasListeners(eventName: string): boolean;

Defined in: data/observable/index.ts

Checks whether a listener is registered for the specified event name.

Parameters ​

ParameterTypeDescription
eventNamestringThe name of the event to check for.

Returns ​

boolean

Inherited from ​

Observable.hasListeners


notify() ​

ts
notify<T>(data: T): void;

Defined in: data/observable/index.ts

Notify this Observable instance with some data. This causes all event handlers on the Observable instance to be called, as well as any 'global' event handlers set on the instance's class.

Type Parameters ​

Type Parameter
T extends Optional<EventData, "object">

Parameters ​

ParameterTypeDescription
dataTan object that satisfies the EventData interface, though with an optional 'object' property. If left undefined, the 'object' property will implicitly be set as this Observable instance.

Returns ​

void

Inherited from ​

Observable.notify


notifyPropertyChange() ​

ts
notifyPropertyChange(
   name: string, 
   value: any, 
   oldValue?: any): void;

Defined in: data/observable/index.ts

Notifies all the registered listeners for the property change event.

Parameters ​

ParameterType
namestring
valueany
oldValue?any

Returns ​

void

Inherited from ​

Observable.notifyPropertyChange


off() ​

Call Signature ​

ts
off(
   event: "activate", 
   callback?: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:218

Removes the listener(s) for the specified event name.

Parameters ​
ParameterTypeDescription
event"activate"-
callback?(data: WindowBaseEventData) => voidAn optional specific event listener to remove (if omitted, all event listeners by this name will be removed).
thisArg?anyAn optional parameter which, when set, will be used to refine search of the correct event listener to be removed.
Returns ​

void

Overrides ​

Observable.off

Call Signature ​

ts
off(
   event: "deactivate", 
   callback?: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:219

Parameters ​
ParameterType
event"deactivate"
callback?(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "background", 
   callback?: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:220

Parameters ​
ParameterType
event"background"
callback?(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "foreground", 
   callback?: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:221

Parameters ​
ParameterType
event"foreground"
callback?(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "attached", 
   callback?: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:222

Parameters ​
ParameterType
event"attached"
callback?(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "detached", 
   callback?: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:223

Parameters ​
ParameterType
event"detached"
callback?(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "close", 
   callback?: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:224

Parameters ​
ParameterType
event"close"
callback?(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "displayed", 
   callback?: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:225

Parameters ​
ParameterType
event"displayed"
callback?(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "orientationChanged", 
   callback?: (data: WindowOrientationChangedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:226

Parameters ​
ParameterType
event"orientationChanged"
callback?(data: WindowOrientationChangedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "systemAppearanceChanged", 
   callback?: (data: WindowSystemAppearanceChangedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:227

Parameters ​
ParameterType
event"systemAppearanceChanged"
callback?(data: WindowSystemAppearanceChangedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "layoutDirectionChanged", 
   callback?: (data: WindowLayoutDirectionChangedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:228

Parameters ​
ParameterType
event"layoutDirectionChanged"
callback?(data: WindowLayoutDirectionChangedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "activityCreated", 
   callback?: (args: AndroidActivityBundleEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:229

Parameters ​
ParameterType
event"activityCreated"
callback?(args: AndroidActivityBundleEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "activityDestroyed", 
   callback?: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:230

Parameters ​
ParameterType
event"activityDestroyed"
callback?(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "activityStarted", 
   callback?: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:231

Parameters ​
ParameterType
event"activityStarted"
callback?(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "activityPaused", 
   callback?: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:232

Parameters ​
ParameterType
event"activityPaused"
callback?(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "activityResumed", 
   callback?: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:233

Parameters ​
ParameterType
event"activityResumed"
callback?(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "activityStopped", 
   callback?: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:234

Parameters ​
ParameterType
event"activityStopped"
callback?(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "saveActivityState", 
   callback?: (args: AndroidActivityBundleEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:235

Parameters ​
ParameterType
event"saveActivityState"
callback?(args: AndroidActivityBundleEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "activityResult", 
   callback?: (args: AndroidActivityResultEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:236

Parameters ​
ParameterType
event"activityResult"
callback?(args: AndroidActivityResultEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "activityBackPressed", 
   callback?: (args: AndroidActivityBackPressedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:237

Parameters ​
ParameterType
event"activityBackPressed"
callback?(args: AndroidActivityBackPressedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "activityNewIntent", 
   callback?: (args: AndroidActivityNewIntentEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:238

Parameters ​
ParameterType
event"activityNewIntent"
callback?(args: AndroidActivityNewIntentEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "activityRequestPermissions", 
   callback?: (args: AndroidActivityRequestPermissionsEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:239

Parameters ​
ParameterType
event"activityRequestPermissions"
callback?(args: AndroidActivityRequestPermissionsEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "sceneWillConnect", 
   callback?: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:240

Parameters ​
ParameterType
event"sceneWillConnect"
callback?(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "sceneDidActivate", 
   callback?: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:241

Parameters ​
ParameterType
event"sceneDidActivate"
callback?(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "sceneWillResignActive", 
   callback?: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:242

Parameters ​
ParameterType
event"sceneWillResignActive"
callback?(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "sceneWillEnterForeground", 
   callback?: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:243

Parameters ​
ParameterType
event"sceneWillEnterForeground"
callback?(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "sceneDidEnterBackground", 
   callback?: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:244

Parameters ​
ParameterType
event"sceneDidEnterBackground"
callback?(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "sceneDidDisconnect", 
   callback?: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:245

Parameters ​
ParameterType
event"sceneDidDisconnect"
callback?(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "sceneOpenURLContexts", 
   callback?: (args: SceneOpenURLContextsEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:246

Parameters ​
ParameterType
event"sceneOpenURLContexts"
callback?(args: SceneOpenURLContextsEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "sceneContinueUserActivity", 
   callback?: (args: SceneContinueUserActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:247

Parameters ​
ParameterType
event"sceneContinueUserActivity"
callback?(args: SceneContinueUserActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   event: "scenePerformActionForShortcutItem", 
   callback?: (args: ScenePerformActionForShortcutItemEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:248

Parameters ​
ParameterType
event"scenePerformActionForShortcutItem"
callback?(args: ScenePerformActionForShortcutItemEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

Call Signature ​

ts
off(
   eventName: string, 
   callback?: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:254

Removes a listener for the specified event name. Omitting the callback removes every listener registered for that event on this window.

Parameters ​
ParameterType
eventNamestring
callback?(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.off

on() ​

Call Signature ​

ts
on(
   event: "activate", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:84

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"activate"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​

Observable.on

Call Signature ​

ts
on(
   event: "deactivate", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:89

Raised when the window loses focus.

Parameters ​
ParameterType
event"deactivate"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "background", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:94

Raised when the window enters the background.

Parameters ​
ParameterType
event"background"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "foreground", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:99

Raised when the window enters the foreground.

Parameters ​
ParameterType
event"foreground"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "attached", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:105

Raised when a native surface is bound to the window - both on the first connect and on every re-attach after a detached.

Parameters ​
ParameterType
event"attached"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "detached", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:115

Raised when the native surface goes away while the window session stays alive (iOS scene disconnect, Android activity recreation).

The window stays registered on the Application and keeps its listeners, so the same instance is handed back when a surface re-attaches and handlers registered before the detach keep working afterwards.

Parameters ​
ParameterType
event"detached"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "close", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:125

Raised when the window session ends for good.

Fires exactly once per window. Listeners stay registered for the whole teardown, so a handler added at any earlier point still observes it; immediately after it is dispatched the framework drops every listener on the instance, so nothing registered on a window outlives the window.

Parameters ​
ParameterType
event"close"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "displayed", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:130

Raised after the window content has been displayed for the first time.

Parameters ​
ParameterType
event"displayed"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "orientationChanged", 
   callback: (data: WindowOrientationChangedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:135

Raised when the orientation of this window changes.

Parameters ​
ParameterType
event"orientationChanged"
callback(data: WindowOrientationChangedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "systemAppearanceChanged", 
   callback: (data: WindowSystemAppearanceChangedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:140

Raised when the system appearance of this window changes between light and dark.

Parameters ​
ParameterType
event"systemAppearanceChanged"
callback(data: WindowSystemAppearanceChangedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "layoutDirectionChanged", 
   callback: (data: WindowLayoutDirectionChangedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:145

Raised when the layout direction of this window changes between ltr and rtl.

Parameters ​
ParameterType
event"layoutDirectionChanged"
callback(data: WindowLayoutDirectionChangedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "activityCreated", 
   callback: (args: AndroidActivityBundleEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:147

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"activityCreated"
callback(args: AndroidActivityBundleEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "activityDestroyed", 
   callback: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:148

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"activityDestroyed"
callback(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "activityStarted", 
   callback: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:149

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"activityStarted"
callback(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "activityPaused", 
   callback: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:150

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"activityPaused"
callback(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "activityResumed", 
   callback: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:151

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"activityResumed"
callback(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "activityStopped", 
   callback: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:152

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"activityStopped"
callback(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "saveActivityState", 
   callback: (args: AndroidActivityBundleEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:153

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"saveActivityState"
callback(args: AndroidActivityBundleEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "activityResult", 
   callback: (args: AndroidActivityResultEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:154

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"activityResult"
callback(args: AndroidActivityResultEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "activityBackPressed", 
   callback: (args: AndroidActivityBackPressedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:155

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"activityBackPressed"
callback(args: AndroidActivityBackPressedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "activityNewIntent", 
   callback: (args: AndroidActivityNewIntentEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:156

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"activityNewIntent"
callback(args: AndroidActivityNewIntentEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "activityRequestPermissions", 
   callback: (args: AndroidActivityRequestPermissionsEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:157

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"activityRequestPermissions"
callback(args: AndroidActivityRequestPermissionsEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "sceneWillConnect", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:158

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"sceneWillConnect"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "sceneDidActivate", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:159

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"sceneDidActivate"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "sceneWillResignActive", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:160

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"sceneWillResignActive"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "sceneWillEnterForeground", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:161

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"sceneWillEnterForeground"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "sceneDidEnterBackground", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:162

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"sceneDidEnterBackground"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "sceneDidDisconnect", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:163

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"sceneDidDisconnect"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "sceneOpenURLContexts", 
   callback: (args: SceneOpenURLContextsEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:164

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"sceneOpenURLContexts"
callback(args: SceneOpenURLContextsEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "sceneContinueUserActivity", 
   callback: (args: SceneContinueUserActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:165

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"sceneContinueUserActivity"
callback(args: SceneContinueUserActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   event: "scenePerformActionForShortcutItem", 
   callback: (args: ScenePerformActionForShortcutItemEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:166

Raised when the window becomes the active/focused window.

Parameters ​
ParameterType
event"scenePerformActionForShortcutItem"
callback(args: ScenePerformActionForShortcutItemEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.on

Call Signature ​

ts
on(
   eventName: string, 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:178

Adds a listener for the specified event name.

Parameters ​
ParameterTypeDescription
eventNamestringThe name of the event.
callback(data: WindowBaseEventData) => voidThe event listener to add. Will be called when an event of the given name is raised.
thisArg?anyAn optional parameter which, when set, will be bound as the this context when the callback is called. Falsy values will be not be bound.
Returns ​

void

Overrides ​
ts
Observable.on

once() ​

Call Signature ​

ts
once(
   event: "activate", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:180

Adds a listener for the specified event name, which, once fired, will remove itself.

Parameters ​
ParameterTypeDescription
event"activate"-
callback(data: WindowBaseEventData) => voidThe event listener to add. Will be called when an event of the given name is raised.
thisArg?anyAn optional parameter which, when set, will be bound as the this context when the callback is called. Falsy values will be not be bound.
Returns ​

void

Overrides ​

Observable.once

Call Signature ​

ts
once(
   event: "deactivate", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:181

Parameters ​
ParameterType
event"deactivate"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "background", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:182

Parameters ​
ParameterType
event"background"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "foreground", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:183

Parameters ​
ParameterType
event"foreground"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "attached", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:184

Parameters ​
ParameterType
event"attached"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "detached", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:185

Parameters ​
ParameterType
event"detached"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "close", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:186

Parameters ​
ParameterType
event"close"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "displayed", 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:187

Parameters ​
ParameterType
event"displayed"
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "orientationChanged", 
   callback: (data: WindowOrientationChangedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:188

Parameters ​
ParameterType
event"orientationChanged"
callback(data: WindowOrientationChangedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "systemAppearanceChanged", 
   callback: (data: WindowSystemAppearanceChangedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:189

Parameters ​
ParameterType
event"systemAppearanceChanged"
callback(data: WindowSystemAppearanceChangedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "layoutDirectionChanged", 
   callback: (data: WindowLayoutDirectionChangedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:190

Parameters ​
ParameterType
event"layoutDirectionChanged"
callback(data: WindowLayoutDirectionChangedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "activityCreated", 
   callback: (args: AndroidActivityBundleEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:191

Parameters ​
ParameterType
event"activityCreated"
callback(args: AndroidActivityBundleEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "activityDestroyed", 
   callback: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:192

Parameters ​
ParameterType
event"activityDestroyed"
callback(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "activityStarted", 
   callback: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:193

Parameters ​
ParameterType
event"activityStarted"
callback(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "activityPaused", 
   callback: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:194

Parameters ​
ParameterType
event"activityPaused"
callback(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "activityResumed", 
   callback: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:195

Parameters ​
ParameterType
event"activityResumed"
callback(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "activityStopped", 
   callback: (args: AndroidActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:196

Parameters ​
ParameterType
event"activityStopped"
callback(args: AndroidActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "saveActivityState", 
   callback: (args: AndroidActivityBundleEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:197

Parameters ​
ParameterType
event"saveActivityState"
callback(args: AndroidActivityBundleEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "activityResult", 
   callback: (args: AndroidActivityResultEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:198

Parameters ​
ParameterType
event"activityResult"
callback(args: AndroidActivityResultEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "activityBackPressed", 
   callback: (args: AndroidActivityBackPressedEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:199

Parameters ​
ParameterType
event"activityBackPressed"
callback(args: AndroidActivityBackPressedEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "activityNewIntent", 
   callback: (args: AndroidActivityNewIntentEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:200

Parameters ​
ParameterType
event"activityNewIntent"
callback(args: AndroidActivityNewIntentEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "activityRequestPermissions", 
   callback: (args: AndroidActivityRequestPermissionsEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:201

Parameters ​
ParameterType
event"activityRequestPermissions"
callback(args: AndroidActivityRequestPermissionsEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "sceneWillConnect", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:202

Parameters ​
ParameterType
event"sceneWillConnect"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "sceneDidActivate", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:203

Parameters ​
ParameterType
event"sceneDidActivate"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "sceneWillResignActive", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:204

Parameters ​
ParameterType
event"sceneWillResignActive"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "sceneWillEnterForeground", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:205

Parameters ​
ParameterType
event"sceneWillEnterForeground"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "sceneDidEnterBackground", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:206

Parameters ​
ParameterType
event"sceneDidEnterBackground"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "sceneDidDisconnect", 
   callback: (args: SceneEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:207

Parameters ​
ParameterType
event"sceneDidDisconnect"
callback(args: SceneEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "sceneOpenURLContexts", 
   callback: (args: SceneOpenURLContextsEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:208

Parameters ​
ParameterType
event"sceneOpenURLContexts"
callback(args: SceneOpenURLContextsEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "sceneContinueUserActivity", 
   callback: (args: SceneContinueUserActivityEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:209

Parameters ​
ParameterType
event"sceneContinueUserActivity"
callback(args: SceneContinueUserActivityEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   event: "scenePerformActionForShortcutItem", 
   callback: (args: ScenePerformActionForShortcutItemEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:210

Parameters ​
ParameterType
event"scenePerformActionForShortcutItem"
callback(args: ScenePerformActionForShortcutItemEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

Call Signature ​

ts
once(
   eventName: string, 
   callback: (data: WindowBaseEventData) => void, 
   thisArg?: any): void;

Defined in: native-window/index.d.ts:216

Adds a listener for the specified event name that is removed as soon as it is raised once.

Parameters ​
ParameterType
eventNamestring
callback(data: WindowBaseEventData) => void
thisArg?any
Returns ​

void

Overrides ​
ts
Observable.once

removeEventListener() ​

ts
removeEventListener(
   eventName: string, 
   callback?: (data: EventData) => void, 
   thisArg?: any): void;

Defined in: data/observable/index.ts

Removes listener(s) for the specified event name.

Parameters ​

ParameterTypeDescription
eventNamestringName of the event to attach to.
callback?(data: EventData) => voidAn optional parameter pointing to a specific listener. If not defined, all listeners for the event names will be removed.
thisArg?anyAn optional parameter which when set will be used to refine search of the correct callback which will be removed as event listener.

Returns ​

void

Inherited from ​

Observable.removeEventListener


set() ​

ts
set(name: string, value: any): void;

Defined in: data/observable/index.ts

Updates the specified property with the provided value.

Parameters ​

ParameterType
namestring
valueany

Returns ​

void

Inherited from ​

Observable.set


setProperty() ​

ts
setProperty(name: string, value: any): void;

Defined in: data/observable/index.ts

Updates the specified property with the provided value and raises a property change event and a specific change event based on the property name.

Parameters ​

ParameterType
namestring
valueany

Returns ​

void

Inherited from ​

Observable.setProperty


addEventListener() ​

ts
static addEventListener(
   eventName: string, 
   callback: (data: EventData) => void, 
   thisArg?: any, 
   once?: boolean): void;

Defined in: data/observable/index.ts

Please avoid using the static event-handling APIs as they will be removed in future.

Parameters ​

ParameterType
eventNamestring
callback(data: EventData) => void
thisArg?any
once?boolean

Returns ​

void

Deprecated ​

Inherited from ​

Observable.addEventListener


off() ​

ts
static off(
   eventName: string, 
   callback?: (data: EventData) => void, 
   thisArg?: any): void;

Defined in: data/observable/index.ts

Please avoid using the static event-handling APIs as they will be removed in future.

Parameters ​

ParameterType
eventNamestring
callback?(data: EventData) => void
thisArg?any

Returns ​

void

Deprecated ​

Inherited from ​

Observable.off


on() ​

ts
static on(
   eventName: string, 
   callback: (data: EventData) => void, 
   thisArg?: any, 
   once?: boolean): void;

Defined in: data/observable/index.ts

Please avoid using the static event-handling APIs as they will be removed in future.

Parameters ​

ParameterType
eventNamestring
callback(data: EventData) => void
thisArg?any
once?boolean

Returns ​

void

Deprecated ​

Inherited from ​

Observable.on


once() ​

ts
static once(
   eventName: string, 
   callback: (data: EventData) => void, 
   thisArg?: any): void;

Defined in: data/observable/index.ts

Please avoid using the static event-handling APIs as they will be removed in future.

Parameters ​

ParameterType
eventNamestring
callback(data: EventData) => void
thisArg?any

Returns ​

void

Deprecated ​

Inherited from ​

Observable.once


removeEventListener() ​

ts
static removeEventListener(
   eventName: string, 
   callback?: (data: EventData) => void, 
   thisArg?: any): void;

Defined in: data/observable/index.ts

Please avoid using the static event-handling APIs as they will be removed in future.

Parameters ​

ParameterType
eventNamestring
callback?(data: EventData) => void
thisArg?any

Returns ​

void

Deprecated ​

Inherited from ​

Observable.removeEventListener

Previous
WebView