Class: ExternalWindow

ExternalWindow

An ExternalWindow object representing an adopted native window on the system. Allows the developer to call actions on external windows as well as listen to external window events.

Methods

(async, static) wrap(identity) → {Promise.<ExternalWindow>}

EXPERIMENTAL

Asynchronously returns an external window object that represents an existing external window.

Parameters:
Name Type Description
identity Identity
Returns:
Type
Promise.<ExternalWindow>

(static) wrapSync(identity) → {ExternalWindow}

EXPERIMENTAL

Synchronously returns an external window object that represents an existing external window.

Parameters:
Name Type Description
identity Identity
Returns:
Type
ExternalWindow

(async) bringToFront() → {Promise.<void>}

EXPERIMENTAL

Brings the external window to the front of the window stack.

Returns:
Type
Promise.<void>

(async) close() → {Promise.<void>}

EXPERIMENTAL

Closes the external window.

Returns:
Type
Promise.<void>

(async) disableUserMovement() → {Promise.<void>}

EXPERIMENTAL

Prevents a user from changing an external window's size/position when using the window's frame.

Returns:
Type
Promise.<void>

(async) enableUserMovement() → {Promise.<void>}

EXPERIMENTAL

Re-enables user changes to an external window's size/position when using the window's frame.

Returns:
Type
Promise.<void>

(async) flash() → {Promise.<void>}

EXPERIMENTAL

Flashes the external window’s frame and taskbar icon until stopFlashing is called.

Returns:
Type
Promise.<void>

(async) focus() → {Promise.<void>}

EXPERIMENTAL

Gives focus to the external window.

Fires:
  • ExternalWindow#event:focused
Returns:
Type
Promise.<void>

(async) getBounds() → {Promise.<Bounds>}

EXPERIMENTAL

Gets the current bounds (top, left, etc.) of the external window.

Returns:
Type
Promise.<Bounds>

(async) getGroup() → {Promise.<Array.<(ExternalWindow|_Window)>>}

EXPERIMENTAL

Retrieves an array containing wrapped external windows that are grouped with this external window. If a window is not in a group an empty array is returned.

Returns:
Type
Promise.<Array.<(ExternalWindow|_Window)>>

(async) getInfo() → {Promise.<any>}

EXPERIMENTAL

Gets an information object for the window.

Returns:
Type
Promise.<any>

(async) getOptions() → {Promise.<any>}

EXPERIMENTAL

Gets an external window's options.

Returns:
Type
Promise.<any>

(async) getState() → {Promise.<string>}

EXPERIMENTAL

Gets the current state ("minimized", "maximized", or "restored") of the external window.

Returns:
Type
Promise.<string>

(async) hide() → {Promise.<void>}

EXPERIMENTAL

Hides the external window.

Returns:
Type
Promise.<void>

(async) isShowing() → {Promise.<boolean>}

EXPERIMENTAL

Determines if the external window is currently showing.

Returns:
Type
Promise.<boolean>

(async) joinGroup(target) → {Promise.<void>}

EXPERIMENTAL

Joins the same window group as the specified window.

Parameters:
Name Type Description
target _Window | ExternalWindow

The window whose group is to be joined

Returns:
Type
Promise.<void>

(async) leaveGroup() → {Promise.<void>}

EXPERIMENTAL

Leaves the current window group so that the window can be moved independently of those in the group.

Returns:
Type
Promise.<void>

(async) maximize() → {Promise.<void>}

EXPERIMENTAL

Maximizes the external window.

Returns:
Type
Promise.<void>

(async) mergeGroups(target) → {Promise.<void>}

EXPERIMENTAL

Merges the instance's window group with the same window group as the specified window

Parameters:
Name Type Description
target _Window | ExternalWindow

The window whose group is to be merged with

Returns:
Type
Promise.<void>

(async) minimize() → {Promise.<void>}

EXPERIMENTAL

Minimizes the external window.

Returns:
Type
Promise.<void>

(async) moveBy(deltaLeft, deltaTop) → {Promise.<void>}

EXPERIMENTAL

Moves the external window by a specified amount.

Parameters:
Name Type Description
deltaLeft number

The change in the left position of the window

deltaTop number

The change in the top position of the window

Returns:
Type
Promise.<void>

(async) moveTo(left, top) → {Promise.<void>}

EXPERIMENTAL

Moves the external window to a specified location.

Parameters:
Name Type Description
left number

The left position of the window

top number

The top position of the window

Returns:
Type
Promise.<void>

(async) resizeBy(deltaWidth, deltaHeight, anchor) → {Promise.<void>}

EXPERIMENTAL

Resizes the external window by a specified amount.

Parameters:
Name Type Description
deltaWidth number

The change in the width of the window

deltaHeight number

The change in the height of the window

anchor AnchorType

Specifies a corner to remain fixed during the resize. Can take the values: "top-left", "top-right", "bottom-left", or "bottom-right". If undefined, the default is "top-left".

Returns:
Type
Promise.<void>

(async) resizeTo(width, height, anchor) → {Promise.<void>}

EXPERIMENTAL

Resizes the external window to the specified dimensions.

Parameters:
Name Type Description
width number

The change in the width of the window

height number

The change in the height of the window

anchor AnchorType

Specifies a corner to remain fixed during the resize. Can take the values: "top-left", "top-right", "bottom-left", or "bottom-right". If undefined, the default is "top-left".

Returns:
Type
Promise.<void>

(async) restore() → {Promise.<void>}

EXPERIMENTAL

Restores the external window to its normal state (i.e. unminimized, unmaximized).

Returns:
Type
Promise.<void>

(async) setAsForeground() → {Promise.<void>}

EXPERIMENTAL

Will bring the external window to the front of the entire stack and give it focus.

Returns:
Type
Promise.<void>

(async) setBounds() → {Promise.<void>}

EXPERIMENTAL

Sets the external window's size and position.

Properties:
Name Type Description
bounds Bounds
Returns:
Type
Promise.<void>

(async) show() → {Promise.<void>}

EXPERIMENTAL

Shows the external window if it is hidden.

Returns:
Type
Promise.<void>

(async) showAt(left, top) → {Promise.<void>}

EXPERIMENTAL

Shows the external window, if it is hidden, at the specified location. If the toggle parameter is set to true, the external window will alternate between showing and hiding.

Parameters:
Name Type Description
left number

The left position of the window

top number

The top position of the window

Returns:
Type
Promise.<void>

(async) stopFlashing() → {Promise.<void>}

EXPERIMENTAL

Stops the taskbar icon from flashing.

Returns:
Type
Promise.<void>

(async) updateOptions(options) → {Promise.<void>}

EXPERIMENTAL

Updates the external window using the passed options

Parameters:
Name Type Description
options *

Changes an external window's options

Returns:
Type
Promise.<void>