Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ThemeLoader

Loads and validates a theme from URL objects.

Hierarchy

  • ThemeLoader

Index

Methods

Static isThemeLoaded

  • isThemeLoaded(theme: Theme): boolean

Static load

  • Loads a {@link @here/harp-datasource-protocol#Theme} from a remote resource, provided as a URL that points to a JSON-encoded theme.

    By default, resolves following features of theme:

    • extends - loads and merges all inherited themes (see [[resolveBaseTheme]])
    • ref - resolves all ref instances to their values defined in definitions section of theme (see [[resolveThemeReferences]])

    Relative URIs of reference resources are resolved to full URL using the document's base URL (see [[resolveUrls]]).

    Custom URIs (of theme itself and of resources referenced by theme) may be resolved with by providing {@link @here/harp-utils#UriResolver} using ThemeLoadOptions.uriResolver option.

    Parameters

    • theme: string | Theme

      {@link @here/harp-datasource-protocol#Theme} instance or theme URL to the theme.

    • Optional options: ThemeLoadOptions

      Optional, a ThemeLoadOptions objects containing any custom settings for this load request.

    Returns Promise<Theme>

Static loadAsync

  • loadAsync(themeUrl: string): Promise<Theme>
  • deprecated

    Please use ThemeLoader.load

    Loads a {@link @here/harp-datasource-protocol#Theme} from a remote resource, provided as a URL that points to a JSON-encoded theme.

    Parameters

    • themeUrl: string

      The URL to the theme.

    Returns Promise<Theme>

Generated using TypeDoc