aps-agent/apps/web/src/aps-desktop.d.ts

31 lines
888 B
TypeScript
Raw Normal View History

/** Electron preload 暴露的桌面桥(Web 端不存在) */
export interface ApsDesktopBridge {
mode: 'desktop';
apiUrl: string;
/** 本机应用数据目录:%USERPROFILE%\.aps 或 ~/.aps */
home: string;
skillsDir: string;
sessionsDir: string;
getDeviceId: () => Promise<string>;
openHome?: () => void;
openSkills?: () => void;
openSessions?: () => void;
pickDirectory?: () => Promise<string | null>;
toggleDevTools?: () => void;
toggleFullScreen?: () => void;
leaveFullScreen?: () => void;
windowMinimize?: () => void;
windowMaximize?: () => void;
windowClose?: () => void;
onWindowState?: (callback: (state: { maximized?: boolean; fullScreen?: boolean }) => void) => () => void;
onMenuAction?: (callback: (action: string) => void) => () => void;
}
declare global {
interface Window {
apsDesktop?: ApsDesktopBridge;
}
}
export {};