import { Node } from './node.js'; /** * Decorator for a {@link Node} instance. * * Tree-query methods will return the behavior instances of the * actual nodes, by dynamically decorating the returned nodes * via the {@link decorate} method, to ensure consistency. * * It is recommended for concrete behavior classes to offer an approach * to ensure that the behavior instances are unique for each node, so that * the same behavior instance is not created multiple times for the same node. * * @example * All objects returned from tree-query methods will be decorated, i.e. * they will also be instances of the behavior class. * ```ts * const rootBehavior = MyBehavior.for(root); * rootBehavior.children().forEach(child => { * assert(child instanceof MyBehavior); * }) * ``` */ export declare abstract class NodeBehavior implements Node { #private; protected constructor(kernel: Node); identity(): string; attach(parent: Node): void; detach(): void; appendChild(child: Node): void; removeChild(child: Node): void; parent(): this | null; children(): ReadonlySet; dispose(): void; traverse(consumer: (node: this) => void): void; track(): Iterable; /** * Return the behavior instance of the given node. * It should try to reuse existing behavior instance to avoid duplicate * behavior instances for the same node. */ protected abstract decorate(target: Node): this; } //# sourceMappingURL=node-behavior.d.ts.map