import { AuthOptions } from './authOptions'; import { SignupProfileData } from './models'; export declare const publicKeyCredentialType = "public-key"; export type EmailLoginWithWebAuthnParams = { email: string; }; export type PhoneNumberLoginWithWebAuthnParams = { phoneNumber: string; }; /** * Launch discoverable login (= where the identifier and the passkey will be provided by the keychain) * @param conditionalMediation whether to use conditional mediation (= autofill request) or a modal request.
* If 'preferred' is selected, do conditional mediation only if the browser supports it and fallback to a modal request.
* If true is selected and conditional mediation is unavailable, an error will be returned */ export type DiscoverableLoginWithWebAuthnParams = { conditionalMediation: boolean | 'preferred'; }; export type LoginWithWebAuthnParams = { auth?: AuthOptions; signal?: AbortSignal; } & (EmailLoginWithWebAuthnParams | PhoneNumberLoginWithWebAuthnParams | DiscoverableLoginWithWebAuthnParams); export type InternalLoginWithWebAuthnParams = LoginWithWebAuthnParams & { webAuthnOrigin?: string; }; export type SignupWithWebAuthnParams = { profile: SignupProfileData; friendlyName?: string; redirectUrl?: string; returnToAfterEmailConfirmation?: string; }; export type InternalSignupWithWebAuthnParams = SignupWithWebAuthnParams & { webAuthnOrigin?: string; }; export type RegistrationOptions = { friendlyName: string; options: { publicKey: PublicKeyCredentialCreationOptionsSerialized; }; }; export type CredentialRequestOptionsSerialized = { publicKey: PublicKeyCredentialRequestOptionsSerialized; }; export type DeviceCredential = { friendlyName: string; id: string; createdAt?: string; lastUsedAt?: string; aaguid?: string; }; type PublicKeyCredentialCreationOptionsSerialized = { rp: PublicKeyCredentialRpEntity; user: { id: string; displayName: string; name: string; }; challenge: string; pubKeyCredParams: PublicKeyCredentialParameters[]; timeout?: number; excludeCredentials?: { type: PublicKeyCredentialType; id: string; transports?: AuthenticatorTransport[]; }[]; authenticatorSelection?: AuthenticatorSelectionCriteria; attestation?: AttestationConveyancePreference; extensions?: AuthenticationExtensionsClientInputs; }; type PublicKeyCredentialRequestOptionsSerialized = { challenge: string; timeout?: number; rpId: string; allowCredentials: { id: string; transports?: AuthenticatorTransport[]; type: PublicKeyCredentialType; }[]; userVerification: UserVerificationRequirement; }; export type RegistrationPublicKeyCredentialSerialized = { id: string; rawId: string; type: PublicKeyCredentialType; response: { attestationObject: string; clientDataJSON: string; transports: ReturnType; }; }; export type AuthenticationPublicKeyCredentialSerialized = { id: string; rawId: string; type: PublicKeyCredentialType; response: { authenticatorData: string; clientDataJSON: string; signature: string; userHandle: string | null; }; }; export declare function encodePublicKeyCredentialCreationOptions(serializedOptions: PublicKeyCredentialCreationOptionsSerialized): PublicKeyCredentialCreationOptions; export declare function encodePublicKeyCredentialRequestOptions(serializedOptions: PublicKeyCredentialRequestOptionsSerialized): PublicKeyCredentialRequestOptions; export declare function serializeRegistrationPublicKeyCredential(encodedPublicKey: PublicKeyCredential): RegistrationPublicKeyCredentialSerialized; export declare function serializeAuthenticationPublicKeyCredential(encodedPublicKey: PublicKeyCredential): AuthenticationPublicKeyCredentialSerialized; export {};