import { PaginationInput, Session } from "../../types.mjs"; import { AuthenticationExtensionsClientInputs, AuthenticationResponseJSON, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, RegistrationResponseJSON } from "@simplewebauthn/browser"; //#region src/plugins/passkey/types.d.ts type PasskeyPluginConfig = { /** * Relying Party ID used for WebAuthn Signal APIs after delete. * Defaults to `location.hostname` in the browser. */ rpID?: string; }; type Passkey = { id: string | number; name: string | null; credentialId: string; transports: string[] | null; aaguid: string | null; backupEligible: boolean; backupState: boolean; lastUsedAt: string | null; createdAt: string; updatedAt: string; }; type AuthenticatorAttachment = "platform" | "cross-platform"; type PasskeyExtensionName = keyof AuthenticationExtensionsClientInputs | string; type BeginPasskeyResult = { publicKey: TPublicKey; mediation?: string; }; type BeginRegistrationInput = { authenticatorAttachment?: AuthenticatorAttachment; /** Opaque signup context (e.g. email) when the server allows public registration. */ context?: string; extensions?: PasskeyExtensionName[]; }; type BeginRegistrationResult = BeginPasskeyResult; type FinishRegistrationInput = RegistrationResponseJSON & { name?: string; createSession?: boolean; }; type FinishRegistrationResult = Passkey | Session; type BeginAuthenticationInput = { extensions?: PasskeyExtensionName[]; } | void; type BeginAuthenticationResult = BeginPasskeyResult; type FinishAuthenticationInput = AuthenticationResponseJSON; type ListPasskeysInput = PaginationInput | void; type UpdatePasskeyInput = { id: string | number; name: string; }; type DeletePasskeyInput = { id: string | number; /** * When set, best-effort `sendSignal(unknownCredential)` so the password * manager may hide or delete the device copy. Use {@link Passkey.credentialId}. */ credentialId?: string; }; type RegisterPasskeyInput = { name?: string; authenticatorAttachment?: AuthenticatorAttachment; context?: string; createSession?: boolean; /** Try silent passkey creation after a non-passkey sign-in. */ useAutoRegister?: boolean; extensions?: PasskeyExtensionName[]; }; type SignInPasskeyInput = { useBrowserAutofill?: boolean; verifyBrowserAutofillInput?: boolean; extensions?: PasskeyExtensionName[]; } | void; //#endregion export { AuthenticatorAttachment, BeginAuthenticationInput, BeginAuthenticationResult, BeginPasskeyResult, BeginRegistrationInput, BeginRegistrationResult, DeletePasskeyInput, FinishAuthenticationInput, FinishRegistrationInput, FinishRegistrationResult, ListPasskeysInput, Passkey, PasskeyExtensionName, PasskeyPluginConfig, RegisterPasskeyInput, SignInPasskeyInput, UpdatePasskeyInput };