@statesync/tauri / TauriInvoke
Type Alias: TauriInvoke()
ts
type TauriInvoke = <T>(commandName, args?) => Promise<T>;Defined in: transport.ts:69
Minimal structural type matching the Tauri invoke function signature.
Accepts any function that:
- Takes a Tauri command name and an optional args record.
- Returns a promise resolving to the command's return value.
Consumers can pass:
invokefrom@tauri-apps/api/core(production)- A custom stub with the same shape (testing / mocking)
Type Parameters
| Type Parameter | Description |
|---|---|
T | The return type of the invoked Tauri command. |
Parameters
| Parameter | Type |
|---|---|
commandName | string |
args? | Record<string, unknown> |
Returns
Promise<T>
Example
typescript
import { invoke } from '@tauri-apps/api/core';
// `invoke` satisfies TauriInvoke out of the box:
const tauriInvoke: TauriInvoke = invoke;