export declare function generateTwoFactorSecret(): string; export declare function generateTwoFactorToken(secret: Secret): Promise; export declare function verifyTwoFactorCode(token: Token, secret: Secret): Promise; /** * Generate an otpauth:// URI for two-factor authentication * * This URI can be used with any QR code library to generate a scannable * QR code for authenticator apps. * * @param user - User identifier (email or username) * @param service - Service name (e.g., 'StacksJS 2FA') * @param secret - Optional secret (will be generated if not provided) * @returns The otpauth:// URI string */ export declare function generateTwoFactorUri(user?: string, service?: string, secret?: Secret): string; /** * Render an otpauth:// URI as a scannable QR code. * * SVG rather than a data URI: it stays sharp at any size, can be inlined into * a server-rendered page or an email, and is a few hundred bytes rather than * tens of kilobytes. `ts-qr-codes` is a pure, synchronous string function with * no runtime dependencies of its own, so this costs nothing at import time. * * Every authenticator setup flow needs this. Leaving it to the caller meant * each one either shipped an encoder to the browser or, more often, fell back * to asking the user to type a 32-character secret by hand. */ export declare function twoFactorQrCode(uri: string, size?: number): string; export type Token = string; export type Secret = string;