# DefaultLayoutAPI

**Kind**: interface | **Module**: [Layouts](https://docs.interop.io/desktop/reference/javascript/layouts/index.md) | **Access**: `io.v2.default`

**Source**: https://docs.interop.io/desktop/reference/javascript/layouts/defaultlayoutapi/index.html

API for managing the default Global Layout which **io.Connect Desktop** will load upon startup.

## Methods

### clear

Clears the default Global Layout.

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

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

### get

Retrieves the default Global Layout. Resolves with `null` if no default Global Layout has been set.

```ts
() => Promise<Layout | null>
```

**Returns**: `Promise<Layout | null>`

### onChanged

Notifies when the default Global Layout is set or cleared. Resolves with an unsubscribe function.

```ts
(handler: (layout: Layout | null) => void) => Promise<UnsubscribeFunction>
```

**Parameters**

- **`handler`** (`(layout: Layout | null) => void`, required)
  Callback function for handling the event. Receives the default Global Layout, or `null`.

**Returns**: `Promise<UnsubscribeFunction>`

### set

Sets a new default Global Layout.

```ts
(layout: LayoutSelect) => Promise<void>
```

**Parameters**

- **`layout`** (`LayoutSelect`, required)
  The Layout to set as the new default Global Layout.

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

## Related types

- [Layout](https://docs.interop.io/desktop/reference/javascript/layouts/layout/index.md)
- [LayoutSelect](https://docs.interop.io/desktop/reference/javascript/layouts/layoutselect/index.md)
- [UnsubscribeFunction](https://docs.interop.io/desktop/reference/javascript/layouts/unsubscribefunction/index.md)
