ASTNode

API / publicodes / ASTNode

type ASTNode<N>: PossibleNodes & object;

Represents a node in the Abstract Syntax Tree of a publicodes expression.

It can be browsed and transformed using the transformAST, reduceAST and traverseASTNode methods.

Type declaration

NameTypeDefined in
isDefault?booleanpackages/core/src/AST/types.ts:72
nodeKindNpackages/core/src/AST/types.ts:71
rawNode?string | Record<string, unknown>packages/core/src/AST/types.ts:77
sourceMap?objectpackages/core/src/AST/types.ts:73
sourceMap.argsRecord<string, ASTNode | ASTNode[]>packages/core/src/AST/types.ts:75
sourceMap.mecanismNamestringpackages/core/src/AST/types.ts:74

Type Parameters

Type ParameterDefault typeDescription
N extends NodeKindNodeKindThe kind of node this ASTNode represents (a string literal type).

Example

let node: ASTNode<'rule'>

Defined in

packages/core/src/AST/types.ts:70