import React$1 from 'react';

interface SchemaFormFieldCondition {
    targetFieldId: string;
    operator: 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'greater_than' | 'less_than' | 'is_empty' | 'is_not_empty' | 'is_true' | 'is_false';
    value?: any;
    logicalOperator?: 'AND' | 'OR';
}
interface TableColumn {
    id: string;
    title: string;
    type: 'string' | 'number' | 'boolean' | 'date';
    required?: boolean;
    width?: string;
}
interface SchemaFormField {
    type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'table';
    title?: string;
    description?: string;
    default?: any;
    enum?: any[];
    enumNames?: string[];
    format?: 'email' | 'date' | 'date-time' | 'uri' | 'textarea' | 'file' | 'select' | 'radio' | 'combobox' | 'checkbox' | 'switch' | 'checkboxes' | 'multiselect';
    minimum?: number;
    maximum?: number;
    minLength?: number;
    maxLength?: number;
    pattern?: string;
    items?: SchemaFormField;
    properties?: Record<string, SchemaFormField>;
    required?: string[];
    conditions?: SchemaFormFieldCondition[];
    showWhen?: 'all' | 'any';
    columns?: TableColumn[];
    minRows?: number;
    maxRows?: number;
}
interface SchemaFormUIConfig {
    'ui:widget'?: 'text' | 'textarea' | 'select' | 'radio' | 'checkboxes' | 'file' | 'email' | 'date' | 'number' | 'checkbox' | 'switch' | 'combobox' | 'multiselect' | 'table';
    'ui:placeholder'?: string;
    'ui:help'?: string;
    'ui:disabled'?: boolean;
    'ui:options'?: {
        label?: boolean;
        rows?: number;
        accept?: string;
    };
    'ui:order'?: string[];
}
interface SchemaFormUISchema {
    [key: string]: SchemaFormUIConfig | SchemaFormUISchema;
}
interface SchemaFormConfig {
    id?: string;
    title: string;
    description: string;
    schema: {
        type: 'object';
        properties: Record<string, SchemaFormField>;
        required?: string[];
    };
    uiSchema: SchemaFormUISchema;
    storage: Record<string, 'private' | 'public' | 'proof' | 'personal'>;
    settings: {
        allowMultipleSubmissions: boolean;
        requireAuthentication: boolean;
        showProgressBar: boolean;
        submitButtonText: string;
        successMessage: string;
    };
    styling: {
        theme: 'default' | 'modern' | 'minimal';
        primaryColor: string;
        backgroundColor: string;
    };
    fieldOrder?: string[];
    createdAt?: string;
    updatedAt?: string;
}
interface TableInputProps$1 {
    columns: TableColumn[];
    value: Record<string, any>[];
    onChange: (value: Record<string, any>[]) => void;
    minRows?: number;
    maxRows?: number;
    className?: string;
}
interface SchemaFormRendererProps {
    config: SchemaFormConfig;
    onSubmit: (data: Record<string, any>) => void;
    isSubmitting?: boolean;
    className?: string;
    initialData?: Record<string, any>;
    components?: {
        Button?: React.ComponentType<any>;
        Input?: React.ComponentType<any>;
        Textarea?: React.ComponentType<any>;
        Select?: React.ComponentType<any>;
        Checkbox?: React.ComponentType<any>;
        RadioGroup?: React.ComponentType<any>;
        Switch?: React.ComponentType<any>;
        Label?: React.ComponentType<any>;
        TableInput?: React.ComponentType<TableInputProps$1>;
    };
}
interface FormEditorValidationResult {
    valid: boolean;
    errors: string[];
}
interface FormEditorState {
    formConfig: SchemaFormConfig;
    setFormConfig: React.Dispatch<React.SetStateAction<SchemaFormConfig>>;
    fieldOrder: string[];
    validate: () => FormEditorValidationResult;
    generateUniqueId: (baseLabel?: string) => string;
    addField: () => void;
    updateField: (fieldId: string, updates: Partial<SchemaFormField>) => void;
    updateFieldUI: (fieldId: string, uiUpdates: any) => void;
    updateFieldStorage: (fieldId: string, storage: 'private' | 'public' | 'proof' | 'personal') => void;
    updateFieldId: (oldId: string, newId: string) => FormEditorValidationResult;
    removeField: (fieldId: string) => void;
    toggleRequired: (fieldId: string, required: boolean) => void;
    reorderFields: (newFieldOrder: string[]) => void;
}
interface FormEditorStateOptions {
    existingForm?: SchemaFormConfig;
    isCreating: boolean;
}
interface FormEditorActionsOptions {
    formConfig: SchemaFormConfig;
    setFormConfig: React.Dispatch<React.SetStateAction<SchemaFormConfig>>;
}
interface FormEditorActions {
    exportSchema: () => void;
    importSchema: (event: React.ChangeEvent<HTMLInputElement>) => {
        success: boolean;
        error?: string;
    };
}

