14 lines
420 B
TypeScript
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);
|
|
}
|