Module

x/ts_morph/ts_morph.js>Node

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
class Node
import { Node } from "https://dotland.deno.dev/x/ts_morph@21.0.0/ts_morph.js";

Constructors

new
Node(
context,
node,
sourceFile,
)

Properties

__sourceFile
_context
readonly
_sourceFile
_wrappedChildCount: number
readonly
compilerNode

Methods

_getAncestorsIterator(includeSyntaxLists)
appendWhitespace(textOrWriterFunction)
asKind(kind)
asKindOrThrow(kind, message)
containsRange(pos, end)
forEachChild(cbNode, cbNodeArray)
forEachDescendant(cbNode, cbNodeArray)
formatText(settings?)
getAncestors(includeSyntaxLists?)
getChildAtIndexIfKindOrThrow(
index,
kind,
message,
)
getFirstAncestor(condition)
getFirstAncestorOrThrow(condition, message)
getFirstChild(condition)
getFirstChildOrThrow(condition, message)
getFirstDescendantOrThrow(condition, message)
getLastChild(condition)
getLastChildOrThrow(condition, message)
getLocal(name)
getLocalOrThrow(name, message)
getNextSibling(condition)
getNextSiblingOrThrow(condition, message)
getNodeProperty(propertyName)
getParentIf(condition)
getParentIfKindOrThrow(kind, message)
getParentIfOrThrow(condition, message)
getParentWhile(condition)
getParentWhileOrThrow(condition, message)
getPreviousSiblingOrThrow(condition, message)
getStart(includeJsDocComments)
getStartLineNumber(includeJsDocComments)
getStartLinePos(includeJsDocComments)
getText(includeJsDocCommentOrOptions)
getWidth(includeJsDocComments)
isKind(kind)
prependWhitespace(textOrWriterFunction)
print(options?)
replaceWithText(textOrWriterFunction, writer)
transform(visitNode)

Static Properties

isAnyKeyword
isArrayBindingPattern
isArrayLiteralExpression
isArrowFunction
isAsExpression
isAwaitExpression
isBigIntLiteral
isBinaryExpression
isBindingElement
isBlock
isBooleanKeyword
isBreakStatement
isCallExpression
isCaseBlock
isCaseClause
isCatchClause
isClassDeclaration
isClassExpression
isClassStaticBlockDeclaration
isCommaListExpression
isComputedPropertyName
isConditionalExpression
isContinueStatement
isDebuggerStatement
isDecorator
isDefaultClause
isDeleteExpression
isDoStatement
isElementAccessExpression
isEmptyStatement
isEnumDeclaration
isEnumMember
isExportAssignment
isExportDeclaration
isExportSpecifier
isExpressionStatement
isExpressionWithTypeArguments
isExternalModuleReference
isForInStatement
isForOfStatement
isForStatement
isFunctionDeclaration
isFunctionExpression
isHeritageClause
isIdentifier
isIfStatement
isImportAttributes
isImportClause
isImportDeclaration
isImportEqualsDeclaration
isImportSpecifier
isInferKeyword
isInterfaceDeclaration
isJSDoc
isJSDocAllType
isJSDocAugmentsTag
isJSDocAuthorTag
isJSDocCallbackTag
isJSDocClassTag
isJSDocDeprecatedTag
isJSDocEnumTag
isJSDocFunctionType
isJSDocImplementsTag
isJSDocLinkCode
isJSDocLinkPlain
isJSDocMemberName
isJSDocNamepathType
isJSDocNameReference
isJSDocNonNullableType
isJSDocNullableType
isJSDocOptionalType
isJSDocOverloadTag
isJSDocOverrideTag
isJSDocParameterTag
isJSDocPrivateTag
isJSDocPropertyTag
isJSDocProtectedTag
isJSDocPublicTag
isJSDocReadonlyTag
isJSDocReturnTag
isJSDocSatisfiesTag
isJSDocSeeTag
isJSDocSignature
isJSDocTemplateTag
isJSDocText
isJSDocThisTag
isJSDocThrowsTag
isJSDocTypedefTag
isJSDocTypeExpression
isJSDocTypeLiteral
isJSDocTypeTag
isJSDocUnknownType
isJSDocVariadicType
isJsxAttribute
isJsxClosingElement
isJsxClosingFragment
isJsxElement
isJsxExpression
isJsxFragment
isJsxNamespacedName
isJsxOpeningElement
isJsxOpeningFragment
isJsxSelfClosingElement
isJsxSpreadAttribute
isJsxText
isLabeledStatement
isMetaProperty
isMethodDeclaration
isMethodSignature
isModuleBlock
isModuleDeclaration
isNamedExports
isNamedImports
isNamedTupleMember
isNamespaceExport
isNamespaceImport
isNeverKeyword
isNewExpression
isNonNullExpression
isNoSubstitutionTemplateLiteral
isNotEmittedStatement
isNumberKeyword
isNumericLiteral
isObjectBindingPattern
isObjectKeyword
isObjectLiteralExpression
isOmittedExpression
isParenthesizedExpression
isPartiallyEmittedExpression
isPostfixUnaryExpression
isPrefixUnaryExpression
isPrivateIdentifier
isPropertyAccessExpression
isPropertyAssignment
isPropertyDeclaration
isPropertySignature
isQualifiedName
isRegularExpressionLiteral
isReturnStatement
isSatisfiesExpression
isSemicolonToken
isShorthandPropertyAssignment
isSourceFile
isSpreadAssignment
isSpreadElement
isStringKeyword
isStringLiteral
isSwitchStatement
isSymbolKeyword
isSyntaxList
isTaggedTemplateExpression
isTemplateExpression
isTemplateHead
isTemplateMiddle
isTemplateSpan
isTemplateTail
isThrowStatement
isTryStatement
isTypeAliasDeclaration
isTypeOfExpression
isUndefinedKeyword
isVariableDeclaration
isVariableDeclarationList
isVariableStatement
isVoidExpression
isWhileStatement
isWithStatement
isYieldExpression

Static Methods

hasBody(node)
hasName(node)
is(kind)
isBodied(node)
isModuled(node)
isNamed(node)
isNode(value)
isScoped(node)
isTyped(node)