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

39 lines
1.2 KiB
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>;
/** 内嵌工程目录浏览器:列目录内容(目录 + 文件),path 为空时列盘符/根目录 */
listDirectory?: (dirPath?: string) => Promise<{
path: string;
parent: string | null;
entries: { name: string; path: string; type: 'dir' | 'file'; size: number | null; mtime: number | null }[];
truncated?: boolean;
error?: string;
}>;
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 {};