2026-07-28 02:12:46 +08:00
|
|
|
|
/** 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>;
|
2026-10-09 14:00:34 +08:00
|
|
|
|
/** 内嵌工程目录浏览器:列目录内容(目录 + 文件),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;
|
|
|
|
|
|
}>;
|
2026-07-28 02:12:46 +08:00
|
|
|
|
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 {};
|