From 3566e45704a24e8a2b089b3c3d2bc3dad859aad6 Mon Sep 17 00:00:00 2001 From: fofolee Date: Sun, 22 Dec 2024 10:12:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0utools=20api=E5=88=B06.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/lib/utoolsLite.js | 17 +- src/plugins/monaco/types/utools.api.d.ts | 562 +++++++++++------------ 2 files changed, 272 insertions(+), 307 deletions(-) diff --git a/plugin/lib/utoolsLite.js b/plugin/lib/utoolsLite.js index 33505c7..55fbc55 100644 --- a/plugin/lib/utoolsLite.js +++ b/plugin/lib/utoolsLite.js @@ -1,9 +1,22 @@ const getuToolsLite = () => { var utoolsLite = Object.assign({}, _.cloneDeep(utools)) // if (utools.isDev()) return utoolsLite - const dbBlackList = ['db', 'dbStorage', 'removeFeature', 'setFeature', 'onDbPull'] + const dbBlackList = [ + "db", + "dbStorage", + "dbCryptoStorage", + "removeFeature", + "setFeature", + "onDbPull", + ]; const payBlackList = ['fetchUserServerTemporaryToken', 'isPurchasedUser', 'openPurchase', 'getUserServerTemporaryToken', 'openPayment', 'fetchUserPayments'] - const etcBlackList = ['onPluginEnter', 'onPluginOut', 'onMainPush', 'createBrowserWindow'] + const etcBlackList = [ + "onPluginEnter", + "onPluginOut", + "onMainPush", + "createBrowserWindow", + "team", + ]; _.concat(dbBlackList, payBlackList, etcBlackList).forEach(item => { delete utoolsLite[item] }) diff --git a/src/plugins/monaco/types/utools.api.d.ts b/src/plugins/monaco/types/utools.api.d.ts index e53f1ef..c794ad9 100644 --- a/src/plugins/monaco/types/utools.api.d.ts +++ b/src/plugins/monaco/types/utools.api.d.ts @@ -9,7 +9,11 @@ interface UBrowser { * @param headers 请求头参数 * @param timeout 加载超时,默认 60000 ms(60秒) */ - goto(url: string, headers?: { Referer: string, userAgent: string }, timeout?: number): this; + goto( + url: string, + headers?: { Referer: string; userAgent: string }, + timeout?: number + ): this; /** * 页面大小 */ @@ -29,7 +33,7 @@ interface UBrowser { /** * 键盘按键 */ - press(key: string, ...modifier: ('ctrl' | 'shift' | 'alt' | 'meta')[]): this; + press(key: string, ...modifier: ("ctrl" | "shift" | "alt" | "meta")[]): this; /** * 粘贴 * @param text 如果是图片的base64编码字符串,粘贴图片,为空只执行粘贴动作 @@ -40,17 +44,31 @@ interface UBrowser { * @param arg 1.字符串 - 要截取的DOM元素, 2.对象 - 截图位置和大小, 3.空 - 为截取整个窗口 * @param savePath 截图保存路径,可以是文件夹 或 .png文件完全路径, 默认保存临时目录 */ - screenshot(arg: string | { x: number, y: number, width: number, height: number }, savePath?: string): this; + screenshot( + arg: string | { x: number; y: number; width: number; height: number }, + savePath?: string + ): this; /** * 保存为PDF * @param options 选项 * @param savePath PDF保存路径,可以是文件夹 或 .pdf文件完全路径, 默认保存临时目录 */ - pdf(options?: { marginsType: 0 | 1 | 2, pageSize: ('A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid') | ({ width: number, height: number }) }, savePath?: string): this; + pdf( + options?: { + marginsType: 0 | 1 | 2; + pageSize: + | ("A3" | "A4" | "A5" | "Legal" | "Letter" | "Tabloid") + | { width: number; height: number }; + }, + savePath?: string + ): this; /** * 模拟设备 */ - device(arg: ('iPhone 11' | 'iPhone X' | 'iPad' | 'iPhone 6/7/8 Plus' | 'iPhone 6/7/8' | 'iPhone 5/SE' | 'HUAWEI Mate10' | 'HUAWEI Mate20' | 'HUAWEI Mate30' | 'HUAWEI Mate30 Pro') | { size: { width: number, height: number }, useragent: string }): this; + device(arg: { + size: { width: number; height: number }; + useragent: string; + }): this; /** * 获取 cookie * @param name 为空获取全部cookie @@ -63,7 +81,7 @@ interface UBrowser { /** * 设置Cookie */ - setCookies(cookies: { name: string, value: string }[]): this; + setCookies(cookies: { name: string; value: string }[]): this; /** * 删除 cookie */ @@ -76,13 +94,13 @@ interface UBrowser { /** * 打开开发者工具 */ - devTools(mode?: 'right' | 'bottom' | 'undocked' | 'detach'): this; + devTools(mode?: "right" | "bottom" | "undocked" | "detach"): this; /** * 执行JS计算 并获得结果 * @param func 在目标网页中执行 * @param params 传到 func 中的参数 */ - evaluate(func: (...params: any[]) => any, ...params: any[]): this; + evaluate(func: (...params: T) => any, ...params: T): this; /** * 等待时间 * @param ms 毫秒 @@ -100,9 +118,13 @@ interface UBrowser { * @param timeout 超时 默认60000 ms(60秒) * @param params 传到 func 中的参数 */ - wait(func: (...params: any[]) => boolean, timeout?: number, ...params: any[]): this; + wait( + func: (...params: T) => boolean, + timeout?: number, + ...params: T + ): this; /** - * 当元素存在时执行直到碰到 end + * 当元素存在时执行,直到碰到 end * @param selector DOM元素 */ when(selector: string): this; @@ -111,7 +133,7 @@ interface UBrowser { * @param func 执行的JS函数 * @param params 传到 func 中的参数 */ - when(func: (...params: any[]) => boolean, ...params: any[]): this; + when(func: (...params: T) => boolean, ...params: T): this; /** * 配合 when 使用 */ @@ -162,42 +184,50 @@ interface UBrowser { * 下载文件 */ download(url: string, savePath?: string): this; + /** + * 下载文件 + */ + download( + func: (...params: any[]) => string, + savePath: string | null, + ...params: any[] + ): this; /** * 启动一个 ubrowser 运行 * 当运行结束后,窗口如果为隐藏状态将自动销毁窗口 * @param options */ - run(options: { - show?: boolean, - width?: number, - height?: number, - x?: number, - y?: number, - center?: boolean, - minWidth?: number, - minHeight?: number, - maxWidth?: number, - maxHeight?: number, - resizable?: boolean, - movable?: boolean, - minimizable?: boolean, - maximizable?: boolean, - alwaysOnTop?: boolean, - fullscreen?: boolean, - fullscreenable?: boolean, - enableLargerThanScreen?: boolean, - opacity?: number - }): Promise; + run(options: { + show?: boolean; + width?: number; + height?: number; + x?: number; + y?: number; + center?: boolean; + minWidth?: number; + minHeight?: number; + maxWidth?: number; + maxHeight?: number; + resizable?: boolean; + movable?: boolean; + minimizable?: boolean; + maximizable?: boolean; + alwaysOnTop?: boolean; + fullscreen?: boolean; + fullscreenable?: boolean; + enableLargerThanScreen?: boolean; + opacity?: number; + }): Promise; /** * 运行在闲置的 ubrowser 上 * @param ubrowserId 1. run(options) 运行结束后, 当 ubrowser 实例窗口仍然显示时返回 2. utools.getIdleUBrowsers() 中获得 */ - run(ubrowserId: number): Promise; + run(ubrowserId: number): Promise; } interface Display { - accelerometerSupport: ('available' | 'unavailable' | 'unknown'); - bounds: { x: number, y: number, width: number, height: number }; + accelerometerSupport: "available" | "unavailable" | "unknown"; + bounds: { x: number; y: number; width: number; height: number }; colorDepth: number; colorSpace: string; depthPerComponent: number; @@ -206,48 +236,34 @@ interface Display { monochrome: boolean; rotation: number; scaleFactor: number; - size: { width: number, height: number }; - touchSupport: ('available' | 'unavailable' | 'unknown'); - workArea: { x: number, y: number, width: number, height: number }; - workAreaSize: { width: number, height: number }; + size: { width: number; height: number }; + touchSupport: "available" | "unavailable" | "unknown"; + workArea: { x: number; y: number; width: number; height: number }; + workAreaSize: { width: number; height: number }; } -interface DbDoc { - _id: string, - _rev?: string, - [key: string]: any +interface PluginFeature { + code: string; + explain?: string; + platform?: + | ("darwin" | "win32" | "linux") + | Array<"darwin" | "win32" | "linux">; + icon?: string; + cmds: ( + | string + | { + type: "img" | "files" | "regex" | "over" | "window"; + label: string; + } + )[]; + mainHide?: boolean; + mainPush?: boolean; } -interface DbReturn { - id: string, - rev?: string, - ok?: boolean, - error?: boolean, - name?: string, - message?: string -} +type PluginEnterFrom = "main" | "panel" | "hotkey" | "redirect"; interface UToolsApi { - /** - * 插件应用进入时触发 - */ - //onPluginEnter(callback: (action: {code: string, type: string, payload: any, option: any }) => void): void; - /** - * 向搜索面板推送消息 - */ - //onMainPush(callback: (action: {code: string, type: string, payload: any }) => { icon?: string, text: string, title?: string }[], selectCallback: (action: {code: string, type: string, payload: any, option: { icon?: string, text: string, title?: string }}) => void): void; - /** - * 插件应用隐藏后台或完全退出时触发 - */ - //onPluginOut(callback: (processExit: boolean) => void): void; - /** - * 插件应用分离时触发 - */ onPluginDetach(callback: () => void): void; - /** - * 插件应用从云端拉取到数据时触发 - */ - //onDbPull(callback: (docs: { _id: string, _rev: string }[]) => void): void; /** * 隐藏主窗口 * @param isRestorePreWindow 是否焦点回归到前面的活动窗口,默认 true @@ -267,7 +283,11 @@ interface UToolsApi { * @param placeholder 占位符, 默认为空 * @param isFocus 是否获得焦点,默认为 true */ - setSubInput(onChange: (text: string) => void, placeholder?: string, isFocus?: boolean): boolean; + setSubInput( + onChange: (input: { text: string }) => void, + placeholder?: string, + isFocus?: boolean + ): boolean; /** * 移除子输入框 */ @@ -294,11 +314,11 @@ interface UToolsApi { * @param options 参考 https://www.electronjs.org/docs/api/browser-window#new-browserwindowoptions * @param callback url 加载完成时的回调 */ - //createBrowserWindow(url: string, options: { width?: number, height?: number }, callback?: () => void): { id: number, [key: string]: any, webContents: { id: number, [key: string]: any } }; /** * 隐藏插件应用到后台 + * @param {boolean|undefined} isKill 设置为 `true` 时,会将插件进程杀死 */ - outPlugin(): boolean; + outPlugin(isKill?: boolean): boolean; /** * 是否深色模式 */ @@ -306,97 +326,31 @@ interface UToolsApi { /** * 获取用户 */ - getUser(): { avatar: string, nickname: string, type: string } | null; + getUser(): { avatar: string; nickname: string; type: string } | null; /** - * 获取用户服务端临时令牌 + * 获取插件应用动态功能,参数为空获取所有动态功能 */ - //fetchUserServerTemporaryToken(): Promise<{ token: string, expiredAt: number }>; - /** - * 是否插件应用的付费用户 - */ - //isPurchasedUser(): boolean; -// /** -// * 打开付费 (软件付费) -// * @param callback 购买成功触发 -// */ -// openPurchase(options: { -// /** -// * 商品 ID,在「开发者工具」插件应用中创建 -// */ -// goodsId: string, -// /** -// * 第三方服务生成的订单号(可选) -// */ -// outOrderId?: string, -// /** -// * 第三方服务附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用(可选) -// */ -// attach?: string -// }, callback?: () => void): void; -// /** -// * 打开支付 (付费付费) -// * @param callback 支付成功触发 -// */ -// openPayment(options: { -// /** -// * 商品 ID,在「开发者工具」插件应用中创建 -// */ -// goodsId: string, -// /** -// * 第三方服务生成的订单号(可选) -// */ -// outOrderId?: string, -// /** -// * 第三方服务附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用(可选) -// */ -// attach?: string -// }, callback?: () => void): void; -// /** -// * 获取用户支付记录 -// */ -// fetchUserPayments(): Promise<{ order_id: string, total_fee: number, body: string, attach: string, goods_id: string, out_order_id: string, paid_at: string }[]>; -// /** -// * 设置插件应用动态功能 -// */ -// setFeature(feature: { -// code: string, -// explain: string, -// platform: ('darwin' | 'win32' | 'linux') | (Array<'darwin' | 'win32' | 'linux'>), -// icon?: string, -// cmds: (string | { -// type: 'img' | 'files' | 'regex' | 'over' | 'window', -// label: string -// })[] -// }): boolean; -// /** -// * 移除插件应用动态功能 -// */ -// removeFeature(code: string): boolean; -// /** -// * 获取插件应用动态功能,参数为空获取所有动态功能 -// */ - getFeatures(codes?: string[]): { - code: string, - explain: string, - platform: ('darwin' | 'win32' | 'linux') | (Array<'darwin' | 'win32' | 'linux'>), - icon?: string, - cmds: string | { - type: 'img' | 'files' | 'regex' | 'over' | 'window', - label: string - }[] - }[]; + getFeatures(codes?: string[]): PluginFeature[]; /** * 插件应用间跳转 + * @todo 创建针对type的多个重载 */ - redirect(label: string | string[], payload: string | { type: 'text' | 'img' | 'files', data: any }): void; + redirect( + label: string | string[], + payload: string | { type: "text" | "img" | "files"; data: any } + ): void; /** * 获取闲置的 ubrowser */ - getIdleUBrowsers(): { id: number, title: string, url: string}[]; + getIdleUBrowsers(): { id: number; title: string; url: string }[]; /** * 设置 ubrowser 代理 https://www.electronjs.org/docs/api/session#sessetproxyconfig */ - setUBrowserProxy(config: {pacScript?: string, proxyRules?: string, proxyBypassRules?: string}): boolean; + setUBrowserProxy(config: { + pacScript?: string; + proxyRules?: string; + proxyBypassRules?: string; + }): boolean; /** * 清空 ubrowser 缓存 */ @@ -404,47 +358,68 @@ interface UToolsApi { /** * 显示系统通知 */ - showNotification(body: string): void; + showNotification(body: string, featureName?: string): void; /** * 弹出文件选择框 */ showOpenDialog(options: { - title?: string, - defaultPath?: string, - buttonLabel?: string, - filters?: { name: string, extensions: string[] }[], - properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory' | 'dontAddToRecent'>, - message?: string, - securityScopedBookmarks?: boolean - }): (string[]) | (undefined); + title?: string; + defaultPath?: string; + buttonLabel?: string; + filters?: { name: string; extensions: string[] }[]; + properties?: Array< + | "openFile" + | "openDirectory" + | "multiSelections" + | "showHiddenFiles" + | "createDirectory" + | "promptToCreate" + | "noResolveAliases" + | "treatPackageAsDirectory" + | "dontAddToRecent" + >; + message?: string; + securityScopedBookmarks?: boolean; + }): string[] | undefined; /** * 弹出文件保存框 */ showSaveDialog(options: { - title?: string, - defaultPath?: string, - buttonLabel?: string, - filters?: { name: string, extensions: string[] }[], - message?: string, - nameFieldLabel?: string, - showsTagField?: string, - properties?: Array<'showHiddenFiles' | 'createDirectory' | 'treatPackageAsDirectory' | 'showOverwriteConfirmation' | 'dontAddToRecent'>, - securityScopedBookmarks?: boolean - }): (string) | (undefined); + title?: string; + defaultPath?: string; + buttonLabel?: string; + filters?: { name: string; extensions: string[] }[]; + message?: string; + nameFieldLabel?: string; + showsTagField?: string; + properties?: Array< + | "showHiddenFiles" + | "createDirectory" + | "treatPackageAsDirectory" + | "showOverwriteConfirmation" + | "dontAddToRecent" + >; + securityScopedBookmarks?: boolean; + }): string | undefined; /** * 插件应用页面中查找 */ - findInPage(text: string, options?: { - forward?: boolean, - findNext?: boolean, - matchCase?: boolean, - wordStart?: boolean, - medialCapitalAsWordStart?: boolean - }): void; + findInPage( + text: string, + options?: { + forward?: boolean; + findNext?: boolean; + matchCase?: boolean; + wordStart?: boolean; + medialCapitalAsWordStart?: boolean; + } + ): void; /** * 停止插件应用页面中查找 */ - stopFindInPage (action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void; + stopFindInPage( + action: "clearSelection" | "keepSelection" | "activateSelection" + ): void; /** * 拖拽文件 */ @@ -452,7 +427,9 @@ interface UToolsApi { /** * 屏幕取色 */ - screenColorPick(callback: (color: { hex: string, rgb: string }) => void): void; + screenColorPick( + callback: (color: { hex: string; rgb: string }) => void + ): void; /** * 屏幕截图 */ @@ -472,11 +449,32 @@ interface UToolsApi { /** * 获取路径 */ - getPath(name: 'home' | 'appData' | 'userData' | 'cache' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'logs' | 'pepperFlashSystemPlugin'): string; + getPath( + name: + | "home" + | "appData" + | "userData" + | "cache" + | "temp" + | "exe" + | "module" + | "desktop" + | "documents" + | "downloads" + | "music" + | "pictures" + | "videos" + | "logs" + | "pepperFlashSystemPlugin" + ): string; /** * 获取文件图标 */ getFileIcon(filePath: string): string; + /** + * 获取当前窗口类型, 'main' 主窗口 | 'detach' 分离窗口 | 'browser' 由 createBrowserWindow 创建的窗口 + */ + getWindowType(): "main" | "detach" | "browser"; /** * 复制文件到剪贴板 */ @@ -493,10 +491,15 @@ interface UToolsApi { /** * 获取复制的文件或文件夹 */ - getCopyedFiles(): { isFile: boolean, isDirectory: boolean, name: string, path: string }[]; + getCopyedFiles(): { + isFile: boolean; + isDirectory: boolean; + name: string; + path: string; + }[]; /** * 读取当前文件管理器路径(linux 不支持) - */ + */ readCurrentFolderPath(): Promise; /** * 读取当前浏览器窗口的URL(linux 不支持) @@ -509,6 +512,10 @@ interface UToolsApi { * 默认方式打开给定的文件 */ shellOpenPath(fullPath: string): void; + /** + * 删除文件到回收站 + */ + shellTrashItem(filename: string): Promise; /** * 在文件管理器中显示给定的文件 */ @@ -522,25 +529,36 @@ interface UToolsApi { */ shellBeep(): void; /* - * 键入字符串 - */ + * 键入字符串 + */ hideMainWindowTypeString(str: string): void; /* - * 粘贴文件 - */ + * 粘贴文件 + */ hideMainWindowPasteFile(file: string | string[]): void; /* - * 粘贴图像 - */ - hideMainWindowPasteImage(img: string): void; + * 粘贴图像 + */ + hideMainWindowPasteImage(img: string | Uint8Array): void; /* - * 粘贴文本 - */ + * 粘贴文本 + */ hideMainWindowPasteText(text: string): void; /** * 模拟键盘按键 */ - simulateKeyboardTap(key: string, ...modifier: ('control' | 'ctrl' | 'shift' | 'option' | 'alt' | 'command' | 'super')[]): void; + simulateKeyboardTap( + key: string, + ...modifier: ( + | "control" + | "ctrl" + | "shift" + | "option" + | "alt" + | "command" + | "super" + )[] + ): void; /** * 模拟鼠标单击 */ @@ -560,7 +578,7 @@ interface UToolsApi { /** * 获取鼠标绝对位置 */ - getCursorScreenPoint(): { x: number, y: number }; + getCursorScreenPoint(): { x: number; y: number }; /** * 获取主显示器 */ @@ -572,15 +590,56 @@ interface UToolsApi { /** * 获取位置所在的显示器 */ - getDisplayNearestPoint(point: { x: number, y: number }): Display; + getDisplayNearestPoint(point: { x: number; y: number }): Display; /** * 获取矩形所在的显示器 */ - getDisplayMatching(rect: { x: number, y: number, width: number, height: number }): Display; + getDisplayMatching(rect: { + x: number; + y: number; + width: number; + height: number; + }): Display; + /** + * 屏幕物理坐标转 DIP 坐标 + */ + screenToDipPoint(point: { x: number; y: number }): { x: number; y: number }; + /** + * 屏幕 DIP 坐标转物理坐标 + */ + dipToScreenPoint(point: { x: number; y: number }): { x: number; y: number }; + /** + * 屏幕物理区域转 DIP 区域 + */ + screenToDipRect(rect: { + x: number; + y: number; + width: number; + height: number; + }): { x: number; y: number; width: number; height: number }; + /** + * 屏幕 DIP 区域转物理区域 + */ + dipToScreenRect(rect: { + x: number; + y: number; + width: number; + height: number; + }): { x: number; y: number; width: number; height: number }; /** * 录屏源 */ - desktopCaptureSources(options: { types: string[], thumbnailSize?: { width: number, height: number }, fetchWindowIcons?: boolean }):Promise<{appIcon: {}, display_id: string, id: string, name: string, thumbnail: {} }>; + desktopCaptureSources(options: { + types: string[]; + thumbnailSize?: { width: number; height: number }; + fetchWindowIcons?: boolean; + }): Promise<{ + appIcon: {}; + display_id: string; + id: string; + name: string; + thumbnail: {}; + }>; /** * 是否开发中 */ @@ -598,113 +657,6 @@ interface UToolsApi { */ isLinux(): boolean; -// db: { -// /** -// * 创建/更新文档 -// */ -// put(doc: DbDoc): DbReturn; -// /** -// * 获取文档 -// */ -// get(id: string): DbDoc | null; -// /** -// * 删除文档 -// */ -// remove(doc: string | DbDoc): DbReturn; -// /** -// * 批量操作文档(新增、修改、删除) -// */ -// bulkDocs(docs: DbDoc[]): DbReturn[]; -// /** -// * 获取所有文档 可根据文档id前缀查找 -// */ -// allDocs(key?: string): DbDoc[]; -// /** -// * 存储附件到新文档 -// * @param docId 文档ID -// * @param attachment 附件 buffer -// * @param type 附件类型,示例:image/png, text/plain -// */ -// postAttachment(docId: string, attachment: Uint8Array, type: string): DbReturn; -// /** -// * 获取附件 -// * @param docId 文档ID -// */ -// getAttachment(docId: string): Uint8Array | null; -// /** -// * 获取附件类型 -// * @param docId 文档ID -// */ -// getAttachmentType(docId: string): string | null; -// /** -// * 云端复制数据状态 (null: 未开启数据同步、0: 已完成复制、1:复制中) -// */ -// replicateStateFromCloud(): null | 0 | 1; -// /** -// * 异步 -// */ -// promises: { -// /** -// * 创建/更新文档 -// */ -// put(doc: DbDoc): Promise; -// /** -// * 获取文档 -// */ -// get(id: string): Promise; -// /** -// * 删除文档 -// */ -// remove(doc: string | DbDoc): Promise; -// /** -// * 批量操作文档(新增、修改、删除) -// */ -// bulkDocs(docs: DbDoc[]): Promise; -// /** -// * 获取所有文档 可根据文档id前缀查找 -// */ -// allDocs(key?: string): Promise; -// /** -// * 存储附件到新文档 -// * @param docId 文档ID -// * @param attachment 附件 buffer -// * @param type 附件类型,示例:image/png, text/plain -// */ -// postAttachment(docId: string, attachment: Uint8Array, type: string): Promise; -// /** -// * 获取附件 -// * @param docId 文档ID -// */ -// getAttachment(docId: string): Promise; -// /** -// * 获取附件类型 -// * @param docId 文档ID -// */ -// getAttachmentType(docId: string): Promise; -// /** -// * 云端复制数据状态 (null: 未开启数据同步、0: 已完成复制、1:复制中) -// */ -// replicateStateFromCloud(): Promise; -// } -// }; - -// dbStorage: { -// /** -// * 键值对存储,如果键名存在,则更新其对应的值 -// * @param key 键名(同时为文档ID) -// * @param value 键值 -// */ -// setItem (key: string, value: any): void; -// /** -// * 获取键名对应的值 -// */ -// getItem (key: string): any; -// /** -// * 删除键值对(删除文档) -// */ -// removeItem (key: string): void; -// }; - ubrowser: UBrowser; }