import { HierarchyItem } from './index.js'; /** * Options to control how trees are rendered to text */ export interface RenderOptions { [key: string]: unknown; /** * The name of a rendering preset to use; built-in options include: * * - default: Only display the first 10 items from each directory; summarize the rest. * - expand: Display the full tree, sorted alphabetically, with no limits * - collapse: Hide and summarize leaf nodes, displaying only branches * - markdown: Expand and display all items with minimal formatting; indent using markdown list syntax. * * Additional option flags and values will override the preset defaults. * * @type {?Extract} */ preset?: Extract; /** * Maximum tree depth to display * * @defaultValue `Infinity` */ maxDepth?: number; /** * Maximum number of children to display for each item * * @defaultValue `Infinity` */ maxChildren?: number; /** * Formats the name of a hierarchy item when displayed in the tree */ label?: (item: T, options: RenderOptions, depth: number) => string; /** * Formats the short summary of a collapsed branch's children */ summary?: (items: T, options: RenderOptions, depth: number) => string; /** * Formats a summary of truncated children when maxChildren is readched */ truncated?: (items: T[], options: RenderOptions, depth: number) => string; /** * Whether a branch should be collapsed or expanded. By default, this is TRUE when * depth >= options.maxDepth. */ collapse?: (item: T, options: RenderOptions, depth: number) => boolean; /** * Optional predicate function to conditionally filter the displayed children of an item. * Can be used to alter the sorting order of child items, hide leaf nodes but display * branches, etc. */ visibleChildren?: (item: T, options: RenderOptions, depth: number) => T[]; characters?: { root: string; spacer: string; parent: string; item: string; itemLast: string; parentLast: string; }; } declare const presets: Record>; export declare function render(item: T, customOptions?: RenderOptions): string; export {}; //# sourceMappingURL=render.d.ts.map