/** Return type for {@link useResend}. */ export interface UseResendReturn { /** Seconds remaining until the next resend attempt is allowed. */ remaining: number; /** Whether the resend action is currently disabled. */ disabled: boolean; /** Start a resend attempt immediately, if allowed. */ startResend: () => void; } /** Optional configuration for {@link useResend}. */ export interface UseResendOptions { /** * Countdown duration (in seconds) before another resend is allowed. * Defaults to `10`. */ timeoutSeconds?: number; /** * Callback fired when the countdown finishes and the resend * action becomes available again. */ onTimeout?: () => void; } /** * This React hook manages "resend" actions (e.g., resending a verification code) on ACUL screens. * * This hook: * - Tracks the remaining cooldown time. * - Tells you whether the resend button should be disabled. * - Provides a `startResend` function to trigger a resend immediately. * * @supportedScreens * - `email-identifier-challenge` * - `email-otp-challenge` * - `login-email-verification` * - `login-passwordless-email-code` * - `login-passwordless-sms-otp` * - `mfa-email-challenge` * - `mfa-sms-challenge` * - `mfa-voice-challenge` * - `phone-identifier-challenge` * - `reset-password-mfa-email-challenge` * - `reset-password-mfa-sms-challenge` * - `reset-password-mfa-voice-challenge` * * @param options - Optional configuration such as `timeoutSeconds` and `onTimeout`. * * @returns An object with: * - `remaining` — seconds left until the next resend is permitted. * - `disabled` — `true` if resending is currently blocked. * - `startResend` — call to initiate a resend immediately (if allowed). * * @example * ```tsx * import { useResend } from '@auth0/auth0-acul-react/mfa-sms-challenge'; * * export function ResendButton() { * const { remaining, disabled, startResend } = useResend({ * timeoutSeconds: 30, * onTimeout: () => console.log('You can resend again'), * }); * * return ( * * ); * } * ``` * * @remarks * - The underlying `ResendControl` has no explicit teardown method; the hook does not require manual cleanup. * - The hook re-initializes the resend manager if `timeoutSeconds` or `onTimeout` change. */ export declare function useResend(options?: UseResendOptions): UseResendReturn;