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;
}
/**
 * Input props for string-backed fields (text, email, password, url, phone, textarea).
 */
interface StringInputProps extends BaseInputProps {
    /** Placeholder text */
    placeholder?: string;
    /** HTML input type (text, email, password, tel, url) */
    type?: "text" | "email" | "password" | "tel" | "url" | string;
    /** Default value */
    defaultValue?: string;
    /** Minimum length */
    minLength?: number;
    /** Maximum length */
    maxLength?: number;
    /** Regex pattern for validation */
    pattern?: string;
    /** Autocomplete hint */
    autoComplete?: string;
}
/**
 * Input props for number-backed fields.
 */
interface NumberInputProps extends BaseInputProps {
    /** Placeholder text */
    placeholder?: string;
    /** Default value */
    defaultValue?: number;
    /** Minimum value */
    min?: number;
    /** Maximum value */
    max?: number;
    /** Step value for increment/decrement */
    step?: number;
}
/**
 * Input props for boolean-backed fields (checkbox, switch).
 */
interface BooleanInputProps extends BaseInputProps {
    /** Default value */
    defaultValue?: boolean;
}
/**
 * Input props for date-backed fields.
 */
interface DateInputProps extends BaseInputProps {
    /** Default value as ISO string or Date */
    defaultValue?: string | Date;
    /** Minimum date as ISO string */
    min?: string;
    /** Maximum date as ISO string */
    max?: string;
}
/**
 * Input props for enum-backed fields (select, radio).
 */
interface EnumInputProps extends BaseInputProps {
    /** Placeholder text (for select) */
    placeholder?: string;
    /** Default value (must match one of the enum options) */
    defaultValue?: string;
}
/**
 * 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;
}
/**
 * Maps backing Zod types to their corresponding input props type.
 */
interface InputPropsByBackingType {
    string: StringInputProps;
    number: NumberInputProps;
    boolean: BooleanInputProps;
    date: DateInputProps;
    enum: EnumInputProps;
}
/**
 * Built-in field types supported by auto-form.
 */
type AutoFormBuiltinFieldType = keyof typeof INPUT_COMPONENTS;
/**
 * Field types that can be specified in JSON Schema.
 * Either a built-in type name or a custom component.
 */
type FieldType = AutoFormBuiltinFieldType | (string & {});
/**
 * JSON Schema property with form-builder and auto-form metadata.
 *
 * This is the intermediate format used when:
 * - form-builder serializes field configurations
 * - auto-form parses JSON Schema to build field configs
 */
interface JSONSchemaPropertyBase {
    /** JSON Schema type */
    type?: "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
    /** Human-readable title (JSON Schema standard) */
    title?: string;
    /** Description text */
    description?: string;
    /** Default value */
    default?: unknown;
    /** Enum values for select/radio fields */
    enum?: (string | number | boolean | null)[];
    /** Minimum value for numbers */
    minimum?: number;
    /** Maximum value for numbers */
    maximum?: number;
    /** Exclusive minimum for numbers */
    exclusiveMinimum?: number;
    /** Exclusive maximum for numbers */
    exclusiveMaximum?: number;
    /** Minimum length for strings */
    minLength?: number;
    /** Maximum length for strings */
    maxLength?: number;
    /** Regex pattern for strings */
    pattern?: string;
    /** Format hint (email, uri, date-time, etc.) */
    format?: string;
    /** Multiple of constraint for numbers */
    multipleOf?: number;
    /** Properties for object types */
    properties?: Record<string, JSONSchemaPropertyBase>;
    /** Required fields for object types */
    required?: string[];
    /** Additional properties allowed for objects */
    additionalProperties?: boolean;
    /** Item schema for array types */
    items?: JSONSchemaPropertyBase;
    /** Display label (form-builder/auto-form) */
    label?: string;
    /** Field type override (checkbox, date, select, radio, switch, textarea, etc.) */
    fieldType?: FieldType;
    /** Placeholder text */
    placeholder?: string;
    /** HTML input type (text, email, password, tel, etc.) */
    inputType?: string;
    /** Additional input props */
    inputProps?: SerializableInputProps;
    /** Display order */
    order?: number;
    /** Minimum date as ISO string */
    formatMinimum?: string;
    /** Maximum date as ISO string */
    formatMaximum?: string;
}

/**
 * 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;
};
/**
 * FieldConfig for nested objects - allows both FieldConfigItem properties
 * AND nested field configs for child properties.
 */
type FieldConfigObject = FieldConfigItem & {
    [key: string]: FieldConfigItem | FieldConfigObject | undefined;
};
/**
 * For object fields, allow both FieldConfigItem properties (label, description, etc.)
 * AND nested field configs for the object's properties.
 */
type FieldConfig<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = {
    [Key in keyof SchemaType]?: FieldConfigItem | FieldConfigObject;
};
declare enum DependencyType {
    DISABLES = 0,
    REQUIRES = 1,
    HIDES = 2,
    SETS_OPTIONS = 3
}
type BaseDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = {
    sourceField: keyof SchemaType;
    type: DependencyType;
    targetField: keyof SchemaType;
    when: (sourceFieldValue: any, targetFieldValue: any) => boolean;
};
type ValueDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = BaseDependency<SchemaType> & {
    type: DependencyType.DISABLES | DependencyType.REQUIRES | DependencyType.HIDES;
};
type EnumValues = readonly [string, ...string[]];
type OptionsDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = BaseDependency<SchemaType> & {
    type: DependencyType.SETS_OPTIONS;
    options: EnumValues;
};
type Dependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = ValueDependency<SchemaType> | OptionsDependency<SchemaType>;
/**
 * 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 { DependencyType as b };
export type { AutoFormInputComponentProps as A, Dependency as D, FieldConfigItem as F, InputPropsByBackingType as I, JSONSchemaPropertyBase as J, SerializableInputProps as S, FieldConfig as a, FieldType as c };
