import * as i0 from '@angular/core';
import { OnInit, OnChanges, OnDestroy, TemplateRef, EventEmitter, SimpleChanges, AfterContentInit, AfterViewInit } from '@angular/core';
import { UxLinkLegacy } from '@eui/core';
import { CdkTree, NestedTreeControl } from '@angular/cdk/tree';
import { ArrayDataSource } from '@angular/cdk/collections';
import { CdkScrollable } from '@angular/cdk/scrolling';
import { ControlValueAccessor } from '@angular/forms';

type TreeDataModel = Array<TreeItemModel>;
type TreeItemModel = {
    node: TreeNode;
    children?: TreeDataModel;
};
type TreeNode = {
    treeContentBlock: EuiTreeContentBlockModel | any;
} & SelectionModel & ExpandModel;
interface EuiTreeContentBlockModel {
    id?: string | number;
    label: string;
    tooltipLabel: string;
    url: string;
    urlExternal: string;
    urlExternalTarget: string;
    typeLabel: string;
    typeClass: string;
    chips?: Array<{
        label: string;
        typeClass?: string;
        isOutline?: boolean;
    }>;
    iconClass: string;
    iconTypeClass: string;
    iconSvgName?: string;
    rightContent?: {
        iconClass: string;
        iconTypeClass: string;
        iconSvgName?: string;
        badges?: Array<{
            label: string;
            typeClass: string;
        }>;
        chips?: Array<{
            label: string;
            typeClass?: string;
            isOutline?: boolean;
        }>;
        contextMenuMetaData?: any;
    };
    metaData: string;
    [key: string]: any;
}
type SelectionModel = {
    selectable?: boolean;
    isSelected?: boolean;
    isIndeterminate?: boolean;
    selectConfig?: SelectConfigModel;
};
interface SelectConfigModel extends MultiSelectionLogic, SingleSelectionLogic {
    recursive?: boolean;
    noAutoSelectParent?: boolean;
    singleSelect?: boolean;
}
interface MultiSelectionLogic {
    recursive?: boolean;
    noAutoSelectParent?: boolean;
}
interface SingleSelectionLogic {
    singleSelect?: boolean;
}
type ExpandModel = {
    isExpanded?: boolean;
};
type EuiTreeSelectionChanges = {
    added: TreeDataModel;
    removed: TreeDataModel;
    selection: TreeDataModel;
};
type TreeDataRunTimeModel = Array<TreeItemRunTimeModel>;
type TreeItemRunTimeModel = {
    index: number;
    path: string;
    children?: Array<TreeItemRunTimeModel>;
    last?: boolean;
    matched?: boolean;
};
type TreeItemSelectionRecursiveModel = {
    selectionRecursiveState: SelectionRecursiveState;
    children?: Array<TreeItemSelectionRecursiveModel>;
};
type SelectionRecursiveState = 'indeterminate' | 'allSelected' | 'allNotSelected';
declare function uxTreeNodesMetaDataMapper(oldTree: Array<UxLinkLegacy>): TreeDataModel;
declare class EuiTreePagination<T> {
    private data;
    private startPage;
    private totalItems;
    private renderedPageCount;
    private perPage;
    private totalPages;
    constructor(data: T[], startPage: number, renderedPageCount: number, perPage: number);
    paginateNext(): {
        startPage: number;
        data: T[];
    };
    paginatePrev(): {
        startPage: number;
        data: T[];
    };
    getCurrentStartPage(): number;
    setCurrentStartPage(startPage: number): void;
    isAtMax(): boolean;
    getViewData(): {
        startPage: number;
        data: T[];
    };
}
declare class CustomNodeSelectFnHelper {
    private compInstance;
    constructor(compInstance: any);
    select(path: string, isChecked: boolean): void;
    getParents(path: string): Array<string>;
    getTreeItem(path: string): TreeItemModel;
    getSelectionRecursiveState(path: string): TreeItemSelectionRecursiveModel;
}
type CustomNodeSelectFn = (path: string, isChecked: boolean, treeItem: TreeItemModel, helper: CustomNodeSelectFnHelper) => void;

