import { type ChildPart, type DirectiveParameters } from 'lit/directive.js'; import { type DirectiveArgs, DirectiveBase } from '../Abstracts/DirectiveBase'; /** * A template function to render a node with its rendered children. * * @public */ export type TreeParentTemplateFn = (node: T, children: Array) => unknown; /** * A template function to render a leaf node (with no children). * * @public */ export type TreeChildTemplateFn = (node: T) => unknown; /** * Configuration options for the tree directive. * * @public */ export interface ITreeOptions { /** * Optional predicate to filter nodes. Return `false` to exclude a node and its subtree. */ filter?: (node: T) => boolean; /** * Optional comparator to sort children at each tree level. */ sort?: (a: T, b: T) => number; } /** * Generic recursive rendering directive for tree structures. * * @private */ declare class TreeDirective extends DirectiveBase { constructor(args: DirectiveArgs); /** * @public */ render(root: T, childSelector: (node: T) => Array | undefined, renderParent: TreeParentTemplateFn, renderChild: TreeChildTemplateFn, options?: ITreeOptions): unknown; /** * @public */ update(_part: ChildPart, [root, childSelector, renderParent, renderChild, options]: DirectiveParameters): unknown; /** * @private */ private renderNode; } /** * Renders recursive tree-like structures with optional filtering and sorting. * * @public * @param root - Root node to start recursion. * @param childSelector - Function to extract children from each node. * @param renderParent - Template for nodes with children. * @param renderChild - Template for leaf nodes. * @param options - Optional filter and sort logic. */ export declare const tree: (...values: Parameters["render"]>) => any; export {}; //# sourceMappingURL=TreeDirective.d.ts.map