2026-03-08 01:34:54 +08:00
|
|
|
export interface ElectronAPI {
|
|
|
|
|
exportPDF: (title: string, htmlContent?: string) => Promise<{ success: boolean; filePath?: string; error?: string; canceled?: boolean }>
|
|
|
|
|
selectHtmlFile: () => Promise<{
|
|
|
|
|
success: boolean
|
|
|
|
|
canceled?: boolean
|
|
|
|
|
error?: string
|
|
|
|
|
htmlPath?: string
|
|
|
|
|
htmlDir?: string
|
|
|
|
|
htmlFileName?: string
|
|
|
|
|
assetsDirName?: string
|
|
|
|
|
assetsFiles?: string[]
|
|
|
|
|
}>
|
|
|
|
|
updateTitlebarButtons: (symbolColor: string) => Promise<{ success: boolean }>
|
|
|
|
|
onRemoteClipboardSyncToRemote: (callback: () => void) => () => void
|
|
|
|
|
onRemoteClipboardSyncFromRemote: (callback: () => void) => () => void
|
|
|
|
|
onRemoteClipboardAutoSync: (callback: (text: string) => void) => () => void
|
2026-03-10 14:59:11 +08:00
|
|
|
onDownloadProgress: (callback: (data: { progress: number; id: string }) => void) => () => void
|
2026-03-10 15:36:10 +08:00
|
|
|
onUploadProgress: (callback: (data: { progress: number; id: string }) => void) => () => void
|
2026-03-08 01:34:54 +08:00
|
|
|
clipboardReadText: () => Promise<{ success: boolean; text?: string; error?: string }>
|
|
|
|
|
clipboardWriteText: (text: string) => Promise<{ success: boolean; error?: string }>
|
2026-03-10 00:34:02 +08:00
|
|
|
remoteFetchDrives: (serverHost: string, port: number, password?: string) => Promise<{
|
|
|
|
|
success: boolean
|
|
|
|
|
data?: Array<{ name: string; path: string; type: 'file' | 'dir'; size: number; modified: string }>
|
|
|
|
|
error?: string
|
|
|
|
|
}>
|
|
|
|
|
remoteFetchFiles: (serverHost: string, port: number, filePath: string, password?: string) => Promise<{
|
|
|
|
|
success: boolean
|
|
|
|
|
data?: Array<{ name: string; path: string; type: 'file' | 'dir'; size: number; modified?: string }>
|
|
|
|
|
error?: string
|
|
|
|
|
}>
|
2026-03-10 15:36:10 +08:00
|
|
|
remoteUploadFile: (id: string, serverHost: string, port: number, filePath: string, remotePath: string, password?: string) => Promise<{
|
2026-03-10 00:34:02 +08:00
|
|
|
success: boolean
|
|
|
|
|
error?: string
|
|
|
|
|
}>
|
2026-03-10 14:59:11 +08:00
|
|
|
remoteDownloadFile: (id: string, serverHost: string, port: number, fileName: string, remotePath: string, localPath: string, password?: string) => Promise<{
|
2026-03-10 00:34:02 +08:00
|
|
|
success: boolean
|
|
|
|
|
filePath?: string
|
|
|
|
|
error?: string
|
|
|
|
|
canceled?: boolean
|
|
|
|
|
}>
|
2026-03-10 16:20:32 +08:00
|
|
|
opencodeStartServer: () => Promise<{ success: boolean; port?: number; error?: string }>
|
|
|
|
|
opencodeStopServer: () => Promise<{ success: boolean; error?: string }>
|
2026-03-13 20:55:34 +08:00
|
|
|
xcOpenCodeWebStart: () => Promise<{ success: boolean; error?: string }>
|
|
|
|
|
xcOpenCodeWebStop: () => Promise<{ success: boolean; error?: string }>
|
|
|
|
|
xcOpenCodeWebGetStatus: () => Promise<{ running: boolean; port: number }>
|
2026-03-13 21:20:31 +08:00
|
|
|
xcOpenCodeWebGetPort: () => Promise<{ port: number }>
|
2026-03-14 20:44:15 +08:00
|
|
|
xcOpenCodeWebCheckReady: () => Promise<{ ready: boolean }>
|
2026-03-18 16:17:30 +08:00
|
|
|
sddStart: () => Promise<{ success: boolean; error?: string }>
|
|
|
|
|
sddStop: () => Promise<{ success: boolean; error?: string }>
|
|
|
|
|
sddGetStatus: () => Promise<{ running: boolean; port: number }>
|
|
|
|
|
sddGetPort: () => Promise<{ port: number }>
|
2026-03-20 13:08:43 +08:00
|
|
|
terminalStart: () => Promise<{ success: boolean; error?: string }>
|
|
|
|
|
terminalStop: () => Promise<{ success: boolean; error?: string }>
|
|
|
|
|
terminalGetStatus: () => Promise<{ running: boolean; port: number }>
|
|
|
|
|
terminalGetPort: () => Promise<{ port: number }>
|
2026-03-21 23:42:48 +08:00
|
|
|
createWindow: (tabData: { route: string; title: string }) => Promise<{ success: boolean; windowId?: number; error?: string }>
|
2026-03-08 01:34:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
|
interface Window {
|
|
|
|
|
electronAPI?: ElectronAPI
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface ElectronWebview {
|
|
|
|
|
canGoBack: () => boolean
|
|
|
|
|
canGoForward: () => boolean
|
|
|
|
|
goBack: () => void
|
|
|
|
|
goForward: () => void
|
|
|
|
|
reload: () => void
|
|
|
|
|
loadURL: (url: string) => Promise<void>
|
|
|
|
|
getURL: () => string
|
|
|
|
|
getTitle: () => string
|
|
|
|
|
executeJavaScript: (code: string) => Promise<unknown>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
|
interface HTMLWebViewElement extends HTMLElement, ElectronWebview { }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export { }
|