type CredentialAttestion = { id: string; raw: PublicKeyCredential; getPublicKey: (compressed?: boolean) => Promise; }; type CreateCredentialParameters = CredentialOptionParameters & { /** * Credential creation function. Useful for environments that do not support * the WebAuthn API natively (i.e. React Native or testing environments). * * @default window.navigator.credentials.create */ createFn?: ((options?: CredentialCreationOptions | undefined) => Promise) | undefined; }; type CredentialOptionParameters = { /** * A string specifying the relying party's preference for how the attestation statement * (i.e., provision of verifiable evidence of the authenticity of the authenticator and its data) * is conveyed during credential creation. */ attestation?: PublicKeyCredentialCreationOptions["attestation"]; /** * An object whose properties are criteria used to filter out the potential authenticators * for the credential creation operation. */ authenticatorSelection?: PublicKeyCredentialCreationOptions["authenticatorSelection"]; /** * An ArrayBuffer, TypedArray, or DataView provided by the relying party's server * and used as a cryptographic challenge. This value will be signed by the authenticator * and the signature will be sent back as part of AuthenticatorAttestationResponse.attestationObject. */ challenge?: PublicKeyCredentialCreationOptions["challenge"]; /** * List of credential IDs to exclude from the creation. This property can be used * to prevent creation of a credential if it already exists. */ excludeCredentialIds?: readonly string[]; /** * List of Web Authentication API credentials to use during creation or authentication. * Extensions are optional and different browsers may recognize different extensions. * Processing extensions is always optional for the client: * if a browser does not recognize a given extension, it will just ignore it */ extensions?: PublicKeyCredentialCreationOptions["extensions"]; /** * An object describing the relying party that requested the credential creation. */ rp?: { /** * A human-readable name for the relying party. */ name: string; /** * A unique identifier for the relying party. */ id: string; }; /** * A numerical hint, in milliseconds, which indicates the time the calling web app is willing to wait for the creation operation to complete. * This hint may be overridden by the browser. */ timeout?: number; /** * An object describing the user account for which the credential is generated. */ user: { /** * A human-readable name for the user. */ displayName?: string; /** * A globally unique identifier for the user. */ id?: string; /** * A human-readable name for the user. */ name: string; }; }; /** * Challange for credential creation - random 16 bytes */ declare function createChallenge(): Uint8Array; declare function createWebAuthnCredential(params: CreateCredentialParameters): Promise; /** * Returns the creation options for a P256 WebAuthn Credential with a Passkey authenticator. * * @example * ```ts * const options = getCredentialCreationOptions({ name: 'Example' }) * const credentials = window.navigator.credentials.create(options) * ``` */ declare function getCredentialCreationOptions(parameters: CredentialOptionParameters & {}): CredentialCreationOptions; export { type CreateCredentialParameters, type CredentialAttestion, type CredentialOptionParameters, createChallenge, createWebAuthnCredential, getCredentialCreationOptions };