import { ControllerRenderProps, FieldValues } from 'react-hook-form';
import * as zod from 'zod';
import * as react_jsx_runtime from 'react/jsx-runtime';

declare function AutoFormCheckbox({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;

declare function AutoFormDate({ label, isRequired, field, fieldConfigItem, fieldProps, zodItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;

declare function AutoFormEnum({ label, isRequired, field, fieldConfigItem, zodItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;

declare function AutoFormInput({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;

declare function AutoFormNumber({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;

declare function AutoFormRadioGroup({ label, isRequired, field, zodItem, fieldProps, fieldConfigItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;

declare function AutoFormSwitch({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;

declare function AutoFormTextarea({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;

declare const INPUT_COMPONENTS: {
    checkbox: typeof AutoFormCheckbox;
    date: typeof AutoFormDate;
    select: typeof AutoFormEnum;
    radio: typeof AutoFormRadioGroup;
    switch: typeof AutoFormSwitch;
    textarea: typeof AutoFormTextarea;
    number: typeof AutoFormNumber;
    fallback: typeof AutoFormInput;
};

/**
 * Common input props shared by all field types.
 */
interface BaseInputProps {
    /** Whether the field is disabled */
    disabled?: boolean;
    /** Whether the field is read-only */
    readOnly?: boolean;
    /** Whether the field is required */
    required?: boolean;
    /** Whether to show the label (auto-form specific) */
    showLabel?: boolean;
}
/**
 * Generic input props that accept any field type.
 * Use this when the backing type is not known at compile time.
 *
 * This is the catch-all type used for runtime flexibility.
 */
interface SerializableInputProps extends BaseInputProps {
    placeholder?: string;
    type?: string;
    defaultValue?: unknown;
    min?: number | string;
    max?: number | string;
    step?: number | string;
    minLength?: number;
    maxLength?: number;
    pattern?: string;
    autoComplete?: string;
    /** Allow additional props for extensibility */
    [key: string]: unknown;
}

/**
 * Input props for form fields.
 *
 * This is the runtime type that accepts any input props.
 * For type-safe props, use the discriminated types:
 * - StringInputProps for text inputs
 * - NumberInputProps for number inputs
 * - BooleanInputProps for checkboxes/switches
 * - DateInputProps for date pickers
 * - EnumInputProps for selects/radios
 */
type FieldInputProps = SerializableInputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof SerializableInputProps> & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, keyof SerializableInputProps>;
/**
 * Configuration for a single field in AutoForm.
 *
 * Note: This type is designed to align with form-builder's FormBuilderFieldProps
 * so that JSON Schema properties can be easily converted to field configs.
 */
type FieldConfigItem = {
    /** Description text or React node */
    description?: React.ReactNode;
    /** Input props passed to the field component */
    inputProps?: FieldInputProps;
    /** Display label */
    label?: string;
    /** Field type override - built-in type or custom component */
    fieldType?: keyof typeof INPUT_COMPONENTS | React.FC<AutoFormInputComponentProps>;
    /** Wrapper component for custom field layout */
    renderParent?: (props: {
        children: React.ReactNode;
    }) => React.ReactElement | null;
    /** Display order for field ordering */
    order?: number;
};
/**
 * A FormInput component can handle a specific Zod type (e.g. "ZodBoolean")
 */
type AutoFormInputComponentProps = {
    zodInputProps: React.InputHTMLAttributes<HTMLInputElement>;
    field: ControllerRenderProps<FieldValues, any>;
    fieldConfigItem: FieldConfigItem;
    label: string;
    isRequired: boolean;
    fieldProps: any;
    zodItem: zod.ZodType;
    className?: string;
};

export type { AutoFormInputComponentProps as A, FieldConfigItem as F };
