UNPKG

@lifeart/gxt

Version:

<img align="right" width="95" height="95" alt="Philosopher’s stone, logo of PostCSS" src="./public/logo.png">

29 lines (27 loc) • 886 B
import { ComponentLike } from './types'; /** * Maps component IDs to component instances */ export declare const TREE: Map<number, ComponentLike>; /** * Maps component IDs to arrays of child component IDs */ export declare const CHILD: Map<number, Set<number> | undefined>; /** * Maps component IDs to parent component IDs (for context API) */ export declare const PARENT: Map<number, number>; /** * Get a unique component ID. * Reuses IDs from the pool when available. */ export declare function cId(): number; /** * Release a component ID back to the pool for reuse. */ export declare function releaseId(id: number): void; /** * Add a component node to the tree under a parent context. * Registers a destructor to clean up tree entries when the node is destroyed. */ export declare function addToTree(ctx: ComponentLike, node: ComponentLike, debugName?: string): void;