/**
 * @description
 * The eui-tree can be used to display hierarchy data with optional added behavior inside node templates and interactions
 * that could affect the rendered data such as expand, collapse, direct actions, extra menu actions, etc.
 *
 */
declare class EuiTreeComponent implements OnInit, OnChanges, OnDestroy {
    get cssClasses(): string;
    e2eAttr: string;
    /**
     * Hierarchy of data to display in the tree
     */
    nodes: TreeDataModel;
    /**
     * Reference to the `ng-template` used to render node item
     */
    nodeTemplateRef: TemplateRef<any>;
    nodeContentMetadataTemplateRef: TemplateRef<any>;
    rightContextMenuTemplateRef: TemplateRef<any>;
    customNodeSelectFn: CustomNodeSelectFn;
    /**
     * Icon to display when a node is closed
     *
     * @default 'eui-chevron-right'
     */
    expandedSvgIconClass: string;
    /**
     * Icon to display when a node is opened
     *
     * @default 'eui-chevron-down'
     */
    collapsedSvgIconClass: string;
    cdkScrollableRef: CdkScrollable;
    treeComponentInstance: CdkTree<TreeItemRunTimeModel>;
    /**
     * Whether the full node display can be clicked to toggle the node.
     *
     * @default false
     */
    isClickTogglingNode: boolean;
    /**
     * Whether multiple nodes can be selected.
     *
     * @default false
     */
    isMultiselect: boolean;
    /**
     * Whether only one node can be selected. Select one will unselect the previous selected.
     *
     * @default false
     */
    isSingleSelect: boolean;
    /**
     * In combination with `isMultiselect`. Whether the selection of a node will automatically select its children.
     *
     * @default false
     */
    isRecursiveSelection: boolean;
    /**
     * In combination with `isMultiselect`. Whether the selection of all children will automatically select the parent.
     *
     * @default true
     */
    isRecursiveParentSelection: boolean;
    /**
     * Whether the links are underlined on hiver in the tree.
     *
     * @default true
     */
    showUnderlinedLinks: boolean;
    /**
     * Whether the lines are displayed on the left of nodes.
     *
     * @default true
     */
    showLines: boolean;
    /**
     * Whether i18n key can be passed to be translated with `TranslateService`.
     *
     * @default true
     */
    autoTranslate: boolean;
    /**
     * Whether all parents till the selected are highlighted in bold.
     *
     * @default false
     */
    highlightPath: boolean;
    /**
     * Treshold for the virtual scroll to be activated
     *
     * @default 800
     */
    virtualScrollThreshold: number;
    /**
     * Size of the virtaul scroll pages
     *
     * @default 400
     */
    virtualScrollPageSize: number;
    selectionChange: EventEmitter<EuiTreeSelectionChanges>;
    nodeClick: EventEmitter<TreeItemModel>;
    nodeToggle: EventEmitter<TreeItemModel>;
    cdkArrayDataSource: ArrayDataSource<TreeItemRunTimeModel>;
    cdkTreeControl: NestedTreeControl<TreeItemRunTimeModel>;
    renderTree: boolean;
    uid: string;
    protected _isMultiLevel: boolean;
    private processedNodes;
    private treeDataRunTime;
    private treeDataRunTimeBackup;
    private runTimeSelectionRecursiveState;
    private selectionModel;
    private tempSelectionModel;
    private selectionModelSubs;
    private scrollDispatcherSubs;
    private _selection;
    private treePagination;
    private changeDetectorRef;
    private scrollDispatcher;
    ngOnInit(): void;
    ngOnChanges(changes: SimpleChanges): void;
    ngOnDestroy(): void;
    getSelection(): TreeDataModel;
    getProcessedNodes(): TreeDataModel;
    trackBy(index: number, item: TreeItemRunTimeModel): any;
    trackByControl(item: TreeItemRunTimeModel): any;
    getTreeItem(path: string): TreeItemModel;
    expandAll(): void;
    expandAt(path: string, detectChanges?: boolean): void;
    collapseAll(): void;
    filterTerm(filterInput: string, filterKey?: string, showChildrenOfMatchedItems?: boolean): void;
    setAllSelection(isChecked: boolean): void;
    updateTreeItem(givenTreeItem: TreeItemModel, path: string): void;
    onNodeClick(treeRunTimeItem: TreeItemRunTimeModel, e: any): void;
    onNodeToggle(treeRunTimeItem: TreeItemRunTimeModel): void;
    nodeSelected(evt: any, path: string): void;
    hasChild: (_: number, item: TreeItemRunTimeModel) => boolean;
    onSelectFn(path: string): (evt: any) => void;
    getRunTimeSelectionRecursiveState(path: string): TreeItemSelectionRecursiveModel;
    private initTree;
    private processInputs;
    private overrideTreeDataModelForSelection;
    private runScrollListener;
    private getSelectionIndexOfItem;
    private silentSelect;
    private selectTreeItem;
    private deselectTreeItem;
    private createTreeDataRuntime;
    private applyRunTimeLastItems;
    private createRunTimeSelectionRecursiveState;
    private calculateItemSelectionRecursiveState;
    private decideSelectionRecursiveState;
    private syncStateChangesAtPath;
    private setTreeData;
    private setTreeDataRunTimeBackup;
    private setTreeDataRunTime;
    private setRunTimeSelectionRecursiveStateTree;
    private updateRunTimeSelectionRecursiveState;
    private setIsCheckedForAll;
    private runStateChangesForAll;
    private syncSelectionAtPath;
    private resolvePath;
    private getParentPaths;
    private calculateRunTimeState;
    private filterTreeData;
    private normalizedStr;
    private getInitialSelection;
    private scanSelection;
    private renderInitialExpand;
    private expandMatched;
    private getRunTimeTreeItem;
    private findRunTimeTreeItem;
    private getRunTimeBackupTreeItem;
    private getCssClasses;
    private checkIfMultiLevel;
    private checkIfCurrentScrollable;
    static ɵfac: i0.ɵɵFactoryDeclaration<EuiTreeComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<EuiTreeComponent, "eui-tree", never, { "e2eAttr": { "alias": "e2eAttr"; "required": false; }; "nodes": { "alias": "nodes"; "required": false; }; "nodeTemplateRef": { "alias": "nodeTemplateRef"; "required": false; }; "nodeContentMetadataTemplateRef": { "alias": "nodeContentMetadataTemplateRef"; "required": false; }; "rightContextMenuTemplateRef": { "alias": "rightContextMenuTemplateRef"; "required": false; }; "customNodeSelectFn": { "alias": "customNodeSelectFn"; "required": false; }; "expandedSvgIconClass": { "alias": "expandedSvgIconClass"; "required": false; }; "collapsedSvgIconClass": { "alias": "collapsedSvgIconClass"; "required": false; }; "isClickTogglingNode": { "alias": "isClickTogglingNode"; "required": false; }; "isMultiselect": { "alias": "isMultiselect"; "required": false; }; "isSingleSelect": { "alias": "isSingleSelect"; "required": false; }; "isRecursiveSelection": { "alias": "isRecursiveSelection"; "required": false; }; "isRecursiveParentSelection": { "alias": "isRecursiveParentSelection"; "required": false; }; "showUnderlinedLinks": { "alias": "showUnderlinedLinks"; "required": false; }; "showLines": { "alias": "showLines"; "required": false; }; "autoTranslate": { "alias": "autoTranslate"; "required": false; }; "highlightPath": { "alias": "highlightPath"; "required": false; }; "virtualScrollThreshold": { "alias": "virtualScrollThreshold"; "required": false; }; "virtualScrollPageSize": { "alias": "virtualScrollPageSize"; "required": false; }; }, { "selectionChange": "selectionChange"; "nodeClick": "nodeClick"; "nodeToggle": "nodeToggle"; }, never, never, true, never>;
    static ngAcceptInputType_isClickTogglingNode: unknown;
    static ngAcceptInputType_isMultiselect: unknown;
    static ngAcceptInputType_isSingleSelect: unknown;
    static ngAcceptInputType_isRecursiveSelection: unknown;
    static ngAcceptInputType_isRecursiveParentSelection: unknown;
    static ngAcceptInputType_showUnderlinedLinks: unknown;
    static ngAcceptInputType_showLines: unknown;
    static ngAcceptInputType_autoTranslate: unknown;
    static ngAcceptInputType_highlightPath: unknown;
    static ngAcceptInputType_virtualScrollThreshold: unknown;
    static ngAcceptInputType_virtualScrollPageSize: unknown;
}

