- add `dialogs.confirm` to native IPC/contracts and desktop preload/main bridge - switch sidebar worktree deletion prompt from `window.confirm` to native API - add `showDesktopConfirmDialog` helper with unit tests for dialog behavior
19 lines
502 B
TypeScript
19 lines
502 B
TypeScript
/// <reference types="vite/client" />
|
|
|
|
import type { NativeApi } from "@t3tools/contracts";
|
|
|
|
interface DesktopBridge {
|
|
getWsUrl: () => string | null;
|
|
pickFolder: () => Promise<string | null>;
|
|
confirm: (message: string) => Promise<boolean>;
|
|
showContextMenu: (items: readonly { id: string; label: string }[]) => Promise<string | null>;
|
|
openExternal: (url: string) => Promise<boolean>;
|
|
}
|
|
|
|
declare global {
|
|
interface Window {
|
|
nativeApi?: NativeApi;
|
|
desktopBridge?: DesktopBridge;
|
|
}
|
|
}
|