# API

**Kind**: interface | **Module**: [Themes](https://docs.interop.io/browser/reference/javascript/themes/index.md) | **Access**: `io.themes`

**Source**: https://docs.interop.io/browser/reference/javascript/themes/api/index.html

## Methods

### getCurrent

Returns the current theme.

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

**Returns**: `Promise<Theme>`

### list

Returns list of available themes

```ts
() => Promise<Theme[]>
```

**Returns**: `Promise<Theme[]>`

### onChanged

Notifies you when the theme is changed.

```ts
(callback: (theme: Theme) => any) => UnsubscribeFunction
```

**Parameters**

- **`callback`** (`(theme: Theme) => any`, required)
  Callback to handle the event. Receives the theme object as an argument.

**Returns**: `UnsubscribeFunction` - Unsubscribe function.

### select

Selects a new theme

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

**Parameters**

- **`name`** (`string`, required)
  The name of the theme

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

## Related types

- [Theme](https://docs.interop.io/browser/reference/javascript/themes/theme/index.md)
- [UnsubscribeFunction](https://docs.interop.io/browser/reference/javascript/search/unsubscribefunction/index.md)
