ProtectedconstructorStatic ReadonlyisStatic ReadonlyisGets if the node is an ArrayBindingPattern.
Static ReadonlyisGets if the node is an ArrayLiteralExpression.
Static ReadonlyisGets if the node is an ArrowFunction.
Static ReadonlyisGets if the node is an AsExpression.
Static ReadonlyisGets if the node is an AwaitExpression.
Static ReadonlyisGets if the node is a BigIntLiteral.
Static ReadonlyisGets if the node is a BinaryExpression.
Static ReadonlyisGets if the node is a BindingElement.
Static ReadonlyisGets if the node is a Block.
Static ReadonlyisGets if the node is a BooleanKeyword.
Static ReadonlyisGets if the node is a BreakStatement.
Static ReadonlyisGets if the node is a CallExpression.
Static ReadonlyisGets if the node is a CaseBlock.
Static ReadonlyisGets if the node is a CaseClause.
Static ReadonlyisGets if the node is a CatchClause.
Static ReadonlyisGets if the node is a ClassDeclaration.
Static ReadonlyisGets if the node is a ClassExpression.
Static ReadonlyisGets if the node is a ClassStaticBlockDeclaration.
Static ReadonlyisGets if the node is a CommaListExpression.
Static ReadonlyisGets if the node is a ComputedPropertyName.
Static ReadonlyisGets if the node is a ConditionalExpression.
Static ReadonlyisGets if the node is a ContinueStatement.
Static ReadonlyisGets if the node is a DebuggerStatement.
Static ReadonlyisGets if the node is a Decorator.
Static ReadonlyisGets if the node is a DefaultClause.
Static ReadonlyisGets if the node is a DeleteExpression.
Static ReadonlyisGets if the node is a DoStatement.
Static ReadonlyisGets if the node is an ElementAccessExpression.
Static ReadonlyisGets if the node is an EmptyStatement.
Static ReadonlyisGets if the node is an EnumDeclaration.
Static ReadonlyisGets if the node is an EnumMember.
Static ReadonlyisGets if the node is an ExportAssignment.
Static ReadonlyisGets if the node is an ExportDeclaration.
Static ReadonlyisGets if the node is an ExportSpecifier.
Static ReadonlyisGets if the node is an ExpressionStatement.
Static ReadonlyisGets if the node is an ExpressionWithTypeArguments.
Static ReadonlyisGets if the node is an ExternalModuleReference.
Static ReadonlyisGets if the node is a ForInStatement.
Static ReadonlyisGets if the node is a ForOfStatement.
Static ReadonlyisGets if the node is a ForStatement.
Static ReadonlyisGets if the node is a FunctionDeclaration.
Static ReadonlyisGets if the node is a FunctionExpression.
Static ReadonlyisGets if the node is a HeritageClause.
Static ReadonlyisGets if the node is a Identifier.
Static ReadonlyisGets if the node is a IfStatement.
Static ReadonlyisGets if the node is a ImportAttribute.
Static ReadonlyisGets if the node is a ImportAttributes.
Static ReadonlyisGets if the node is a ImportClause.
Static ReadonlyisGets if the node is a ImportDeclaration.
Static ReadonlyisGets if the node is a ImportEqualsDeclaration.
Static ReadonlyisGets if the node is a ImportSpecifier.
Static ReadonlyisGets if the node is a InferKeyword.
Static ReadonlyisGets if the node is a InterfaceDeclaration.
Static ReadonlyisGets if the node is a JSDoc.
Static ReadonlyisGets if the node is a JSDocAllType.
Static ReadonlyisGets if the node is a JSDocAugmentsTag.
Static ReadonlyisGets if the node is a JSDocAuthorTag.
Static ReadonlyisGets if the node is a JSDocCallbackTag.
Static ReadonlyisGets if the node is a JSDocClassTag.
Static ReadonlyisGets if the node is a JSDocDeprecatedTag.
Static ReadonlyisGets if the node is a JSDocEnumTag.
Static ReadonlyisGets if the node is a JSDocFunctionType.
Static ReadonlyisGets if the node is a JSDocImplementsTag.
Static ReadonlyisGets if the node is a JSDocLink.
Static ReadonlyisGets if the node is a JSDocLinkCode.
Static ReadonlyisGets if the node is a JSDocLinkPlain.
Static ReadonlyisGets if the node is a JSDocMemberName.
Static ReadonlyisGets if the node is a JSDocNamepathType.
Static ReadonlyisGets if the node is a JSDocNameReference.
Static ReadonlyisGets if the node is a JSDocNonNullableType.
Static ReadonlyisGets if the node is a JSDocNullableType.
Static ReadonlyisGets if the node is a JSDocOptionalType.
Static ReadonlyisGets if the node is a JSDocOverloadTag.
Static ReadonlyisGets if the node is a JSDocOverrideTag.
Static ReadonlyisGets if the node is a JSDocParameterTag.
Static ReadonlyisGets if the node is a JSDocPrivateTag.
Static ReadonlyisGets if the node is a JSDocPropertyTag.
Static ReadonlyisGets if the node is a JSDocProtectedTag.
Static ReadonlyisGets if the node is a JSDocPublicTag.
Static ReadonlyisGets if the node is a JSDocReadonlyTag.
Static ReadonlyisGets if the node is a JSDocReturnTag.
Static ReadonlyisGets if the node is a JSDocSatisfiesTag.
Static ReadonlyisGets if the node is a JSDocSeeTag.
Static ReadonlyisGets if the node is a JSDocSignature.
Static ReadonlyisGets if the node is a JSDocTemplateTag.
Static ReadonlyisGets if the node is a JSDocText.
Static ReadonlyisGets if the node is a JSDocThisTag.
Static ReadonlyisGets if the node is a JSDocThrowsTag.
Static ReadonlyisGets if the node is a JSDocTypedefTag.
Static ReadonlyisGets if the node is a JSDocTypeExpression.
Static ReadonlyisGets if the node is a JSDocTypeLiteral.
Static ReadonlyisGets if the node is a JSDocTypeTag.
Static ReadonlyisGets if the node is a JSDocUnknownType.
Static ReadonlyisGets if the node is a JSDocVariadicType.
Static ReadonlyisGets if the node is a JsxAttribute.
Static ReadonlyisGets if the node is a JsxClosingElement.
Static ReadonlyisGets if the node is a JsxClosingFragment.
Static ReadonlyisGets if the node is a JsxElement.
Static ReadonlyisGets if the node is a JsxExpression.
Static ReadonlyisGets if the node is a JsxFragment.
Static ReadonlyisGets if the node is a JsxNamespacedName.
Static ReadonlyisGets if the node is a JsxOpeningElement.
Static ReadonlyisGets if the node is a JsxOpeningFragment.
Static ReadonlyisGets if the node is a JsxSelfClosingElement.
Static ReadonlyisGets if the node is a JsxSpreadAttribute.
Static ReadonlyisGets if the node is a JsxText.
Static ReadonlyisGets if the node is a LabeledStatement.
Static ReadonlyisGets if the node is a MetaProperty.
Static ReadonlyisGets if the node is a MethodDeclaration.
Static ReadonlyisGets if the node is a MethodSignature.
Static ReadonlyisGets if the node is a ModuleBlock.
Static ReadonlyisGets if the node is a ModuleDeclaration.
Static ReadonlyisGets if the node is a NamedExports.
Static ReadonlyisGets if the node is a NamedImports.
Static ReadonlyisGets if the node is a NamedTupleMember.
Static ReadonlyisGets if the node is a NamespaceExport.
Static ReadonlyisGets if the node is a NamespaceImport.
Static ReadonlyisGets if the node is a NeverKeyword.
Static ReadonlyisGets if the node is a NewExpression.
Static ReadonlyisGets if the node is a NonNullExpression.
Static ReadonlyisGets if the node is a NoSubstitutionTemplateLiteral.
Static ReadonlyisGets if the node is a NotEmittedStatement.
Static ReadonlyisGets if the node is a NumberKeyword.
Static ReadonlyisGets if the node is a NumericLiteral.
Static ReadonlyisGets if the node is a ObjectBindingPattern.
Static ReadonlyisGets if the node is a ObjectKeyword.
Static ReadonlyisGets if the node is a ObjectLiteralExpression.
Static ReadonlyisGets if the node is a OmittedExpression.
Static ReadonlyisGets if the node is a ParenthesizedExpression.
Static ReadonlyisGets if the node is a PartiallyEmittedExpression.
Static ReadonlyisGets if the node is a PostfixUnaryExpression.
Static ReadonlyisGets if the node is a PrefixUnaryExpression.
Static ReadonlyisGets if the node is a PrivateIdentifier.
Static ReadonlyisGets if the node is a PropertyAccessExpression.
Static ReadonlyisGets if the node is a PropertyAssignment.
Static ReadonlyisGets if the node is a PropertyDeclaration.
Static ReadonlyisGets if the node is a PropertySignature.
Static ReadonlyisGets if the node is a QualifiedName.
Static ReadonlyisGets if the node is a RegularExpressionLiteral.
Static ReadonlyisGets if the node is a ReturnStatement.
Static ReadonlyisGets if the node is a SatisfiesExpression.
Static ReadonlyisGets if the node is a SemicolonToken.
Static ReadonlyisGets if the node is a ShorthandPropertyAssignment.
Static ReadonlyisGets if the node is a SourceFile.
Static ReadonlyisGets if the node is a SpreadAssignment.
Static ReadonlyisGets if the node is a SpreadElement.
Static ReadonlyisGets if the node is a StringKeyword.
Static ReadonlyisGets if the node is a StringLiteral.
Static ReadonlyisGets if the node is a SwitchStatement.
Static ReadonlyisGets if the node is a SymbolKeyword.
Static ReadonlyisGets if the node is a SyntaxList.
Static ReadonlyisGets if the node is a TaggedTemplateExpression.
Static ReadonlyisGets if the node is a TemplateExpression.
Static ReadonlyisGets if the node is a TemplateHead.
Static ReadonlyisGets if the node is a TemplateMiddle.
Static ReadonlyisGets if the node is a TemplateSpan.
Static ReadonlyisGets if the node is a TemplateTail.
Static ReadonlyisGets if the node is a ThrowStatement.
Static ReadonlyisGets if the node is a TryStatement.
Static ReadonlyisGets if the node is a TypeAliasDeclaration.
Static ReadonlyisGets if the node is a TypeOfExpression.
Static ReadonlyisGets if the node is a UndefinedKeyword.
Static ReadonlyisGets if the node is a VariableDeclaration.
Static ReadonlyisGets if the node is a VariableDeclarationList.
Static ReadonlyisGets if the node is a VariableStatement.
Static ReadonlyisGets if the node is a VoidExpression.
Static ReadonlyisGets if the node is a WhileStatement.
Static ReadonlyisGets if the node is a WithStatement.
Static ReadonlyisGets if the node is a YieldExpression.
Gets the underlying compiler node.
Add call signature.
Structure representing the call signature.
Add call signatures.
Structures representing the call signatures.
Add construct signature.
Structure representing the construct signature.
Add construct signatures.
Structures representing the construct signatures.
Adds multiple extends clauses.
Texts to add for the extends clause.
Adds an extends clause.
Text to add for the extends clause.
Add get accessor.
Structure representing the get accessor.
Add get accessors.
Structures representing the get accessors.
Add index signature.
Structure representing the index signature.
Add index signatures.
Structures representing the index signatures.
Adds a JS doc.
Structure to add.
Adds JS docs.
Structures to add.
Adds a member.
Member to add.
Adds members.
Collection of members to add.
Add method.
Structure representing the method.
Add methods.
Structures representing the methods.
Add properties.
Structures representing the properties.
Add property.
Structure representing the property.
Add set accessor.
Structure representing the set accessor.
Add set accessors.
Structures representing the set accessors.
Adds a type parameter.
Structure of the type parameter.
Adds type parameters.
Structures of the type parameters.
Appends the specified whitespace to current node.
Text or writer function.
Gets the node as the specified kind if it is equal to that kind, otherwise returns undefined.
Syntax kind.
Gets the node as the specified kind if it is equal to that kind, otherwise throws.
Syntax kind.
Optionalmessage: string | (() => string)If the node contains the provided range (inclusive).
Start position.
End position.
Finds the references of the definition of the node.
Invokes the cbNode callback for each child and the cbNodeArray for every array of nodes stored in properties of the node.
If cbNodeArray is not defined, then it will pass every element of the array to cbNode.
The first truthy value returned by a callback.
Invokes the cbNode callback for each descendant and the cbNodeArray for every array of nodes stored in properties of the node and descendant nodes.
If cbNodeArray is not defined, then it will pass every element of the array to cbNode.
Callback invoked for each descendant.
OptionalcbNodeArray: (Callback invoked for each array of nodes.
The first truthy value returned by a callback.
Releases the node and all its descendants from the underlying node cache and ast.
This is useful if you want to improve the performance of manipulation by not tracking this node anymore.
Forgets the descendants of this node.
Formats the node's text using the internal TypeScript formatting API.
Optionalsettings: FormatCodeSettingsFormat code settings.
Gets the base declarations.
Gets the first call signature by a find function.
Function to find the call signature by.
Gets the first call signature by a find function or throws if not found.
Function to find the call signature by.
Gets the interface call signatures.
Gets the child at the specified index if it's the specified kind or returns undefined.
Child index to get.
Expected kind.
Gets the child at the specified index if it's the specified kind or throws an exception.
Child index to get.
Expected kind.
Optionalmessage: string | (() => string)Gets the number of children the node has.
Gets the child indentation level of the current node.
Gets the next indentation level text.
Optionaloffset: numberOptional number of levels of indentation to add or remove.
Gets the child index of this node relative to the parent.
Gets the children based on a kind.
Syntax kind.
Gets the child syntax list if it exists.
Gets the child syntax list or throws if it doesn't exist.
Optionalmessage: string | (() => string)Gets the combined modifier flags.
Gets the first construct signature by a find function.
Function to find the construct signature by.
Gets the first construct signature by a find function or throws if not found.
Function to find the construct signature by.
Gets the interface construct signatures.
Gets the declare keyword or throws if it doesn't exist.
Optionalmessage: string | (() => string)Gets the default keyword or throws if none exists.
Optionalmessage: string | (() => string)Gets the descendants that match a specified syntax kind.
Kind to check.
Gets the node's descendant statements and any arrow function statement-like expressions (ex. returns the expression 5 in () => 5).
Gets the line number of the end of the node.
Gets the export keyword or throws if none exists.
Optionalmessage: string | (() => string)Gets the extends clauses.
Get the first ancestor by syntax kind.
Syntax kind.
Gets the first ancestor by syntax kind or throws if not found.
Syntax kind.
Optionalmessage: string | (() => string)Gets the first child by syntax kind.
Syntax kind.
Gets the first child by syntax kind or throws an error if not found.
Syntax kind.
Optionalmessage: string | (() => string)Gets the first child if it matches the specified syntax kind.
Syntax kind.
Gets the first child if it matches the specified syntax kind or throws an error if not found.
Syntax kind.
Optionalmessage: string | (() => string)Gets the first descendant by syntax kind.
Syntax kind.
Gets the first descendant by syntax kind or throws.
Syntax kind.
Optionalmessage: string | (() => string)Gets the first modifier of the specified syntax kind or undefined if none found.
Syntax kind.
Gets the first modifier of the specified syntax kind or throws if none found.
Syntax kind.
Gets the source file text position of the end of the last significant token or the start of the source file.
Gets the full text with leading trivia (comments and whitespace).
Gets the text length of the node with trivia.
Gets the first get accessor by name.
Name.
Gets the first get accessor by a find function.
Function to find the get accessor by.
Gets the first get accessor by name or throws if not found.
Name.
Gets the first get accessor by a find function or throws if not found.
Function to find the get accessor by.
Gets the interface get accessor declarations.
Gets the heritage clause by kind.
Gets the heritage clause by kind or throws if it doesn't exist.
Gets the heritage clauses of the node.
Gets all the implementations of the interface.
This is similar to "go to implementation."
Gets the indentation level of the current node.
Gets the indentation text.
Optionaloffset: numberOptional number of levels of indentation to add or remove.
Gets the first index signature by a find function.
Function to find the index signature by.
Gets the first index signature by a find function or throws if not found.
Function to find the index signature by.
Gets the interface index signatures.
Gets the JS doc nodes.
Gets the syntax kind.
Gets the syntax kind name.
Gets the last child by syntax kind.
Syntax kind.
Gets the last child by syntax kind or throws an error if not found.
Syntax kind.
Optionalmessage: string | (() => string)Gets the last child if it matches the specified syntax kind.
Syntax kind.
Gets the last child if it matches the specified syntax kind or throws an error if not found.
Syntax kind.
Optionalmessage: string | (() => string)Gets the last token of this node. Usually this is a close brace.
Gets the leading comment ranges of the current node.
Gets the node's leading trivia's text length.
Gets the specified local symbol by name or returns undefined if it doesn't exist.
WARNING: The symbol table of locals is not exposed publicly by the compiler. Use this at your own risk knowing it may break.
Name of the local symbol.
Gets the specified local symbol by name or throws if it doesn't exist.
WARNING: The symbol table of locals is not exposed publicly by the compiler. Use this at your own risk knowing it may break.
Name of the local symbol.
Optionalmessage: string | (() => string)Gets the symbols within the current scope.
WARNING: The symbol table of locals is not exposed publicly by the compiler. Use this at your own risk knowing it may break.
Gets all the members.
Gets all the members with comment type elements.
Gets the first method by a find function.
Function to find the method by.
Gets the first method by name or throws if not found.
Name.
Gets the first method by a find function or throws if not found.
Function to find the method by.
Gets the interface method signatures.
Gets the name as a string.
Gets the name node.
Gets the next sibling if it matches the specified kind.
Kind to check.
Gets the next sibiling if it matches the specified kind, or throws.
Kind to check.
Optionalmessage: string | (() => string)Gets a compiler node property wrapped in a Node.
Property name.
Gets the first source file text position that is not whitespace taking into account comment nodes and a previous node's trailing trivia.
Gets the parent if it's a certain syntax kind.
Gets the parent if it's a certain syntax kind or throws.
Optionalmessage: string | (() => string)Gets the parent module declaration or undefined if it doesn't exist.
Gets the parent module declaration or throws if it doesn't exist.
Optionalmessage: string | (() => string)Gets the parent if it's a syntax list.
Gets the parent if it's a syntax list or throws an error otherwise.
Optionalmessage: string | (() => string)Goes up the parents (ancestors) of the node while a condition is true. Returns undefined if the initial parent doesn't match the condition.
Goes up the parents (ancestors) of the node while the parent is the specified syntax kind. Returns undefined if the initial parent is not the specified syntax kind.
Syntax kind to check for.
Goes up the parents (ancestors) of the node while the parent is the specified syntax kind. Throws if the initial parent is not the specified syntax kind.
Syntax kind to check for.
Optionalmessage: string | (() => string)Goes up the parents (ancestors) of the node while a condition is true. Throws if the initial parent doesn't match the condition.
Goes up the parents (ancestors) of the node while a condition is true. Throws if the initial parent doesn't match the condition.
Gets the source file text position where the node starts that includes the leading trivia (comments and whitespace).
Gets the previous sibling if it matches the specified kind.
Kind to check.
Gets the previous sibiling if it matches the specified kind, or throws.
Kind to check.
Optionalmessage: string | (() => string)Gets the project.
Gets the interface property signatures.
Gets the first property by a find function.
Function to find the property by.
Gets the first property by name or throws if not found.
Name.
Gets the first property by a find function or throws if not found.
Function to find the property by.
Gets the first set accessor by name.
Name.
Gets the first set accessor by a find function.
Function to find the set accessor by.
Gets the first set accessor by name or throws if not found.
Name.
Gets the first set accessor by a find function or throws if not found.
Function to find the set accessor by.
Gets the interface set accessor declarations.
Gets the source file.
Gets the source file text position where the node starts that does not include the leading trivia (comments and whitespace).
OptionalincludeJsDocComments: booleanWhether to include the JS doc comments.
Gets the line number at the start of the node.
OptionalincludeJsDocComments: booleanWhether to include the JS doc comments or not.
Gets the position of the start of the line that this node starts on.
OptionalincludeJsDocComments: booleanWhether to include the JS doc comments or not.
Gets the structure equivalent to this node.
Gets the compiler symbol or undefined if it doesn't exist.
Gets the symbol or throws an error if it doesn't exist.
Optionalmessage: string | (() => string)Gets the symbols in the scope of the node.
Note: This will always return the local symbols. If you want the export symbol from a local symbol, then
use the #getExportSymbol() method on the symbol.
Meaning of symbol to filter by.
Gets the text without leading trivia (comments and whitespace).
OptionalincludeJsDocComments: booleanWhether to include the js doc comments when getting the text.
Gets the text without leading trivia (comments and whitespace).
Options for getting the text.
Gets the trailing comment ranges of the current node.
Gets the text position of the next significant token or new line.
Gets the text length from the end of the current node to the next significant token or new line.
Gets the type of the node.
Gets a type parameter or undefined if it doesn't exist.
Name of the parameter.
Gets a type parameter or undefined if it doesn't exist.
Function to use to find the type parameter.
Gets a type parameter or throws if it doesn't exist.
Name of the parameter.
Gets a type parameter or throws if it doesn't exist.
Function to use to find the type parameter.
Gets the type parameters.
Gets the text length of the node without trivia.
OptionalincludeJsDocComments: booleanWhether to include the JS doc comments in the width or not.
If the node has the declare keyword.
If the node has the default keyword.
If the node has the export keyword.
Gets if it has the specified modifier.
Syntax kind to check for.
Gets if it has the specified modifier.
Text to check for.
Insert call signature.
Child index to insert at.
Structure representing the call signature.
Insert call signatures.
Child index to insert at.
Structures representing the call signatures.
Insert construct signature.
Child index to insert at.
Structure representing the construct signature.
Insert construct signatures.
Child index to insert at.
Structures representing the construct signatures.
Inserts multiple extends clauses.
Texts to insert for the extends clause.
Inserts an extends clause.
Text to insert for the extends clause.
Insert get accessor.
Child index to insert at.
Structure representing the get accessor.
Insert get accessors.
Child index to insert at.
Structures representing the get accessors.
Insert index signature.
Child index to insert at.
Structure representing the index signature.
Insert index signatures.
Child index to insert at.
Structures representing the index signatures.
Inserts a JS doc.
Child index to insert at.
Structure to insert.
Inserts JS docs.
Child index to insert at.
Structures to insert.
Inserts a member.
Child index to insert at.
Member to insert.
Inserts members.
Child index to insert at.
Collection of members to insert.
Insert method.
Child index to insert at.
Structure representing the method.
Insert methods.
Child index to insert at.
Structures representing the methods.
Insert properties.
Child index to insert at.
Structures representing the properties.
Insert property.
Child index to insert at.
Structure representing the property.
Insert set accessor.
Child index to insert at.
Structure representing the set accessor.
Insert set accessors.
Child index to insert at.
Structures representing the set accessors.
Inserts text within the body of the node.
WARNING: This will forget any previously navigated descendant nodes.
Position to insert at.
Text to insert.
Inserts a type parameter.
Child index to insert at. Specify a negative index to insert from the reverse.
Structure of the type parameter.
Inserts type parameters.
Child index to insert at. Specify a negative index to insert from the reverse.
Structures of the type parameters.
Gets if the node is ambient.
Gets if this node is a default export of a file.
Gets if the node is exported from a namespace, is a default export, or is a named export.
Gets if this is the first node on the current line.
Gets if the specified position is within a string.
Position.
Gets if this node is in a syntax list.
Returns if the node is the specified kind.
This is a type guard.
Syntax kind.
Gets if this node is a named export of a file.
Prepends the specified whitespace to current node.
Text or writer function.
Prints the node using the compiler's printer.
Optionaloptions: PrintNodeOptionsOptions.
Removes the statement.
Removes the extends at the specified index.
Index to remove.
Removes the specified extends.
Node of the extend to remove.
Removes all the text within the node
Removes text within the body of the node.
WARNING: This will forget any previously navigated descendant nodes.
Start position to remove.
End position to remove.
Renames the name of the node.
New name.
Optionaloptions: RenameOptionsOptions for renaming.
Replaces text within the body of the node.
WARNING: This will forget any previously navigated descendant nodes.
Start and end position of the text to replace.
Text to replace the range with.
Replaces the text of the current node with new text.
This will forget the current node and return a new node that can be asserted or type guarded to the correct type.
Text or writer function to replace with.
The new node.
Sets the node from a structure.
Structure to set the node with.
Sets if this node has a declare keyword.
Optionalvalue: booleanTo add the declare keyword or not.
Sets if this node is a default export of a file.
If it should be a default export or not.
Sets if the node is exported.
Note: Will remove the default keyword if set.
If it should be exported or not.
Sets the child order of the node within the parent.
Toggles a modifier.
Text to toggle the modifier for.
Optionalvalue: booleanOptional toggling value.
Transforms the node using the compiler api nodes and functions and returns the node that was transformed (experimental).
WARNING: This will forget descendants of transformed nodes and potentially this node.
sourceFile.transform(traversal => {
const node = traversal.visitChildren(); // recommend always visiting the children first (post order)
if (ts.isNumericLiteral(node))
return ts.createNumericLiteral((parseInt(node.text, 10) + 1).toString());
return node;
});
const classDec = sourceFile.getClassOrThrow("MyClass");
classDec.transform(traversal => {
const node = traversal.currentNode;
return ts.updateClassDeclaration(node, undefined, undefined, ts.createIdentifier("MyUpdatedClass"), undefined, undefined, []);
});
Gets if the compiler node was forgotten.
This will be true when the compiler node was forgotten or removed.
StatichasStatichasStatichasStatichasStaticisStaticisGets if the node is an AbstractableNode.
StaticisGets if the node is an AmbientableNode.
StaticisStaticisGets if the node is an ArrayTypeNode.
StaticisGets if the node is an AsyncableNode.
StaticisStaticisStaticisStaticisStaticisGets if the node is a CallSignatureDeclaration.
StaticisStaticisStaticisGets if the provided node is a CommentClassElement.
StaticisGets if the provided node is a CommentEnumMember.
StaticisGets if the provided node is a comment node.
StaticisGets if the provided node is a CommentObjectLiteralElement.
StaticisGets if the provided node is a CommentStatement.
StaticisGets if the provided value is a CommentTypeElement.
StaticisGets if the node is a ConditionalTypeNode.
StaticisGets if the node is a ConstructorDeclaration.
StaticisGets if the node is a ConstructorTypeNode.
StaticisGets if the node is a ConstructSignatureDeclaration.
StaticisGets if the node is a DecoratableNode.
StaticisStaticisStaticisGets if the node is an ExportableNode.
StaticisStaticisGets if the node is an Expression.
StaticisStaticisStaticisGets if the node is an ExtendsClauseableNode.
StaticisGets if the node is a FalseLiteral.
StaticisStaticisGets if the node is a FunctionTypeNode.
StaticisStaticisGets if the node is a GetAccessorDeclaration.
StaticisStaticisGets if the node is a ImplementsClauseableNode.
StaticisStaticisGets if the node is a ImportExpression.
StaticisGets if the node is a ImportTypeNode.
StaticisGets if the node is a IndexedAccessTypeNode.
StaticisGets if the node is a IndexSignatureDeclaration.
StaticisGets if the node is a InferTypeNode.
StaticisStaticisStaticisGets if the node is a IntersectionTypeNode.
StaticisGets if the node is a IterationStatement.
StaticisStaticisStaticisStaticisStaticisStaticisStaticisGets if the node is a JSDocUnknownTag.
StaticisGets if the node is a JsxAttributedNode.
StaticisStaticisGets if the node is a LeftHandSideExpression.
StaticisStaticisGets if the node is a LiteralExpression.
StaticisStaticisGets if the node is a LiteralTypeNode.
StaticisGets if the node is a MappedTypeNode.
StaticisGets if the node is a MemberExpression.
StaticisStaticisStaticisGets if the node is a ModuledNode.
StaticisStaticisStaticisStaticisStaticisGets if the node is a NodeWithTypeArguments.
StaticisGets if the node is a NullLiteral.
StaticisGets if the node is a OverloadableNode.
StaticisGets if the node is a OverrideableNode.
StaticisGets if the node is a ParameterDeclaration.
StaticisStaticisGets if the node is a ParenthesizedTypeNode.
StaticisGets if the node is a PrimaryExpression.
StaticisStaticisStaticisStaticisGets if the node is a ReadonlyableNode.
StaticisStaticisStaticisGets if the node is a RestTypeNode.
StaticisStaticisGets if the node is a ScopeableNode.
StaticisStaticisGets if the node is a SetAccessorDeclaration.
StaticisStaticisStaticisStaticisGets if the node is a StaticableNode.
StaticisGets if the node is a SuperExpression.
StaticisGets if the node is a TemplateLiteralTypeNode.
StaticisStaticisGets if the node is a ThisExpression.
StaticisGets if the node is a ThisTypeNode.
StaticisGets if the node is a TrueLiteral.
StaticisGets if the node is a TupleTypeNode.
StaticisStaticisGets if the node is a TypeAssertion.
StaticisStaticisGets if the node is a TypeElement.
StaticisStaticisGets if the node is a TypeLiteralNode.
StaticisStaticisGets if the node is a TypeOperatorTypeNode.
StaticisGets if the node is a TypeParameterDeclaration.
StaticisStaticisGets if the node is a TypePredicateNode.
StaticisGets if the node is a TypeQueryNode.
StaticisGets if the node is a TypeReferenceNode.
StaticisGets if the node is a UnaryExpression.
StaticisStaticisGets if the node is a UnionTypeNode.
StaticisStaticisGets if the node is a UpdateExpression.
Gets if the node is an AnyKeyword.