import { CredentialRequestOptionsJSON, CredentialCreationOptionsJSON, PublicKeyCredentialWithAssertionJSON, PublicKeyCredentialWithAttestationJSON } from "@github/webauthn-json"; /** * Manages WebAuthn credential operations as a singleton, ensuring only one active request at a time. * Uses an internal AbortController to cancel previous requests when a new one is initiated. */ declare class WebauthnManager { private static instance; private abortController; private constructor(); /** * Gets the singleton instance of WebauthnManager. * Creates a new instance if one doesn't exist, otherwise returns the existing one. * @returns {WebauthnManager} The singleton instance */ static getInstance(): WebauthnManager; /** * Creates a new abort signal, aborting any ongoing WebAuthn request. * @private * @returns {AbortSignal} The new abort signal */ private createAbortSignal; /** * Retrieves a WebAuthn credential using the provided options. * Aborts any previous request before starting a new one. * @param {CredentialRequestOptionsJSON} options - The options for credential retrieval * @returns {Promise} A promise resolving to the retrieved credential * @throws {DOMException} If the WebAuthn request fails (e.g., aborted, not allowed) */ getWebauthnCredential(options: CredentialRequestOptionsJSON): Promise; /** * Retrieves a WebAuthn credential with conditional UI mediation. * Aborts any previous request before starting a new one. * @param {CredentialRequestOptionsJSON} publicKey - The public key options for conditional retrieval * @returns {Promise} A promise resolving to the retrieved credential * @throws {DOMException} If the WebAuthn request fails (e.g., aborted, not allowed) */ getConditionalWebauthnCredential(publicKey: CredentialRequestOptionsJSON["publicKey"]): Promise; /** * Creates a new WebAuthn credential using the provided options. * Aborts any previous request before starting a new one. * @param {CredentialCreationOptionsJSON} options - The options for credential creation * @returns {Promise} A promise resolving to the created credential * @throws {DOMException} If the WebAuthn request fails (e.g., aborted, not allowed) */ createWebauthnCredential(options: CredentialCreationOptionsJSON): Promise; } export default WebauthnManager;