/**
 * Canonical type definitions for field metadata and state
 *
 * These types are shared across FormSet and Summary components.
 * Use FieldMetadataInput for external/consumer-facing APIs.
 * Use FieldMetadata for internal normalized state.
 */
import type { NoteEntry, ChatStatus, FileData } from '../../hazo_collab_form_base.js';
/**
 * Data OK state values for multi-state mode
 */
export type DataOkState = 'ok' | 'not_ok' | 'pending';
/**
 * Confirm state for prefilled field values.
 *
 * Lifecycle:
 *  - 'prefilled': Value was auto-filled (e.g. via LLM extraction); awaiting human confirmation.
 *  - 'confirmed': Human explicitly confirmed the prefilled value is correct.
 *  - 'edited': Human changed the prefilled value; transitions back to 'prefilled' if value
 *    reverts to the original snapshot.
 */
export type ConfirmState = 'prefilled' | 'confirmed' | 'edited';
/**
 * Metadata for a single field's control states
 * This is the canonical internal format.
 *
 * For input that may come from consuming apps with alternative formats,
 * use FieldMetadataInput and normalize_field_metadata().
 */
export interface FieldMetadata {
    /**
     * Data OK state
     * - boolean: For checkbox mode (true = OK, false = not OK)
     * - DataOkState: For multi-state mode ('ok' | 'not_ok' | 'pending')
     */
    data_ok?: boolean | DataOkState;
    /**
     * Notes attached to this field
     */
    notes?: NoteEntry[];
    /**
     * Whether field has unread chat messages
     * @deprecated Use chat_status instead
     */
    has_chat_messages?: boolean;
    /**
     * Chat status for visual indicator
     * - 'none': No messages, default color
     * - 'has_messages': Has messages (all read), orange indicator
     * - 'has_unread': Has unread messages, red indicator
     */
    chat_status?: ChatStatus;
    /**
     * Lock state - when true, field is read-only
     */
    locked?: boolean;
    /**
     * Visibility state
     * - 'visible': Field is visible to all users
     * - 'hidden': Field is hidden from responders
     */
    visibility?: 'visible' | 'hidden';
    /**
     * Whether field is marked for deletion (soft delete)
     */
    deleted?: boolean;
    /**
     * Whether field is marked as skipped/not applicable (N/A)
     */
    skipped?: boolean;
    /**
     * Needs correction flag
     */
    needs_correction?: boolean;
    /**
     * Public files attached to this field
     */
    files?: FileData[];
    /**
     * Private files attached to this field
     */
    private_files?: FileData[];
    /**
     * Whether this field has active clarification issues.
     * Persisted across sessions so the badge shows even before clarification data loads.
     */
    has_clarification?: boolean;
    /**
     * Confirm state for prefilled field values (H.7).
     * Set by the consumer when a value was auto-filled and needs human review.
     * The form auto-transitions to 'edited' when the value changes from the prefill snapshot.
     */
    confirm_state?: ConfirmState;
}
/**
 * Input type for field metadata that accepts alternative formats.
 *
 * Consuming apps can use either naming convention:
 *
 * **Visibility:**
 * - `visibility: 'visible' | 'hidden'` (preferred)
 * - `hidden: boolean` (legacy/alternative)
 *
 * **Data OK:**
 * - `data_ok: boolean | DataOkState` (preferred, snake_case)
 * - `dataOk: boolean | DataOkState` (alternative, camelCase)
 *
 * @example
 * ```typescript
 * // All formats work:
 * const meta1: FieldMetadataInput = { visibility: 'hidden', data_ok: 'ok' };
 * const meta2: FieldMetadataInput = { hidden: true, dataOk: 'ok' };
 *
 * // Normalize before using internally:
 * const normalized = normalize_field_metadata(meta2);
 * // normalized = { visibility: 'hidden', data_ok: 'ok' }
 * ```
 */
export interface FieldMetadataInput extends Omit<FieldMetadata, 'visibility' | 'data_ok'> {
    /**
     * Visibility state (preferred format)
     */
    visibility?: 'visible' | 'hidden';
    /**
     * Alternative to visibility - when true, field is hidden
     * @deprecated Use `visibility: 'hidden'` instead
     */
    hidden?: boolean;
    /**
     * Data OK state (preferred format, snake_case)
     */
    data_ok?: boolean | DataOkState;
    /**
     * Data OK state (alternative format, camelCase)
     * @deprecated Use `data_ok` (snake_case) instead
     */
    dataOk?: boolean | DataOkState;
}
/**
 * Normalized field metadata result
 * Returned by normalize_field_metadata_input
 */
export interface NormalizedFieldMetadata {
    visibility?: 'visible' | 'hidden';
    locked?: boolean;
    data_ok?: boolean | DataOkState;
    deleted?: boolean;
    skipped?: boolean;
    has_clarification?: boolean;
}
/**
 * Change event for field metadata updates
 * Used by on_field_metadata_change callback
 */
export interface FieldMetadataChange {
    field_id: string;
    changes: Partial<FieldMetadata>;
}
//# sourceMappingURL=types.d.ts.map