Expand description
JS-bridge bindings for the M-SAVE.0 recorder settings — the persisted output directory + the native folder picker.
Mirror of crate::recording_ipc. The __screenPickOutputDir /
__screenGetOutputDir / __screenSetOutputDir helpers in
index.html wrap window.__TAURI__.core.invoke(...). Consumed by
the post-record Save panel (M-SAVE.3) and the “Recording folder”
settings row (M-SAVE.4).
The extern "C" block is intentionally not cfg-gated to
wasm32: #[wasm_bindgen] externs compile on native targets too
(they just can’t be invoked there), which keeps
cargo check --workspace green on the host triple. The wrapper
functions are only ever called from the browser.
Functions§
- get_
output_ dir - Read the currently-configured output directory. Returns an empty string on IPC failure (caller falls back to a placeholder label).
- get_
output_ 🔒dir_ js __screenGetOutputDir()—Promise<string>returning the configured output directory (persisted override or per-OS default; never empty).- pick_
output_ dir - Open the native folder picker. Returns the chosen absolute path, or
Nonewhen the user cancelled (or on IPC failure — the caller treats both the same: keep the current directory). - pick_
output_ 🔒dir_ js __screenPickOutputDir()— opens the native folder dialog.Promise<string | null>(null on cancel).- set_
output_ dir - Persist
diras the default output directory. Empty string clears the override (reverts to the per-OS default). - set_
output_ 🔒dir_ js __screenSetOutputDir(dir)—Promise<void>. Persistsdiras the default; empty string clears the override.