/**
 * Type definitions for the HazoFieldSelectorDialog component
 */
import type { Section, FieldConfig } from '../_internal_form_set.js';
import type { IconsBehaviour } from '../../types/icons_behaviour.js';
/**
 * Full form template structure (matches tax_form_individual_full.json)
 */
export interface FormTemplate {
    icons_behaviour?: IconsBehaviour;
    sections: Section[];
}
/**
 * Type of selectable item in search results
 */
export type SelectableItemType = 'section' | 'group' | 'field';
/**
 * Searchable item - can be section, group, or field
 */
export interface SearchableItem {
    /** Unique identifier (combines type + id for uniqueness) */
    search_id: string;
    /** Type of item */
    item_type: SelectableItemType;
    /** Display label */
    label: string;
    /** Parent section name */
    section_name: string;
    /** Section index in original template */
    section_index: number;
    /** Group index (for group/field types) */
    group_index?: number;
    /** Field index within group (for field type only) */
    field_index?: number;
    /** Parent group ID (for field type only) */
    parent_group_id?: string;
    /** Parent group label (for field type only) */
    parent_group_label?: string;
    /** Original field config (group or field) */
    field_config: FieldConfig;
    /** Number of fields in group (for group type) or groups in section (for section type) */
    child_count?: number;
}
/**
 * Tracks which fields are selected within a group
 */
export interface GroupFieldSelection {
    /** Set of field IDs that are selected within this group */
    selected_field_ids: Set<string>;
    /** Total count of fields in the group (for display) */
    total_fields: number;
}
/**
 * Selected item with order tracking and field-level selection
 */
export interface FieldSelectorItem {
    /** Unique identifier (group ID) */
    id: string;
    /** Display label */
    label: string;
    /** Parent section name */
    section_name: string;
    /** Original section index */
    section_index: number;
    /** Original group index within section */
    group_index: number;
    /** Original field configuration (the full group with all its fields) */
    field_config: FieldConfig;
    /** Order in the selection list (global) */
    order: number;
    /** Field selection state - undefined = all fields selected */
    field_selection?: GroupFieldSelection;
    /** Whether the group is expanded in the UI */
    is_expanded?: boolean;
}
/**
 * Selection state grouped by section
 */
export interface SelectionBySection {
    section_name: string;
    section_index: number;
    items: FieldSelectorItem[];
}
/**
 * Props for HazoFieldSelectorDialog
 */
export interface HazoFieldSelectorDialogProps {
    /** Whether the dialog is open */
    open: boolean;
    /** Callback when dialog open state changes */
    on_open_change: (open: boolean) => void;
    /** Input form template JSON */
    form_template: FormTemplate;
    /** Callback when selection is confirmed - returns filtered JSON */
    on_confirm: (output: FormTemplate) => void;
    /** Callback when dialog is cancelled */
    on_cancel?: () => void;
    /** Initial selection (for editing existing selections) */
    initial_selection?: FieldSelectorItem[];
    /** Dialog title @default "Select Fields" */
    title?: string;
    /** Dialog description */
    description?: string;
    /** Confirm button text @default "Confirm" */
    confirm_text?: string;
    /** Cancel button text @default "Cancel" */
    cancel_text?: string;
    /** Whether to include icons_behaviour in output @default true */
    include_icons_behaviour?: boolean;
    /** Custom class name */
    className?: string;
}
/**
 * Props for FieldAutocomplete component
 */
export interface FieldAutocompleteProps {
    /** All searchable items (sections, groups, fields) */
    items: SearchableItem[];
    /** Set of already selected group IDs */
    selected_group_ids: Set<string>;
    /** Set of already selected section names (when entire section was selected) */
    selected_section_names: Set<string>;
    /** Callback when an item is selected */
    on_select: (item: SearchableItem) => void;
    /** Placeholder text */
    placeholder?: string;
}
/**
 * Props for SortableFieldItem component
 */
export interface SortableFieldItemProps {
    /** The item to display */
    item: FieldSelectorItem;
    /** Callback to remove the item */
    on_remove: () => void;
    /** Toggle expanded state */
    on_toggle_expand: () => void;
    /** Toggle field selection within group */
    on_toggle_field: (field_id: string) => void;
}
/**
 * Props for SortableFieldList component
 */
export interface SortableFieldListProps {
    /** Items to display */
    items: FieldSelectorItem[];
    /** Callback when items are reordered */
    on_reorder: (items: FieldSelectorItem[]) => void;
    /** Callback to remove an item */
    on_remove: (id: string) => void;
    /** Toggle group expansion */
    on_toggle_expand: (id: string) => void;
    /** Toggle field selection within a group */
    on_toggle_field: (group_id: string, field_id: string) => void;
}
/**
 * Props for SectionSidebar component
 */
export interface SectionSidebarProps {
    /** List of sections with selected items */
    sections: SelectionBySection[];
    /** Currently active/focused section */
    active_section: string | null;
    /** Callback when a section is clicked */
    on_section_click: (section_name: string) => void;
}
/**
 * Props for SelectedFieldsPanel component
 */
export interface SelectedFieldsPanelProps {
    /** All selected items */
    items: FieldSelectorItem[];
    /** Callback to remove an item */
    on_remove: (id: string) => void;
    /** Callback when items are reordered (globally, across sections) */
    on_reorder: (items: FieldSelectorItem[]) => void;
    /** Toggle group expansion */
    on_toggle_expand: (id: string) => void;
    /** Toggle field selection within a group */
    on_toggle_field: (group_id: string, field_id: string) => void;
}
//# sourceMappingURL=types.d.ts.map