current state before improvement pass

This commit is contained in:
2026-05-27 18:56:36 +03:00
parent 5eb27ab779
commit f0775b8ff0
23 changed files with 3563 additions and 1853 deletions
+27 -1
View File
@@ -38,12 +38,15 @@ export type UpdatesConfig = {
check_on_launch: boolean
}
export type Theme = "dark" | "light"
export type Config = {
export: ExportConfig
capture: CaptureConfig
hotkeys: HotkeyConfig
updates: UpdatesConfig
output_dir: string | null
theme: Theme
}
export type DownloadProgress = {
@@ -109,6 +112,7 @@ export type ExportRequest = {
trim_start_secs?: number | null
trim_end_secs?: number | null
output_path?: string | null
crop?: CaptureRect | null
}
export type ExportResult = {
@@ -116,10 +120,28 @@ export type ExportResult = {
size_bytes: number
}
export type HotkeyRegistrationResult = {
start_ok: boolean | null
stop_ok: boolean | null
pause_ok: boolean | null
}
export type SaveConfigResult = {
hotkey_result: HotkeyRegistrationResult
}
export type EncodeProgress = {
pass: number
total_passes: number
percent: number
}
export type AudioFailed = string
export const api = {
getStatus: () => invoke<AppStatus>("get_status"),
getConfig: () => invoke<Config>("get_config"),
saveConfig: (config: Config) => invoke<void>("save_config", { config }),
saveConfig: (config: Config) => invoke<SaveConfigResult>("save_config", { config }),
downloadFfmpeg: () => invoke<void>("download_ffmpeg"),
onFfmpegProgress: (handler: (p: DownloadProgress) => void): Promise<UnlistenFn> =>
listen<DownloadProgress>("ffmpeg-progress", (e) => handler(e.payload)),
@@ -158,6 +180,10 @@ export const api = {
listen<UpdateDownloadProgress>("update-download-progress", (e) =>
handler(e.payload),
),
onEncodeProgress: (handler: (p: EncodeProgress) => void): Promise<UnlistenFn> =>
listen<EncodeProgress>("encode-progress", (e) => handler(e.payload)),
onAudioFailed: (handler: (msg: string) => void): Promise<UnlistenFn> =>
listen<string>("audio-failed", (e) => handler(e.payload)),
}
export function formatBytes(n: number): string {