/**
 * Props and public types for auth page components.
 */
import type { UserType } from '../auth/auth-types';
import type { IdentifierType, LinkOrMergeState } from '../auth/flow';
import type { LoginEntryMode } from './login-form';
import type { UseMainAuthPageHandlersOptions } from './main-login';
import type { OtpValidateFn, OtpVerificationMode } from './otp-verification';
/** Props for MainLoginPage and MainLogin components. */
export type MainLoginPageProps = UseMainAuthPageHandlersOptions;
/** Props for LoginEntry (inner form without layout). */
export interface LoginEntryProps {
    /** Mode: phone number or email input */
    mode: LoginEntryMode;
    /** Override title (consumers render via AuthLayout.Title) */
    title?: string;
    /** Override subtitle (consumers render via AuthLayout.Description) */
    subtitle?: string;
    /** Handler when back button is clicked (consumers render back button in AuthLayout.Logo) */
    onBack?: () => void;
    /**
     * Sync callback with valid data. Use when parent owns API (e.g. AuthFlow).
     * Ignored when submitApi is provided.
     */
    onSubmit?: ((data: {
        phone?: string;
        email?: string;
        countryCode?: string;
    }) => void) | undefined;
    /**
     * Async API call (e.g. send OTP). When provided, hook runs: validate → submitApi(data) → onSuccess().
     * Consumer (e.g. Next.js) can pass redirect in onSuccess.
     */
    submitApi?: ((data: {
        phone?: string;
        email?: string;
        countryCode?: string;
    }) => Promise<void>) | undefined;
    /** Called after submitApi succeeds; receives { mode, recipient } for OTP redirect/recipientDisplay. */
    onSuccess?: ((params: {
        mode: LoginEntryMode;
        recipient: string;
    }) => void) | undefined;
    /** Called when submitApi fails. */
    onError?: ((error: unknown) => void) | undefined;
}
/** Props for the full LoginEntryPage (adds optional layout overrides for story/viewport). */
export interface LoginEntryPageProps extends LoginEntryProps {
    /** Layout type. Default: 'withSlider' for desktop, use 'standalone' for mobile. */
    layoutType?: 'withSlider' | 'standalone';
    /** Layout variant. Default derived from layoutType if not set. */
    variant?: 'desktop' | 'mobile';
}
/** Props for Signup (inner form without layout). */
export interface SignupPageProps {
    /** Indian: which field to collect. Foreign: use 'foreign' mode (name + email + phone). */
    userType: UserType;
    /** How user started (phone or email). */
    loginMethod: IdentifierType;
    /** Indian only: which field to collect (phone or email). */
    signupCollectField: IdentifierType;
    /** Foreign only: phone when user entered phone before signup details. */
    pendingPhone?: string | undefined;
    /** Sync callback with valid data. Use when parent owns API (e.g. AuthFlow). Ignored when submitApi is provided. */
    onSubmit?: ((data: {
        fullName: string;
        phone?: string;
        email?: string;
        countryCode?: string;
    }) => void) | undefined;
    /** Async API (e.g. complete profile). When provided, hook runs: validate → submitApi(data) → onSuccess(). */
    submitApi?: ((data: {
        fullName: string;
        phone?: string;
        email?: string;
        countryCode?: string;
    }) => Promise<void>) | undefined;
    /** Called after submitApi succeeds (e.g. router.push('/otp') or next step). */
    onSuccess?: (() => void) | undefined;
    /** Called when submitApi fails. */
    onError?: ((error: unknown) => void) | undefined;
}
/** Props for the full SignupPage (adds optional layout overrides). */
export interface SignupPageFullProps extends SignupPageProps {
    layoutType?: 'withSlider' | 'standalone';
    variant?: 'desktop' | 'mobile';
}
export interface LinkOrMergePageProps {
    details: LinkOrMergeState;
    onBack?: (() => void) | undefined;
    onContinue: () => Promise<void>;
    onVerify: (otp: string) => Promise<void>;
    onResendCode?: (() => void) | undefined;
}
/** Props for OtpVerification (inner form without layout). */
export interface OtpVerificationProps {
    /** Mode: mobile (phone) or email OTP */
    mode: OtpVerificationMode;
    /** Title override. Default: "6 digit OTP has been sent to your Mobile" | "..." Email */
    title?: string | undefined;
    /** Masked phone (e.g. "+91 9825910X0X") or email (e.g. "j***@gmail.com") */
    recipientDisplay: string;
    /** When true, show instruction line ("Kindly check your Email Inbox."). Used for foreign user flow. */
    isForeignUser?: boolean | undefined;
    /** Handler when back is clicked */
    onBack?: (() => void) | undefined;
    /** Sync callback with OTP. Use when parent owns API (e.g. AuthFlow). Ignored when submitApi is provided. */
    onSubmit?: ((otp: string) => void) | undefined;
    /** Handler when user requests resend code */
    onResendCode?: (() => void) | undefined;
    /** Async API (e.g. verify OTP). When provided, hook runs: validate → submitApi(otp) → onSuccess(). */
    submitApi?: ((otp: string) => Promise<void>) | undefined;
    /** Called after submitApi succeeds (e.g. router.push('/dashboard')). */
    onSuccess?: (() => void) | undefined;
    /** Called when submitApi fails. */
    onError?: ((error: unknown) => void) | undefined;
    /**
     * Optional custom OTP validator. Runs after the built-in 6-digit
     * check; return `true` to accept or a string message to display as
     * the field error (and block submission).
     */
    validate?: OtpValidateFn | undefined;
}
/** Props for the full OtpVerificationPage (adds optional layout overrides). */
export interface OtpVerificationPageProps extends OtpVerificationProps {
    layoutType?: 'withSlider' | 'standalone';
    variant?: 'desktop' | 'mobile';
}
/** Props for RepeatLogin (inner component without layout). */
export interface RepeatLoginProps {
    /**
     * Last used authentication method shown in the primary button label.
     * Example: "Mobile", "Email".
     *
     * @default "Mobile"
     */
    lastUsedMethod?: string;
    /** Sync handler for primary action. Use when caller owns API (e.g. AuthFlow). Ignored when continueApi is provided. */
    onContinueWithLastMethod?: (() => void) | undefined;
    /** Handler for the secondary action (choose another method). */
    onUseAnotherMethod?: (() => void) | undefined;
    /** Async API for continue (e.g. validate session). When provided, hook runs: continueApi() → onSuccess(). */
    continueApi?: (() => Promise<void>) | undefined;
    /** Called after continueApi succeeds (e.g. router.push('/dashboard')). */
    onSuccess?: (() => void) | undefined;
    /** Called when continueApi fails. */
    onError?: ((error: unknown) => void) | undefined;
}
/** Props for the full RepeatLoginPage (adds optional layout overrides). */
export interface RepeatLoginPageProps extends RepeatLoginProps {
    layoutType?: 'withSlider' | 'standalone';
    variant?: 'desktop' | 'mobile';
}
