@player-ui/player
Version:
35 lines • 1.19 kB
TypeScript
import type { Node, AnyAssetType } from "../parser";
import { NodeType } from "../parser";
/**
* Functions for building AST nodes (relatively) easily
*/
export declare class Builder {
/**
* Creates an asset node
*
* @param value - the value to put in the asset node
*/
static asset<T extends AnyAssetType>(value: T): Node.Asset<T>;
/**
* Creates a value node
*
* @param v - The object to put in the value node
*/
static value(v?: object): Node.Value;
/**
* Creates a multiNode and associates the multiNode as the parent
* of all the value nodes
*
* @param values - the value or applicability nodes to put in the multinode
*/
static multiNode(...values: (Node.Value | Node.Applicability)[]): Node.MultiNode;
/**
* Adds a child node to a node
*
* @param node - The node to add a child to
* @param path - The path at which to add the child
* @param child - The child node
*/
static addChild<N extends Node.BaseWithChildren<NT>, NT extends NodeType>(node: N, path: Node.PathSegment | Node.PathSegment[], child: Node.Node): N;
}
//# sourceMappingURL=index.d.ts.map