import { base64URLStringToBuffer, browserSupportsWebAuthn, browserSupportsWebAuthnAutofill, bufferToBase64URLString, platformAuthenticatorIsAvailable } from '@simplewebauthn/browser'; export interface WebAuthnConfig { authenticatorSelection?: { authenticatorAttachment?: 'platform' | 'cross-platform'; requireResidentKey?: boolean; residentKey?: 'required' | 'preferred' | 'discouraged'; userVerification?: 'required' | 'preferred' | 'discouraged'; }; attestation?: 'none' | 'indirect' | 'direct' | 'enterprise'; algorithms?: number[]; showQROption?: boolean; preferPlatformAuthenticator?: boolean; onStart?: (options: any) => void | Promise; onComplete?: (credential: any) => void | Promise; onError?: (error: Error) => void | Promise; onStatusUpdate?: (status: string, type: 'info' | 'success' | 'error' | 'warning') => void; } export declare const DEFAULT_WEBAUTHN_CONFIG: WebAuthnConfig; export declare const WEBAUTHN_PRESETS: { BROAD_COMPATIBILITY: WebAuthnConfig; PLATFORM_ONLY: { authenticatorSelection: { authenticatorAttachment: "platform"; requireResidentKey: boolean; residentKey: "required"; userVerification: "required"; }; showQROption: boolean; preferPlatformAuthenticator: boolean; attestation?: "none" | "indirect" | "direct" | "enterprise"; algorithms?: number[]; onStart?: (options: any) => void | Promise; onComplete?: (credential: any) => void | Promise; onError?: (error: Error) => void | Promise; onStatusUpdate?: (status: string, type: "info" | "success" | "error" | "warning") => void; }; SECURITY_KEY: { authenticatorSelection: { authenticatorAttachment: "cross-platform"; requireResidentKey: boolean; residentKey: "discouraged"; userVerification: "preferred"; }; attestation: "direct"; showQROption: boolean; algorithms?: number[]; preferPlatformAuthenticator?: boolean; onStart?: (options: any) => void | Promise; onComplete?: (credential: any) => void | Promise; onError?: (error: Error) => void | Promise; onStatusUpdate?: (status: string, type: "info" | "success" | "error" | "warning") => void; }; MOBILE_FRIENDLY: { authenticatorSelection: { requireResidentKey: boolean; residentKey: "preferred"; userVerification: "preferred"; }; showQROption: boolean; preferPlatformAuthenticator: boolean; attestation?: "none" | "indirect" | "direct" | "enterprise"; algorithms?: number[]; onStart?: (options: any) => void | Promise; onComplete?: (credential: any) => void | Promise; onError?: (error: Error) => void | Promise; onStatusUpdate?: (status: string, type: "info" | "success" | "error" | "warning") => void; }; HIGH_SECURITY: { authenticatorSelection: { requireResidentKey: boolean; residentKey: "required"; userVerification: "required"; }; attestation: "direct"; algorithms?: number[]; showQROption?: boolean; preferPlatformAuthenticator?: boolean; onStart?: (options: any) => void | Promise; onComplete?: (credential: any) => void | Promise; onError?: (error: Error) => void | Promise; onStatusUpdate?: (status: string, type: "info" | "success" | "error" | "warning") => void; }; }; export interface PasskeyRegistrationOptions { username: string; rpId?: string; rpName?: string; email?: string; tel?: string; displayName?: string; createVault?: boolean; timeout?: number; config?: WebAuthnConfig; } export interface PasskeyLoginOptions { username: string; rpId?: string; rpName?: string; timeout?: number; config?: WebAuthnConfig; } export interface PasskeyRegistrationResult { success: boolean; did?: string; vaultId?: string; assertionMethods?: string[]; ucanToken?: string; credential?: any; error?: string; } export interface PasskeyLoginResult { success: boolean; did?: string; vaultId?: string; sessionToken?: string; error?: string; } export declare const bufferToBase64url: typeof bufferToBase64URLString; export declare const base64urlToBuffer: typeof base64URLStringToBuffer; export declare const isWebAuthnSupported: typeof browserSupportsWebAuthn; export declare const isWebAuthnAvailable: typeof platformAuthenticatorIsAvailable; export declare const isConditionalMediationAvailable: typeof browserSupportsWebAuthnAutofill; /** * Register with a passkey (WebAuthn) * Supports email/tel assertion methods for Sonr blockchain */ export declare function registerWithPasskey(apiUrl: string, options: PasskeyRegistrationOptions): Promise; /** * Login with a passkey (WebAuthn) */ export declare function loginWithPasskey(apiUrl: string, options: PasskeyLoginOptions): Promise; /** * Utility to create a button with WebAuthn registration */ export declare function createRegistrationButton(buttonElement: HTMLButtonElement, apiUrl: string, options: PasskeyRegistrationOptions): void; /** * Utility to create a button with WebAuthn login */ export declare function createLoginButton(buttonElement: HTMLButtonElement, apiUrl: string, options: PasskeyLoginOptions): void; /** * Check if conditional mediation (autofill) is available */ export declare function checkConditionalMediationSupport(): Promise<{ supported: boolean; available: boolean; platformAuthenticator: boolean; }>; //# sourceMappingURL=webauthn.d.ts.map