export interface Theme { /** * The type of theme */ type: "light" | "dark" | "contrast"; /** * The theme's author */ author: string; /** * The name of the theme */ name: string; /** * The theme's description */ description?: string; /** * The theme's color palette */ palette: { [index: string]: string; }; /** * The theme's version number */ version: string; /** * The theme's GitHub repository */ repository?: string; /** * The theme's website URL */ homepage?: string; /** * The theme's license */ license?: string; } export interface ThemeCSSPrettySettings { /** * The indentation character */ indentChar?: string; /** * The new line character */ newLineChar?: string; } declare let themeStore: { [index: string]: { [index: string]: Theme; }; }; /** * Generate a theme using CSS variables from a theme palette * @param theme The theme palette * @param pretty Make the output pretty */ export declare function buildCSSFromPalette(theme: { [index: string]: string; }, pretty?: boolean | ThemeCSSPrettySettings): string; export declare enum ThemeInstallErrors { /** * The name of the theme contains spaces */ nameContainsSpaces = 0, /** * The name of the author contains spaces */ authorContainsSpaces = 1 } /** * Install a theme to local storage * @param theme The theme * @returns A promise for when the theme is installed */ export declare function installTheme(theme: Theme): Promise; export declare enum ThemeLoadErrors { /** * A theme on that author was not installed */ nameNotFound = 0, /** * There are no themes using that author currently installed */ authorNotFound = 1 } export declare enum ThemeRemoveErrors { /** * A theme on that author was not installed */ nameNotFound = 0, /** * There are no themes using that author currently installed */ authorNotFound = 1 } /** * Load a theme for rendering * @param author Theme author * @param name Theme name * @returns Promise for when the theme is loaded */ export declare function loadTheme(author: string, name: string): Promise; /** * Uninstall a theme from local storage * @param author Theme author * @param name Theme name * @returns Promise for if the theme was uninstalled */ export declare function removeTheme(author: string, name: string): Promise; /** * Get all the installed themes * @returns All the installed themes */ export declare function getInstalledThemes(): typeof themeStore; /** * Get the currently loaded theme * @returns The currently loaded theme */ export declare function getLoadedTheme(): Theme; /** * Listen for when a new theme is loaded * @param event Event name * @param listener Event callback */ export declare function on(event: "load", listener: () => void): string; /** * Listen for when a new theme is loaded * @param event Event name * @param listener Event callback */ export declare function once(event: "load", listener: () => void): string; /** * Remove an event listener * @param eventID Event ID */ export declare function removeListener(eventID: string): void; export {};