import { type AvailableSpace, TaffyTree } from "taffy-layout"; import { type ElementNames } from "./dom.js"; /** * Represents a node in the Taffy layout tree. * This class wraps a Taffy node ID and manages its lifecycle. */ export declare class TaffyNode { /** * The Taffy tree instance this node belongs to. */ tree: TaffyTree; /** * Unique identifier for the node within the Taffy tree. */ id: bigint; /** * Callback function to measure the content of the node. * Used for text nodes or other content with intrinsic size. * * @param width - Available width for content. * @returns Element dimensions. */ measureFunc?: (width: AvailableSpace) => { width: number; height: number; }; /** * Creates a new TaffyNode. * * @param nodeName - The name of the element. */ constructor(nodeName?: ElementNames); /** * Removes the node and all its descendants from the Taffy tree. * Necessary to prevent memory leaks as Taffy nodes aren't GC'd automatically. */ free(): void; /** * Recursively removes a node and all its descendants from the Taffy tree. * * @param id - The ID of the node to remove. */ private freeRecursive; }