ASTNode

API / publicodes / ASTNode

type ASTNode<N> = PossibleNodes & object;

Defined in: packages/core/src/AST/types.ts:81

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:83
nodeKindNpackages/core/src/AST/types.ts:82
rawNode?string | Rulepackages/core/src/AST/types.ts:88
sourceMap?objectpackages/core/src/AST/types.ts:84
sourceMap.argsRecord<string, ASTNode | ASTNode[]>packages/core/src/AST/types.ts:86
sourceMap.mecanismNamestringpackages/core/src/AST/types.ts:85

Type Parameters

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

Warning

The ASTNode types are considered internal implementation details. They are not covered by semantic versioning guarantees and may undergo breaking changes without a major version bump. Use them at your own risk.

Example

let node: ASTNode<'rule'>