UNPKG

@better-auth-ui/core

Version:

Authentication components and data utilities for [Better Auth](https://better-auth.com), available for React and Solid.

14 lines (13 loc) 978 B
import { MutationOptions } from '@tanstack/query-core'; import { BetterFetchError } from 'better-auth/client'; import { TwoFactorAuthClient } from './two-factor-auth-client'; export type GenerateBackupCodesParams<TAuthClient extends TwoFactorAuthClient> = Parameters<TAuthClient["twoFactor"]["generateBackupCodes"]>[0]; export type GenerateBackupCodesOptions<TAuthClient extends TwoFactorAuthClient> = Omit<ReturnType<typeof generateBackupCodesOptions<TAuthClient>>, "mutationKey" | "mutationFn">; /** Mutation options factory for regenerating backup codes. */ export declare function generateBackupCodesOptions<TAuthClient extends TwoFactorAuthClient>(authClient: TAuthClient): MutationOptions<Awaited<ReturnType<(params: GenerateBackupCodesParams<TAuthClient>) => Promise<{ status: boolean; backupCodes: string[]; }>>>, BetterFetchError, Parameters<(params: GenerateBackupCodesParams<TAuthClient>) => Promise<{ status: boolean; backupCodes: string[]; }>>[0]>;