import * as _angular_core from '@angular/core';
import { TemplateRef, EventEmitter } from '@angular/core';
import { AXEvent, AXHtmlEvent, AXValueChangedEvent } from '@acorex/cdk/common';
import { AXDropListDroppedEvent } from '@acorex/cdk/drag-drop';

/**
 * TreeView Component - Design Tokens
 *
 * The component supports the following CSS custom properties (design tokens):
 *
 * **Layout & Spacing:**
 * - `--ax-comp-tree-view-indent-size`: Indentation size for each tree level.
 *   Default: `12px`
 * - `--ax-comp-tree-view-node-margin`: Vertical margin between nodes.
 *   Default: `0.125rem`
 *
 * **Node Styling:**
 * - `--ax-comp-tree-view-node-border-radius`: Border radius for tree nodes.
 *   Default: `6px`
 * - `--ax-comp-tree-view-node-hover-bg`: Background color on node hover.
 *   Default: `rgba(var(--ax-sys-color-on-lightest-surface), 0.04)`
 * - `--ax-comp-tree-view-node-selected-bg`: Background color for selected nodes.
 *   Default: `rgba(var(--ax-sys-color-primary-500), 0.12)`
 *
 * **Tree Lines (with-line look):**
 * - `--ax-comp-tree-view-line-color`: Color for tree structure lines.
 *   Default: `rgba(var(--ax-sys-color-on-lightest-surface), 0.15)`
 *
 * **Drag & Drop:**
 * - `--ax-comp-tree-view-drag-preview-opacity`: Opacity of dragged element preview.
 *   Default: `0.9`
 * - `--ax-comp-tree-view-drag-placeholder-bg`: Background for drag placeholder.
 *   Default: `rgba(var(--ax-sys-color-on-lightest-surface), 0.02)`
 * - `--ax-comp-tree-view-drop-active-bg`: Background when hovering over valid drop zone.
 *   Default: `rgba(var(--ax-sys-color-primary-500), 0.08)`
 * - `--ax-comp-tree-view-drop-active-outline`: Outline color for active drop zones.
 *   Default: `rgba(var(--ax-sys-color-primary-500), 0.3)`
 *
 * **Dynamic Tokens (set via TypeScript):**
 * - `--ax-tree-view-indent-size`: Dynamically set from `indentSize` input
 * - `--ax-tree-view-line-offset`: Dynamically calculated as `indentSize / 2`
 * - `--ax-tree-view-line-color`: Optional override for line color
 *
 * @example
 * ```css
 * // Customize tree appearance
 * ax-tree-view {
 *   --ax-comp-tree-view-indent-size: 16px;
 *   --ax-comp-tree-view-node-selected-bg: rgba(var(--ax-sys-color-primary-600), 0.15);
 *   --ax-comp-tree-view-line-color: rgba(var(--ax-sys-color-on-lightest-surface), 0.1);
 *   --ax-comp-tree-view-node-hover-bg: rgba(var(--ax-sys-color-primary-500), 0.06);
 * }
 * ```
 *
 * @remarks
 * All color tokens use Acorex design system variables (`--ax-sys-color-*`) for automatic
 * light/dark mode support. Colors adapt based on the active theme without additional configuration.
 */
interface AXTreeViewBeforeDropEvent extends AXEvent {
    movedNode: AXTreeViewNode;
    previousParent?: AXTreeViewNode;
    currentParent?: AXTreeViewNode;
    previousIndex: number;
    currentIndex: number;
    canceled: boolean;
}
/**
 * Tree view node interface.
 *
 * By default, nodes should have the following structure:
 * ```typescript
 * {
 *   id: string;              // Unique identifier for the node
 *   title: string;           // Display text for the node
 *   tooltip?: string;        // Optional tooltip text
 *   icon?: string;           // Optional icon class name
 *   expanded?: boolean;      // Whether the node is expanded
 *   selected?: boolean;      // Whether the node is selected
 *   indeterminate?: boolean; // Whether the checkbox is in indeterminate state
 *   disabled?: boolean;      // Whether the node is disabled
 *   hidden?: boolean;        // Whether the node is hidden
 *   children?: AXTreeViewNode[]; // Child nodes
 *   childrenCount?: number;  // Count of children (for lazy loading)
 *   data?: unknown;          // Optional custom data
 * }
 * ```
 *
 * However, you can use custom field names by providing field name inputs
 * (idField, titleField, etc.) to the component. The component will then
 * use those field names to access node properties.
 */
