/**
 * Types for HazoFieldLibrary component
 */
import type { FieldConfig } from '../_internal_form_set.js';
import type { EditorTheme } from '../shared/editor_theme/types.js';
import type { TemplateOption } from './components/template_loader_dialog.js';
/**
 * Database record for a library element
 */
export interface ElementRecord {
    id: string;
    scope_id: string | null;
    area: string;
    key: string;
    element: string;
    created_at: string;
    changed_at: string;
}
/**
 * Reference to a library field (used by group elements)
 */
export interface ReferenceElement {
    key: string;
}
/**
 * Parsed element data for a field
 */
export type FieldElementData = FieldConfig & {
    field_type: 'field';
};
/**
 * Parsed element data for a group
 */
export interface GroupElementData {
    id: string;
    label: string;
    field_type: 'group';
    description?: string;
    reference_element: ReferenceElement[];
}
/**
 * Union of parsed element data
 */
export type ElementData = FieldElementData | GroupElementData;
/**
 * Tab selection for Fields vs Groups
 */
export type LibraryTab = 'fields' | 'groups';
/**
 * Props for HazoFieldLibrary component
 */
export interface HazoFieldLibraryProps {
    /** Base URL for the hazo_connect REST API */
    api_base_url?: string;
    /** Database table name */
    table_name?: string;
    /** Scope ID for filtering elements */
    scope_id?: string | null;
    /** Additional CSS class */
    className?: string;
    /** Editor theme overrides */
    theme?: Partial<EditorTheme>;
    /** Template options for "Import from Template" button */
    templates?: TemplateOption[];
}
/**
 * Return type for the use_elements hook
 */
export interface UseElementsReturn {
    elements: ElementRecord[];
    loading: boolean;
    error: string | null;
    areas: string[];
    fetch_elements: (filter?: {
        area?: string;
    }) => Promise<void>;
    create_element: (area: string, key: string, element_json: string) => Promise<ElementRecord | null>;
    update_element: (id: string, updates: Partial<Pick<ElementRecord, 'area' | 'key' | 'element'>>) => Promise<ElementRecord | null>;
    delete_element: (id: string) => Promise<boolean>;
}
/**
 * Context value for the field library
 */
export interface FieldLibraryContextValue {
    active_tab: LibraryTab;
    set_active_tab: (tab: LibraryTab) => void;
    selected_id: string | null;
    set_selected_id: (id: string | null) => void;
    area_filter: string | null;
    set_area_filter: (area: string | null) => void;
    search_query: string;
    set_search_query: (query: string) => void;
    elements: UseElementsReturn;
    filtered_elements: ElementRecord[];
    templates?: TemplateOption[];
}
//# sourceMappingURL=types.d.ts.map