global hotkeys wired up

This commit is contained in:
2026-05-12 01:33:47 +03:00
parent 72e7a0d33b
commit 2882e78795
10 changed files with 637 additions and 107 deletions
+5
View File
@@ -85,6 +85,7 @@ export type ExportRequest = {
deleted_frame_indices: number[]
trim_start_secs?: number | null
trim_end_secs?: number | null
output_path?: string | null
}
export type ExportResult = {
@@ -111,9 +112,13 @@ export const api = {
getOverlayRect: () => invoke<CaptureRect>("get_overlay_rect"),
extractThumbnails: (fps: number) =>
invoke<string[]>("extract_thumbnails", { fps }),
defaultOutputPath: (format: Format) =>
invoke<string>("default_output_path", { format }),
openUrl: (url: string) => invoke<void>("open_url", { url }),
onUpdateAvailable: (handler: (info: UpdateInfo) => void): Promise<UnlistenFn> =>
listen<UpdateInfo>("update-available", (e) => handler(e.payload)),
onHotkey: (handler: (kind: "start" | "stop" | "pause") => void): Promise<UnlistenFn> =>
listen<"start" | "stop" | "pause">("hotkey", (e) => handler(e.payload)),
}
export function formatBytes(n: number): string {