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
    readonly Trivia[] | undefined

    edgeCount

    Declaration
    protected get edgeCount(): number;
    Property Value
    number

    end

    Declaration
    get end(): number;
    Property Value
    number

    firstChild

    Declaration
    get firstChild(): Node | undefined;
    Property Value
    Node | undefined

    kind

    Declaration
    readonly kind: TKind;
    Property Value
    TKind

    lastChild

    Declaration
    get lastChild(): Node | undefined;
    Property Value
    Node | undefined

    leadingHtmlTrivia

    Warning

    Deprecated

    Use or instead.
    Declaration
    get leadingHtmlTrivia(): readonly HtmlTrivia[] | undefined;
    Property Value
    readonly HtmlTrivia[] | undefined

    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
    readonly Trivia[] | undefined

    pos

    Declaration
    get pos(): number;
    Property Value
    number

    trailingHtmlTrivia

    Warning

    Deprecated

    Use instead.
    Declaration
    get trailingHtmlTrivia(): readonly HtmlTrivia[] | undefined;
    Property Value
    readonly HtmlTrivia[] | undefined

    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
    readonly Trivia[] | undefined

    Methods

    accept(visitor)

    Declaration
    protected accept(visitor: NodeVisitor): Node;
    Parameters
    visitor
    NodeVisitor

    Returns
    Node

    children()

    Declaration
    children(): IterableIterator<Node>;
    Returns
    IterableIterator<Node>

    edgeName(offset)

    Declaration
    protected edgeName(offset: number): string | undefined;
    Parameters
    offset
    number

    Returns
    string | undefined

    edgeValue(offset)

    Declaration
    protected edgeValue(offset: number): Node | ReadonlyArray<Node> | undefined;
    Parameters
    offset
    number

    Returns
    Node | ReadonlyArray<Node> | undefined

    forEachChild(cbNode)

    Declaration
    forEachChild<T>(cbNode: (node: Node) => T | undefined): T | undefined;
    Type Parameters
    T

    Parameters
    cbNode
    (node: Node) => T | undefined

    Returns
    T | undefined

    getEnd()

    Declaration
    getEnd(): number;
    Returns
    number

    getFullStart()

    Declaration
    getFullStart(): number;
    Returns
    number

    getFullText(sourceFile)

    Declaration
    getFullText(sourceFile: SourceFile): string;
    Parameters
    sourceFile
    SourceFile

    Returns
    string

    getFullWidth()

    Declaration
    getFullWidth(): number;
    Returns
    number

    getStart(sourceFile)

    Declaration
    getStart(sourceFile?: SourceFile): number;
    Parameters
    sourceFile
    SourceFile

    Returns
    number

    getText(sourceFile)

    Declaration
    getText(sourceFile: SourceFile): string;
    Parameters
    sourceFile
    SourceFile

    Returns
    string

    getWidth(sourceFile)

    Declaration
    getWidth(sourceFile?: SourceFile): number;
    Parameters
    sourceFile
    SourceFile

    Returns
    number

    Generated by DocFX