From ae2aefe4e215b9e7bda47b99edb41d1a0a0b2a84 Mon Sep 17 00:00:00 2001 From: webadderall <131426131+webadderall@users.noreply.github.com> Date: Sat, 4 Apr 2026 13:07:42 +1100 Subject: [PATCH] add native export electron api typings --- electron/electron-env.d.ts | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/electron/electron-env.d.ts b/electron/electron-env.d.ts index 98675762..38ac8701 100644 --- a/electron/electron-env.d.ts +++ b/electron/electron-env.d.ts @@ -75,6 +75,10 @@ interface Window { ) => Promise<{ success: boolean; enabled: boolean }>; getSources: (opts: Electron.SourcesOptions) => Promise; switchToEditor: () => Promise; + openEditorEarly: () => Promise; + isRecordingFinalizing: () => Promise; + notifyRecordingFinalized: () => Promise; + onRecordingFinalized: (callback: () => void) => () => void; openSourceSelector: () => Promise; selectSource: (source: any) => Promise; showSourceHighlight: (source: any) => Promise<{ success: boolean }>; @@ -137,6 +141,40 @@ interface Window { readLocalFile: ( filePath: string, ) => Promise<{ success: boolean; data?: Uint8Array; error?: string }>; + nativeVideoExportStart: (options: { + width: number; + height: number; + frameRate: number; + bitrate: number; + encodingMode: "fast" | "balanced" | "quality"; + }) => Promise<{ + success: boolean; + sessionId?: string; + encoderName?: string; + error?: string; + }>; + nativeVideoExportWriteFrame: ( + sessionId: string, + frameData: Uint8Array, + ) => Promise<{ success: boolean; error?: string }>; + nativeVideoExportFinish: ( + sessionId: string, + options?: { + audioMode?: "none" | "copy-source" | "trim-source" | "edited-track"; + audioSourcePath?: string | null; + trimSegments?: Array<{ startMs: number; endMs: number }>; + editedAudioData?: ArrayBuffer; + editedAudioMimeType?: string | null; + }, + ) => Promise<{ + success: boolean; + data?: Uint8Array; + encoderName?: string; + error?: string; + }>; + nativeVideoExportCancel: ( + sessionId: string, + ) => Promise<{ success: boolean; error?: string }>; getVideoAudioFallbackPaths: ( videoPath: string, ) => Promise<{ success: boolean; paths: string[]; error?: string }>; @@ -186,6 +224,10 @@ interface Window { videoData: ArrayBuffer, fileName: string, ) => Promise<{ success: boolean; path?: string; message?: string; canceled?: boolean }>; + writeExportedVideoToPath: ( + videoData: ArrayBuffer, + outputPath: string, + ) => Promise<{ success: boolean; path?: string; message?: string; error?: string; canceled?: boolean }>; openVideoFilePicker: () => Promise<{ success: boolean; path?: string; canceled?: boolean }>; openAudioFilePicker: () => Promise<{ success: boolean; path?: string; canceled?: boolean }>; openWhisperExecutablePicker: () => Promise<{