Commands API
The frontend wrappers live in src/lib/tauri.ts. All commands return promises
that reject with a string message on error.
Show persistence
/** Saves to an explicit path, validating before writing. */
function saveShow(show: Show, path: string): Promise<void>;
/** Opens a native save dialog, saves, and returns the chosen path (or null). */
function saveShowAs(show: Show): Promise<string | null>;
/** Loads from a path, or opens a dialog when path is omitted. */
function loadShow(path?: string): Promise<LoadedShowFile | null>;
/** Returns true without prompting when isDirty is false. */
function confirmDiscardChanges(isDirty: boolean): Promise<boolean>;
/** Opens a PDF picker and imports a show (or null when cancelled). */
function importPdfShow(): Promise<ShowFile | null>;
Types:
type LoadedShowFile = {
path: string;
showFile: ShowFile;
};
Window management
/** Opens a new live display window; returns its generated label. */
function openDisplayWindow(): Promise<string>;
In the UI this is invoked directly in perform-toolbar.tsx via
invoke("open_display_window").
Command names
| Wrapper | Tauri command | Defined in |
|---|---|---|
saveShow | save_show | crates/show/src/commands.rs |
saveShowAs | save_show_as | crates/show/src/commands.rs |
loadShow | load_show | crates/show/src/commands.rs |
confirmDiscardChanges | confirm_discard_changes | crates/show/src/commands.rs |
importPdfShow | import_pdf_show | src-tauri/src/commands.rs |
openDisplayWindow | open_display_window | src-tauri/src/lib.rs |
All are registered in the invoke_handler in src-tauri/src/lib.rs.