# WorkspaceWindow

**Kind**: interface | **Module**: [Workspaces](https://docs.interop.io/desktop/reference/javascript/workspaces/index.md)

**Source**: https://docs.interop.io/desktop/reference/javascript/workspaces/workspacewindow/index.html

An object describing a window part of an existing workspace

## Properties

- **`allowExtract`** (`boolean`, optional)
  Show whether or not the user can extract the specified window
- **`allowReorder`** (`boolean`, optional)
  Show whether or not the user can reorder the specified window
- **`appName`** (`string`, required)
  The application name of the window if it was registered as an application
- **`elementId`** (`string`, required)
  An unique string identifier of the workspace element that hosts the window
- **`focused`** (`boolean`, required)
  A flag showing whether or not the window has focus
- **`frame`** (`Frame`, required)
  An object representing the frame, which contains this window
- **`frameId`** (`string`, required)
  The string id of the frame containing this window
- **`height`** (`number`, optional)
  Indicates the current height of the window
- **`id`** (`string | undefined`, required)
  An unique string identifier of the window
- **`isLoaded`** (`boolean`, required)
  A flag showing whether or not the window's content is loaded
- **`isMaximized`** (`boolean`, required)
  A flag showing whether or not the window is maximized within it's box
- **`isSelected`** (`boolean`, required)
  A flag showing whether or not the window is selected
- **`maxHeight`** (`number`, optional)
  Indicates the configured maximum height of the window
- **`maxWidth`** (`number`, optional)
  Indicates the configured maximum width of the window
- **`minHeight`** (`number`, optional)
  Indicates the configured height width of the window
- **`minWidth`** (`number`, optional)
  Indicates the configured minimum width of the window
- **`parent`** (`Workspace | WorkspaceBox`, required)
  An object representing the parent box, which contains this window
- **`positionIndex`** (`number`, required)
  The position of this window regarding it's siblings
- **`showCloseButton`** (`boolean`, optional)
  Indicates whether the close button which is located in the window's tab is visible
- **`title`** (`string`, required)
  The title of the window
- **`type`** (`"window"`, required)
  The type of the workspace element
- **`width`** (`number`, optional)
  Indicates the current width of the window
- **`workspace`** (`Workspace`, required)
  An object representing the workspace, which contains this window
- **`workspaceId`** (`string`, required)
  The string id of the workspace containing this window

## Methods

### close

Closes the workspace window.

```ts
() => Promise<void>
```

**Returns**: `Promise<void>`

### eject

Removes a workspace window from the workspace and turns it into a standalone window.

```ts
() => Promise<any>
```

**Returns**: `Promise<any>`

### focus

Gives focus to the window.

```ts
() => Promise<void>
```

**Returns**: `Promise<void>`

### forceLoad

Forces a window, which was added to the workspace to load it's contents.

```ts
() => Promise<void>
```

**Returns**: `Promise<void>`

### getGdWindow

Returns the underlying GDWindow (Enterprise) or WebWindow (Core) of the workspace window.

```ts
() => any
```

**Returns**: `any`

### lock

Locks the window using a provided config object, which restricts various modification functionalities of the window

```ts
(config?: IOConnectWorkspaces.WorkspaceWindowLockConfig | ((config: IOConnectWorkspaces.WorkspaceWindowLockConfig) => IOConnectWorkspaces.WorkspaceWindowLockConfig)) => Promise<void>
```

**Parameters**

- **`config`** (`IOConnectWorkspaces.WorkspaceWindowLockConfig | ((config: IOConnectWorkspaces.WorkspaceWindowLockConfig) => IOConnectWorkspaces.WorkspaceWindowLockConfig)`, optional)
  This can be either an object or a function. When the object is provided, it overrides all other lock properties. When a function is provided, it will be called with the current lock settings and it should return a lock config, which will override the current settings. The function is recommended in all cases where overriding of the settings is not desired.

**Returns**: `Promise<void>`

### maximize

Maximizes the workspace window relative to it's parent box.

```ts
() => Promise<void>
```

**Returns**: `Promise<void>`

### moveTo

Moves the workspace window to a new box. In **io.Connect Browser** this box must be part of the same frame.

```ts
(box: WorkspaceBox) => Promise<void>
```

**Parameters**

- **`box`** (`WorkspaceBox`, required)
  An object describing the new box of the window.

**Returns**: `Promise<void>`

### onLockConfigurationChanged

Notifies when a change in the lock configuration of the workspace window has been made

```ts
(callback: (config: IOConnectWorkspaces.WorkspaceWindowLockConfig) => void) => Promise<IOConnectWorkspaces.Unsubscribe>
```

**Parameters**

- **`callback`** (`(config: IOConnectWorkspaces.WorkspaceWindowLockConfig) => void`, required)
  Callback function to handle the event. Receives the new lock configuration as a parameter

**Returns**: `Promise<IOConnectWorkspaces.Unsubscribe>`

### onRemoved

Notifies when this window was removed from the workspace.

```ts
(callback: () => void) => Promise<Unsubscribe>
```

**Parameters**

- **`callback`** (`() => void`, required)
  Callback function to handle the event.

**Returns**: `Promise<Unsubscribe>`

### onTabReordered

Notifies when the tab of the Workspace window has been reordered. Returns an unsubscribe function.

*Since: io.Connect Browser 4.4*

```ts
(callback: () => void) => Promise<IOConnectWorkspaces.Unsubscribe>
```

**Parameters**

- **`callback`** (`() => void`, required)
  Callback function for handling the event.
  *Available only in **io.Connect Browser**.*

**Returns**: `Promise<IOConnectWorkspaces.Unsubscribe>`

### restore

Restores a previously maximized workspace window.

```ts
() => Promise<void>
```

**Returns**: `Promise<void>`

### setSize

Sets a new size for the window

```ts
(sizeConfig: ElementResizeConfig) => Promise<void>
```

**Parameters**

- **`sizeConfig`** (`ElementResizeConfig`, required)
  A config object which should be the new size of the window.

**Returns**: `Promise<void>`

### setTitle

Sets a new title to the workspace window.

```ts
(title: string) => Promise<void>
```

**Parameters**

- **`title`** (`string`, required)
  The new title for the window.

**Returns**: `Promise<void>`

## Related types

- [ElementResizeConfig](https://docs.interop.io/desktop/reference/javascript/workspaces/elementresizeconfig/index.md)
- [Frame](https://docs.interop.io/desktop/reference/javascript/workspaces/frame/index.md)
- [Unsubscribe](https://docs.interop.io/desktop/reference/javascript/workspaces/unsubscribe/index.md)
- [Workspace](https://docs.interop.io/desktop/reference/javascript/workspaces/workspace/index.md)
- [WorkspaceBox](https://docs.interop.io/desktop/reference/javascript/workspaces/workspacebox/index.md)
- [WorkspaceWindowLockConfig](https://docs.interop.io/desktop/reference/javascript/workspaces/workspacewindowlockconfig/index.md)
