- add desktop IPC handler to validate and open http(s) URLs via Electron shell - expose `shell.openExternal` in shared NativeApi contracts and web bridge - route Git PR opening and native API reads through the new `useNativeApi` hook Co-authored-by: codex <[email protected]>
18 lines
452 B
TypeScript
18 lines
452 B
TypeScript
/// <reference types="vite/client" />
|
|
|
|
import type { NativeApi } from "@t3tools/contracts";
|
|
|
|
interface DesktopBridge {
|
|
getWsUrl: () => string | null;
|
|
pickFolder: () => Promise<string | null>;
|
|
showContextMenu: (items: readonly { id: string; label: string }[]) => Promise<string | null>;
|
|
openExternal: (url: string) => Promise<boolean>;
|
|
}
|
|
|
|
declare global {
|
|
interface Window {
|
|
nativeApi?: NativeApi;
|
|
desktopBridge?: DesktopBridge;
|
|
}
|
|
}
|