Options
All
  • Public
  • Public/Protected
  • All
Menu

Theming API.

Hierarchy

  • ThemeAPI

Index

Properties

currentTheme

currentTheme: string

Current theme name.

iconCache

iconCache: any

[internal] Icon cache.

registeredThemes

registeredThemes: any

Theme registry.

uiVars

uiVars: ThemeUIVars

Current UI variables.

Methods

applyTheme

  • applyTheme(id: string, opts?: any): Promise<void>
  • Loads a theme by id.

    Parameters

    • id: string

      The ID of the theme to load.

    • Optional opts: any

      Apply options

    Returns Promise<void>

clearIconCache

  • clearIconCache(): void
  • Clears the current icon cache.

    Returns void

cssa

  • cssa(css: string): void
  • Append CSS to system style.

    Parameters

    • css: string

      The CSS to append.

    Returns void

cssl

  • cssl(url: string): void
  • Loads CSS from a file and appends it to the system style.

    Parameters

    • url: string

      The URL of the file to load.

    Returns void

dropSoundCache

  • dropSoundCache(): void
  • Revoke all sound URLs in the sound cache.

    Returns void

getActiveVariant

  • getActiveVariant(): string
  • Gets the active theme variant.

    Returns string

getFileIconUrl

  • getFileIconUrl(filePath: string, size?: string, format?: string): Promise<string>
  • Returns an icon url for the specified file or directory.

    Parameters

    • filePath: string

      The path of the file/directory to retrieve an icon for.

    • Optional size: string

      The size of the icon to retrieve.

    • Optional format: string

      The format of the icon to retrieve.

    Returns Promise<string>

getIconFromFileExtension

  • getIconFromFileExtension(ext: string, size?: string, format?: string): Promise<string>
  • Gets an icon for the specified file extension.

    Parameters

    • ext: string

      The extension to get the icon for.

    • Optional size: string

      The size of the icon to retrieve.

    • Optional format: string

      The format of the icon to retrieve.

    Returns Promise<string>

getIconUrl

  • getIconUrl(name: string, size?: string, format?: string): Promise<string>
  • Returns the icon url for the specified icon.

    Parameters

    • name: string

      The name of the icon to return a URL from.

    • Optional size: string

      The size of the icon to return. Default is 32x32.

    • Optional format: string

      The format of the icon to use.

    Returns Promise<string>

getMappedBlobResources

getSound

  • getSound(id: string): Promise<string>
  • Gets a sound from the current theme.

    Parameters

    • id: string

      The id of the sound to get

    Returns Promise<string>

init

  • init(isRecovery: boolean): Promise<void>
  • Initializes the theming engine.

    Required for any sort of theming related services. THIS SHOULD NEVER BE INITIALIZED TWICE - THE SYSTEM VALUES ARE DESIGNED TO BE INHERITED.

    Parameters

    • isRecovery: boolean

      Is in recovery mode - only use W:/ paths

    Returns Promise<void>

loadIconMap

  • loadIconMap(path: string): Promise<void>
  • Loads an icon map.

    Parameters

    • path: string

      The path of the icon map to load

    Returns Promise<void>

playSound

  • playSound(id: string): Promise<void>
  • Shortcut for new Audio(getSound(id)).play() also handles autoplay errors (if there are any)

    Parameters

    • id: string

      The id of the sound to play

    Returns Promise<void>

reloadDesktop

  • reloadDesktop(): Promise<void>
  • Reloads the desktop.

    Returns Promise<void>

unloadTheme

  • unloadTheme(reloadDesk?: boolean): void
  • Unload themes and reset everything.

    Parameters

    • Optional reloadDesk: boolean

      Whether to reload the desktop.

    Returns void

Generated using TypeDoc