import { ApiUrls } from 'star-horse-lowcode'; /** 存储模式: db-数据库, local-本地缓存 */ export type CustomCompStorageMode = "db" | "local"; /** * 初始化自定义组件接口配置 * @param api 接口配置(可选,未配置时使用默认路径) * @param prefix 网关前缀(可选,默认 /userdb-manage) */ export declare function initCustomCompApi(api?: ApiUrls, prefix?: string): void; /** * 保存自定义组件到数据库 */ export declare function saveCustomComponent(params: { idCustomComponent?: string; compName: string; compIcon: string; description?: string; baseItemType: string; baseCompType: string; prepSnapshot: string; isShared?: number; }): Promise; /** * 查询所有有效的自定义组件(数据库) */ export declare function getCustomComponentList(): Promise; /** * 删除自定义组件(数据库) */ export declare function deleteCustomComponent(id: string): Promise; /** 自定义组件本地缓存数据结构 */ export interface CustomCompLocalData { idCustomComponent: string; compName: string; compIcon: string; description?: string; baseItemType: string; baseCompType: string; prepSnapshot: string; storageMode: "local"; isShared?: number; createdTime?: string; } /** 保存自定义组件到本地缓存(本地缓存天然私有,不涉及共享) */ export declare const saveLocalCustomComponent: (params: { compName: string; compIcon: string; description?: string; baseItemType: string; baseCompType: string; prepSnapshot: string; }) => CustomCompLocalData; /** 获取本地自定义组件列表 */ export declare const getLocalCustomComponentList: () => CustomCompLocalData[]; /** 删除本地自定义组件 */ export declare const deleteLocalCustomComponent: (id: string) => void; /** * 从舞台组件preps中提取配置快照(去除实例专属字段) */ export declare function extractPrepSnapshot(preps: Record): Record; /** * 保存当前选中组件为自定义组件(自动判断存储模式) */ export declare function saveCurrentCompAsCustom(params: { compName: string; compIcon: string; description?: string; baseItemType: string; baseCompType: string; preps: Record; storageMode: CustomCompStorageMode; isShared?: boolean; }): Promise;