# SiDefaultThemeStore Type documentation

## TypeScript declaration

### [SiDefaultThemeStore](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L73-L173>)

**Kind:** class

```
import { SiDefaultThemeStore } from '@siemens/element-ng/theme';
```

```
undecorated_class SiDefaultThemeStore extends SiThemeStore
```

#### Constructor

##### constructor

[Source for constructor](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L76-L79>)

```
constructor(isBrowser: boolean): SiDefaultThemeStore
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [isBrowser](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L76-L76>) | `boolean` |  |  |

**Returns:** [SiDefaultThemeStore](<index.html#t:SiDefaultThemeStore>)

#### Methods

##### activateTheme

[Source for activateTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L94-L107>)

Sets the theme with the given name to active.

Inherited from [SiThemeStore](<index.html#t:SiThemeStore>)

```
activateTheme(name: string): Observable<boolean>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L94-L94>) | `string` |  | • The name of the theme to become active. |

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[boolean](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean>)`>`

##### deactivateTheme

[Source for deactivateTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L109-L118>)

Deactivate any active theme and makes the element theme the default one.

Inherited from [SiThemeStore](<index.html#t:SiThemeStore>)

```
deactivateTheme(): Observable<boolean>
```

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[boolean](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean>)`>`

##### deleteTheme

[Source for deleteTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L147-L159>)

Deletes the theme with the given name from the store.

Inherited from [SiThemeStore](<index.html#t:SiThemeStore>)

```
deleteTheme(name: string): Observable<boolean>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L147-L147>) | `string` |  | • The name of the theme to be deleted. |

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[boolean](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean>)`>`

##### loadActiveTheme

[Source for loadActiveTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L81-L92>)

Load and return an alternative custom theme, other then the default element theme. This method is invoked initially to check for an alternative custom theme.

Inherited from [SiThemeStore](<index.html#t:SiThemeStore>)

```
loadActiveTheme(): Observable<Theme | undefined>
```

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[Theme](<index.html#t:Theme>)`  |  `[undefined](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined>)`>`

##### loadTheme

[Source for loadTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L139-L145>)

Load theme with the given `name`.

Inherited from [SiThemeStore](<index.html#t:SiThemeStore>)

```
loadTheme(name: string): Observable<Theme | undefined>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L139-L139>) | `string` |  | • The name of the theme to be returned. |

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[Theme](<index.html#t:Theme>)`  |  `[undefined](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined>)`>`

##### loadThemeNames

[Source for loadThemeNames](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L120-L126>)

Load and return the available theme names.

Inherited from [SiThemeStore](<index.html#t:SiThemeStore>)

```
loadThemeNames(): Observable<string[]>
```

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[string](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>)`[]>`

##### saveTheme

[Source for saveTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L128-L137>)

Saves a theme to the store. The name shall not be empty. A theme with identical name gets overwritten.

Inherited from [SiThemeStore](<index.html#t:SiThemeStore>)

```
saveTheme(theme: Theme): Observable<boolean>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [theme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L128-L128>) | `Theme` |  | • The theme to be saved. |

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[boolean](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean>)`>`

### Types Documentation

### [SiThemeStore](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L15-L64>)

**Kind:** class

```
import { SiThemeStore } from '@siemens/element-ng/theme';
```

SiThemeStore object is used by the theme service to load and store the themes. You can inject your own implementation to provide a backend implementation. Otherwise a localStorage based implementation is used.

```
undecorated_class SiThemeStore
```

#### Constructor

##### constructor

[Source for constructor](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L15-L64>)

```
constructor(): SiThemeStore
```

**Returns:** [SiThemeStore](<index.html#t:SiThemeStore>)

#### Methods

##### activateTheme

[Source for activateTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L30-L30>)

Sets the theme with the given name to active.

Returns: True on success, otherwise false.

```
activateTheme(name: string): Observable<boolean>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L30-L30>) | `string` |  | • The name of the theme to become active. |

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[boolean](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean>)`>`

##### deactivateTheme

[Source for deactivateTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L35-L35>)

Deactivate any active theme and makes the element theme the default one.

Returns: True on success, otherwise false.

```
deactivateTheme(): Observable<boolean>
```

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[boolean](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean>)`>`

##### deleteTheme

[Source for deleteTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L63-L63>)

Deletes the theme with the given name from the store.

Returns: True on success, otherwise false. All nicely wrapped in an observable that may also emit errors. Returns false, if the theme does not exist.

```
deleteTheme(name: string): Observable<boolean>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L63-L63>) | `string` |  | • The name of the theme to be deleted. |

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[boolean](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean>)`>`

##### loadActiveTheme

[Source for loadActiveTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L24-L24>)

Load and return an alternative custom theme, other then the default element theme. This method is invoked initially to check for an alternative custom theme.

Returns: The active theme to be used, or undefined if the default element theme shall be used. All wrapped in an observable that can also emit errors.

```
loadActiveTheme(): Observable<Theme | undefined>
```

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[Theme](<index.html#t:Theme>)`  |  `[undefined](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined>)`>`

##### loadTheme

[Source for loadTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L47-L47>)

Load theme with the given `name`.

Returns: Observable with the named theme or `undefined` if no such theme exist.

```
loadTheme(name: string): Observable<Theme | undefined>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L47-L47>) | `string` |  | • The name of the theme to be returned. |

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[Theme](<index.html#t:Theme>)`  |  `[undefined](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined>)`>`

##### loadThemeNames

[Source for loadThemeNames](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L41-L41>)

Load and return the available theme names.

Returns: An `Observable` of available theme names, other than the default element theme.

```
loadThemeNames(): Observable<string[]>
```

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[string](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>)`[]>`

##### saveTheme

[Source for saveTheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L55-L55>)

Saves a theme to the store. The name shall not be empty. A theme with identical name gets overwritten.

Returns: True on success, otherwise false. All nicely wrapped in an observable that may also emit errors.

```
saveTheme(theme: Theme): Observable<boolean>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [theme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-store.ts#L55-L55>) | `Theme` |  | • The theme to be saved. |

**Returns:** [Observable](<https://rxjs.dev/api/index/class/Observable>)`<`[boolean](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean>)`>`

### [Theme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme.model.ts#L25-L43>)

**Kind:** interface

```
import type { Theme } from '@siemens/element-ng/theme';
```

```
interface Theme
```

#### Properties

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr id="t:Theme.icons"> <td class="api-column-name"><a href="https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme.model.ts#L42-L42">icons</a> (optional)</td> <td class="api-column-type"><code>Record&lt;<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;</code></td> <td class="api-column-description"><p>A map of icons that overrides the default Element icons. The key must be the key of the original icon that should be overridden. The value has to be a data SVG string.</p><p>Example:</p><pre><code class="language-ts">{&#10;  elementUser: &quot;data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'&gt;...&lt;/svg&gt;&quot;&#10;}</code></pre></td></tr><tr id="t:Theme.name"> <td class="api-column-name"><a href="https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme.model.ts#L26-L26">name</a></td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></td> <td class="api-column-description"></td></tr><tr id="t:Theme.schemes"> <td class="api-column-name"><a href="https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme.model.ts#L27-L27">schemes</a></td> <td class="api-column-type"><code><a href="index.html#t:ThemeColorSchemes">ThemeColorSchemes</a></code></td> <td class="api-column-description"></td></tr></tbody></table>

### [ThemeColorSchemes](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme.model.ts#L45-L48>)

**Kind:** interface

```
import type { ThemeColorSchemes } from '@siemens/element-ng/theme';
```

```
interface ThemeColorSchemes
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [dark](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme.model.ts#L47-L47>) (optional) | `ThemeColorScheme` |  |
| [light](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme.model.ts#L46-L46>) (optional) | `ThemeColorScheme` |  |

### [ThemeColorScheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme.model.ts#L50-L50>)

**Kind:** type alias

```
import type { ThemeColorScheme } from '@siemens/element-ng/theme';
```

```
type ThemeColorScheme = { [key: string]: string }
```

#### Index Signatures

| Name | Type | Description |
| --- | --- | --- |
| [\[key: string\]](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme.model.ts#L50-L50>) | `string` |  |
