50 lines
1.6 KiB
TypeScript
50 lines
1.6 KiB
TypeScript
/// <reference types="vite-plugin-electron/electron-env" />
|
|
|
|
declare namespace NodeJS {
|
|
interface ProcessEnv {
|
|
/**
|
|
* The built directory structure
|
|
*
|
|
* ```tree
|
|
* ├─┬─┬ dist
|
|
* │ │ └── index.html
|
|
* │ │
|
|
* │ ├─┬ dist-electron
|
|
* │ │ ├── main.js
|
|
* │ │ └── preload.js
|
|
* │
|
|
* ```
|
|
*/
|
|
APP_ROOT: string
|
|
/** /dist/ or /public/ */
|
|
VITE_PUBLIC: string
|
|
}
|
|
}
|
|
|
|
// Used in Renderer process, expose in `preload.ts`
|
|
interface Window {
|
|
electronAPI: {
|
|
getSources: (opts: Electron.SourcesOptions) => Promise<ProcessedDesktopSource[]>
|
|
switchToEditor: () => Promise<void>
|
|
openSourceSelector: () => Promise<void>
|
|
selectSource: (source: any) => Promise<any>
|
|
getSelectedSource: () => Promise<any>
|
|
startMouseTracking: () => Promise<void>
|
|
stopMouseTracking: () => Promise<void>
|
|
storeRecordedVideo: (videoData: ArrayBuffer, fileName: string) => Promise<{ success: boolean; path?: string; message?: string }>
|
|
storeMouseTrackingData: (fileName: string) => Promise<{ success: boolean; path?: string; eventCount?: number; message?: string }>
|
|
getRecordedVideoPath: () => Promise<{ success: boolean; path?: string; message?: string }>
|
|
setRecordingState: (recording: boolean) => Promise<void>
|
|
onStopRecordingFromTray: (callback: () => void) => () => void
|
|
openExternalUrl: (url: string) => Promise<{ success: boolean; error?: string }>
|
|
}
|
|
}
|
|
|
|
interface ProcessedDesktopSource {
|
|
id: string
|
|
name: string
|
|
display_id: string
|
|
thumbnail: string | null
|
|
appIcon: string | null
|
|
}
|