import * as lCore from './core'; /** * --- 初始化系统级 ID,仅能设置一次 --- * @param id 系统级 ID */ export declare function initSysId(id: string): void; /** --- 当前全局主题 --- */ export declare let global: ITheme | null; /** * --- cgt 文件 blob 转 IThemePkg 对象,会自动创建 object url,请注意释放 --- * @param blob blob 对象 */ export declare function read(blob: Blob): Promise; /** * --- 加载 theme 给任务 --- * @param taskId 要给某任务 ID 加载主题 * @param theme ITheme 对象,undefined 代表加载全局的默认主题 */ export declare function load(taskId: lCore.TCurrent, theme?: ITheme): Promise; /** * --- 移除当前 task 的 theme(只能移除自定的) --- * @param taskId 任务 ID * @param name 要移除的主题 */ export declare function remove(taskId: lCore.TCurrent, name: string): Promise; /** * --- 清除一个 task 中所有加载的 theme(只能清除自定) --- * @param taskId 要清除的任务 id */ export declare function clear(taskId: lCore.TCurrent): Promise; /** * --- 将 cgt 主题设置到全局所有任务 --- * @param theme 主题对象或主题路径(不带 .cgt) * @param current 如果要读包内对象,则要传当前任务 */ export declare function setGlobal(theme: ITheme | string, current?: lCore.TCurrent | null): Promise; /** * --- 清除全局主题 --- */ export declare function clearGlobal(): Promise; /** * --- 设置全局主色 --- * @param color 如 oklch(.7 .2 43),留空为还原 * @param hue 主色的 hue 值,留空为还原 */ export declare function setMain(color?: string, hue?: number): void; /** --- 主题对象 --- */ export interface ITheme { 'type': 'theme'; /** --- 主题对象配置文件 --- */ 'config': IThemeConfig; /** --- 所有已加载的文件内容 --- */ 'files': Record; } /** --- 主题文件包的 config --- */ export interface IThemeConfig { 'name': string; 'ver': number; 'version': string; 'author': string; /** --- 不带扩展名,系统会在末尾添加 .css --- */ 'style': string; /** --- 将要加载的文件 --- */ 'files': string[]; }