# Class Window

An interface for managing the current window.

#### Hierarchy

- Window

#####
Index

### Constructors

constructor

### Methods

fullscreen
getPosition
getRect
getSize
maximize
minimize
setPosition
setRect
setSize

## Constructors

### constructor

- new Window(driver): Window

- #### Parameters

  - ##### driver: WebDriver

    The parent driver.

  #### Returns Window

## Methods

### fullscreen

- fullscreen(): Promise<void>

- Invokes the "full screen" operation on the current window. The exact behavior of this command is specific to individual window managers, but this will typically increase the window size to the size of the physical display and hide the browser chrome.

  #### Returns Promise<void>

  A promise that will be resolved when the command has completed.

  #### See

  https://fullscreen.spec.whatwg.org/#fullscreen-an-element

### getPosition

- getPosition(): Promise<ILocation>

- Retrieves the window's current position, relative to the top left corner of the screen.

  #### Returns Promise<ILocation>

  A promise that will be resolved with the window's position in the form of a {x:number, y:number} object literal.

### getRect

- getRect(): Promise<IRectangle>

- Returns the current top-level window's size and position.

  #### Returns Promise<IRectangle>

### getSize

- getSize(): Promise<ISize>

- Retrieves the window's current size.

  #### Returns Promise<ISize>

  A promise that will be resolved with the window's size in the form of a {width:number, height:number} object literal.

### maximize

- maximize(): Promise<void>

- Maximizes the current window. The exact behavior of this command is specific to individual window managers, but typically involves increasing the window to the maximum available size without going full-screen.

  #### Returns Promise<void>

  A promise that will be resolved when the command has completed.

### minimize

- minimize(): Promise<void>

- Minimizes the current window. The exact behavior of this command is specific to individual window managers, but typically involves hiding the window in the system tray.

  #### Returns Promise<void>

  A promise that will be resolved when the command has completed.

### setPosition

- setPosition(x, y): Promise<void>

- Repositions the current window.

  #### Parameters

  - ##### x: number

    The desired horizontal position, relative to the left side of the screen.

  - ##### y: number

    The desired vertical position, relative to the top of the of the screen.

  #### Returns Promise<void>

  A promise that will be resolved when the command has completed.

### setRect

- setRect(__namedParameters): Promise<IRectangle>

- Sets the current top-level window's size and position. You may update just the size by omitting `x` & `y`, or just the position by omitting `width` & `height` options.

  #### Parameters

  - ##### __namedParameters: Partial<IRectangle>

  #### Returns Promise<IRectangle>

### setSize

- setSize(width, height): Promise<void>

- Resizes the current window.

  #### Parameters

  - ##### width: number

    The desired window width.

  - ##### height: number

    The desired window height.

  #### Returns Promise<void>

  A promise that will be resolved when the command has completed.

Generated using TypeDoc