import { RouteDescriptor } from "../../route.mjs"; import { Page, Session } from "../../types.mjs"; import { ClientPlugin, StrictConfig } from "../../define-plugin.mjs"; import { AuthenticatorAttachment, BeginAuthenticationInput, BeginAuthenticationResult, BeginPasskeyResult, BeginRegistrationInput, BeginRegistrationResult, DeletePasskeyInput, FinishAuthenticationInput, FinishRegistrationInput, FinishRegistrationResult, ListPasskeysInput, Passkey, PasskeyExtensionName, PasskeyPluginConfig, RegisterPasskeyInput, SignInPasskeyInput, UpdatePasskeyInput } from "./types.mjs"; import { serializeBeginQuery, serializeFinishRegistration } from "./helpers.mjs"; //#region src/plugins/passkey/index.d.ts /** * Passkey / WebAuthn client plugin. Orchestrates registration and sign-in * ceremonies via `@simplewebauthn/browser` (optional peer dependency). * * @example * import { passkey } from "limen-auth/plugins/passkey"; * createAuthClient({ plugins: [passkey({ rpID: "example.com" })] }); */ declare function passkey = Record, TFields = unknown>(config?: Config): ClientPlugin<"passkey", "/passkeys", [RouteDescriptor, RouteDescriptor, { readonly method: "POST"; readonly path: "/finish-registration"; readonly as: "passkey.finishRegistration"; readonly serialize: typeof serializeFinishRegistration; readonly parseSession: true; }>, RouteDescriptor, RouteDescriptor, { readonly method: "POST"; readonly path: "/finish-authentication"; readonly as: "passkey.finishAuthentication"; readonly serialize: (input: import("@simplewebauthn/browser").AuthenticationResponseJSON) => import("@simplewebauthn/browser").AuthenticationResponseJSON; readonly parseSession: true; }>, RouteDescriptor, { readonly method: "GET"; readonly path: "/"; readonly as: "passkey.list"; }>, RouteDescriptor, RouteDescriptor, void, { readonly method: "DELETE"; readonly path: "/:id"; readonly expose: false; readonly params: readonly ["id"]; }>], { signIn: { passkey: (input?: SignInPasskeyInput | undefined) => Promise>; }; passkey: { register: (input?: RegisterPasskeyInput) => Promise>; delete: (input: DeletePasskeyInput) => Promise; isSupported: () => Promise; browserSupportsPasskeys: () => Promise; }; }, unknown, Record>; //#endregion export { type AuthenticatorAttachment, type BeginAuthenticationInput, type BeginAuthenticationResult, type BeginPasskeyResult, type BeginRegistrationInput, type BeginRegistrationResult, type DeletePasskeyInput, type FinishAuthenticationInput, type FinishRegistrationInput, type FinishRegistrationResult, type ListPasskeysInput, type Passkey, type PasskeyExtensionName, type PasskeyPluginConfig, type RegisterPasskeyInput, type SignInPasskeyInput, type UpdatePasskeyInput, passkey };