@sassoftware/vi-api
Version:
Types used in the SAS Visual Investigator API
40 lines (39 loc) • 1.15 kB
TypeScript
export declare enum Theme {
Illuminate = "sas_corporate",
Ignite = "sas_ignite",
HighContrast = "sas_hcb"
}
/**
* This API provides the functionality related to SAS Visual Investigator's application theme.
*
* Accessed from the window at `window.sas.vi.theme`.
*
* @example window.sas.vi.theme.getCurrent();
* @category API
*/
export interface ThemeApi {
/**
* @method
* @description Gets the current theme.
* @returns The current theme.
*/
getCurrent(): Theme;
/**
* @method
* @description Callback function when the theme is changed.
* @param {ThemeApi~themeChangeHandler} callback to be called when a theme is changed.
* @returns {ThemeApi~stopThemeChangeHandler} A function that, when invoked, stops the callback from being called.
*/
onChange(callback: (themeName: Theme) => void): () => void;
}
/**
* A callback function to handle theme changes.
* @callback ThemeApi~themeChangeHandler
* @param {theme} themeName New theme.
* @returns {void}
*/
/**
* Stops handling theme change events.
* @callback ThemeApi~stopThemeChangeHandler
* @returns {void}
*/