import { default as React } from 'react';
import { default as StepContentHeader } from './StepContentHeader';
import { IStepperStepProps } from '../../stepper/components';
import { StepperStepStatus } from '../../stepper/types';
import { default as NavigationButtonState } from './NavigationButtonState';
import { default as StepperTypeMap } from './StepperTypeMap';
/**
 * Base fields shared by all step definitions.
 */
type StepDefBase = Pick<IStepperStepProps, 'title' | 'description' | 'completedTitle' | 'completedBadgeLabel' | 'completedBadgeIcon'> & {
    /** Explicit visual status override. */
    status?: Exclude<StepperStepStatus, 'active'>;
    /**
     * Optional header for the card content area.
     *
     * - `StepContentHeader` — renders the default `AppHeader` with title/subtitle/icon.
     * - `React.ReactElement` — renders the element directly inside `CardHeader`, replacing `AppHeader`.
     */
    contentHeader?: StepContentHeader | React.ReactElement;
    /** Back button state override for this step. */
    backAction?: NavigationButtonState;
    /** Next button state override for this step. */
    nextAction?: NavigationButtonState;
    /**
     * Conditional next step target.
     *
     * - `string` — static step id to navigate to instead of the next in array order.
     * - `(allData) => string` — predicate evaluated at navigation time; receives all stored
     *   step data and returns the target step id.
     *
     * Falls back to array-order advance when the returned id is not found.
     */
    nextStep?: string | ((allData: Record<string, unknown>) => string);
};
/**
 * Step definition for `useStepper`. When a specific type map is provided,
 * each step's extra fields are type-safe based on `TDataMap[id]`.
 *
 * Without a generic (default), accepts any custom fields via index signature.
 *
 * @example
 * ```tsx
 * type MySteps = {
 *   company: { schema: z.ZodSchema };
 *   review: {};
 * };
 *
 * const steps: StepDef<MySteps>[] = [
 *   { id: 'company', title: 'Firmendaten', schema: companySchema }, // ✅ schema is typed
 *   { id: 'review', title: 'Überprüfung', nextAction: 'hidden' },
 * ];
 * ```
 */
type StepDef<TDataMap extends StepperTypeMap = StepperTypeMap> = string extends keyof TDataMap ? StepDefBase & {
    id: string;
    [key: string]: unknown;
} : {
    [K in keyof TDataMap & string]: StepDefBase & {
        id: K;
    } & Omit<TDataMap[K], '__stored'>;
}[keyof TDataMap & string];
export type { StepDefBase };
export default StepDef;
