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
Name | Type | Defined in |
---|---|---|
isDefault ? | boolean | packages/core/src/AST/types.ts:83 |
nodeKind | N | packages/core/src/AST/types.ts:82 |
rawNode ? | string | Rule | packages/core/src/AST/types.ts:88 |
sourceMap ? | object | packages/core/src/AST/types.ts:84 |
sourceMap.args | Record <string , ASTNode | ASTNode []> | packages/core/src/AST/types.ts:86 |
sourceMap.mecanismName | string | packages/core/src/AST/types.ts:85 |
Type Parameters
Type Parameter | Default type | Description |
---|---|---|
N extends NodeKind | NodeKind | The 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'>