Files
XCDesktop/src/types/electron.d.ts

44 lines
1.3 KiB
TypeScript
Raw Normal View History

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
clipboardReadText: () => Promise<{ success: boolean; text?: string; error?: string }>
clipboardWriteText: (text: string) => Promise<{ success: boolean; error?: string }>
}
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 { }