import { type IdObjectSkeletonInterface } from '../api/ApiTypes'; import { State } from '../shared/State'; import { ExportMetaData } from './OpsTypes'; export type ThemeSkeleton = IdObjectSkeletonInterface & { name: string; isDefault: boolean; linkedTrees: string[]; }; export type UiThemeRealmObject = IdObjectSkeletonInterface & { name: string; realm: Map; }; export declare const THEMEREALM_ID = "ui/themerealm"; export type Theme = { /** * Create an empty theme export template * @returns {ThemeExportInterface} an empty theme export template */ createThemeExportTemplate(): ThemeExportInterface; /** * Read all themes * @param {string} realm realm name * @returns {Promise} a promise that resolves to an array of themes */ readThemes(): Promise; /** * Read theme by id * @param {string} themeId theme id * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ readTheme(themeId: string, realm?: string): Promise; /** * Read theme by name * @param {string} themeName theme name * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ readThemeByName(themeName: string, realm?: string): Promise; /** * Export all themes. The response can be saved to file as is. * @returns {Promise} Promise resolving to a ThemeExportInterface object. */ exportThemes(): Promise; /** * Update theme * @param {ThemeSkeleton} themeData theme object * @param {string} themeId theme id * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ createTheme(themeData: ThemeSkeleton, themeId?: string, realm?: string): Promise; /** * Update theme * @param {string} themeId theme id * @param {ThemeSkeleton} themeData theme object * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ updateTheme(themeId: string, themeData: ThemeSkeleton, realm?: string): Promise; /** * Update theme by name * @param {String} themeName theme name * @param {ThemeSkeleton} themeData theme object * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ updateThemeByName(themeName: string, themeData: ThemeSkeleton, realm?: string): Promise; /** * Update all themes * @param {Map} allThemesData themes object containing all themes for all realms * @param {string} realm realm name * @returns {Promise>} a promise that resolves to a themes object */ updateThemes(themeMap: Record): Promise>; /** * Import themes * @param {ThemeExportInterface} importData import data * @returns {Promise} a promise resolving to an array of theme objects */ importThemes(importData: ThemeExportInterface): Promise; /** * Delete theme by id * @param {string} themeId theme id * @param {string} realm realm name * @returns {Promise} a promise that resolves to a themes object */ deleteTheme(themeId: string, realm?: string): Promise; /** * Delete theme by name * @param {string} themeName theme name * @param {string} realm realm name * @returns {Promise} a promise that resolves to a themes object */ deleteThemeByName(themeName: string, realm?: string): Promise; /** * Delete all themes * @param {string} realm realm name * @returns {Promise} a promise that resolves to an array of themes */ deleteThemes(realm?: string): Promise; /** * Get all themes * @param {string} realm realm name * @returns {Promise} a promise that resolves to an array of themes * @deprecated since v2.0.0 use {@link Theme.readThemes | readThemes} instead * ```javascript * readThemes(): Promise * ``` * @group Deprecated */ getThemes(): Promise; /** * Get theme by id * @param {string} themeId theme id * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object * @deprecated since v2.0.0 use {@link Theme.readTheme | readTheme} instead * ```javascript * readTheme(themeId: string, realm?: string): Promise * ``` * @group Deprecated */ getTheme(themeId: string, realm?: string): Promise; /** * Get theme by name * @param {string} themeName theme name * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object * @deprecated since v2.0.0 use {@link Theme.readThemeByName | readThemeByName} instead * ```javascript * readThemeByName(themeName: string, realm?: string): Promise * ``` * @group Deprecated */ getThemeByName(themeName: string, realm?: string): Promise; /** * Put theme by id * @param {string} themeId theme id * @param {ThemeSkeleton} themeData theme object * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object * @deprecated since v2.0.0 use {@link Theme.updateTheme | updateTheme} or {@link Theme.createTheme | createTheme} instead * ```javascript * updateTheme(themeId: string, themeData: ThemeSkeleton, realm?: string): Promise * createTheme(themeData: ThemeSkeleton, themeId?: string, realm?: string): Promise * ``` * @group Deprecated */ putTheme(themeId: string, themeData: ThemeSkeleton, realm?: string): Promise; /** * Put theme by name * @param {String} themeName theme name * @param {ThemeSkeleton} themeData theme object * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object * @deprecated since v2.0.0 use {@link Theme.updateThemeByName | updateThemeByName} instead * ```javascript * updateThemeByName(themeName: string, themeData: ThemeSkeleton, realm?: string): Promise * ``` * @group Deprecated */ putThemeByName(themeName: string, themeData: ThemeSkeleton, realm?: string): Promise; /** * Put all themes * @param {Map} allThemesData themes object containing all themes for all realms * @param {string} realm realm name * @returns {Promise>} a promise that resolves to a themes object * @deprecated since v2.0.0 use {@link Theme.updateThemes | updateThemes} instead * ```javascript * updateThemes(themeMap: Map): Promise> * ``` * @group Deprecated */ putThemes(themeMap: Record): Promise>; }; declare const _default: (state: State) => Theme; export default _default; export interface ThemeExportInterface { meta?: ExportMetaData; theme: Record; } /** * Create an empty theme export template * @returns {ThemeExportInterface} an empty theme export template */ export declare function createThemeExportTemplate({ state, }: { state: State; }): ThemeExportInterface; /** * Read all themes * @param {string} realm realm name * @returns {Promise} a promise that resolves to an array of themes */ export declare function readThemes({ realm, state, }: { realm?: string; state: State; }): Promise; /** * Read theme by id * @param {string} themeId theme id * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ export declare function readTheme({ themeId, realm, state, }: { themeId: string; realm?: string; state: State; }): Promise; /** * Read theme by name * @param {string} themeName theme name * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ export declare function readThemeByName({ themeName, realm, state, }: { themeName: string; realm?: string; state: State; }): Promise; /** * Export all themes. The response can be saved to file as is. * @returns {Promise} Promise resolving to a ThemeExportInterface object. */ export declare function exportThemes({ state, }: { state: State; }): Promise; /** * Create theme * @param {string} themeId theme id * @param {ThemeSkeleton} themeData theme object * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ export declare function createTheme({ themeData, themeId, realm, state, }: { themeData: ThemeSkeleton; themeId?: string; realm?: string; state: State; }): Promise; /** * Update theme * @param {string} themeId theme id * @param {ThemeSkeleton} themeData theme object * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ export declare function updateTheme({ themeId, themeData, realm, state, }: { themeId: string; themeData: ThemeSkeleton; realm?: string; state: State; }): Promise; /** * Update theme by name * @param {String} themeName theme name * @param {ThemeSkeleton} themeData theme object * @param {string} realm realm name * @returns {Promise} a promise that resolves to a theme object */ export declare function updateThemeByName({ themeName, themeData, realm, state, }: { themeName: string; themeData: ThemeSkeleton; realm?: string; state: State; }): Promise; /** * Update all themes * @param {Map} allThemesData themes object containing all themes for all realms * @param {string} realm realm name * @returns {Promise>} a promise that resolves to a themes object */ export declare function updateThemes({ themeMap, realm, state, }: { themeMap: Record; realm?: string; state: State; }): Promise>; /** * Import themes * @param {ThemeExportInterface} importData import data * @param {string} realm realm name * @returns {Promise} a promise resolving to an array of theme objects */ export declare function importThemes({ importData, realm, state, }: { importData: ThemeExportInterface; realm?: string; state: State; }): Promise; /** * Delete theme by id * @param {string} themeId theme id * @param {string} realm realm name * @returns {Promise} a promise that resolves to a themes object */ export declare function deleteTheme({ themeId, realm, state, }: { themeId: string; realm?: string; state: State; }): Promise; /** * Delete theme by name * @param {string} themeName theme name * @param {string} realm realm name * @returns {Promise} a promise that resolves to a themes object */ export declare function deleteThemeByName({ themeName, realm, state, }: { themeName: string; realm?: string; state: State; }): Promise; /** * Delete all themes * @param {string} realm realm name * @returns {Promise} a promise that resolves to an array of themes */ export declare function deleteThemes({ realm, state, }: { realm?: string; state: State; }): Promise; //# sourceMappingURL=ThemeOps.d.ts.map