import { BasePlugin } from "../base/base.plugin.js"; import type { $BuildRequestWithBaseInit } from "../base/base.type.js"; import type { $DwebRquestInit } from "./dweb-service-worker.type.js"; /**这是app之间通信的组件 */ export declare class DwebServiceWorkerPlugin extends BasePlugin { readonly tagName = "dweb-service-worker"; constructor(); readonly ipc: import("@dweb-browser/core").Ipc; private createIpc; /** * 关闭app * @returns boolean */ close(): Promise; /** * 重启app * @returns boolean */ restart(): Promise; /** * 配置没有命中缓存是否自动清空数据 * @returns boolean */ clearCache(): Promise; /** * 查询应用是否安装 * @param mmid * @returns boolean */ has(mmid: $MMID): Promise; /** * 向别的app发送request消息 * @param pathname * @param init * @returns Promise * @example file://desktop.dweb.waterbang.top.dweb/say/hi?message="hi 今晚吃螃🦀️蟹吗?" */ fetch(url: string, init?: $DwebRquestInit | undefined): Promise; } export type $MMID = `${string}.dweb`; export interface $ExterRequestWithBaseInit extends $BuildRequestWithBaseInit { pathname: string; } export interface $ExternalFetchHandle { close: () => void; response: Promise; } export declare const dwebServiceWorkerPlugin: DwebServiceWorkerPlugin; //# sourceMappingURL=dweb-service-worker.plugin.d.ts.map