feat(wails): add native file dialogs and video streaming

FileService exposes open/save dialogs for video, project JSON, and WAV
export. User-selected videos stream from disk at /localmedia/video with
range request support for seeking in the webview.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-29 22:22:37 -07:00
parent f5feefe844
commit 3a5d9d849f
7 changed files with 271 additions and 3 deletions
@@ -0,0 +1,9 @@
//@ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Create as $Create } from "@wailsio/runtime";
Object.freeze($Create.Events);
@@ -0,0 +1,2 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
+36
View File
@@ -0,0 +1,36 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
/**
* FileService exposes native file dialogs and streams the current video.
* @module
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function OpenProject(): $CancellablePromise<string> {
return $Call.ByID(2194602340);
}
export function OpenVideo(): $CancellablePromise<$models.VideoResult> {
return $Call.ByID(392322154).then(($result: any) => {
return $$createType0($result);
});
}
export function SaveAudio(data: string, defaultName: string): $CancellablePromise<void> {
return $Call.ByID(1785178400, data, defaultName);
}
export function SaveProject(content: string, defaultName: string): $CancellablePromise<void> {
return $Call.ByID(2685219959, content, defaultName);
}
// Private type creation functions
const $$createType0 = $models.VideoResult.createFrom;
+11
View File
@@ -0,0 +1,11 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import * as FileService from "./fileservice.js";
export {
FileService
};
export {
VideoResult
} from "./models.js";
+34
View File
@@ -0,0 +1,34 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Create as $Create } from "@wailsio/runtime";
/**
* VideoResult is returned when the user opens a video file.
*/
export class VideoResult {
"url": string;
"name": string;
/** Creates a new VideoResult instance. */
constructor($$source: Partial<VideoResult> = {}) {
if (!("url" in $$source)) {
this["url"] = "";
}
if (!("name" in $$source)) {
this["name"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new VideoResult instance from a string or object.
*/
static createFrom($$source: any = {}): VideoResult {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new VideoResult($$parsedSource as Partial<VideoResult>);
}
}