declare const evaluateFieldConditions: (conditions?: SchemaFormFieldCondition[], showWhen?: "all" | "any", formData?: Record<string, any>) => boolean;

declare const SchemaFormRenderer: React$1.FC<SchemaFormRendererProps>;

interface TableInputProps {
    columns: TableColumn[];
    value: Record<string, any>[];
    onChange: (value: Record<string, any>[]) => void;
    minRows?: number;
    maxRows?: number;
    className?: string;
}
declare const TableInput: React$1.FC<TableInputProps>;

declare const Button: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
    variant?: string;
}>;
declare const Input: React$1.FC<React$1.InputHTMLAttributes<HTMLInputElement>>;
declare const Textarea: React$1.FC<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>>;
declare const Label: React$1.FC<React$1.LabelHTMLAttributes<HTMLLabelElement>>;
declare const Select: React$1.FC<React$1.SelectHTMLAttributes<HTMLSelectElement> & {
    placeholder?: string;
    onValueChange?: (value: string) => void;
}>;
declare const Checkbox: React$1.FC<React$1.InputHTMLAttributes<HTMLInputElement> & {
    onCheckedChange?: (checked: boolean) => void;
}>;
declare const Switch: React$1.FC<React$1.InputHTMLAttributes<HTMLInputElement> & {
    onCheckedChange?: (checked: boolean) => void;
}>;
declare const RadioGroup: React$1.FC<{
    value?: string;
    onValueChange?: (value: string) => void;
    children: React$1.ReactNode;
    className?: string;
}>;
declare const RadioGroupItem: React$1.FC<React$1.InputHTMLAttributes<HTMLInputElement>>;

declare const DefaultComponents_d_Button: typeof Button;
declare const DefaultComponents_d_Checkbox: typeof Checkbox;
declare const DefaultComponents_d_Input: typeof Input;
declare const DefaultComponents_d_Label: typeof Label;
declare const DefaultComponents_d_RadioGroup: typeof RadioGroup;
declare const DefaultComponents_d_RadioGroupItem: typeof RadioGroupItem;
declare const DefaultComponents_d_Select: typeof Select;
declare const DefaultComponents_d_Switch: typeof Switch;
declare const DefaultComponents_d_TableInput: typeof TableInput;
declare const DefaultComponents_d_Textarea: typeof Textarea;
declare namespace DefaultComponents_d {
  export {
    DefaultComponents_d_Button as Button,
    DefaultComponents_d_Checkbox as Checkbox,
    DefaultComponents_d_Input as Input,
    DefaultComponents_d_Label as Label,
    DefaultComponents_d_RadioGroup as RadioGroup,
    DefaultComponents_d_RadioGroupItem as RadioGroupItem,
    DefaultComponents_d_Select as Select,
    DefaultComponents_d_Switch as Switch,
    DefaultComponents_d_TableInput as TableInput,
    DefaultComponents_d_Textarea as Textarea,
  };
}

/**
 * Core form editor state management hook.
 *
 * Provides all field CRUD operations, validation, reordering, and ID management.
 * This hook has zero UI dependencies — consuming apps handle their own toast/notification layer.
 *
 * @example
 * ```tsx
 * const editor = useFormEditorState({ isCreating: true });
 *
 * // Add a field
 * editor.addField();
 *
 * // Validate before save
 * const result = editor.validate();
 * if (!result.valid) {
 *   showToast(result.errors[0]);
 * }
 * ```
 */
declare const useFormEditorState: ({ existingForm, isCreating, }: FormEditorStateOptions) => FormEditorState;

/**
 * Form editor action utilities for import/export.
 *
 * Returns pure results — consuming apps handle their own toast/notification layer.
 *
 * @example
 * ```tsx
 * const actions = useFormEditorActions({ formConfig, setFormConfig });
 *
 * // Export schema as JSON file download
 * actions.exportSchema();
 *
 * // Import: wire to a file input's onChange
 * <input type="file" onChange={(e) => {
 *   const result = actions.importSchema(e);
 *   if (result.success) showToast('Imported!');
 *   else showToast(result.error, 'error');
 * }} />
 * ```
 */
declare const useFormEditorActions: ({ formConfig, setFormConfig }: FormEditorActionsOptions) => {
    exportSchema: () => void;
    importSchema: (event: React.ChangeEvent<HTMLInputElement>) => {
        success: boolean;
        error?: string;
    };
};

export { DefaultComponents_d as DefaultComponents, SchemaFormRenderer, evaluateFieldConditions, useFormEditorActions, useFormEditorState };
export type { FormEditorActions, FormEditorActionsOptions, FormEditorState, FormEditorStateOptions, FormEditorValidationResult, SchemaFormConfig, SchemaFormField, SchemaFormFieldCondition, SchemaFormRendererProps, SchemaFormUIConfig, SchemaFormUISchema, TableColumn, TableInputProps$1 as TableInputProps };
