import { FaceMatchConfig } from '@incodetech/core/face-match';
import { FC } from 'preact/compat';

/**
 * Face match UI component.
 *
 * Provides a complete face comparison experience including:
 * - Animated photo comparison sequence
 * - Match/no-match result display
 * - Continue button to proceed
 *
 * @example Basic usage
 * ```tsx
 * <FaceMatch
 *   config={{
 *     variant: 'selfieVsId',
 *     disableFaceMatchAnimation: false,
 *   }}
 *   onFinish={() => router.push('/next-step')}
 *   onError={(err) => toast.error(err)}
 * />
 * ```
 *
 * @see {@link createFaceMatchManager} for headless usage
 */
export declare const FaceMatch: FC<FaceMatchProps>;

/**
 * Props for the FaceMatch component
 */
declare type FaceMatchProps = IncodeModuleProps<FaceMatchConfig>;

declare type IncodeModuleProps<TConfig, TResult = void, TManager = unknown> = {
    /**
     * Module configuration required to render the flow.
     * For Web Components, this is typically assigned via `element.config = ...`.
     */
    config?: TConfig;
    /**
     * Optional pre-built manager. When provided, the module does not create or manage the manager lifecycle.
     */
    manager?: TManager;
    /**
     * Callback invoked when the module completes successfully.
     * @param result - Optional result data from the module completion
     */
    onFinish?: (result?: TResult) => void;
    /**
     * Callback invoked when a fatal module error occurs.
     *
     * @param error - Human-readable error message.
     * @param errorCode - Optional numeric code (e.g. HTTP status). Populated by
     *   the workflow and flow modules on QR validation failures —
     *   `4026` (`expiredUUID`), `4081` (`invalidQRuuid`) or `4083` (`onboardingUrlAlreadyUsed`).
     * @param moduleErrorCode - Optional machine-readable error code (e.g. a
     *   `FaceErrorCode` such as `NONEXISTENT_CUSTOMER`). Lets an orchestrator
     *   branch on the specific terminal error without parsing the message string.
     */
    onError?: (error: string | undefined, errorCode?: number, moduleErrorCode?: string) => void;
};

export { }
