示例工程 33-clipboard-dnd-fs

33-clipboard-dnd-fs/app/src/api.d.ts

typescript · 0.7 KB

import type { Snapshot } from "../shared/ipc";

declare global {
  interface Window {
    api: {
      clipboard: {
        get: () => Promise<Snapshot>;
        read: () => Promise<Snapshot>;
        writeText: (text: string) => Promise<Snapshot>;
        writeHtml: (html: string) => Promise<Snapshot>;
      };
      fs: {
        readPath: (path: string) => Promise<Snapshot>;
        pick: () => Promise<Snapshot>;
        refreshRecent: () => Promise<Snapshot>;
        clearRecent: () => Promise<Snapshot>;
        pathForFile: (file: File) => string;
      };
    };
    __prepareShots?: (stage: "clipboard" | "file" | "missing") => Promise<void>;
    __smoke?: () => Promise<unknown>;
  }
}

export {};