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
Name | Type | Defined in |
---|---|---|
isDefault ? | boolean | packages/core/src/AST/types.ts:72 |
nodeKind | N | packages/core/src/AST/types.ts:71 |
rawNode ? | string | Record <string , unknown > | packages/core/src/AST/types.ts:77 |
sourceMap ? | object | packages/core/src/AST/types.ts:73 |
sourceMap.args | Record <string , ASTNode | ASTNode []> | packages/core/src/AST/types.ts:75 |
sourceMap.mecanismName | string | packages/core/src/AST/types.ts:74 |
Type Parameters
Type Parameter | Default type | Description |
---|---|---|
N extends NodeKind | NodeKind | The kind of node this ASTNode represents (a string literal type). |
Example
let node: ASTNode<'rule'>