Skip to main content

window.WindowManager

Manage the current window object.

Constructors#

constructor#

+ new WindowManager(): WindowManager

Returns: WindowManager

Methods#

close#

close(): Promise<void>

Closes the window.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:471


hide#

hide(): Promise<void>

Sets the window visibility to false.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:457


innerPosition#

innerPosition(): Promise<PhysicalPosition>

The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop.

Returns: Promise<PhysicalPosition>

Defined in: window.ts:283


innerSize#

innerSize(): Promise<PhysicalSize>

The physical size of the window's client area. The client area is the content of the window, excluding the title bar and borders.

Returns: Promise<PhysicalSize>

Defined in: window.ts:306


isFullscreen#

isFullscreen(): Promise<boolean>

Gets the window's current fullscreen state.

Returns: Promise<boolean>

Defined in: window.ts:329


isMaximized#

isMaximized(): Promise<boolean>

Gets the window's current maximized state.

Returns: Promise<boolean>

Defined in: window.ts:339


maximize#

maximize(): Promise<void>

Maximizes the window.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:387


minimize#

minimize(): Promise<void>

Minimizes the window.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:415


outerPosition#

outerPosition(): Promise<PhysicalPosition>

The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.

Returns: Promise<PhysicalPosition>

Defined in: window.ts:293


outerSize#

outerSize(): Promise<PhysicalSize>

The physical size of the entire window. These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead.

Returns: Promise<PhysicalSize>

Defined in: window.ts:319


scaleFactor#

scaleFactor(): Promise<number>

The scale factor that can be used to map physical pixels to logical pixels.

Returns: Promise<number>

Defined in: window.ts:273


setAlwaysOnTop#

setAlwaysOnTop(alwaysOnTop: boolean): Promise<void>

Whether the window should always be on top of other windows.

Parameters:#

NameTypeDescription
alwaysOnTopbooleanWhether the window should always be on top of other windows or not.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:502


setDecorations#

setDecorations(decorations: boolean): Promise<void>

Whether the window should have borders and bars.

Parameters:#

NameTypeDescription
decorationsbooleanWhether the window should have borders and bars.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:486


setFullscreen#

setFullscreen(fullscreen: boolean): Promise<void>

Sets the window fullscreen state.

Parameters:#

NameTypeDescription
fullscreenbooleanWhether the window should go to fullscreen or not.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:616


setIcon#

setIcon(icon: string | number[]): Promise<void>

Sets the window icon.

Parameters:#

NameTypeDescription
iconstring | number[]Icon bytes or path to the icon file.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:632


setMaxSize#

setMaxSize(size: undefined | PhysicalSize | LogicalSize): Promise<void>

Sets the window max size.

Parameters:#

NameTypeDescription
sizeundefined | PhysicalSize | LogicalSizeThe logical or physical size.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:566


setMinSize#

setMinSize(size: undefined | PhysicalSize | LogicalSize): Promise<void>

Sets the window min size.

Parameters:#

NameTypeDescription
sizeundefined | PhysicalSize | LogicalSizeThe logical or physical size.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:540


setPosition#

setPosition(position: PhysicalPosition | LogicalPosition): Promise<void>

Sets the window position.

Parameters:#

NameTypeDescription
positionPhysicalPosition | LogicalPositionThe new position, in logical or physical pixels.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:592


setResizable#

setResizable(resizable: boolean): Promise<void>

Updates the window resizable flag.

Parameters:#

NameType
resizableboolean

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:356


setSize#

setSize(size: PhysicalSize | LogicalSize): Promise<void>

Resizes the window.

Parameters:#

NameTypeDescription
sizePhysicalSize | LogicalSizeThe logical or physical size.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:518


setTitle#

setTitle(title: string): Promise<void>

Sets the window title.

Parameters:#

NameTypeDescription
titlestringThe new title

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:372


show#

show(): Promise<void>

Sets the window visibility to true.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:443


startDragging#

startDragging(): Promise<void>

Starts dragging the window.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:649


unmaximize#

unmaximize(): Promise<void>

Unmaximizes the window.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:401


unminimize#

unminimize(): Promise<void>

Unminimizes the window.

Returns: Promise<void>

A promise indicating the success or failure of the operation.

Defined in: window.ts:429