/**
 * use_clarifications - Hook for reading/writing clarification state from form_data.
 *
 * Clarifications are stored at form_data['__clarifications'] as ClarificationItem[].
 * This follows the existing __files_* pattern for metadata stored alongside field values.
 */
import type { ClarificationItem, ClarificationResponse, ClarificationCounts } from '../../types/clarification.js';
/** Storage key in form_data */
export declare const CLARIFICATIONS_KEY = "__clarifications";
/** Return type for the use_clarifications hook */
export interface UseClarificationsReturn {
    /** All clarification items */
    items: ClarificationItem[];
    /** Get clarifications for a specific field */
    get_field_clarifications: (field_id: string) => ClarificationItem[];
    /** Get count of pending clarifications for a field */
    get_pending_count: (field_id: string) => number;
    /** Whether there are any pending clarifications */
    has_pending: boolean;
    /** Aggregate counts by status */
    counts: ClarificationCounts;
    /** Set of file_ids from active (pending/responded) clarification doc_references */
    error_file_ids: Set<string>;
    /** Add a new clarification item */
    add_clarification: (item: ClarificationItem) => void;
    /**
     * Upsert clarifications with deduplication.
     * For each item, matches against existing active items (pending|responded) by rule_id + target_field_id.
     * - Match found: updates in place (new description, details, references, options; resets status to pending)
     * - No match: appends as new item
     */
    upsert_clarifications: (new_items: ClarificationItem[]) => void;
    /** Submit a response to a clarification */
    update_response: (id: string, response: ClarificationResponse) => void;
    /** Resolve a clarification */
    resolve: (id: string) => void;
    /** Dismiss a clarification */
    dismiss: (id: string) => void;
    /** Re-open a resolved/dismissed clarification */
    reopen: (id: string) => void;
    /** Remove a doc reference from a clarification; resolves it if no references remain */
    remove_doc_reference: (clarification_id: string, file_id: string) => void;
}
/**
 * Extract clarification items from form_data.
 * Returns empty array if key doesn't exist or isn't an array.
 */
export declare function get_clarifications(form_data: Record<string, unknown>): ClarificationItem[];
/**
 * Hook for managing clarification state stored in form_data.
 *
 * @param form_data - Current form data object
 * @param on_form_data_change - Callback to update form_data (from FormView context)
 */
export declare function use_clarifications(form_data: Record<string, unknown>, on_form_data_change?: (data: Record<string, unknown>) => void): UseClarificationsReturn;
//# sourceMappingURL=use_clarifications.d.ts.map