Initial commit
This commit is contained in:
43
src/types/electron.d.ts
vendored
Normal file
43
src/types/electron.d.ts
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
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 { }
|
||||
Reference in New Issue
Block a user