Files
WRNexusJS/packages/auth/src/client/index.ts
T
2026-07-29 12:51:10 +05:30

17 lines
437 B
TypeScript

export interface AuthRuntimeApi {
mount(root?: ParentNode): void;
unmount(root?: ParentNode): void;
registerPasskey(element: HTMLElement): Promise<void>;
authenticatePasskey(element: HTMLElement): Promise<void>;
}
declare global {
interface Window {
WRNexusAuth?: AuthRuntimeApi;
}
}
export function authRuntime(): AuthRuntimeApi | undefined {
return typeof window === "undefined" ? undefined : window.WRNexusAuth;
}