interface AXTreeViewNode {
    [key: string]: unknown;
}
interface AXTreeViewNodeToggleEvent extends AXHtmlEvent {
    node: AXTreeViewNode;
}
interface AXTreeViewNodeSelectEvent extends AXHtmlEvent {
    node: AXTreeViewNode;
}
interface AXTreeViewNodeDoubleClickEvent extends AXHtmlEvent {
    node: AXTreeViewNode;
}
interface AXTreeViewNodeClickEvent extends AXHtmlEvent {
    node: AXTreeViewNode;
}
interface AXTreeViewSelectionChangeEvent extends AXEvent {
    selectedNodes: AXTreeViewNode[];
}
interface AXTreeViewDropEvent extends AXEvent {
    node: AXTreeViewNode;
    previousParent?: AXTreeViewNode;
    currentParent?: AXTreeViewNode;
    previousIndex: number;
    currentIndex: number;
}
interface AXTreeViewItemTemplateContext {
    $implicit: AXTreeViewNode;
    node: AXTreeViewNode;
    level: number;
    expanded: boolean;
    childrenCount: number;
    loading: boolean;
    /** Whether the node is effectively disabled (considering inheritance from parents) */
    disabled: boolean;
    /** Whether checkbox should be shown for this node */
    showCheckbox: boolean;
    /** Checkbox value (null for indeterminate, boolean for checked/unchecked) */
    checkboxValue: boolean | null;
    /** Whether checkbox is in indeterminate state */
    checkboxIndeterminate: boolean;
    /** Handler function for checkbox value changes */
    onCheckboxChange: (event: {
        value: boolean | null;
        isUserInteraction: boolean;
    }) => void;
    /** Whether drag is enabled for this tree (dragBehavior !== 'none') */
    dragEnabled: boolean;
    /** The drag area mode: 'handler' (drag handle) or 'item' (full item) */
    dragArea: AXTreeViewDragArea;
    /** Whether the drag handle should be shown (dragArea === 'handler' && dragBehavior !== 'none') */
    showDragHandle: boolean;
}
type AXTreeViewViewLook = 'default' | 'card' | 'with-line';
type AXTreeViewDragArea = 'handler' | 'item';
type AXTreeViewDragBehavior = 'none' | 'order-only' | 'move' | 'both';
type AXTreeViewSelectMode = 'none' | 'single' | 'multiple';
/**
 * Selection behavior mode for tree nodes.
 *
 * Controls how node selection behaves in the tree:
 * - **'all'**: No restrictions or special behavior. Any node can be selected independently.
 * - **'intermediate'**: When children are selected, parent nodes show indeterminate state.
 *   If all children are selected, parent becomes selected; if some are selected, parent shows indeterminate.
 * - **'leaf'**: Only leaf nodes (nodes with no children) can be selected. Parent nodes cannot be selected.
 * - **'nested'**: Selecting a parent node automatically selects all its children (cascading selection).
 * - **'intermediate-nested'**: Combines both behaviors - selecting parent selects children AND children selection affects parent state.
 *
 * @example
 * ```typescript
 * // Allow any node to be selected
 * <ax-tree-view [selectionBehavior]="'all'" />
 *
 * // Only leaf nodes can be selected
 * <ax-tree-view [selectionBehavior]="'leaf'" />
 *
 * // Parent shows indeterminate when children are selected
 * <ax-tree-view [selectionBehavior]="'intermediate'" />
 *
 * // Selecting parent selects all children
 * <ax-tree-view [selectionBehavior]="'nested'" />
 *
 * // Both: selecting parent selects children AND children affect parent state
 * <ax-tree-view [selectionBehavior]="'intermediate-nested'" />
 * ```
 */
type AXTreeViewSelectionBehavior = 'all' | 'intermediate' | 'leaf' | 'nested' | 'intermediate-nested';
/**
 * Function type for lazy loading tree nodes
 */
type AXTreeViewCallback = (id?: string) => AXTreeViewNode[] | Promise<AXTreeViewNode[]>;
/**
 * Data source type - can be static array or lazy loading function
 */
type AXTreeViewDataSource = AXTreeViewNode[] | AXTreeViewCallback;
/**
 * Flat node representation for keyboard navigation
 */
interface AXTreeViewFlatNode {
    node: AXTreeViewNode;
    level: number;
    parent?: AXTreeViewNode;
}
/**
 * Children selection state for parent node calculation
 */
interface AXTreeViewChildrenSelectionState {
    allSelected: boolean;
    someSelected: boolean;
}

