/**
 * Type definitions for the UnifiedFieldControls component
 *
 * This component provides consistent icon rendering across form view
 * and summary view with role-based visibility and kebab menu consolidation.
 */
import type { IconsBehaviour, ControlName } from '../../../types/icons_behaviour.js';
import type { ChatStatus, NoteEntry } from '../../hazo_collab_form_base.js';
import type { DataOkState } from '../../data_ok_multi_state.js';
export type { IconsBehaviour, ControlName, DataOkState, ChatStatus, NoteEntry };
/**
 * Control metadata for determining state/activity
 */
export interface ControlMetadata {
    /** Data OK state */
    data_ok?: boolean | DataOkState;
    /** Skip/Not Applicable state */
    skipped?: boolean;
    /** Complete/addressed state */
    complete?: boolean;
    /** Lock state */
    locked?: boolean;
    /** Soft delete state */
    deleted?: boolean;
    /** Visibility state */
    visibility?: 'visible' | 'hidden';
    /** Notes array */
    notes?: NoteEntry[];
    /** Number of notes (alternative to notes array) */
    notes_count?: number;
    /** @deprecated Use chat_status instead */
    has_chat_messages?: boolean;
    /** Chat status for visual indicator */
    chat_status?: ChatStatus;
    /** Whether this field/group has validation_rules configured */
    has_validation_rules?: boolean;
}
/**
 * Control callbacks - all optional based on which controls are enabled
 */
export interface ControlCallbacks {
    /** Callback when data OK value changes */
    on_data_ok_change?: (value: boolean | DataOkState) => void;
    /** Callback when skip/N/A state changes */
    on_skip_change?: (skipped: boolean) => void;
    /** Callback when complete checkbox changes */
    on_complete_change?: (complete: boolean) => void;
    /** Callback when notes change */
    on_notes_change?: (notes: NoteEntry[]) => void;
    /** Callback when chat icon is clicked */
    on_chat_click?: () => void;
    /** Callback when visibility changes */
    on_visibility_change?: (visibility: 'visible' | 'hidden') => void;
    /** Callback when lock state changes */
    on_lock_change?: (locked: boolean) => void;
    /** Callback when delete is triggered */
    on_delete?: () => void;
    /** Callback when edit field icon is clicked */
    on_edit_field?: () => void;
    /** Callback when edit group icon is clicked */
    on_edit_group?: () => void;
    /** Callback when delete field icon is clicked */
    on_delete_field?: () => void;
    /** Callback when edit elements icon is clicked */
    on_edit_elements?: () => void;
    /** Callback when re-validate icon is clicked */
    on_revalidate?: () => void;
}
/**
 * Control configuration options
 */
export interface ControlConfig {
    /** Data OK mode: checkbox or multi-state */
    data_ok_mode?: 'checkbox' | 'multi_state';
    /** States to hide from data OK selection */
    data_ok_hidden_states?: DataOkState[];
    /** Chat group ID for HazoChat integration */
    chat_group_id?: string;
    /** Current user for notes/chat attribution */
    current_user?: {
        id?: string;
        name: string;
        email: string;
        profile_image?: string;
    };
    /** Field data ID for notes/chat */
    field_data_id?: string;
    /** Field label for display */
    label?: string;
    /** Chat API base URL */
    chat_api_base_url?: string;
    /** Chat timezone */
    chat_timezone?: string;
    /** Chat read-only mode */
    chat_read_only?: boolean;
    /** Chat log polling - when true, logs polling activity to console (default: false) */
    chat_log_polling?: boolean;
    /** Notes panel presentation style */
    notes_panel_style?: 'popover' | 'slide_panel';
    /** Notes panel background color (Tailwind class) */
    notes_background_color?: string;
    /** Notes save behavior */
    notes_save_mode?: 'explicit' | 'auto';
    /** Notes management mode: 'controlled' or 'api' */
    notes_mode?: 'controlled' | 'api';
    /** Auto-action settings for data OK changes */
    auto_actions?: DataOkAutoActions;
}
/**
 * Fallback visibility/enabled settings for when no icons_behaviour is provided
 */
