import { RenderOptions } from './render.js'; type UserDataDefault = Record; /** * An individual node in a hierarchy, responsible for its own identity and * parent/child relationships. * * @typeParam UserData - Payload data for the hierarchy item */ export declare class HierarchyItem { data?: UserData | undefined; protected static _idCounter: number; protected _name?: string; protected _hierarchyId: number; protected _id?: string; /** * The item's direct parent */ parent?: this; /** * The item's direct children */ children: this[]; /** * Create a new hierarchy item with the passed-in data, but no parents or children */ constructor(data?: UserData | undefined); /** * A unique ID for the item in the hiearchy. Used by HierarchyBuilder as a * key for storing and retrieving items. * * @remarks * Changing an item's ID after the hierarchy has been built is likely to mess * everything up in dramatic and interesting ways. * * @defaultValue An auto-generated sequential integer */ get id(): string; set id(input: string); /** * An auto-generated sequential integer used as a fallback ID */ get hierarchyId(): number; /** * A descriptive label for the node; if none exists, fall back to the ID. */ get name(): string; set name(input: string); /** * Set or remove the item's parent, removing it from the previous parent's children * and adding it to the new parent's children as necessary. */ setParent(newParent?: this): void; /** * Add a node to the item's list of children, updating that child's existing * parent if necessary. */ addChild(newChild: this): void; /** * Remove a node from the item's list of children, and update the child node's parent. */ removeChild(existingChild: this): void; /** * An array of parent nodes, starting with the item's direct parent and ending with its root node. */ get ancestors(): this[]; /** * An array of nodes containing the current item and all of its descendants */ get flattened(): this[]; /** * An array of nodes containing all of the current item's descendants */ get descendants(): this[]; /** * An array of nodes containing the current item's siblings: i.e., * other children of its parent node. */ get siblings(): this[]; /** * A Root node has children but no parent. */ get isRoot(): boolean; /** * An Orphan node has no parents, and no children. */ get isOrphan(): boolean; /** * A Leaf node has a parent, but no children. */ get isLeaf(): boolean; render(options?: RenderOptions): string; } export {}; //# sourceMappingURL=hierarchy-item.d.ts.map