/**
 * Shared hook that extracts ALL common setup logic from form field components.
 *
 * Every form component (inputbox, textarea, checkbox, combo, radio, date)
 * duplicates ~200 lines of identical setup: file state, validation,
 * chat hook, visibility check, disabled state, additional entry logic,
 * error merging, data_ok handler, and imperative handle.
 *
 * This hook consolidates all of that into a single reusable hook.
 */
import React from 'react';
import { CollabFormFieldContainer, type CollabFormFieldBaseProps, type NoteEntry } from '../hazo_collab_form_base.js';
import type { FormFileAttachment } from '../../types/file_attachment.js';
import type { FileManagerCallbacks } from '../../types/file_manager.js';
import type { ClarificationItem, ClarificationCallbacks } from '../../types/clarification.js';
import type { DataOkState } from '../data_ok_multi_state.js';
/** Props type for CollabFormFieldContainer (excluding children) */
type ContainerPropsType = Omit<Parameters<typeof CollabFormFieldContainer>[0], 'children'>;
/**
 * Result returned by use_base_form_field
 */
export interface BaseFormFieldResult {
    /** Ref for the underlying DOM element (input, textarea, button, etc.) */
    component_ref: React.RefObject<any>;
    /** Current files (controlled or internal) */
    current_files: FormFileAttachment[];
    /** Internal file setter (for controlled/uncontrolled file state) */
    set_internal_files: React.Dispatch<React.SetStateAction<FormFileAttachment[]>>;
    /** Combined display error (external error || validation error) */
    display_error: string | undefined;
    /** Setter for internal validation error */
    set_validation_error: React.Dispatch<React.SetStateAction<string | null>>;
    /** Whether the field should be disabled (chat active || locked || skipped) */
    is_field_disabled: boolean;
    /** Whether visibility === 'hidden' */
    is_hidden: boolean;
    /** Whether to return null (responder + hidden) */
    should_hide: boolean;
    /** Whether to show the add entry button */
    show_add_entry: boolean;
    /** Unified handler for data_ok changes (both checkbox and multi-state) */
    handle_data_ok_unified_change: (value: boolean | DataOkState) => void;
    /** Stable callback for files change (handles internal/controlled state) */
    handle_files_change: (new_files: FormFileAttachment[]) => void;
    /** Final computed field ID */
    field_id_final: string;
    /** Chat icon click handler */
    handle_chat_icon_click: () => void;
    /** Chat close handler */
    handle_chat_close: () => void;
    /** Whether chat is currently open */
    chat_is_open: boolean;
    /** Whether chat is effectively disabled (hidden field, etc.) */
    is_chat_effectively_disabled: boolean;
    /** Container props for CollabFormFieldContainer */
    container_props: ContainerPropsType;
    /** Label props for CollabFormFieldLabel */
    label_props: {
        field_id_final: string;
        label: string;
        tooltip: any;
        label_class_name?: string;
        required?: boolean;
        visibility?: 'visible' | 'hidden';
        locked?: boolean;
        label_actions?: React.ReactNode;
        clarification_count?: number;
        has_clarification?: boolean;
        file_error_count?: number;
        on_file_error_click?: () => void;
    };
    /** Controls props for UnifiedFieldControls */
    controls_props: {
        field_id: string;
        icons_behaviour: any;
        active_role: any;
        metadata: {
            data_ok: any;
            skipped: boolean;
            complete: boolean | undefined;
            locked: boolean;
            deleted: boolean;
            visibility: 'visible' | 'hidden';
            notes: NoteEntry[] | undefined;
            chat_status: any;
        };
        callbacks: {
            on_data_ok_change: (value: boolean | DataOkState) => void;
            on_skip_change: ((skipped: boolean) => void) | undefined;
            on_complete_change: ((complete: boolean) => void) | undefined;
            on_notes_change: ((notes: NoteEntry[]) => void) | undefined;
            on_chat_click: () => void;
            on_visibility_change: ((visibility: 'visible' | 'hidden') => void) | undefined;
            on_lock_change: ((locked: boolean) => void) | undefined;
            on_delete: (() => void) | undefined;
        };
        config: {
            data_ok_mode: 'checkbox' | 'multi_state';
            data_ok_hidden_states: DataOkState[] | undefined;
            chat_group_id: string | undefined;
            current_user: any;
            field_data_id: string;
            label: string;
            chat_api_base_url: string | undefined;
            chat_timezone: string | undefined;
            chat_read_only: boolean | undefined;
            notes_panel_style: any;
            notes_background_color: string | undefined;
            notes_save_mode: any;
        };
        fallback_visibility: {
            data_ok: boolean;
            skip: boolean;
            notes: boolean;
            chat: boolean;
            visibility: boolean;
            lock: boolean;
            delete: boolean;
        };
        fallback_enabled: {
            data_ok: boolean;
            skip: boolean;
            notes: boolean;
            chat: boolean;
            visibility: boolean;
            lock: boolean;
            delete: boolean;
        };
        clarification_count?: number;
        on_clarification_click?: () => void;
    };
    /** File upload section props */
    file_upload_props: {
        field_id_final: string;
        accept_files_public: boolean;
        accept_files_private: boolean;
        files_dir?: string;
        default_file_accordion_open?: boolean;
        max_size?: number;
        min_files?: number;
        max_files?: number;
        file_accept?: string;
        file_processor?: any;
        file_validator?: any;
        file_manager?: FileManagerCallbacks;
        files: FormFileAttachment[];
        on_files_change: (new_files: FormFileAttachment[]) => void;
        component_ref: React.RefObject<any>;
        private_files_permission?: string;
        can_access_private_files?: boolean;
        private_files?: FormFileAttachment[];
        on_private_files_change?: (files: FormFileAttachment[]) => void;
        validating_file_ids?: Set<string>;
        error_file_ids?: Set<string>;
        passed_file_ids?: Set<string>;
        error_file_details?: Record<string, string[]>;
        clarification_items?: ClarificationItem[];
        clarification_callbacks?: ClarificationCallbacks;
        private_files_class_name?: string;
    };
    /** Reference tag props */
    reference_tag_props: {
        reference_data?: any;
        reference_value?: any;
        reference_label?: string;
        reference_tag_background_color?: string;
        on_reference_delete?: (index: number) => void;
    };
    /** Error display props */
    error_props: {
        field_id_final: string;
        error: string | undefined;
        error_class_name: string | undefined;
    };
    /** Additional entry props */
    entry_props: {
        show_add_entry: boolean;
        label: string;
        field_id: string;
        on_add_entry: ((field_id: string) => void) | undefined;
        is_additional_entry: boolean | undefined;
        on_delete_entry: ((field_id: string) => void) | undefined;
        action_buttons_borderless: boolean | undefined;
    };
    /** User role */
    user_role: 'author' | 'responder';
    /** Width class name for field container */
    field_width_class_name: string | undefined;
    /** Whether field is locked */
    locked: boolean;
    /** Whether field is skipped */
    skipped: boolean;
    /** Class name */
    className: string | undefined;
    /** When true, the field input should show a light pink background. */
    show_required_highlight: boolean;
}
/**
 * Hook that consolidates all common form field component setup.
 *
 * @param props - The full component props (extends CollabFormFieldBaseProps)
 * @param ref - The forwarded ref
 * @param element_type_name - Used for display name / typing context only
 */
export declare function use_base_form_field<TRef>(props: CollabFormFieldBaseProps & {
    disabled?: boolean;
    className?: string;
    id?: string;
    files?: FormFileAttachment[];
    on_files_change?: (files: FormFileAttachment[]) => void;
    [key: string]: any;
}, ref: React.ForwardedRef<TRef>): BaseFormFieldResult;
export {};
//# sourceMappingURL=use_base_form_field.d.ts.map