Skip to content

SiThemeStore Type documentation

TypeScript declaration

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.

Constructor
Methods
  • activateTheme (name: string) => Observable<boolean>

    Sets the theme with the given name to active.

    Returns: True on success, otherwise false.

    Parameters
    • • The name of the theme to become active.

      name : string

  • deactivateTheme () => Observable<boolean>

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

    Returns: True on success, otherwise false.

  • deleteTheme (name: string) => Observable<boolean>

    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.

    Parameters
  • loadActiveTheme () => Observable<Theme | undefined>

    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.

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

    Load theme with the given name.

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

    Parameters
    • • The name of the theme to be returned.

      name : string

  • loadThemeNames () => Observable<string[]>

    Load and return the available theme names.

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

  • saveTheme (theme: Theme) => Observable<boolean>

    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.

    Parameters

Types Documentation

import type { Theme } from '@siemens/element-ng/theme';
Properties
  • 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.

    Example:

    {
      elementUser: "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>...</svg>"
    }
    

    icons ? : Record<string, string>

  • name : string

  • schemes : ThemeColorSchemes

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

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


Except where otherwise noted, content on this site is licensed under MIT License.