/** * Server-side implementation of nostr-biometric-login */ import type { AuthenticationOptions, MagicLinkPayload, SessionToken } from '../types/auth'; export declare class NostrBiometricServer { /** Maximum number of concurrent sessions before cleanup is triggered */ private static readonly MAX_SESSIONS; /** Session time-to-live: 24 hours */ private static readonly SESSION_TTL; /** Maximum number of concurrent magic links before cleanup is triggered */ private static readonly MAX_MAGIC_LINKS; /** Magic link time-to-live: 1 hour */ private static readonly MAGIC_LINK_TTL; private options; private magicLinks; private sessions; constructor(options: AuthenticationOptions); /** * Remove expired sessions to free up space */ private cleanupExpiredSessions; /** * Remove expired magic links to free up space */ private cleanupExpiredMagicLinks; /** * Enforce session map size limit, cleaning up expired entries first * @throws Error if limit is still exceeded after cleanup */ private enforceSessionLimit; /** * Enforce magic link map size limit, cleaning up expired entries first * @throws Error if limit is still exceeded after cleanup */ private enforceMagicLinkLimit; /** * Create and send a magic link for the given npub * @param npub The user's npub to authenticate */ createMagicLink(npub: string): Promise; /** * Verify a magic link token * @param token The token to verify */ verifyMagicLink(token: string): Promise; /** * Start WebAuthn registration/authentication * @param npub The user's npub */ startWebAuthn(npub: string): Promise<{ challenge: string; }>; /** * Verify WebAuthn response and create session * @param npub The user's npub * @param response The WebAuthn response */ verifyWebAuthnAndCreateSession(npub: string, response: any): Promise; /** * Verify a session token * @param token The session token to verify */ verifySession(token: string): Promise; } export type { AuthenticationOptions, MagicLinkPayload, SessionToken };