declare class EuiDropdownTreeDirective implements AfterContentInit, AfterViewInit {
    buttonTemplateRef: TemplateRef<any>;
    euiTree: EuiTreeComponent;
    private buttonLabel;
    private buttonViewRef;
    private changeDetectorRef;
    private hostElement;
    private renderer;
    private euiDropdown;
    ngAfterContentInit(): void;
    ngAfterViewInit(): void;
    private createButtonLabel;
    static ɵfac: i0.ɵɵFactoryDeclaration<EuiDropdownTreeDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<EuiDropdownTreeDirective, "eui-dropdown[euiDropdownTree]", never, { "buttonTemplateRef": { "alias": "buttonTemplateRef"; "required": false; }; }, {}, ["euiTree"], never, true, never>;
}

declare class EuiTreeFormControlDirective implements ControlValueAccessor, AfterContentInit {
    private onChange;
    private onTouched;
    private tree;
    euiTreeControlValueSetter: (selection: TreeDataModel) => any;
    euiTreeControlModelMapper: (model: any, tree?: TreeDataModel) => Array<TreeItemModel>;
    writeValue(value: any): void;
    registerOnChange(fn: any): void;
    registerOnTouched(fn: any): void;
    ngAfterContentInit(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<EuiTreeFormControlDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<EuiTreeFormControlDirective, "eui-tree[euiTreeFormControl]", never, { "euiTreeControlValueSetter": { "alias": "euiTreeControlValueSetter"; "required": false; }; "euiTreeControlModelMapper": { "alias": "euiTreeControlModelMapper"; "required": false; }; }, {}, never, never, true, never>;
}

declare class EuiTreeHelper {
    private readonly treeData;
    constructor(treeData: TreeDataModel);
    getPath(value: any, identifierKey?: string): string;
    getPaths(values: Array<any>, identifierKey?: string): Array<string>;
    getItems(values: Array<any>, identifierKey?: string): Array<TreeItemModel>;
    private traverse;
    private getValueAtKey;
    private deepEqual;
}

declare const EUI_TREE: readonly [typeof EuiTreeComponent];

export { CustomNodeSelectFnHelper, EUI_TREE, EuiDropdownTreeDirective, EuiTreeComponent, EuiTreeFormControlDirective, EuiTreeHelper, EuiTreePagination, uxTreeNodesMetaDataMapper };
export type { CustomNodeSelectFn, EuiTreeContentBlockModel, EuiTreeSelectionChanges, ExpandModel, MultiSelectionLogic, SelectConfigModel, SelectionModel, SelectionRecursiveState, SingleSelectionLogic, TreeDataModel, TreeDataRunTimeModel, TreeItemModel, TreeItemRunTimeModel, TreeItemSelectionRecursiveModel, TreeNode };
//# sourceMappingURL=eui-components-eui-tree.d.ts.map
