Node

/**
* A JavaScript / TypeScript ast node.
*/

Primary key: id: int

schema Node {
  @primary id: int
}

Node::getModifier

/**
* Gets the `i`th modifier.
*/
pub fn getModifier(self: Node, i: int) -> Modifier;

Node::getDecorator

/**
* Gets the `i`th decorator.
*/
pub fn getDecorator(self: Node, i: int) -> Decorator;

Node::getText

/**
* Gets the text of this node.
*/
  • Parameter self: Node
  • Return string
pub fn getText(self: Node) -> string;

Node::getADecorator

/**
* Gets a decorator.
*/
pub fn getADecorator(self: Node) -> *Decorator;

Node::getAComment

/**
* Gets the comments related to it
*/
pub fn getAComment(self: Node) -> *Comment;

Node::getATrailingComment

/**
* Gets the trailing comments of it
*/
pub fn getATrailingComment(self: Node) -> *Comment;

Node::getALeadingComment

/**
* Gets the leading comments of it
*/
pub fn getALeadingComment(self: Node) -> *Comment;

Node::getEndLineNumber

  • Parameter self: Node
  • Return int
pub fn getEndLineNumber(self: Node) -> int;

Node::getAnAncestorByLevel

/**
* Gets an ancestor of this node by the level of the hierarchy.
*
* @param level: the number of levels to go up in the hierarchy.
*/
  • Parameter self: Node
  • Parameter level: int
  • Return Node
pub fn getAnAncestorByLevel(self: Node, level: int) -> Node;

Node::getStartLineNumber

  • Parameter self: Node
  • Return int
pub fn getStartLineNumber(self: Node) -> int;

Node::getLocation

/**
* Gets the location of this node.
*/
pub fn getLocation(self: Node) -> Location;

Node::__all__

Data constraint method.

pub fn __all__(db: JavascriptDB) -> *Node;

Node::getADescendantByLevel

/**
* Gets a descendant of this node by the level of the hierarchy.
*
* @param level: the number of levels to go up in the hierarchy.
*/
  • Parameter self: Node
  • Parameter level: int
  • Return *Node
pub fn getADescendantByLevel(self: Node, level: int) -> *Node;

Node::getAModifier

/**
* Gets a modifier.
*/
pub fn getAModifier(self: Node) -> *Modifier;

Node::getKind

/**
* Get the syntax kind of this node
*/
  • Parameter self: Node
  • Return int
pub fn getKind(self: Node) -> int;

Node::getFile

/**
* Gets the file of this node.
*/
pub fn getFile(self: Node) -> File;

Node::getParent

/**
* Gets the parent node of this node.
*/
pub fn getParent(self: Node) -> Node;

Node::getEndColumnNumber

  • Parameter self: Node
  • Return int
pub fn getEndColumnNumber(self: Node) -> int;

Node::getLastChild

/**
* Gets the last child of this node parent.
*/
pub fn getLastChild(self: Node) -> Node;

Node::getRelativePath

/**
* Gets the relative path of this node.
*/
  • Parameter self: Node
  • Return string
pub fn getRelativePath(self: Node) -> string;

Node::getParentOid

/**
* Gets the parent oid of this node.
*/
  • Parameter self: Node
  • Return int
pub fn getParentOid(self: Node) -> int;

Node::getIndex

  • Parameter self: Node
  • Return int
pub fn getIndex(self: Node) -> int;

Node::getSymbol

/**
* Gets the symbol associated with this node.
*/
pub fn getSymbol(self: Node) -> Symbol;

Node::getAnAncestorEnclosingFunction

/**
* Gets an ancestor enclosing function of it
*/
pub fn getAnAncestorEnclosingFunction(self: Node) -> *FunctionLikeDeclaration;

Node::getStartColumnNumber

  • Parameter self: Node
  • Return int
pub fn getStartColumnNumber(self: Node) -> int;

Node::getAChild

/**
* Gets a child node of this node.
*/
pub fn getAChild(self: Node) -> *Node;

Node::getChildCount

/**
* Gets the number of child nodes.
*/
  • Parameter self: Node
  • Return int
pub fn getChildCount(self: Node) -> int;

Node::getChild

/**
* Gets the `i`th child of this node.
*/
  • Parameter self: Node
  • Parameter i: int
  • Return Node
pub fn getChild(self: Node, i: int) -> Node;

Node::getAnAncestor

/**
* Gets an ancestor of this node. 
*/
pub fn getAnAncestor(self: Node) -> *Node;

Node::getRoot

/**
* Gets the root top-level of this node. 
*/
pub fn getRoot(self: Node) -> TopLevelDO;

Node::getADescendant

/**
* Gets a descendant of this node. 
*/
pub fn getADescendant(self: Node) -> *Node;

Node::getEnclosingFunction

/**
* Gets the enclosing function of it
*/
pub fn getEnclosingFunction(self: Node) -> FunctionLikeDeclaration;