/**
 * Utility to convert NewFieldDefinition to FieldConfig
 * Used when consuming apps need a ready-to-use field configuration
 */
import type { NewFieldDefinition } from '../components/hazo_add_field_dialog/types.js';
import type { FieldConfig } from '../components/_internal_form_set.js';
/**
 * Convert a NewFieldDefinition to a partial FieldConfig
 *
 * This utility creates a FieldConfig object from a NewFieldDefinition,
 * generating a unique ID and mapping field-type-specific options.
 *
 * @param definition - The new field definition from the add field dialog
 * @returns A partial FieldConfig that can be merged into the form sections
 *
 * @example
 * ```typescript
 * const handle_add_field_config = (after_field_id: string, field_config: FieldConfig) => {
 *   // Insert field_config into sections after the specified field
 *   set_sections(prev => insert_field_after(prev, after_field_id, field_config));
 * };
 * ```
 */
export declare function new_field_definition_to_config(definition: NewFieldDefinition): FieldConfig;
/**
 * Insert a field or group into sections after a specific field/group
 *
 * This is a helper function that consuming apps can use to insert
 * a new field or group configuration into their sections array.
 *
 * For groups (field_type === 'group'), inserts into section.groups.
 * For fields, inserts into the appropriate group's fields array.
 *
 * @param sections - The current sections array
 * @param after_field_id - The field/group ID after which to insert
 * @param new_field - The new field/group configuration to insert
 * @returns A new sections array with the field/group inserted
 */
export declare function insert_field_after_in_sections<T extends {
    groups?: Array<{
        id: string;
        fields?: Array<{
            id: string;
        }>;
    }>;
}>(sections: T[], after_field_id: string, new_field: FieldConfig): T[];
/**
 * Remove a field from sections by its ID
 *
 * This is a helper function that consuming apps can use to remove
 * a field from their sections array (soft delete or hard delete).
 *
 * @param sections - The current sections array
 * @param field_id - The ID of the field to remove
 * @returns A new sections array with the field removed
 *
 * @example
 * ```typescript
 * const handle_delete_field = (field_id: string) => {
 *   set_sections(prev => remove_field_from_sections(prev, field_id));
 * };
 * ```
 */
export declare function remove_field_from_sections<T extends {
    groups?: Array<{
        id: string;
        fields?: Array<{
            id: string;
        }>;
    }>;
}>(sections: T[], field_id: string): T[];
/**
 * Update a field's properties in sections by its ID
 *
 * This is a helper function that consuming apps can use to update
 * a field's properties (label, type, options, etc.) in their sections array.
 *
 * @param sections - The current sections array
 * @param field_id - The ID of the field to update
 * @param updates - Partial field properties to merge
 * @returns A new sections array with the field updated
 *
 * @example
 * ```typescript
 * const handle_edit_field = (field_id: string, updates: Partial<FieldConfig>) => {
 *   set_sections(prev => update_field_in_sections(prev, field_id, updates));
 * };
 * ```
 */
export declare function update_field_in_sections<F extends {
    id: string;
}, T extends {
    groups?: Array<{
        id: string;
        label?: string;
        fields?: F[];
    }>;
}>(sections: T[], field_id: string, updates: Partial<F>): T[];
//# sourceMappingURL=field_definition_to_config.d.ts.map