16 lines
440 B
TypeScript
16 lines
440 B
TypeScript
import { invoke } from '@tauri-apps/api/core'
|
|
|
|
type DuckResponse = {
|
|
success: boolean
|
|
}
|
|
|
|
export async function duck(): Promise<boolean | null> {
|
|
// @ts-expect-error - not typed
|
|
return await invoke('plugin:duck|duck').then((r: DuckResponse) => r.success);
|
|
}
|
|
|
|
export async function unduck(): Promise<boolean | null> {
|
|
// @ts-expect-error - not typed
|
|
return await invoke('plugin:duck|unduck').then((r: DuckResponse) => r.success);
|
|
}
|