SiThemeService documentation¶
provided in root
✓
Attributes and Methods¶
Name | Type | Default | Description |
---|---|---|---|
activeThemeName | string | The name of the theme that is active. Theme name element is the default. | |
addOrUpdateTheme(...) ¶ | (theme: Theme ) => Observable <boolean > | Adds or updates the given theme in the theme store. Returns true if the theme was saved successfully.Parameters
| |
applyTheme(...) ¶ | (theme: Theme , type: ThemeType , overwrite: boolean ) => void | Applies the given theme to the document. If no theme is given, the active theme is applied. Parameters | |
applyThemeType(...) ¶ | (type: ThemeType ) => void | Apply light or dark theme to the document.Parameters
| |
deleteTheme(...) ¶ | (name: string ) => Observable <boolean > | Deletes the theme with the given name from the theme store. Parameters
| |
getActiveTheme() ¶ | () => Observable <(undefined | Theme )> | Loads and returns the currently active theme. Returns undefined if no custom theme is used. Returns A custom theme or undefined if the default element theme is used. | |
getTheme(...) ¶ | (name: string ) => Observable <(undefined | Theme )> | Returns a clone of the theme with the given name or undefined if not available or name is element .Returns The theme with the given name and undefined if name is element .Parameters
| |
hasTheme(...) ¶ | (name: string ) => boolean | Returns true if a theme with the given name is available.Parameters
| |
isThemeValid(...) ¶ | (data: unknown ) => boolean | Checks if the given theme JSON object is a valid theme. Parameters
| |
resetPreview() ¶ | () => void | Resets the preview theme to the default element theme. | |
(readonly) resolvedColorScheme ¶ | (undefined | ThemeType ) | The current color scheme. (e.g. light or dark). | |
(readonly) resolvedColorScheme$ ¶ | Observable <keyof ThemeColorSchemes > | this.resolvedColorSchemeSub.asObservable() | Emits events when the color scheme changes. |
setActiveTheme(...) ¶ | (name: string , type: ThemeType ) => Observable <boolean > | Sets the active theme to the given name. If no name is given, the default element theme is used. Parameters | |
(readonly) themeChange ¶ | EventEmitter <(undefined | Theme )> | ... | Emits events when the currently applied theme changes. Either by changing to another theme or by re-applying a theme with updated properties. When switching to default theme element, undefined is emitted. |
(readonly) themeIcons ¶ | WritableSignal <Record <string , SafeHtml >> | {} | Icon overrides by the currently activeTheme. |
(readonly) themeNames ¶ | string [] | All available theme names, including element theme name. | |
(readonly) themeNames$ ¶ | Observable <string []> | this.themeNamesSub.asObservable() | Emits events when the list of available theme names changes. |
updateProperty(...) ¶ | (name: string , value: string , type: keyof ThemeColorSchemes ) => void | Updates the given property of the preview theme. Parameters
|
Types Documentation¶
|
|
Except where otherwise noted, content on this site is licensed under MIT License.