export interface FallbackSettings {
    data_ok?: boolean;
    skip?: boolean;
    complete?: boolean;
    notes?: boolean;
    chat?: boolean;
    visibility?: boolean;
    lock?: boolean;
    delete?: boolean;
    add_elements?: boolean;
    edit_field?: boolean;
    edit_group?: boolean;
    delete_field?: boolean;
    edit_elements?: boolean;
    private_files?: boolean;
    revalidate?: boolean;
}
/**
 * Auto-action settings for data OK changes
 */
export interface DataOkAutoActions {
    /** Auto-hide field when data_ok is set to 'ok' */
    on_data_ok_hidden?: boolean;
    /** Auto-lock field when data_ok is set to 'ok' */
    on_data_ok_protected?: boolean;
}
/**
 * Props for the UnifiedFieldControls component
 */
export interface UnifiedFieldControlsProps {
    /**
     * Field identifier for accessibility and callbacks
     */
    field_id: string;
    /**
     * Icons behaviour configuration
     * Controls which icons are visible, their order, border settings, and role-based visibility
     */
    icons_behaviour?: IconsBehaviour;
    /**
     * Active role ID for role-based control resolution
     * Must match a role_id in icons_behaviour.roles
     */
    active_role?: string;
    /**
     * Metadata containing current state of all controls
     */
    metadata: ControlMetadata;
    /**
     * Callbacks for control interactions
     */
    callbacks: ControlCallbacks;
    /**
     * Additional configuration options
     */
    config?: ControlConfig;
    /**
     * Fallback visibility for controls when no icons_behaviour is provided
     * Determines which controls are visible by default
     */
    fallback_visibility?: FallbackSettings;
    /**
     * Fallback enabled state for controls when no icons_behaviour is provided
     * Determines which controls are clickable/editable by default
     */
    fallback_enabled?: FallbackSettings;
    /**
     * Data OK auto-action settings
     */
    auto_actions?: DataOkAutoActions;
    /**
     * Custom className for the container
     */
    class_name?: string;
    /**
     * Number of pending clarifications for this field (shows red badge when > 0)
     */
    clarification_count?: number;
    /**
     * Callback when clarification badge is clicked (opens dialog)
     */
    on_clarification_click?: () => void;
}
/**
 * Resolved state for a single control
 */
export interface ResolvedControlState {
    /** Whether the control is visible */
    visible: boolean;
    /** Whether the control is interactive/clickable */
    enabled: boolean;
    /** Whether the control should be shown inline (vs in kebab) */
    extracted: boolean;
    /** Whether the control should have a border */
    show_border: boolean;
    /** Whether the control currently has a value/activity */
    has_value: boolean;
    /** Allowed values for multi-value controls (from role config) */
    allowed_values?: string[];
}
/**
 * Result of control resolution for all controls
 */
export interface ControlResolutionResult {
    /** Resolved state for each control */
    controls: Record<ControlName, ResolvedControlState>;
    /** Ordered list of control names for rendering */
    icon_order: ControlName[];
    /** Controls that should be shown inline */
    inline_controls: ControlName[];
    /** Controls that should be in kebab menu */
    kebab_controls: ControlName[];
    /** Whether to show the kebab menu */
    show_kebab: boolean;
    /** Whether kebab has an indicator (notes/chat activity) */
    has_kebab_indicator: boolean;
    /** Kebab indicator status for coloring */
    kebab_indicator_status: 'unread' | 'messages' | 'notes' | null;
}
/**
 * Props for the KebabMenu sub-component
 */
export interface KebabMenuProps {
    /** Controls to show in the menu */
    controls: ControlName[];
    /** Resolved control states */
    control_states: Record<ControlName, ResolvedControlState>;
    /** Control metadata */
    metadata: ControlMetadata;
    /** Control callbacks */
    callbacks: ControlCallbacks;
    /** Control config */
    config?: ControlConfig;
    /** Whether indicator should show */
    has_indicator: boolean;
    /** Indicator status for coloring */
    indicator_status: 'unread' | 'messages' | 'notes' | null;
    /** Field ID for callbacks */
    field_id: string;
    /** Custom className */
    class_name?: string;
}
//# sourceMappingURL=types.d.ts.map