ASTNode

API / publicodes / ASTNode

type ASTNode<N> = PossibleNodes & object;

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

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 Parameters

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

Type Declaration

NameTypeDefined in
isDefault?booleanpackages/core/src/AST/types.ts:84
nodeKindNpackages/core/src/AST/types.ts:83
rawNode?string | Rulepackages/core/src/AST/types.ts:89
sourceMap?objectpackages/core/src/AST/types.ts:85
sourceMap.argsRecord<string, ASTNode | ASTNode[]>packages/core/src/AST/types.ts:87
sourceMap.mecanismNamestringpackages/core/src/AST/types.ts:86

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'>