示例工程 30-multi-window-state

30-multi-window-state/app/src/api.d.ts

typescript · 0.8 KB

import type { AuxRole, WindowsSnapshot } from "../shared/ipc";

declare global {
  interface Window {
    api: {
      windows: {
        get: () => Promise<WindowsSnapshot>;
        create: (role: AuxRole) => Promise<WindowsSnapshot>;
        focus: (id: number) => Promise<WindowsSnapshot>;
        close: (id: number) => Promise<WindowsSnapshot>;
        move: (id: number, dx: number, dy: number) => Promise<WindowsSnapshot>;
        message: (text: string) => Promise<WindowsSnapshot>;
        restore: () => Promise<WindowsSnapshot>;
        reset: () => Promise<WindowsSnapshot>;
        onChange: (callback: (state: WindowsSnapshot) => void) => () => void;
      };
    };
    __prepareShots?: (stage: "hub" | "restore") => Promise<void>;
    __smoke?: () => Promise<unknown>;
  }
}

export {};