region capture overlay window
This commit is contained in:
+17
-1
@@ -49,11 +49,23 @@ export type DownloadProgress = {
|
||||
total: number | null
|
||||
}
|
||||
|
||||
export type CaptureRect = {
|
||||
x: number
|
||||
y: number
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
|
||||
export type RecordedClip = {
|
||||
temp_path: string
|
||||
duration_secs: number
|
||||
width: number
|
||||
height: number
|
||||
crop: CaptureRect | null
|
||||
}
|
||||
|
||||
export type StartCaptureRequest = {
|
||||
crop: CaptureRect | null
|
||||
}
|
||||
|
||||
export type ExportRequest = {
|
||||
@@ -75,10 +87,14 @@ export const api = {
|
||||
downloadFfmpeg: () => invoke<void>("download_ffmpeg"),
|
||||
onFfmpegProgress: (handler: (p: DownloadProgress) => void): Promise<UnlistenFn> =>
|
||||
listen<DownloadProgress>("ffmpeg-progress", (e) => handler(e.payload)),
|
||||
startCapture: () => invoke<void>("start_capture"),
|
||||
startCapture: (request: StartCaptureRequest) =>
|
||||
invoke<void>("start_capture", { request }),
|
||||
stopCapture: () => invoke<RecordedClip>("stop_capture"),
|
||||
export: (request: ExportRequest) => invoke<ExportResult>("export", { request }),
|
||||
revealInExplorer: (path: string) => invoke<void>("reveal_in_explorer", { path }),
|
||||
showOverlay: () => invoke<void>("show_overlay"),
|
||||
hideOverlay: () => invoke<void>("hide_overlay"),
|
||||
getOverlayRect: () => invoke<CaptureRect>("get_overlay_rect"),
|
||||
}
|
||||
|
||||
export function formatBytes(n: number): string {
|
||||
|
||||
Reference in New Issue
Block a user