Branchwell

Become a Pro / website · becomeapro.ai / src / lib / biolock / server.d.ts

Raw 1.2 KB on 0104128d30a01b5156cca2446fd234b2f1fa3673
1// Types for the vendored BioLock server (server.js, public domain).
2export type Jwk = Record<string, unknown>;
3export type CredentialJSON = Record<string, unknown>;
4export interface Stored { id: string; alg: number; publicKey: Jwk; counter: number }
5export function randomB64u(n?: number): string;
6export function registrationOptions(o: { rpId: string; rpName?: string; userId?: string; userName: string; displayName?: string; excludeIds?: string[]; timeout?: number }): { challenge: string } & Record<string, unknown>;
7export function signInOptions(o: { rpId: string; deviceCredentialIds?: string[]; timeout?: number }): { challenge: string } & Record<string, unknown>;
8export function verifyRegistration(o: { credential: unknown; expectedChallenge: string; expectedOrigin: string; rpId: string; requireUserVerification?: boolean }): Promise<{ id: string; alg: number; publicKey: Jwk; counter: number; transports: string[]; backupEligible: boolean; backedUp: boolean; createdAt: number }>;
9export function verifySignIn(o: { credential: unknown; stored: Stored; expectedChallenge: string; expectedOrigin: string; rpId: string; requireUserVerification?: boolean }): Promise<{ userHandle: string | null; counter: number; backedUp: boolean }>;