Files
codeg/src/lib/transport/detect.ts
2026-03-26 21:47:13 +08:00

9 lines
226 B
TypeScript

export type TransportEnvironment = "tauri" | "web"
export function detectEnvironment(): TransportEnvironment {
if (typeof window !== "undefined" && "__TAURI_INTERNALS__" in window) {
return "tauri"
}
return "web"
}