-
Notifications
You must be signed in to change notification settings - Fork 0
Generate typed invoke() command bindings with tauri-specta #118
Copy link
Copy link
Open
Labels
area:desktopTauri desktop shell: src-tauri/.Tauri desktop shell: src-tauri/.area:frontendReact/TypeScript UI: ui/.React/TypeScript UI: ui/.status:needs-decisionBlocked on a human: design sign-off, a clarifying answer, or repeated agent failure.Blocked on a human: design sign-off, a clarifying answer, or repeated agent failure.type:refactorInternal restructuring with no behavior change.Internal restructuring with no behavior change.
Description
Metadata
Metadata
Assignees
Labels
area:desktopTauri desktop shell: src-tauri/.Tauri desktop shell: src-tauri/.area:frontendReact/TypeScript UI: ui/.React/TypeScript UI: ui/.status:needs-decisionBlocked on a human: design sign-off, a clarifying answer, or repeated agent failure.Blocked on a human: design sign-off, a clarifying answer, or repeated agent failure.type:refactorInternal restructuring with no behavior change.Internal restructuring with no behavior change.
Summary
Follow-up to #83 (which generates the DTO types via specta). Once the type bindings are in place, replace the hand-written
invoke()calls inui/src/api/tauri.tswith typed command wrappers generated bytauri-specta. Todayinvoke("get_board")is typed only by its return annotation — the command name string and argument names are unverified. tauri-specta can emit acommands.tsthat generates a strongly-typed wrapper per#[tauri::command], making a renamed command a compile error in TypeScript.Depends on
#83 — specta derives and tauri-specta dep must be in place first.
Needs scoping first
tauri_specta::collect_commands!or equivalent in v2).commands.tsas a separate file or fold it into the bindings file from Generate the Rust↔TypeScript type contract with specta/tauri-specta #83.invoke()calls inui/src/api/tauri.tswith the generated wrappers.