declare class AXTreeViewComponent {
    #private;
    private readonly treeService;
    private readonly platformService;
    private readonly destroyRef;
    /** Tree data source - can be static array or lazy loading function */
    readonly datasource: _angular_core.ModelSignal<AXTreeViewDataSource>;
    /** Selection mode: 'single' (click to select) or 'multiple' (checkbox selection). Default: `'single'`. In multiple mode, checkboxes are automatically shown. */
    readonly selectMode: _angular_core.InputSignal<AXTreeViewSelectMode>;
    /** Selection behavior: 'all' (select anything, no special behavior), 'intermediate' (parent indeterminate state when children selected), 'leaf' (only leaf nodes selectable), 'nested' (selecting parent selects all children). Default: `'intermediate'` */
    readonly selectionBehavior: _angular_core.InputSignal<AXTreeViewSelectionBehavior>;
    /** Drag area: 'handler' (drag handle), 'item' (entire item). Default: `'handler'` */
    readonly dragArea: _angular_core.InputSignal<AXTreeViewDragArea>;
    /** Drag behavior: 'none' (disabled), 'order-only' (reorder only), 'move' (move between parents), 'both' (allow both). Default: `'none'` */
    readonly dragBehavior: _angular_core.InputSignal<AXTreeViewDragBehavior>;
    /** Whether to show icons. Default: `true` */
    readonly showIcons: _angular_core.InputSignal<boolean>;
    /** Whether to show children count badge. Default: `true` */
    readonly showChildrenBadge: _angular_core.InputSignal<boolean>;
    /** Custom icon for expanded nodes. Default: `'fa-solid fa-chevron-down'` */
    readonly expandedIcon: _angular_core.InputSignal<string>;
    /** Custom icon for collapsed nodes. Default: `'fa-solid fa-chevron-right'` */
    readonly collapsedIcon: _angular_core.InputSignal<string>;
    /** Indent size in pixels for each level. Default: `16` */
    readonly indentSize: _angular_core.InputSignal<number>;
    /** Visual style variant. Default: `'default'` */
    readonly look: _angular_core.InputSignal<AXTreeViewViewLook>;
    /** Custom template for tree items. Default: `undefined` */
    readonly nodeTemplate: _angular_core.InputSignal<TemplateRef<AXTreeViewItemTemplateContext>>;
    /** Field name for node ID. Default: `'id'` */
    readonly idField: _angular_core.InputSignal<string>;
    /** Field name for node title. Default: `'title'` */
    readonly titleField: _angular_core.InputSignal<string>;
    /** Field name for node tooltip. Default: `'tooltip'` */
    readonly tooltipField: _angular_core.InputSignal<string>;
    /** Field name for node icon. Default: `'icon'` */
    readonly iconField: _angular_core.InputSignal<string>;
    /** Field name for expanded state. Default: `'expanded'` */
    readonly expandedField: _angular_core.InputSignal<string>;
    /** Field name for selected state. Default: `'selected'` */
    readonly selectedField: _angular_core.InputSignal<string>;
    /** Field name for indeterminate state. Default: `'indeterminate'` */
    readonly indeterminateField: _angular_core.InputSignal<string>;
    /** Field name for disabled state. Default: `'disabled'` */
    readonly disabledField: _angular_core.InputSignal<string>;
    /** Field name for hidden state. Default: `'hidden'` */
    readonly hiddenField: _angular_core.InputSignal<string>;
    /** Field name for children array. Default: `'children'` */
    readonly childrenField: _angular_core.InputSignal<string>;
    /** Field name for children count. Default: `'childrenCount'` */
    readonly childrenCountField: _angular_core.InputSignal<string>;
    /** Field name for custom data. Default: `'data'` */
    readonly dataField: _angular_core.InputSignal<string>;
    /** Whether disabled state is inherited from parent nodes. Default: `true`. */
    readonly inheritDisabled: _angular_core.InputSignal<boolean>;
    /** Whether double-click on node content toggles expand/collapse. Default: `true`. */
    readonly expandOnDoubleClick: _angular_core.InputSignal<boolean>;
    /** Duration in milliseconds for detecting double-clicks. Default: `50`. */
    readonly doubleClickDuration: _angular_core.InputSignal<number>;
    /** Duration in milliseconds for detecting double-clicks. Default: `50`. */
    readonly tooltipDelay: _angular_core.InputSignal<number>;
    /** Emitted before a drop operation - set canceled to true to prevent drop */
    readonly onBeforeDrop: _angular_core.OutputEmitterRef<AXTreeViewBeforeDropEvent>;
    /** Emitted when a node is toggled (expanded/collapsed) */
    readonly onNodeToggle: _angular_core.OutputEmitterRef<AXTreeViewNodeToggleEvent>;
    /** Emitted when a node is selected/deselected */
    readonly onNodeSelect: _angular_core.OutputEmitterRef<AXTreeViewNodeSelectEvent>;
    /** Emitted when a node is double-clicked */
    onNodeDoubleClick: EventEmitter<AXTreeViewNodeDoubleClickEvent>;
    /** Emitted when a node is double-clicked */
    readonly onNodeClick: _angular_core.OutputEmitterRef<AXTreeViewNodeClickEvent>;
    /** Emitted when selection changes - returns all currently selected nodes */
    readonly onSelectionChange: _angular_core.OutputEmitterRef<AXTreeViewSelectionChangeEvent>;
    /** Emitted when nodes are reordered within the same parent */
    readonly onOrderChange: _angular_core.OutputEmitterRef<AXTreeViewDropEvent>;
    /** Emitted when a node is moved to a different parent */
    readonly onMoveChange: _angular_core.OutputEmitterRef<AXTreeViewDropEvent>;
    /** Emitted for any item change (order or move) */
    readonly onItemsChange: _angular_core.OutputEmitterRef<AXTreeViewDropEvent>;
    /** Internal signal for tree nodes */
    protected readonly nodes: _angular_core.WritableSignal<AXTreeViewNode[]>;
    /** Internal signal for tracking loading state of individual nodes */
    protected readonly loadingNodes: _angular_core.WritableSignal<Set<string>>;
    /** Signal for tracking root/tree-level loading state (used by reloadData) */
    private readonly _isLoading;
    /** Public readonly signal for tree loading state - can be used in templates */
    readonly isLoading: _angular_core.Signal<boolean>;
    /** Currently focused node ID for keyboard navigation */
    protected readonly focusedNodeId: _angular_core.WritableSignal<string>;
    /** RTL detection signal */
    protected readonly isRtl: _angular_core.WritableSignal<boolean>;
    /** active node id */
    protected readonly activeNodeId: _angular_core.WritableSignal<string>;
    /** Computed chevron icons that flip for RTL */
    protected readonly directionExpandedIcon: _angular_core.Signal<string>;
    protected readonly directionCollapsedIcon: _angular_core.Signal<string>;
    /** Flag to prevent infinite loops when syncing datasource */
    private isUpdatingFromDatasource;
    /** Computed to check if datasource is a function */
    private readonly isLazyDataSource;
    /** Computed: Returns true when selection is restricted to leaf nodes only */
    protected readonly isLeafOnlyMode: _angular_core.Signal<boolean>;
    /** Computed: Returns true when selecting a parent automatically selects all its children */
    protected readonly cascadesToChildren: _angular_core.Signal<boolean>;
    /** Computed: Returns true when parent nodes show indeterminate state based on children selection */
    protected readonly hasIntermediateState: _angular_core.Signal<boolean>;
    /** Computed: Returns true when drag handle should be shown */
    protected readonly shouldShowDragHandle: _angular_core.Signal<boolean>;
    /** Signal to track if double-click output has subscribers */
    private readonly hasDoubleClickSubscribers;
    /**
     * Returns true if double-click output has no subscribers (should disable directive)
     * Uses a computed signal that checks if EventEmitter has observers
     * If no subscribers AND expandOnDoubleClick is false, disable the directive (return true)
     * If has subscribers OR expandOnDoubleClick is true, enable the directive (return false)
     */
    protected readonly isDoubleClickDisabled: _angular_core.Signal<boolean>;
    /** Check EventEmitter observers and update signal */
    private checkDoubleClickSubscribers;
    /**
     * Get a property value from a node using the configured field name
     */
    protected getNodeProp<T = unknown>(node: AXTreeViewNode, fieldName: string, defaultValue?: T): T;
    /**
     * Set a property value on a node using the configured field name
     */
    protected setNodeProp(node: AXTreeViewNode, fieldName: string, value: unknown): void;
    /**
     * Get node ID
     */
    protected getNodeId(node: AXTreeViewNode): string;
    /**
     * Get node title
     */
    protected getNodeTitle(node: AXTreeViewNode): string;
    /**
     * Get node tooltip
     */
    protected getNodeTooltip(node: AXTreeViewNode): string | undefined;
    /**
     * Get node icon
     */
    protected getNodeIcon(node: AXTreeViewNode): string | undefined;
    /**
     * Get node expanded state
     */
    protected getNodeExpanded(node: AXTreeViewNode): boolean;
    /**
     * Set node expanded state
     */
    protected setNodeExpanded(node: AXTreeViewNode, value: boolean): void;
    /**
     * Get node selected state
     */
    protected getNodeSelected(node: AXTreeViewNode): boolean;
    /**
     * Set node selected state
     */
    protected setNodeSelected(node: AXTreeViewNode, value: boolean): void;
    /**
     * Get node indeterminate state
     */
    protected getNodeIndeterminate(node: AXTreeViewNode): boolean;
    /**
     * Set node indeterminate state
     */
    protected setNodeIndeterminate(node: AXTreeViewNode, value: boolean): void;
    /**
     * Get node's own disabled state (without inheritance)
     */
    protected getNodeDisabled(node: AXTreeViewNode): boolean;
    /**
     * Check if node is effectively disabled (considering inheritance from parents)
     * When inheritDisabled is true:
     * - Returns true if node itself is disabled
     * - Returns true if any ancestor is disabled AND node doesn't have explicit `disabled: false`
     * When inheritDisabled is false:
     * - Only returns node's own disabled state
     */
    protected isNodeEffectivelyDisabled(node: AXTreeViewNode): boolean;
    /**
     * Check if any ancestor of the node is disabled
     */
    private isAnyAncestorDisabled;
    /**
     * Get node hidden state
     */
    protected getNodeHidden(node: AXTreeViewNode): boolean;
    /**
     * Get node children array
     */
    protected getNodeChildren(node: AXTreeViewNode): AXTreeViewNode[] | undefined;
    /**
     * Set node children array
     */
    protected setNodeChildren(node: AXTreeViewNode, value: AXTreeViewNode[] | undefined): void;
    /**
     * Get node children count
     */
    protected getNodeChildrenCount(node: AXTreeViewNode): number | undefined;
    /**
     * Set node children count
     */
    protected setNodeChildrenCount(node: AXTreeViewNode, value: number | undefined): void;
    /**
     * Expand all nodes in the tree (with lazy loading support)
     */
    expandAll(): Promise<void>;
    /**
     * Collapse all nodes in the tree
     */
    collapseAll(): void;
    /**
     * Get count of selected nodes
     */
    getSelectedCount(): number;
    /**
     * Check if any nodes are selected
     */
    hasSelection(): boolean;
    /**
     * Get all selected nodes
     */
    getSelectedNodes(): AXTreeViewNode[];
    /**
     * Delete selected nodes from the tree
     */
    deleteSelected(): void;
    /**
     * Select all nodes in the tree (respects disabled state)
     */
    selectAll(): void;
    /**
     * Deselect all nodes in the tree
     */
    deselectAll(): void;
    /**
     * Find a node by ID in the tree
     */
    findNode(id: string): AXTreeViewNode | null;
    /**
     * Refresh the tree to trigger change detection
     */
    refresh(): void;
    /**
     * Reload the entire tree data from the datasource
     * For callback datasource: clears all nodes and reloads from root
     * For array datasource: refreshes the current data
     * @returns Promise that resolves when reload is complete
     */
    reloadData(): Promise<void>;
    /**
     * Check if the tree is currently loading data (root level)
     * @returns true if the tree is loading root data
     */
    getIsLoading(): boolean;
    /**
     * Check if a node is currently loading
     */
    isNodeLoading(nodeId: string): boolean;
    /**
     * Get loading state for a node (internal state)
     */
    getNodeLoading(node: AXTreeViewNode): boolean;
    /**
     * Edit/update a node's properties
     * @param nodeId - The ID of the node to edit
     * @param updates - Partial node object with properties to update
     * @returns true if node was found and updated, false otherwise
     */
    editNode(nodeId: string, updates: Partial<AXTreeViewNode>): boolean;
    /**
     * Add a child node to a parent node
     * @param parentId - The ID of the parent node
     * @param childNode - The child node to add
     * @param index - Optional index to insert at (default: append to end)
     * @returns true if parent was found and child was added, false otherwise
     */
    addChild(parentId: string, childNode: AXTreeViewNode, index?: number): boolean;
    /**
     * Remove a node from the tree
     * @param nodeId - The ID of the node to remove
     * @returns The removed node if found, null otherwise
     */
    removeNode(nodeId: string): AXTreeViewNode | null;
    /**
     * Expand a specific node
     * @param nodeId - The ID of the node to expand
     * @returns Promise that resolves when expansion is complete (if lazy loading)
     */
    expandNode(nodeId: string): Promise<void>;
    /**
     * Collapse a specific node
     * @param nodeId - The ID of the node to collapse
     */
    collapseNode(nodeId: string): void;
    /**
     * Toggle expansion state of a specific node
     * @param nodeId - The ID of the node to toggle
     * @returns Promise that resolves when toggle is complete (if lazy loading)
     */
    toggleNodeExpansion(nodeId: string): Promise<void>;
    /**
     * Programmatically select a node
     * @param nodeId - The ID of the node to select
     * @returns true if node was found and selected, false otherwise
     */
    selectNode(nodeId: string): boolean;
    /**
     * Programmatically deselect a node
     * @param nodeId - The ID of the node to deselect
     * @returns true if node was found and deselected, false otherwise
     */
    deselectNode(nodeId: string): boolean;
    /**
     * Get parent node of a given node
     * @param nodeId - The ID of the node
     * @returns The parent node if found, null otherwise
     */
    getParent(nodeId: string): AXTreeViewNode | null;
    /**
     * Get children of a node
     * @param nodeId - The ID of the parent node
     * @returns Array of child nodes, or null if node not found
     */
    getChildren(nodeId: string): AXTreeViewNode[] | null;
    /**
     * Get all root nodes
     * @returns Array of root nodes
     */
    getRootNodes(): AXTreeViewNode[];
    /**
     * Get all nodes in a flat array
     * @returns Array of all nodes in the tree
     */
    getAllNodes(): AXTreeViewNode[];
    /**
     * Get the path to a node (array of parent IDs from root to node)
     * @param nodeId - The ID of the node
     * @returns Array of node IDs representing the path, or empty array if node not found
     */
    getNodePath(nodeId: string): string[];
    /**
     * Get the level/depth of a node (0 = root level)
     * @param nodeId - The ID of the node
     * @returns The level of the node, or -1 if node not found
     */
    getNodeLevel(nodeId: string): number;
    /**
     * Programmatically move a node to a new parent
     * @param nodeId - The ID of the node to move
     * @param newParentId - The ID of the new parent (undefined for root level)
     * @param index - Optional index to insert at (default: append to end)
     * @returns true if move was successful, false otherwise
     */
    moveNode(nodeId: string, newParentId?: string, index?: number): boolean;
    /**
     * Clone a node (creates a deep copy)
     * @param nodeId - The ID of the node to clone
     * @returns The cloned node, or null if node not found
     */
    cloneNode(nodeId: string): AXTreeViewNode | null;
    /**
     * Focus a specific node by ID
     * @param nodeId - The ID of the node to focus
     * @returns true if node was found and focused, false otherwise
     */
    focusNode(nodeId: string): boolean;
    /**
     * Get all expanded nodes
     * @returns Array of expanded nodes
     */
    getExpandedNodes(): AXTreeViewNode[];
    /**
     * Get all collapsed nodes that have children
     * @returns Array of collapsed nodes with children
     */
    getCollapsedNodes(): AXTreeViewNode[];
    /**
     * Check if a node is expanded
     * @param nodeId - The ID of the node
     * @returns true if node is expanded, false otherwise
     */
    isNodeExpanded(nodeId: string): boolean;
    /**
     * Check if a node is selected
     * @param nodeId - The ID of the node
     * @returns true if node is selected, false otherwise
     */
    isNodeSelected(nodeId: string): boolean;
    /**
     * Check if a node has children
     * @param nodeId - The ID of the node
     * @returns true if node has children, false otherwise
     */
    hasChildren(nodeId: string): boolean;
    /**
     * Check if a node is disabled (considering inheritance from parent nodes)
     * @param nodeId - The ID of the node
     * @returns true if node is disabled (directly or inherited), false otherwise
     */
    isDisabled(nodeId: string): boolean;
    /**
     * Get template context for a node
     */
    getTemplateContext(node: AXTreeViewNode, level?: number): AXTreeViewItemTemplateContext;
    /**
     * Calculate padding-inline for a node based on its level
     */
    getNodePaddingInline(level: number): number;
    /**
     * Check if node should show expand toggle
     */
    shouldShowExpandToggle(node: AXTreeViewNode): boolean;
    /**
     * Check if checkboxes should be shown (only for multiple mode)
     */
    shouldShowCheckbox(): boolean;
    /**
     * Check if double-click directive should be disabled for a node
     * Disabled for leaf nodes (immediate clicks) or when isDoubleClickDisabled is true
     */
    protected isDoubleClickDisabledForNode(node: AXTreeViewNode): boolean;
    /**
     * Check if a node is a leaf (has no children)
     * A node is a leaf if it has no loaded children AND no childrenCount (or childrenCount is 0)
     */
    isLeafNode(node: AXTreeViewNode): boolean;
    /**
     * Check if a node can be selected (considering selectMode and isLeafOnlyMode)
     */
    canSelectNode(node: AXTreeViewNode): boolean;
    /**
     * Check if checkbox should be shown for a specific node
     */
    shouldShowCheckboxForNode(node: AXTreeViewNode): boolean;
    /**
     * Generate unique list ID for each node
     */
    getListId(node?: AXTreeViewNode): string;
    /**
     * Check if a node is currently focused
     */
    isNodeFocused(nodeId: string): boolean;
    /**
     * Get ARIA level for a node
     */
    getNodeAriaLevel(level: number): number;
    /**
     * Get ARIA expanded state for a node
     */
    getNodeAriaExpanded(node: AXTreeViewNode): string | null;
    /**
     * Get ARIA selected state for a node
     */
    getNodeAriaSelected(node: AXTreeViewNode): string | null;
    /**
     * Emit selection change event with all selected nodes
     */
    private emitSelectionChange;
    /**
     * Handle node double click
     */
    onNodeDoubleClickHandle(node: AXTreeViewNode, event: Event): Promise<void>;
    /**
     * Handle node click handle
     */
    onNodeClickHandle(node: AXTreeViewNode, event: Event): void;
    /**
     * Toggle node expansion state with lazy loading support
     * Note: Disabled nodes can still be toggled (expanded/collapsed) for better UX
     */
    toggleNode(node: AXTreeViewNode, event: Event): Promise<void>;
    /**
     * Toggle node selection state with indeterminate support (for multiple mode)
     */
    toggleSelection(node: AXTreeViewNode, event: AXValueChangedEvent): void;
    /**
     * Handle drop events for tree nodes
     */
    onDrop(event: AXDropListDroppedEvent, parentNode?: AXTreeViewNode): void;
    /**
     * Handle drop events when dropping directly onto a node (to make it a child)
     */
    onDropOntoNode(event: AXDropListDroppedEvent, targetNode: AXTreeViewNode): void;
    /**
     * Handle node focus event
     */
    onNodeFocus(nodeId: string): void;
    /**
     * Handle tree container focus - focus first node if none is focused
     */
    onTreeFocus(event: FocusEvent): void;
    /**
     * Handle tree container blur
     */
    onTreeBlur(event: FocusEvent): void;
    /**
     * Handle keyboard navigation
     */
    handleKeyDown(event: KeyboardEvent): void;
    /**
     * Load root items when datasource is a function
     */
    private loadRootItems;
    /**
     * Load children for a node using lazy loading
     * Only calls callback if:
     * - children field is undefined or empty
     * - AND childrenCount > 0
     */
    private loadNodeChildren;
    /**
     * Internal method to refresh nodes signal and sync back to datasource if it's an array
     * Creates new array references for all nested children to ensure reactivity
     */
    private refreshNodes;
    /**
     * Recursively ensure all children arrays have new references to trigger change detection
     * Mutates the tree structure by replacing children arrays with new array references
     */
    private ensureNewArrayReferences;
    /**
     * Handle single selection mode
     */
    private handleSingleSelection;
    /**
     * Handle multiple selection mode (used internally, but in multiple mode selection is primarily handled by checkboxes)
     */
    private handleMultipleSelection;
    /**
     * Get array reference by drop list ID
     */
    private getArrayByListId;
    /**
     * Find parent node by list ID
     */
    private findParentByListId;
    /**
     * Check if move operation is allowed based on dragBehavior
     */
    private canMoveToParent;
    /**
     * Check if reorder operation is allowed based on dragBehavior
     */
    private canReorder;
    /**
     * Handle reordering within the same list   */
    private handleReorder;
    /**
     * Handle moving between different lists
     */
    private handleMove;
    /**
     * Emit beforeDrop event and return whether to continue
     */
    private emitBeforeDropEvent;
    /**
     * Emit drop events based on operation type
     */
    private emitDropEvents;
    /**
     * Get the currently focused node
     */
    private getFocusedNode;
    /**
     * Set focus to a node by ID
     */
    private focusNodeById;
    /**
     * Handle keyboard navigation keys
     */
    private handleNavigationKey;
    /**
     * Handle Space key selection
     * In single mode: replaces selection (deselects all, selects this node)
     * In multiple mode: toggles selection
     */
    private handleSpaceKeySelection;
    /**
     * Handle Enter key selection
     * In single mode: replaces selection (deselects all, selects this node)
     * In multiple mode: replaces selection (deselects all, selects this node and respects selectionBehavior)
     */
    private handleEnterKeySelection;
    /**
     * Handle Ctrl/Cmd + Enter key selection
     */
    private handleCtrlEnterSelection;
    /**
     * Type guard to check if value is an Event
     */
    private isEvent;
    /**
     * Handle errors consistently
     */
    private handleError;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXTreeViewComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXTreeViewComponent, "ax-tree-view", never, { "datasource": { "alias": "datasource"; "required": true; "isSignal": true; }; "selectMode": { "alias": "selectMode"; "required": false; "isSignal": true; }; "selectionBehavior": { "alias": "selectionBehavior"; "required": false; "isSignal": true; }; "dragArea": { "alias": "dragArea"; "required": false; "isSignal": true; }; "dragBehavior": { "alias": "dragBehavior"; "required": false; "isSignal": true; }; "showIcons": { "alias": "showIcons"; "required": false; "isSignal": true; }; "showChildrenBadge": { "alias": "showChildrenBadge"; "required": false; "isSignal": true; }; "expandedIcon": { "alias": "expandedIcon"; "required": false; "isSignal": true; }; "collapsedIcon": { "alias": "collapsedIcon"; "required": false; "isSignal": true; }; "indentSize": { "alias": "indentSize"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "nodeTemplate": { "alias": "nodeTemplate"; "required": false; "isSignal": true; }; "idField": { "alias": "idField"; "required": false; "isSignal": true; }; "titleField": { "alias": "titleField"; "required": false; "isSignal": true; }; "tooltipField": { "alias": "tooltipField"; "required": false; "isSignal": true; }; "iconField": { "alias": "iconField"; "required": false; "isSignal": true; }; "expandedField": { "alias": "expandedField"; "required": false; "isSignal": true; }; "selectedField": { "alias": "selectedField"; "required": false; "isSignal": true; }; "indeterminateField": { "alias": "indeterminateField"; "required": false; "isSignal": true; }; "disabledField": { "alias": "disabledField"; "required": false; "isSignal": true; }; "hiddenField": { "alias": "hiddenField"; "required": false; "isSignal": true; }; "childrenField": { "alias": "childrenField"; "required": false; "isSignal": true; }; "childrenCountField": { "alias": "childrenCountField"; "required": false; "isSignal": true; }; "dataField": { "alias": "dataField"; "required": false; "isSignal": true; }; "inheritDisabled": { "alias": "inheritDisabled"; "required": false; "isSignal": true; }; "expandOnDoubleClick": { "alias": "expandOnDoubleClick"; "required": false; "isSignal": true; }; "doubleClickDuration": { "alias": "doubleClickDuration"; "required": false; "isSignal": true; }; "tooltipDelay": { "alias": "tooltipDelay"; "required": false; "isSignal": true; }; }, { "datasource": "datasourceChange"; "onBeforeDrop": "onBeforeDrop"; "onNodeToggle": "onNodeToggle"; "onNodeSelect": "onNodeSelect"; "onNodeDoubleClick": "onNodeDoubleClick"; "onNodeClick": "onNodeClick"; "onSelectionChange": "onSelectionChange"; "onOrderChange": "onOrderChange"; "onMoveChange": "onMoveChange"; "onItemsChange": "onItemsChange"; }, never, never, true, never>;
}

declare class AXTreeViewModule {
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXTreeViewModule, never>;
    static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXTreeViewModule, never, [typeof AXTreeViewComponent], never>;
    static ɵinj: _angular_core.ɵɵInjectorDeclaration<AXTreeViewModule>;
}

/**
 * Service for tree node operations
 * Handles all business logic for tree node manipulation
 */
declare class AXTreeViewService {
    private static readonly ROOT_LIST_ID;
    private static readonly NODE_DROP_PREFIX;
    private static readonly LIST_PREFIX;
    /**
     * Find a node by ID in the tree
     */
    findNodeById(nodes: AXTreeViewNode[], id: string, idField?: string, childrenField?: string): AXTreeViewNode | null;
    /**
     * Find parent node of a given node
     */
    findParentNode(nodes: AXTreeViewNode[], targetNode: AXTreeViewNode, idField?: string, childrenField?: string): AXTreeViewNode | undefined;
    /**
     * Check if targetNode is a descendant of ancestorNode (or the same node)
     * Prevents circular references by checking if target exists in ancestor's children tree
     */
    isValidDropTarget(movedNode: AXTreeViewNode, targetNode: AXTreeViewNode, idField?: string, childrenField?: string): boolean;
    /**
     * Check if targetNode is a descendant of ancestorNode
     */
    private isNodeDescendantOf;
    /**
     * Build a flat list of all visible focusable nodes
     */
    buildFlatNodeList(nodes: AXTreeViewNode[], hiddenField?: string, disabledField?: string, expandedField?: string, childrenField?: string): AXTreeViewFlatNode[];
    /**
     * Check if node has children
     */
    hasChildren(node: AXTreeViewNode, childrenField?: string): boolean;
    /**
     * Check if node can be lazy loaded
     */
    canLazyLoad(node: AXTreeViewNode, isLazyDataSource: boolean, childrenCountField?: string, childrenField?: string): boolean;
    /**
     * Recursively select/deselect all children
     */
    selectAllChildren(children: AXTreeViewNode[], selected: boolean, selectedField?: string, indeterminateField?: string, childrenField?: string): void;
    /**
     * Get selection state of children
     */
    getChildrenSelectionState(children: AXTreeViewNode[], selectedField?: string, indeterminateField?: string): AXTreeViewChildrenSelectionState;
    /**
     * Update parent node states based on children selection (with intermediate state support)
     */
    updateParentStates(nodes: AXTreeViewNode[], changedNode: AXTreeViewNode, intermediateState: boolean, idField?: string, childrenField?: string, selectedField?: string, indeterminateField?: string): void;
    /**
     * Recursively deselect all nodes
     */
    deselectAllNodes(nodes: AXTreeViewNode[], selectedField?: string, indeterminateField?: string, childrenField?: string): void;
    /**
     * Recursively set selection state for all nodes
     */
    setAllSelection(nodes: AXTreeViewNode[], selected: boolean, selectedField?: string, indeterminateField?: string, childrenField?: string): void;
    /**
     * Recursively count selected nodes
     */
    countSelected(nodes: AXTreeViewNode[], selectedField?: string, childrenField?: string): number;
    /**
     * Recursively collect selected nodes
     */
    collectSelected(nodes: AXTreeViewNode[], result: AXTreeViewNode[], selectedField?: string, childrenField?: string): void;
    /**
     * Recursively remove selected nodes
     */
    removeSelected(nodes: AXTreeViewNode[], selectedField?: string, indeterminateField?: string, childrenField?: string): void;
    /**
     * Recursively update all parent states in the tree (used after deletion)
     */
    updateAllParentStates(nodes: AXTreeViewNode[], intermediateState: boolean, childrenField?: string, selectedField?: string, indeterminateField?: string): void;
    /**
     * Recursively set expanded state (with lazy loading)
     */
    setExpandedState(nodes: AXTreeViewNode[], expanded: boolean, isLazyDataSource: boolean, loadNodeChildren: (node: AXTreeViewNode) => Promise<void>, expandedField?: string, childrenField?: string, childrenCountField?: string): Promise<void>;
    /**
     * Get array reference by drop list ID
     */
    getArrayByListId(nodes: AXTreeViewNode[], listId: string, idField?: string, childrenField?: string): AXTreeViewNode[] | null;
    /**
     * Find parent node by list ID
     */
    findParentByListId(nodes: AXTreeViewNode[], listId: string, idField?: string, childrenField?: string): AXTreeViewNode | undefined;
    /**
     * Generate unique list ID for each node
     */
    getListId(node: AXTreeViewNode | undefined, idField?: string): string;
    /**
     * Get root list ID constant
     */
    getRootListId(): string;
    /**
     * Get node drop prefix constant
     */
    getNodeDropPrefix(): string;
    /**
     * Get list prefix constant
     */
    getListPrefix(): string;
    /**
     * Get all nodes in a flat array
     */
    getAllNodes(nodes: AXTreeViewNode[], childrenField?: string): AXTreeViewNode[];
    /**
     * Get the path to a node (array of parent nodes from root to node)
     */
    getNodePath(nodes: AXTreeViewNode[], nodeId: string, idField?: string, childrenField?: string): AXTreeViewNode[];
    /**
     * Get the level/depth of a node (0 = root level)
     */
    getNodeLevel(nodes: AXTreeViewNode[], nodeId: string, idField?: string, childrenField?: string): number;
    /**
     * Get sibling nodes of a given node
     */
    getSiblings(nodes: AXTreeViewNode[], nodeId: string, idField?: string, childrenField?: string): AXTreeViewNode[];
    /**
     * Clone a node (creates a deep copy)
     */
    cloneNode(node: AXTreeViewNode, idField?: string, titleField?: string, tooltipField?: string, iconField?: string, expandedField?: string, selectedField?: string, indeterminateField?: string, disabledField?: string, hiddenField?: string, childrenCountField?: string, dataField?: string, childrenField?: string): AXTreeViewNode;
    /**
     * Move a node to a new parent in the tree
     * @param nodes - Root nodes array
     * @param nodeId - The ID of the node to move
     * @param newParentId - The ID of the new parent (undefined for root level)
     * @param index - Optional index to insert at (default: append to end)
     * @param idField - Field name for node ID
     * @param childrenField - Field name for children array
     * @param childrenCountField - Field name for children count
     * @param expandedField - Field name for expanded state
     * @returns Object with success status, moved node, previous parent, new parent, and indices
     */
    moveNode(nodes: AXTreeViewNode[], nodeId: string, newParentId: string | undefined, index: number | undefined, idField?: string, childrenField?: string, childrenCountField?: string, expandedField?: string): {
        success: boolean;
        movedNode?: AXTreeViewNode;
        previousParent?: AXTreeViewNode;
        newParent?: AXTreeViewNode;
        previousIndex: number;
        currentIndex: number;
    };
    /**
     * Edit/update a node's properties
     * @param nodes - Root nodes array
     * @param nodeId - The ID of the node to edit
     * @param updates - Partial node object with properties to update
     * @param idField - Field name for node ID
     * @param childrenField - Field name for children array
     * @param childrenCountField - Field name for children count
     * @returns The updated node if found, null otherwise
     */
    editNode(nodes: AXTreeViewNode[], nodeId: string, updates: Partial<AXTreeViewNode>, idField?: string, childrenField?: string, childrenCountField?: string): AXTreeViewNode | null;
    /**
     * Add a child node to a parent node
     * @param nodes - Root nodes array
     * @param parentId - The ID of the parent node
     * @param childNode - The child node to add
     * @param index - Optional index to insert at (default: append to end)
     * @param idField - Field name for node ID
     * @param childrenField - Field name for children array
     * @param childrenCountField - Field name for children count
     * @param expandedField - Field name for expanded state
     * @returns The parent node if found and child was added, null otherwise
     */
    addChild(nodes: AXTreeViewNode[], parentId: string, childNode: AXTreeViewNode, index: number | undefined, idField?: string, childrenField?: string, childrenCountField?: string, expandedField?: string): AXTreeViewNode | null;
    /**
     * Remove a node from the tree
     * @param nodes - Root nodes array
     * @param nodeId - The ID of the node to remove
     * @param idField - Field name for node ID
     * @param childrenField - Field name for children array
     * @param childrenCountField - Field name for children count
     * @returns The removed node if found, null otherwise
     */
    removeNode(nodes: AXTreeViewNode[], nodeId: string, idField?: string, childrenField?: string, childrenCountField?: string): AXTreeViewNode | null;
    /**
     * Validate node structure (check for required fields and circular references)
     */
    validateNode(node: AXTreeViewNode, visitedIds?: Set<string>, idField?: string, titleField?: string, childrenField?: string, childrenCountField?: string): {
        valid: boolean;
        errors: string[];
    };
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXTreeViewService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXTreeViewService>;
}

export { AXTreeViewComponent, AXTreeViewModule, AXTreeViewService };
export type { AXTreeViewBeforeDropEvent, AXTreeViewCallback, AXTreeViewChildrenSelectionState, AXTreeViewDataSource, AXTreeViewDragArea, AXTreeViewDragBehavior, AXTreeViewDropEvent, AXTreeViewFlatNode, AXTreeViewItemTemplateContext, AXTreeViewNode, AXTreeViewNodeClickEvent, AXTreeViewNodeDoubleClickEvent, AXTreeViewNodeSelectEvent, AXTreeViewNodeToggleEvent, AXTreeViewSelectMode, AXTreeViewSelectionBehavior, AXTreeViewSelectionChangeEvent, AXTreeViewViewLook };
