import { ElementRef, EventEmitter } from '@angular/core'; import { TreeNodeEndDirective } from './tree-node-end.directive'; import * as i0 from "@angular/core"; /** A node of an `epag-tree`. */ export interface EpagTreeNode { /** Unique across the whole tree. */ id: string; /** Text shown on the row, and the row's accessible name. */ label: string; /** Child nodes. A node with this array, even an empty one, is a folder; without it, a leaf. */ children?: EpagTreeNode[]; /** When true, the user can select the node. Defaults to false. */ selectable?: boolean; } /** A node drawn as a folder. */ type FolderNode = EpagTreeNode & { children: EpagTreeNode[]; }; /** * Hierarchical data drawn as expandable rows, with single selection. * * Name the tree with `aria-label` or `aria-labelledby` on `` itself. * * @example * ```html * * * ``` */ export declare class TreeComponent { private readonly host; /** * The top-level nodes. Pass a new array to change the tree: the component uses OnPush, so * nodes or children changed in place are not picked up. */ nodes: EpagTreeNode[]; /** Id of the selected node, or null when nothing is selected. */ set selectedId(id: string | null | undefined); /** Emits the id of the node the user selects. */ readonly selectedIdChange: EventEmitter; /** Ids of the nodes whose children are shown. */ set expandedIds(ids: string[] | null | undefined); /** Emits every expanded id whenever the user expands or collapses a node. */ readonly expandedIdsChange: EventEmitter; protected readonly role = "tree"; /** Template drawn at the end of every row. */ protected nodeEnd?: TreeNodeEndDirective; /** The row the user last moved focus to; it keeps the tab stop while focus stays in the tree. */ protected activeId: string | null; private readonly treeId; /** Node id → a key safe inside DOM ids: node ids may hold spaces, which split ARIA id lists. */ private readonly domKeys; private expanded; private selected; /** The selection as the host last passed it, which may lag behind `selected`. */ private hostSelected; private cachedView?; constructor(host: ElementRef); /** The one row a Tab keypress lands on (roving tabindex). */ protected get tabStopId(): string | undefined; protected onKeydown(event: KeyboardEvent): void; /** Once focus leaves the tree, coming back lands on the selected row, not the last one visited. */ protected onFocusout(event: FocusEvent): void; protected onRowClick(event: MouseEvent, node: EpagTreeNode): void; protected onChevronClick(event: MouseEvent, node: EpagTreeNode): void; protected trackById(_index: number, node: EpagTreeNode): string; protected labelId(node: EpagTreeNode): string; protected endId(node: EpagTreeNode): string; protected isFolder(node: EpagTreeNode): node is FolderNode; protected isExpanded(node: EpagTreeNode): boolean; protected isSelected(node: EpagTreeNode): boolean; /** * The rendered rows and the tab stop. Every row reads the tab stop on every change detection, * so they are derived once per state change rather than once per row. */ private view; /** What clicking a row, or pressing Enter or Space on it, does: select it, else expand or collapse it. */ private activate; /** Whether an element is one of this tree's rows, rather than a row of a tree nested inside it. */ private ownsRow; private domKey; private focusNode; private select; private toggle; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};