/** * Shared node primitives that mirror PhpParser's Node\* base classes. */ /** * Represents the attributes of a PHP AST node. * * @category PHP AST */ export type PhpAttributes = Readonly>; /** * Base interface for all PHP AST nodes. * * @category PHP AST */ export interface PhpNode { readonly nodeType: string; readonly attributes: PhpAttributes; } /** * Merges new attributes into an existing PHP AST node's attributes. * * This function creates a new node with the merged attributes if changes are detected, * otherwise, it returns the original node to ensure immutability where possible. * * @category PHP AST * @param node - The original PHP AST node. * @param attributes - The attributes to merge into the node. * @returns A new node with merged attributes, or the original node if no changes. */ export declare function mergeNodeAttributes(node: T, attributes?: PhpAttributes): T; /** * Generic factory helper for PHP AST node construction. * * Prefer dedicated builders exported alongside the node interfaces for specific node types. * Use this generic builder for niche constructs that do not yet have a typed factory. * * @category PHP AST * @param nodeType - The type of the PHP AST node. * @param props - The properties of the node, excluding `nodeType` and `attributes`. * @param attributes - Optional attributes for the node. * @returns A new PHP AST node of the specified type. */ export declare function buildNode(nodeType: T['nodeType'], props: Omit, attributes?: PhpAttributes): T;