Skip to main content

Module settings_ipc

Module settings_ipc 

Source
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 None when 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 dir as the default output directory. Empty string clears the override (reverts to the per-OS default).
set_output_dir_js 🔒
__screenSetOutputDir(dir)Promise<void>. Persists dir as the default; empty string clears the override.