/**
 * Role-based icon control utilities
 *
 * This module provides functions for resolving control visibility and
 * enabled states based on icons_behaviour configuration and active role.
 */
import type { IconsBehaviour, ControlName, RoleBehaviour, RoleControlBehaviour } from '../../../types/icons_behaviour.js';
/**
 * Get role behaviour for a specific role from icons_behaviour config
 */
export declare function get_role_behaviour(icons_behaviour: IconsBehaviour | undefined, role_id: string): RoleBehaviour | undefined;
/**
 * Resolve control visibility and editability for a role
 * Returns { visible: boolean, enabled: boolean } for each control
 */
export declare function resolve_role_controls(icons_behaviour: IconsBehaviour | undefined, role_id: string | undefined): Record<ControlName, RoleControlBehaviour>;
/**
 * Check if a control has a value/activity (for extraction and border logic)
 *
 * Different controls have different "has value" semantics:
 * - control_data_ok: has value when data_ok is 'ok' or true (approved state)
 * - control_skip: has value when skipped is true (marked as N/A)
 * - control_lock: has value when locked is true
 * - control_delete: has value when deleted is true
 * - control_visibility: has value when visibility is 'hidden'
 * - control_notes: has value when at least one note exists
 * - control_chat: has value when at least one chat message exists
 */
export declare function control_has_value(control: ControlName, metadata: {
    data_ok?: boolean | string;
    skipped?: boolean;
    complete?: boolean;
    locked?: boolean;
    deleted?: boolean;
    visibility?: 'visible' | 'hidden';
    notes?: unknown[];
    has_chat_messages?: boolean;
    chat_status?: 'none' | 'has_messages' | 'has_unread';
} | undefined): boolean;
/**
 * Determine if a control should be extracted (shown inline vs in kebab menu)
 *
 * Extraction logic:
 * 1. always_extracted: always extracted (shown inline, never in kebab)
 * 2. extracted_on_value: extracted when has value/activity
 * 3. Default: NOT extracted (will go in kebab if 2+ controls)
 *
 * Note: Data OK (control_data_ok) should always be in always_extracted by default.
 * Controls not extracted will be consolidated into kebab menu if 2+ remain.
 */
export declare function should_extract_control(control: ControlName, icons_behaviour: IconsBehaviour | undefined, has_value: boolean): boolean;
/**
 * Get the icon order from icons_behaviour or use default
 */
export declare function get_icon_order(icons_behaviour: IconsBehaviour | undefined): ControlName[];
/**
 * Determine if a control should have a border based on icons_behaviour config
 *
 * Simple logic:
 * - If icons_behaviour is provided, only controls in border_on have borders
 * - All other controls have no border (default: off)
 * - If icons_behaviour is not provided, fall back to showing borders (legacy behavior)
 *
 * @param control - The control name
 * @param icons_behaviour - The icons behaviour config
 * @param has_value - Unused, kept for API compatibility
 * @returns true if border should be shown
 */
export declare function should_show_border(control: ControlName, icons_behaviour: IconsBehaviour | undefined, has_value: boolean): boolean;
/**
 * Check if a control is enabled based on role settings
 * Falls back to individual settings if no role is active
 *
 * IMPORTANT: When fallback_visible is explicitly false (e.g., show_control_icons=false at field level),
 * that takes precedence over role-based settings. This ensures that fields with force-hidden
 * overrides don't display controls even when a role has controls enabled.
 */
export declare function is_control_visible(control: ControlName, icons_behaviour: IconsBehaviour | undefined, active_role: string | undefined, fallback_visible: boolean): boolean;
/**
 * Check if a control is enabled (editable/clickable) based on role settings
 * Falls back to individual settings if no role is active
 */
export declare function is_control_enabled(control: ControlName, icons_behaviour: IconsBehaviour | undefined, active_role: string | undefined, fallback_enabled: boolean): boolean;
/**
 * Resolved control state combining visibility and enabled
 */
export interface ResolvedControlState {
    visible: boolean;
    enabled: boolean;
    extracted: boolean;
    show_border: boolean;
    /** Allowed values for multi-value controls (from role config) */
    allowed_values?: string[];
}
/**
 * Get fully resolved control state for a single control
 */
export declare function resolve_control_state(control: ControlName, icons_behaviour: IconsBehaviour | undefined, active_role: string | undefined, metadata: {
    data_ok?: boolean | string;
    skipped?: boolean;
    locked?: boolean;
    deleted?: boolean;
    visibility?: 'visible' | 'hidden';
    notes?: unknown[];
    has_chat_messages?: boolean;
    chat_status?: 'none' | 'has_messages' | 'has_unread';
} | undefined, fallback: {
    visible: boolean;
    enabled: boolean;
}): ResolvedControlState;
/**
 * Resolve private file access permission based on role settings
 *
 * Returns true if the active role has `control_private_files.visible: true` in their controls.
 * This is used to control visibility of private file sections at the form level,
 * instead of per-field configuration.
 *
 * @param icons_behaviour - The icons behaviour / global settings config
 * @param role_id - The active role ID to check
 * @returns true if the role can access private files, false otherwise
 */
export declare function can_role_access_private_files(icons_behaviour: IconsBehaviour | undefined, role_id: string | undefined): boolean;
//# sourceMappingURL=role_utils.d.ts.map