Class Node
Package: grammarkdown
Constructors
constructor(kind)
Constructs a new instance of the Node
class
Declaration
constructor(kind: TKind);
Parameters
- kind
- TKind
Properties
detachedTrivia
Detached trivia is any trivia that occurs prior to the node that is not the leading or trailing trivia of this or any other node.
Declaration
get detachedTrivia(): readonly Trivia[] | undefined;
Property Value
edgeCount
Declaration
protected get edgeCount(): number;
Property Value
end
Declaration
get end(): number;
Property Value
firstChild
Declaration
get firstChild(): Node | undefined;
Property Value
kind
Declaration
readonly kind: TKind;
Property Value
lastChild
Declaration
get lastChild(): Node | undefined;
Property Value
leadingHtmlTrivia
Warning
Deprecated
Use or instead.Declaration
get leadingHtmlTrivia(): readonly HtmlTrivia[] | undefined;
Property Value
leadingTrivia
Leading trivia is trivia that belongs to the beginning of the node: - An HTML close tag trivia, or any trivia preceding an HTML close tag trivia, is not leading trivia of the node. - An HTML open tag trivia, and any trivia following an HTML open tag trivia, is leading trivia of the node. - If the node has a preceding line break, then - Any other non-HTML tag trivia on the same line as the node that precedes the node is leading trivia of the node. - Any other non-HTML tag trivia on a line that precedes the node, but not preceding a blank line, is leading trivia of the node. - Otherwise, - Any other non-HTML tag trivia on the same line as the node that precedes the node is leading trivia, if there is no whitespace between that trivia and the node.
Declaration
get leadingTrivia(): readonly Trivia[] | undefined;
Property Value
pos
Declaration
get pos(): number;
Property Value
trailingHtmlTrivia
Warning
Deprecated
Use instead.Declaration
get trailingHtmlTrivia(): readonly HtmlTrivia[] | undefined;
Property Value
trailingTrivia
Trailing trivia is trivia that belongs to the end of the node: - An HTML open tag trivia, or any trivia following an HTML open tag trivia, is not trailing trivia of the node. - An HTML close tag trivia, and any trivia preceding an HTML close tag trivia, is trailing trivia of the node. - If the node has a trailing line break, then - Any other non-HTML tag trivia on the same line as the node that follows the node is trailing trivia of the node. - Any other non-HTML tag trivia on a line that follows the node, but not following a blank line, is trailing trivia of the node. - Otherwise, - Any other non-HTML tag trivia on the same line as the node that follows the node is trailing trivia, if there is no whitespace between that trivia and the node.
Declaration
get trailingTrivia(): readonly Trivia[] | undefined;
Property Value
Methods
accept(visitor)
Declaration
protected accept(visitor: NodeVisitor): Node;
Parameters
- visitor
- NodeVisitor
Returns
children()
Declaration
children(): IterableIterator<Node>;
Returns
edgeName(offset)
Declaration
protected edgeName(offset: number): string | undefined;
Parameters
- offset
- number
Returns
edgeValue(offset)
Declaration
protected edgeValue(offset: number): Node | ReadonlyArray<Node> | undefined;
Parameters
- offset
- number
Returns
forEachChild(cbNode)
Declaration
forEachChild<T>(cbNode: (node: Node) => T | undefined): T | undefined;
Type Parameters
- T
Parameters
- cbNode
- (node: Node) => T | undefined
Returns
getEnd()
Declaration
getEnd(): number;
Returns
getFullStart()
Declaration
getFullStart(): number;
Returns
getFullText(sourceFile)
Declaration
getFullText(sourceFile: SourceFile): string;
Parameters
- sourceFile
- SourceFile
Returns
getFullWidth()
Declaration
getFullWidth(): number;
Returns
getStart(sourceFile)
Declaration
getStart(sourceFile?: SourceFile): number;
Parameters
- sourceFile
- SourceFile
Returns
getText(sourceFile)
Declaration
getText(sourceFile: SourceFile): string;
Parameters
- sourceFile
- SourceFile
Returns
getWidth(sourceFile)
Declaration
getWidth(sourceFile?: SourceFile): number;
Parameters
- sourceFile
- SourceFile
Returns