/** * Credential manager: WebAuthn passkey ceremonies + optional passkey-record * persistence. * * Constructed from a plain {@link CredentialManagerDeps} object so it is fully * unit-testable with `vi.fn()` fakes (no live authenticator or RPC needed). * * @packageDocumentation */ import type { AuthenticatorSelectionCriteria } from "@simplewebauthn/browser"; import type { StorageAdapter, StoredPasskey } from "../types.js"; import { type AuthenticatedPasskey, type CreatedPasskey, type WebAuthnClient } from "../kit/webauthn-ops.js"; export interface CredentialManagerDeps { rpId?: string; webAuthn: WebAuthnClient; /** Optional passkey-record store; when absent, remember/lookup are no-ops. */ storage?: StorageAdapter; } export declare class CredentialManager { private readonly deps; constructor(deps: CredentialManagerDeps); private get webAuthnDeps(); /** Run a registration ceremony, returning the new passkey + its public key. */ createKey(appName: string, userName: string, authenticatorSelection?: AuthenticatorSelectionCriteria): Promise; /** Run a discoverable-credential authentication ceremony. */ authenticate(): Promise; /** Persist a passkey → wallet association (no-op without a storage adapter). */ rememberPasskey(record: StoredPasskey): Promise; /** Remove a persisted passkey record (no-op without a storage adapter). */ forgetPasskey(keyId: string): Promise; /** Look up a stored passkey record by keyId. */ getPasskey(keyId: string): Promise; /** * Resolve a wallet contract id for a keyId from local storage, if a record * exists. Used as an indexer-free `connectWallet` fallback. */ lookupContractId(keyId: string): Promise; } //# sourceMappingURL=credential-manager.d.ts.map