Files
tauri-plugin-duck/guest-js/index.ts
2025-08-07 10:01:06 +02:00

14 lines
420 B
TypeScript

import { invoke } from '@tauri-apps/api/core'
type DuckResponse = {
success: boolean
}
export async function duck(): Promise<string | null> {
return await invoke<{value?: string}>('plugin:duck|duck').then((r: DuckResponse) => r.success);
}
export async function unduck(value: string): Promise<boolean | null> {
return await invoke<{value?: string}>('plugin:duck|unduck').then((r: DuckResponse) => r.success);
}