Skip to main content

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​

WrapperTauri commandDefined in
saveShowsave_showcrates/show/src/commands.rs
saveShowAssave_show_ascrates/show/src/commands.rs
loadShowload_showcrates/show/src/commands.rs
confirmDiscardChangesconfirm_discard_changescrates/show/src/commands.rs
importPdfShowimport_pdf_showsrc-tauri/src/commands.rs
openDisplayWindowopen_display_windowsrc-tauri/src/lib.rs

All are registered in the invoke_handler in src-tauri/src/lib.rs.

See also​

Architecture → Tauri commands and Events.