import { BaseNodeType } from './BaseNodeType'; import { TypedNodeType } from './TypedNodeType'; import { UntypedNodeType } from './UntypedNodeType'; /** * Property key used to identify a node's type */ export declare const nodeTypeKey = "$$type"; /** * Type of the nodeTypeKey constant */ export type NodeTypeKey = typeof nodeTypeKey; /** * Value that identifies a node's type (string or number) */ export type NodeTypeValue = string | number; /** * Value that uniquely identifies a node instance (string or number) */ export type NodeKeyValue = string | number; /** * Represents any node that has a type designation */ export interface NodeWithAnyType { readonly [nodeTypeKey]: NodeTypeValue; } /** * Combines a specific node type with additional data properties * * @template TType - The node's type identifier * @template TData - Additional data properties for the node */ export type TNode = { readonly [nodeTypeKey]: TType; } & TData; /** * Attempts to register a node in the type/key registry * * @param node - The node to register * @returns True if registration was successful */ export declare function tryRegisterNodeByTypeAndKey(node: object): boolean; /** * A type representing any untyped node type. */ export type AnyUntypedNodeType = BaseNodeType; /** * Union of all possible typed node type objects */ export type AnyTypedNodeType = BaseNodeType; /** * Union of all possible node type objects */ export type AnyNodeType = AnyUntypedNodeType | AnyTypedNodeType; /** * Retrieves the registered node type for a given type ID * * @param typeId - The node type identifier to look up * @returns The node type object or undefined if not found */ export declare function findNodeTypeById(typeId: NodeTypeValue): AnyTypedNodeType | undefined; export declare function getNodeTypeId(node: TNode): TNode[NodeTypeKey]; export declare function getNodeTypeId(node: object): NodeTypeValue | undefined; export declare function getNodeTypeAndKey(node: TNode): { type: AnyTypedNodeType; key: NodeKeyValue | undefined; }; export declare function getNodeTypeAndKey(node: object): { type: AnyTypedNodeType | undefined; key: NodeKeyValue | undefined; }; export declare function nodeType(type: TNode[NodeTypeKey]): TypedNodeType; export declare function nodeType(): UntypedNodeType; /** * Registers a callback function to be invoked after a node of the specified type is initialized. * * @template TNode - The type of the node that extends NodeWithAnyType * * @param nodeType - The typed node type to attach the initialization callback to * @param callback - Function to be called with the newly initialized node * * @returns A disposer function that can be called to unregister the callback */ export declare function onInit(nodeType: TypedNodeType, callback: (node: TNode) => void): import('../../utils/disposable').Dispose;