ts-simple-ast
- Version 21.0.4
- Published
- 1.95 MB
- 9 dependencies
- MIT license
Install
npm i ts-simple-ast
yarn add ts-simple-ast
pnpm add ts-simple-ast
Overview
TypeScript compiler wrapper for static analysis and code manipulation.
Index
Variables
- ArrayDestructuringAssignmentBase
- ArrowFunctionBase
- AsExpressionBase
- AssignmentExpressionBase
- AwaitExpressionBase
- BinaryExpressionBase
- BindingElementBase
- BlockBase
- BooleanLiteralBase
- BreakStatementBase
- CallExpressionBase
- CallSignatureDeclarationBase
- CaseBlockBase
- CaseClauseBase
- CatchClauseBase
- ClassDeclarationBase
- ClassExpressionBase
- CommaListExpressionBase
- ConditionalExpressionBase
- ConstructorDeclarationBase
- ConstructorDeclarationOverloadBase
- ConstructSignatureDeclarationBase
- ContinueStatementBase
- DebuggerStatementBase
- DecoratorBase
- DefaultClauseBase
- DeleteExpressionBase
- DoStatementBase
- ElementAccessExpressionBase
- EmptyStatementBase
- EnumDeclarationBase
- EnumMemberBase
- ExportAssignmentBase
- ExportDeclarationBase
- ExportSpecifierBase
- ExpressionStatementBase
- ExpressionWithTypeArgumentsBase
- ForInStatementBase
- ForOfStatementBase
- ForStatementBase
- FunctionDeclarationBase
- FunctionDeclarationOverloadBase
- FunctionExpressionBase
- FunctionOrConstructorTypeNodeBaseBase
- FunctionTypeNodeBase
- GetAccessorDeclarationBase
- IdentifierBase
- IfStatementBase
- ImportClauseBase
- ImportDeclarationBase
- ImportEqualsDeclarationBase
- ImportExpressionBase
- ImportSpecifierBase
- ImportTypeNodeBase
- IndexSignatureDeclarationBase
- InterfaceDeclarationBase
- IterationStatementBase
- JSDocBase
- JSDocParameterTagBase
- JSDocPropertyTagBase
- JsxAttributeBase
- JsxClosingElementBase
- JsxElementBase
- JsxOpeningElementBase
- JsxSelfClosingElementBase
- JsxSpreadAttributeBase
- LabeledStatementBase
- LiteralExpressionBase
- MetaPropertyBase
- MethodDeclarationBase
- MethodDeclarationOverloadBase
- MethodSignatureBase
- ModuleBlockBase
- NamedExportsBase
- NamedImportsBase
- NamespaceDeclarationBase
- NamespaceImportBase
- NewExpressionBase
- NonNullExpressionBase
- NoSubstitutionTemplateLiteralBase
- NotEmittedStatementBase
- NullLiteralBase
- NumericLiteralBase
- ObjectDestructuringAssignmentBase
- ObjectLiteralExpressionBase
- OmittedExpressionBase
- ParameterDeclarationBase
- ParenthesizedExpressionBase
- PartiallyEmittedExpressionBase
- PostfixUnaryExpressionBase
- PrefixUnaryExpressionBase
- PropertyAccessExpressionBase
- PropertyAssignmentBase
- PropertyDeclarationBase
- PropertySignatureBase
- RegularExpressionLiteralBase
- ReturnStatementBase
- SetAccessorDeclarationBase
- ShorthandPropertyAssignmentBase
- SourceFileBase
- SpreadAssignmentBase
- SpreadElementBase
- StringLiteralBase
- SuperElementAccessExpressionBase
- SuperExpressionBase
- SuperPropertyAccessExpressionBase
- SwitchStatementBase
- TemplateExpressionBase
- TemplateHeadBase
- TemplateMiddleBase
- TemplateSpanBase
- TemplateTailBase
- ThisExpressionBase
- ThrowStatementBase
- TryStatementBase
- TypeAliasDeclarationBase
- TypeAssertionBase
- TypeLiteralNodeBase
- TypeOfExpressionBase
- TypeParameterDeclarationBase
- VariableDeclarationBase
- VariableDeclarationListBase
- VariableStatementBase
- VoidExpressionBase
- WhileStatementBase
- WithStatementBase
- YieldExpressionBase
Functions
- AbstractableNode()
- AmbientableNode()
- ArgumentedNode()
- AsyncableNode()
- AwaitableNode()
- BindingNamedNode()
- BodiedNode()
- BodyableNode()
- ChildOrderableNode()
- ClassLikeDeclarationBase()
- ClassLikeDeclarationBaseSpecific()
- createWrappedNode()
- DeclarationNamedNode()
- DecoratableNode()
- ExclamationTokenableNode()
- ExportableNode()
- ExpressionedNode()
- ExtendsClauseableNode()
- FunctionLikeDeclaration()
- GeneratorableNode()
- getCompilerOptionsFromTsConfig()
- HeritageClauseableNode()
- ImplementsClauseableNode()
- ImportExpressionedNode()
- InitializerExpressionableNode()
- InitializerGetExpressionableNode()
- InitializerSetExpressionableNode()
- JSDocableNode()
- JSDocPropertyLikeTag()
- JsxAttributedNode()
- JsxTagNamedNode()
- LeftHandSideExpressionedNode()
- LiteralLikeNode()
- ModifierableNode()
- ModuledNode()
- NameableNode()
- NamedNode()
- NamedNodeBase()
- NamespaceChildableNode()
- OverloadableNode()
- ParameteredNode()
- printNode()
- PropertyNamedNode()
- QuestionTokenableNode()
- ReadonlyableNode()
- ReferenceFindableNode()
- RenameableNode()
- ReturnTypedNode()
- ScopeableNode()
- ScopedNode()
- SignaturedDeclaration()
- StatementedNode()
- StaticableNode()
- SuperExpressionedNode()
- TextInsertableNode()
- TypeArgumentedNode()
- TypedNode()
- TypeElementMemberedNode()
- TypeParameteredNode()
- UnaryExpressionedNode()
- UnwrappableNode()
Classes
CodeBlockWriter
- blankLine()
- blankLineIfLastNot()
- block()
- conditionalBlankLine()
- conditionalNewLine()
- conditionalWrite()
- conditionalWriteLine()
- getIndentationLevel()
- getLastChar()
- getLength()
- getOptions()
- indent()
- indentBlock()
- inlineBlock()
- isAtStartOfFirstLineOfBlock()
- isInComment()
- isInString()
- isLastBlankLine()
- isLastNewLine()
- isLastSpace()
- isLastTab()
- isOnFirstLineOfBlock()
- newLine()
- newLineIfLastNot()
- queueIndentationLevel()
- quote()
- setIndentationLevel()
- space()
- spaceIfLastNot()
- tab()
- tabIfLastNot()
- toString()
- write()
- writeLine()
Decorator
- addArgument()
- addArguments()
- addTypeArgument()
- addTypeArguments()
- getArguments()
- getCallExpression()
- getCallExpressionOrThrow()
- getExpression()
- getFullName()
- getName()
- getNameNode()
- getStructure()
- getTypeArguments()
- insertArgument()
- insertArguments()
- insertTypeArgument()
- insertTypeArguments()
- isDecoratorFactory()
- remove()
- removeArgument()
- removeTypeArgument()
- set()
- setIsDecoratorFactory()
Directory
- addExistingDirectory()
- addExistingDirectoryIfExists()
- addExistingSourceFile()
- addExistingSourceFileIfExists()
- addExistingSourceFiles()
- copy()
- copyImmediately()
- copyImmediatelySync()
- copyToDirectory()
- createDirectory()
- createSourceFile()
- delete()
- deleteImmediately()
- deleteImmediatelySync()
- emit()
- emitSync()
- forget()
- getBaseName()
- getDescendantDirectories()
- getDescendantSourceFiles()
- getDirectories()
- getDirectory()
- getDirectoryOrThrow()
- getParent()
- getParentOrThrow()
- getPath()
- getRelativePathAsModuleSpecifierTo()
- getRelativePathTo()
- getSourceFile()
- getSourceFileOrThrow()
- getSourceFiles()
- isAncestorOf()
- isDescendantOf()
- move()
- moveImmediately()
- moveImmediatelySync()
- moveToDirectory()
- save()
- saveSync()
- wasForgotten()
ExportDeclaration
- addNamedExport()
- addNamedExports()
- getModuleSpecifier()
- getModuleSpecifierSourceFile()
- getModuleSpecifierSourceFileOrThrow()
- getModuleSpecifierValue()
- getNamedExports()
- getStructure()
- hasModuleSpecifier()
- hasNamedExports()
- insertNamedExport()
- insertNamedExports()
- isModuleSpecifierRelative()
- isNamespaceExport()
- removeModuleSpecifier()
- set()
- setModuleSpecifier()
- toNamespaceExport()
ImportDeclaration
- addNamedImport()
- addNamedImports()
- getDefaultImport()
- getDefaultImportOrThrow()
- getImportClause()
- getImportClauseOrThrow()
- getModuleSpecifier()
- getModuleSpecifierSourceFile()
- getModuleSpecifierSourceFileOrThrow()
- getModuleSpecifierValue()
- getNamedImports()
- getNamespaceImport()
- getNamespaceImportOrThrow()
- getStructure()
- insertNamedImport()
- insertNamedImports()
- isModuleSpecifierRelative()
- removeDefaultImport()
- removeNamedImports()
- removeNamespaceImport()
- renameDefaultImport()
- set()
- setDefaultImport()
- setModuleSpecifier()
- setNamespaceImport()
LanguageService
- compilerObject
- findReferences()
- findReferencesAsNodes()
- findReferencesAtPosition()
- findRenameLocations()
- getCodeFixesAtPosition()
- getCombinedCodeFix()
- getDefinitions()
- getDefinitionsAtPosition()
- getEditsForRefactor()
- getEmitOutput()
- getFormattedDocumentText()
- getFormattingEditsForDocument()
- getFormattingEditsForRange()
- getIdentationAtPosition()
- getImplementations()
- getImplementationsAtPosition()
- getProgram()
- getSuggestionDiagnostics()
- organizeImports()
- renameLocations()
- renameNode()
Node
- appendWhitespace()
- compilerNode
- containsRange()
- forEachChild()
- forEachDescendant()
- forget()
- forgetDescendants()
- formatText()
- getAncestors()
- getChildAtIndex()
- getChildAtIndexIfKind()
- getChildAtIndexIfKindOrThrow()
- getChildAtPos()
- getChildCount()
- getChildIndentationLevel()
- getChildIndentationText()
- getChildIndex()
- getChildren()
- getChildrenOfKind()
- getChildSyntaxList()
- getChildSyntaxListOrThrow()
- getCombinedModifierFlags()
- getDescendantAtPos()
- getDescendantAtStartWithWidth()
- getDescendants()
- getDescendantsOfKind()
- getDescendantStatements()
- getEnd()
- getEndLineNumber()
- getFirstAncestor()
- getFirstAncestorByKind()
- getFirstAncestorByKindOrThrow()
- getFirstAncestorOrThrow()
- getFirstChild()
- getFirstChildByKind()
- getFirstChildByKindOrThrow()
- getFirstChildIfKind()
- getFirstChildIfKindOrThrow()
- getFirstChildOrThrow()
- getFirstDescendant()
- getFirstDescendantByKind()
- getFirstDescendantByKindOrThrow()
- getFirstDescendantOrThrow()
- getFullStart()
- getFullText()
- getFullWidth()
- getIndentationLevel()
- getIndentationText()
- getKind()
- getKindName()
- getLastChild()
- getLastChildByKind()
- getLastChildByKindOrThrow()
- getLastChildIfKind()
- getLastChildIfKindOrThrow()
- getLastChildOrThrow()
- getLastToken()
- getLeadingCommentRanges()
- getLeadingTriviaWidth()
- getNextSibling()
- getNextSiblingIfKind()
- getNextSiblingIfKindOrThrow()
- getNextSiblingOrThrow()
- getNextSiblings()
- getNodeProperty()
- getNonWhitespaceStart()
- getParent()
- getParentIfKind()
- getParentIfKindOrThrow()
- getParentOrThrow()
- getParentSyntaxList()
- getParentSyntaxListOrThrow()
- getParentWhile()
- getParentWhileKind()
- getParentWhileKindOrThrow()
- getParentWhileOrThrow()
- getPos()
- getPreviousSibling()
- getPreviousSiblingIfKind()
- getPreviousSiblingIfKindOrThrow()
- getPreviousSiblingOrThrow()
- getPreviousSiblings()
- getSourceFile()
- getStart()
- getStartLineNumber()
- getStartLinePos()
- getSymbol()
- getSymbolOrThrow()
- getText()
- getTrailingCommentRanges()
- getTrailingTriviaEnd()
- getTrailingTriviaWidth()
- getType()
- getWidth()
- isFirstNodeOnLine()
- isInStringAtPos()
- isInSyntaxList()
- prependWhitespace()
- print()
- replaceWithText()
- transform()
- wasForgotten()
ObjectLiteralExpression
- addGetAccessor()
- addGetAccessors()
- addMethod()
- addMethods()
- addPropertyAssignment()
- addPropertyAssignments()
- addSetAccessor()
- addSetAccessors()
- addShorthandPropertyAssignment()
- addShorthandPropertyAssignments()
- addSpreadAssignment()
- addSpreadAssignments()
- getProperties()
- getProperty()
- getPropertyOrThrow()
- insertGetAccessor()
- insertGetAccessors()
- insertMethod()
- insertMethods()
- insertPropertyAssignment()
- insertPropertyAssignments()
- insertSetAccessor()
- insertSetAccessors()
- insertShorthandPropertyAssignment()
- insertShorthandPropertyAssignments()
- insertSpreadAssignment()
- insertSpreadAssignments()
Project
- addExistingDirectory()
- addExistingDirectoryIfExists()
- addExistingSourceFile()
- addExistingSourceFileIfExists()
- addExistingSourceFiles()
- addSourceFilesFromTsConfig()
- applyFileTextChanges()
- compilerOptions
- createDirectory()
- createSourceFile()
- createWriter()
- emit()
- emitToMemory()
- enableLogging()
- forgetNodesCreatedInBlock()
- formatDiagnosticsWithColorAndContext()
- getAmbientModule()
- getAmbientModuleOrThrow()
- getAmbientModules()
- getCompilerOptions()
- getDirectories()
- getDirectory()
- getDirectoryOrThrow()
- getFileSystem()
- getLanguageService()
- getPreEmitDiagnostics()
- getProgram()
- getRootDirectories()
- getSourceFile()
- getSourceFileOrThrow()
- getSourceFiles()
- getTypeChecker()
- manipulationSettings
- removeSourceFile()
- resolveSourceFileDependencies()
- save()
- saveSync()
SourceFile
- applyTextChanges()
- copy()
- copyImmediately()
- copyImmediatelySync()
- copyToDirectory()
- delete()
- deleteImmediately()
- deleteImmediatelySync()
- emit()
- fixMissingImports()
- formatText()
- getBaseName()
- getBaseNameWithoutExtension()
- getDirectory()
- getDirectoryPath()
- getEmitOutput()
- getExtension()
- getFilePath()
- getFullText()
- getImportStringLiterals()
- getLanguageVariant()
- getLanguageVersion()
- getLengthFromLineStartAtPos()
- getLineNumberAtPos()
- getPreEmitDiagnostics()
- getReferencedFiles()
- getReferencingLiteralsInOtherSourceFiles()
- getReferencingNodesInOtherSourceFiles()
- getReferencingSourceFiles()
- getRelativePathAsModuleSpecifierTo()
- getRelativePathTo()
- getStructure()
- getTypeReferenceDirectives()
- indent()
- isDeclarationFile()
- isFromExternalLibrary()
- isInNodeModules()
- isSaved()
- move()
- moveImmediately()
- moveImmediatelySync()
- moveToDirectory()
- onModified()
- organizeImports()
- refreshFromFileSystem()
- refreshFromFileSystemSync()
- save()
- saveSync()
- set()
- unindent()
Symbol
- compilerSymbol
- getAliasedSymbol()
- getAliasedSymbolOrThrow()
- getDeclarations()
- getDeclaredType()
- getEscapedName()
- getExportByName()
- getExportByNameOrThrow()
- getExports()
- getFlags()
- getFullyQualifiedName()
- getGlobalExportByName()
- getGlobalExportByNameOrThrow()
- getGlobalExports()
- getMemberByName()
- getMemberByNameOrThrow()
- getMembers()
- getName()
- getTypeAtLocation()
- getValueDeclaration()
- getValueDeclarationOrThrow()
- hasFlags()
- isAlias()
Type
- compilerType
- getAliasSymbol()
- getAliasSymbolOrThrow()
- getAliasTypeArguments()
- getApparentProperties()
- getApparentProperty()
- getApparentType()
- getArrayType()
- getBaseTypeOfLiteralType()
- getBaseTypes()
- getCallSignatures()
- getConstraint()
- getConstraintOrThrow()
- getConstructSignatures()
- getDefault()
- getDefaultOrThrow()
- getFlags()
- getIntersectionTypes()
- getNonNullableType()
- getNumberIndexType()
- getObjectFlags()
- getProperties()
- getProperty()
- getStringIndexType()
- getSymbol()
- getSymbolOrThrow()
- getTargetType()
- getTargetTypeOrThrow()
- getText()
- getTupleElements()
- getTypeArguments()
- getUnionTypes()
- isAnonymous()
- isArray()
- isBoolean()
- isBooleanLiteral()
- isClass()
- isClassOrInterface()
- isEnum()
- isEnumLiteral()
- isInterface()
- isIntersection()
- isLiteral()
- isNull()
- isNullable()
- isNumber()
- isNumberLiteral()
- isObject()
- isString()
- isStringLiteral()
- isTuple()
- isTypeParameter()
- isUndefined()
- isUnion()
- isUnionOrIntersection()
TypeChecker
- compilerObject
- getAliasedSymbol()
- getAmbientModules()
- getApparentType()
- getBaseTypeOfLiteralType()
- getConstantValue()
- getContextualType()
- getDeclaredTypeOfSymbol()
- getExportsOfModule()
- getExportSpecifierLocalTargetSymbol()
- getFullyQualifiedName()
- getPropertiesOfType()
- getReturnTypeOfSignature()
- getSignatureFromNode()
- getSymbolAtLocation()
- getTypeAtLocation()
- getTypeOfSymbolAtLocation()
- getTypeText()
TypeGuards
- hasBody()
- hasExpression()
- hasName()
- isAbstractableNode()
- isAmbientableNode()
- isAnyKeyword()
- isArgumentedNode()
- isArrayBindingPattern()
- isArrayLiteralExpression()
- isArrayTypeNode()
- isArrowFunction()
- isAsExpression()
- isAsyncableNode()
- isAwaitableNode()
- isAwaitExpression()
- isBinaryExpression()
- isBindingElement()
- isBindingNamedNode()
- isBlock()
- isBodiedNode()
- isBodyableNode()
- isBooleanKeyword()
- isBooleanLiteral()
- isBreakStatement()
- isCallExpression()
- isCallSignatureDeclaration()
- isCaseBlock()
- isCaseClause()
- isCatchClause()
- isChildOrderableNode()
- isClassDeclaration()
- isClassExpression()
- isClassLikeDeclarationBase()
- isCommaListExpression()
- isComputedPropertyName()
- isConditionalExpression()
- isConstructorDeclaration()
- isConstructorTypeNode()
- isConstructSignatureDeclaration()
- isContinueStatement()
- isDebuggerStatement()
- isDeclarationNamedNode()
- isDecoratableNode()
- isDecorator()
- isDefaultClause()
- isDeleteExpression()
- isDoStatement()
- isElementAccessExpression()
- isEmptyStatement()
- isEnumDeclaration()
- isEnumMember()
- isExclamationTokenableNode()
- isExportableNode()
- isExportAssignment()
- isExportDeclaration()
- isExportSpecifier()
- isExpression()
- isExpressionedNode()
- isExpressionStatement()
- isExpressionWithTypeArguments()
- isExtendsClauseableNode()
- isExternalModuleReference()
- isFalseKeyword()
- isForInStatement()
- isForOfStatement()
- isForStatement()
- isFunctionDeclaration()
- isFunctionExpression()
- isFunctionLikeDeclaration()
- isFunctionOrConstructorTypeNodeBase()
- isFunctionTypeNode()
- isGeneratorableNode()
- isGetAccessorDeclaration()
- isHeritageClause()
- isHeritageClauseableNode()
- isIdentifier()
- isIfStatement()
- isImplementsClauseableNode()
- isImportClause()
- isImportDeclaration()
- isImportEqualsDeclaration()
- isImportExpression()
- isImportSpecifier()
- isImportTypeNode()
- isIndexSignatureDeclaration()
- isInitializerExpressionableNode()
- isInitializerGetExpressionableNode()
- isInitializerSetExpressionableNode()
- isInterfaceDeclaration()
- isIntersectionTypeNode()
- isIterationStatement()
- isJSDoc()
- isJSDocableNode()
- isJSDocAugmentsTag()
- isJSDocClassTag()
- isJSDocParameterTag()
- isJSDocPropertyLikeTag()
- isJSDocPropertyTag()
- isJSDocReturnTag()
- isJSDocTag()
- isJSDocTypedefTag()
- isJSDocTypeTag()
- isJSDocUnknownTag()
- isJsxAttribute()
- isJsxAttributedNode()
- isJsxClosingElement()
- isJsxClosingFragment()
- isJsxElement()
- isJsxExpression()
- isJsxFragment()
- isJsxOpeningElement()
- isJsxOpeningFragment()
- isJsxSelfClosingElement()
- isJsxSpreadAttribute()
- isJsxTagNamedNode()
- isJsxText()
- isLabeledStatement()
- isLeftHandSideExpression()
- isLeftHandSideExpressionedNode()
- isLiteralExpression()
- isLiteralLikeNode()
- isLiteralTypeNode()
- isMemberExpression()
- isMetaProperty()
- isMethodDeclaration()
- isMethodSignature()
- isModifierableNode()
- isModuleBlock()
- isModuledNode()
- isNameableNode()
- isNamedExports()
- isNamedImports()
- isNamedNode()
- isNamespaceChildableNode()
- isNamespaceDeclaration()
- isNamespaceImport()
- isNeverKeyword()
- isNewExpression()
- isNonNullExpression()
- isNoSubstitutionTemplateLiteral()
- isNotEmittedStatement()
- isNullLiteral()
- isNumberKeyword()
- isNumericLiteral()
- isObjectBindingPattern()
- isObjectKeyword()
- isObjectLiteralExpression()
- isOmittedExpression()
- isOverloadableNode()
- isParameterDeclaration()
- isParameteredNode()
- isParenthesizedExpression()
- isParenthesizedTypeNode()
- isPartiallyEmittedExpression()
- isPostfixUnaryExpression()
- isPrefixUnaryExpression()
- isPrimaryExpression()
- isPropertyAccessExpression()
- isPropertyAssignment()
- isPropertyDeclaration()
- isPropertyNamedNode()
- isPropertySignature()
- isQualifiedName()
- isQuestionTokenableNode()
- isReadonlyableNode()
- isReferenceFindableNode()
- isRegularExpressionLiteral()
- isRenameableNode()
- isReturnStatement()
- isReturnTypedNode()
- isScopeableNode()
- isScopedNode()
- isSemicolonToken()
- isSetAccessorDeclaration()
- isShorthandPropertyAssignment()
- isSignaturedDeclaration()
- isSourceFile()
- isSpreadAssignment()
- isSpreadElement()
- isStatement()
- isStatementedNode()
- isStaticableNode()
- isStringKeyword()
- isStringLiteral()
- isSuperExpression()
- isSwitchStatement()
- isSymbolKeyword()
- isSyntaxList()
- isTaggedTemplateExpression()
- isTemplateExpression()
- isTemplateHead()
- isTemplateMiddle()
- isTemplateSpan()
- isTemplateTail()
- isTextInsertableNode()
- isThisExpression()
- isThrowStatement()
- isTrueKeyword()
- isTryStatement()
- isTupleTypeNode()
- isTypeAliasDeclaration()
- isTypeArgumentedNode()
- isTypeAssertion()
- isTypedNode()
- isTypeElement()
- isTypeElementMemberedNode()
- isTypeLiteralNode()
- isTypeNode()
- isTypeOfExpression()
- isTypeParameterDeclaration()
- isTypeParameteredNode()
- isTypeReferenceNode()
- isUnaryExpression()
- isUnaryExpressionedNode()
- isUndefinedKeyword()
- isUnionTypeNode()
- isUnwrappableNode()
- isUpdateExpression()
- isVariableDeclaration()
- isVariableDeclarationList()
- isVariableStatement()
- isVoidExpression()
- isWhileStatement()
- isWithStatement()
- isYieldExpression()
Interfaces
ImplementedKindToNodeMappings
- [SyntaxKind.AnyKeyword]
- [SyntaxKind.ArrayBindingPattern]
- [SyntaxKind.ArrayLiteralExpression]
- [SyntaxKind.ArrayType]
- [SyntaxKind.ArrowFunction]
- [SyntaxKind.AsExpression]
- [SyntaxKind.AwaitExpression]
- [SyntaxKind.BinaryExpression]
- [SyntaxKind.BindingElement]
- [SyntaxKind.Block]
- [SyntaxKind.BooleanKeyword]
- [SyntaxKind.BreakStatement]
- [SyntaxKind.CallExpression]
- [SyntaxKind.CallSignature]
- [SyntaxKind.CaseBlock]
- [SyntaxKind.CaseClause]
- [SyntaxKind.CatchClause]
- [SyntaxKind.ClassDeclaration]
- [SyntaxKind.ClassExpression]
- [SyntaxKind.CommaListExpression]
- [SyntaxKind.ComputedPropertyName]
- [SyntaxKind.ConditionalExpression]
- [SyntaxKind.Constructor]
- [SyntaxKind.ConstructorType]
- [SyntaxKind.ConstructSignature]
- [SyntaxKind.ContinueStatement]
- [SyntaxKind.DebuggerStatement]
- [SyntaxKind.Decorator]
- [SyntaxKind.DefaultClause]
- [SyntaxKind.DeleteExpression]
- [SyntaxKind.DoStatement]
- [SyntaxKind.ElementAccessExpression]
- [SyntaxKind.EmptyStatement]
- [SyntaxKind.EnumDeclaration]
- [SyntaxKind.EnumMember]
- [SyntaxKind.ExportAssignment]
- [SyntaxKind.ExportDeclaration]
- [SyntaxKind.ExportSpecifier]
- [SyntaxKind.ExpressionStatement]
- [SyntaxKind.ExpressionWithTypeArguments]
- [SyntaxKind.ExternalModuleReference]
- [SyntaxKind.FalseKeyword]
- [SyntaxKind.FirstJSDocTagNode]
- [SyntaxKind.FirstLiteralToken]
- [SyntaxKind.FirstNode]
- [SyntaxKind.FirstTemplateToken]
- [SyntaxKind.FirstTypeNode]
- [SyntaxKind.ForInStatement]
- [SyntaxKind.ForOfStatement]
- [SyntaxKind.ForStatement]
- [SyntaxKind.FunctionDeclaration]
- [SyntaxKind.FunctionExpression]
- [SyntaxKind.FunctionType]
- [SyntaxKind.GetAccessor]
- [SyntaxKind.HeritageClause]
- [SyntaxKind.Identifier]
- [SyntaxKind.IfStatement]
- [SyntaxKind.ImportClause]
- [SyntaxKind.ImportDeclaration]
- [SyntaxKind.ImportEqualsDeclaration]
- [SyntaxKind.ImportKeyword]
- [SyntaxKind.ImportSpecifier]
- [SyntaxKind.ImportType]
- [SyntaxKind.IndexSignature]
- [SyntaxKind.InterfaceDeclaration]
- [SyntaxKind.IntersectionType]
- [SyntaxKind.JSDocAugmentsTag]
- [SyntaxKind.JSDocClassTag]
- [SyntaxKind.JSDocComment]
- [SyntaxKind.JSDocParameterTag]
- [SyntaxKind.JSDocPropertyTag]
- [SyntaxKind.JSDocReturnTag]
- [SyntaxKind.JSDocTag]
- [SyntaxKind.JSDocTypedefTag]
- [SyntaxKind.JSDocTypeTag]
- [SyntaxKind.JsxAttribute]
- [SyntaxKind.JsxClosingElement]
- [SyntaxKind.JsxClosingFragment]
- [SyntaxKind.JsxElement]
- [SyntaxKind.JsxExpression]
- [SyntaxKind.JsxFragment]
- [SyntaxKind.JsxOpeningElement]
- [SyntaxKind.JsxOpeningFragment]
- [SyntaxKind.JsxSelfClosingElement]
- [SyntaxKind.JsxSpreadAttribute]
- [SyntaxKind.JsxText]
- [SyntaxKind.LabeledStatement]
- [SyntaxKind.LastJSDocNode]
- [SyntaxKind.LastJSDocTagNode]
- [SyntaxKind.LastLiteralToken]
- [SyntaxKind.LastTemplateToken]
- [SyntaxKind.LastTypeNode]
- [SyntaxKind.LiteralType]
- [SyntaxKind.MetaProperty]
- [SyntaxKind.MethodDeclaration]
- [SyntaxKind.MethodSignature]
- [SyntaxKind.ModuleBlock]
- [SyntaxKind.ModuleDeclaration]
- [SyntaxKind.NamedExports]
- [SyntaxKind.NamedImports]
- [SyntaxKind.NamespaceImport]
- [SyntaxKind.NeverKeyword]
- [SyntaxKind.NewExpression]
- [SyntaxKind.NonNullExpression]
- [SyntaxKind.NoSubstitutionTemplateLiteral]
- [SyntaxKind.NotEmittedStatement]
- [SyntaxKind.NullKeyword]
- [SyntaxKind.NumberKeyword]
- [SyntaxKind.NumericLiteral]
- [SyntaxKind.ObjectBindingPattern]
- [SyntaxKind.ObjectKeyword]
- [SyntaxKind.ObjectLiteralExpression]
- [SyntaxKind.OmittedExpression]
- [SyntaxKind.Parameter]
- [SyntaxKind.ParenthesizedExpression]
- [SyntaxKind.ParenthesizedType]
- [SyntaxKind.PartiallyEmittedExpression]
- [SyntaxKind.PostfixUnaryExpression]
- [SyntaxKind.PrefixUnaryExpression]
- [SyntaxKind.PropertyAccessExpression]
- [SyntaxKind.PropertyAssignment]
- [SyntaxKind.PropertyDeclaration]
- [SyntaxKind.PropertySignature]
- [SyntaxKind.QualifiedName]
- [SyntaxKind.RegularExpressionLiteral]
- [SyntaxKind.ReturnStatement]
- [SyntaxKind.SemicolonToken]
- [SyntaxKind.SetAccessor]
- [SyntaxKind.ShorthandPropertyAssignment]
- [SyntaxKind.SourceFile]
- [SyntaxKind.SpreadAssignment]
- [SyntaxKind.SpreadElement]
- [SyntaxKind.StringKeyword]
- [SyntaxKind.StringLiteral]
- [SyntaxKind.SuperKeyword]
- [SyntaxKind.SwitchStatement]
- [SyntaxKind.SymbolKeyword]
- [SyntaxKind.SyntaxList]
- [SyntaxKind.TaggedTemplateExpression]
- [SyntaxKind.TemplateExpression]
- [SyntaxKind.TemplateHead]
- [SyntaxKind.TemplateMiddle]
- [SyntaxKind.TemplateSpan]
- [SyntaxKind.TemplateTail]
- [SyntaxKind.ThisKeyword]
- [SyntaxKind.ThrowStatement]
- [SyntaxKind.TrueKeyword]
- [SyntaxKind.TryStatement]
- [SyntaxKind.TupleType]
- [SyntaxKind.TypeAliasDeclaration]
- [SyntaxKind.TypeAssertionExpression]
- [SyntaxKind.TypeLiteral]
- [SyntaxKind.TypeOfExpression]
- [SyntaxKind.TypeParameter]
- [SyntaxKind.TypePredicate]
- [SyntaxKind.TypeReference]
- [SyntaxKind.UndefinedKeyword]
- [SyntaxKind.UnionType]
- [SyntaxKind.VariableDeclaration]
- [SyntaxKind.VariableDeclarationList]
- [SyntaxKind.VariableStatement]
- [SyntaxKind.VoidExpression]
- [SyntaxKind.WhileStatement]
- [SyntaxKind.WithStatement]
- [SyntaxKind.YieldExpression]
KindToExpressionMappings
- [SyntaxKind.AnyKeyword]
- [SyntaxKind.ArrayLiteralExpression]
- [SyntaxKind.ArrowFunction]
- [SyntaxKind.AsExpression]
- [SyntaxKind.AwaitExpression]
- [SyntaxKind.BinaryExpression]
- [SyntaxKind.BooleanKeyword]
- [SyntaxKind.CallExpression]
- [SyntaxKind.ClassExpression]
- [SyntaxKind.CommaListExpression]
- [SyntaxKind.ConditionalExpression]
- [SyntaxKind.DeleteExpression]
- [SyntaxKind.ElementAccessExpression]
- [SyntaxKind.FalseKeyword]
- [SyntaxKind.FirstLiteralToken]
- [SyntaxKind.FirstTemplateToken]
- [SyntaxKind.FunctionExpression]
- [SyntaxKind.Identifier]
- [SyntaxKind.ImportKeyword]
- [SyntaxKind.JsxClosingFragment]
- [SyntaxKind.JsxElement]
- [SyntaxKind.JsxExpression]
- [SyntaxKind.JsxFragment]
- [SyntaxKind.JsxOpeningElement]
- [SyntaxKind.JsxOpeningFragment]
- [SyntaxKind.JsxSelfClosingElement]
- [SyntaxKind.LastLiteralToken]
- [SyntaxKind.MetaProperty]
- [SyntaxKind.NeverKeyword]
- [SyntaxKind.NewExpression]
- [SyntaxKind.NonNullExpression]
- [SyntaxKind.NoSubstitutionTemplateLiteral]
- [SyntaxKind.NullKeyword]
- [SyntaxKind.NumberKeyword]
- [SyntaxKind.NumericLiteral]
- [SyntaxKind.ObjectKeyword]
- [SyntaxKind.ObjectLiteralExpression]
- [SyntaxKind.OmittedExpression]
- [SyntaxKind.ParenthesizedExpression]
- [SyntaxKind.PartiallyEmittedExpression]
- [SyntaxKind.PostfixUnaryExpression]
- [SyntaxKind.PrefixUnaryExpression]
- [SyntaxKind.PropertyAccessExpression]
- [SyntaxKind.RegularExpressionLiteral]
- [SyntaxKind.SpreadElement]
- [SyntaxKind.StringKeyword]
- [SyntaxKind.StringLiteral]
- [SyntaxKind.SuperKeyword]
- [SyntaxKind.SymbolKeyword]
- [SyntaxKind.TaggedTemplateExpression]
- [SyntaxKind.TemplateExpression]
- [SyntaxKind.ThisKeyword]
- [SyntaxKind.TrueKeyword]
- [SyntaxKind.TypeAssertionExpression]
- [SyntaxKind.TypeOfExpression]
- [SyntaxKind.UndefinedKeyword]
- [SyntaxKind.VoidExpression]
- [SyntaxKind.YieldExpression]
ModuledNode
- addExportAssignment()
- addExportAssignments()
- addExportDeclaration()
- addExportDeclarations()
- addImportDeclaration()
- addImportDeclarations()
- getDefaultExportSymbol()
- getDefaultExportSymbolOrThrow()
- getExportAssignment()
- getExportAssignmentOrThrow()
- getExportAssignments()
- getExportDeclaration()
- getExportDeclarationOrThrow()
- getExportDeclarations()
- getExportedDeclarations()
- getExportSymbols()
- getImportDeclaration()
- getImportDeclarationOrThrow()
- getImportDeclarations()
- insertExportAssignment()
- insertExportAssignments()
- insertExportDeclaration()
- insertExportDeclarations()
- insertImportDeclaration()
- insertImportDeclarations()
- removeDefaultExport()
StatementedNode
- addClass()
- addClasses()
- addEnum()
- addEnums()
- addFunction()
- addFunctions()
- addInterface()
- addInterfaces()
- addNamespace()
- addNamespaces()
- addStatements()
- addTypeAlias()
- addTypeAliases()
- addVariableStatement()
- addVariableStatements()
- getClass()
- getClasses()
- getClassOrThrow()
- getEnum()
- getEnumOrThrow()
- getEnums()
- getFunction()
- getFunctionOrThrow()
- getFunctions()
- getInterface()
- getInterfaceOrThrow()
- getInterfaces()
- getNamespace()
- getNamespaceOrThrow()
- getNamespaces()
- getStatement()
- getStatementByKind()
- getStatementByKindOrThrow()
- getStatementOrThrow()
- getStatements()
- getTypeAlias()
- getTypeAliases()
- getTypeAliasOrThrow()
- getVariableDeclaration()
- getVariableDeclarationOrThrow()
- getVariableDeclarations()
- getVariableStatement()
- getVariableStatementOrThrow()
- getVariableStatements()
- insertClass()
- insertClasses()
- insertEnum()
- insertEnums()
- insertFunction()
- insertFunctions()
- insertInterface()
- insertInterfaces()
- insertNamespace()
- insertNamespaces()
- insertStatements()
- insertTypeAlias()
- insertTypeAliases()
- insertVariableStatement()
- insertVariableStatements()
- removeStatement()
- removeStatements()
TypeElementMemberedNode
- addCallSignature()
- addCallSignatures()
- addConstructSignature()
- addConstructSignatures()
- addIndexSignature()
- addIndexSignatures()
- addMethod()
- addMethods()
- addProperties()
- addProperty()
- getCallSignature()
- getCallSignatureOrThrow()
- getCallSignatures()
- getConstructSignature()
- getConstructSignatureOrThrow()
- getConstructSignatures()
- getIndexSignature()
- getIndexSignatureOrThrow()
- getIndexSignatures()
- getMembers()
- getMethod()
- getMethodOrThrow()
- getMethods()
- getProperties()
- getProperty()
- getPropertyOrThrow()
- insertCallSignature()
- insertCallSignatures()
- insertConstructSignature()
- insertConstructSignatures()
- insertIndexSignature()
- insertIndexSignatures()
- insertMethod()
- insertMethods()
- insertProperties()
- insertProperty()
Enums
Type Aliases
- AccessorDeclaration
- ArrayBindingElement
- BindingName
- BindingNamedNodeSpecific
- BindingPattern
- CaseOrDefaultClause
- ClassInstanceMemberTypes
- ClassInstancePropertyTypes
- ClassMemberTypes
- ClassPropertyTypes
- ClassStaticMemberTypes
- ClassStaticPropertyTypes
- CompilerNodeToWrappedType
- Constructor
- EntityName
- JsxAttributeLike
- JsxChild
- JsxTagNameExpression
- ModifierTexts
- ModuleReference
- NamedNodeSpecific
- NodeParentType
- NodePropertyToWrappedType
- ObjectLiteralElementLike
- PropertyName
- PropertyNamedNodeSpecific
- SourceFileReferencingNodes
- TemplateLiteral
- TypeElementTypes
- WriterFunction
Variables
variable ArrayDestructuringAssignmentBase
const ArrayDestructuringAssignmentBase: typeof AssignmentExpression;
variable ArrowFunctionBase
const ArrowFunctionBase: Constructor<TextInsertableNode> & Constructor<BodiedNode> & Constructor<AsyncableNode> & Constructor<FunctionLikeDeclaration> & typeof Expression;
variable AsExpressionBase
const AsExpressionBase: Constructor<TypedNode> & Constructor<ExpressionedNode> & typeof Expression;
variable AssignmentExpressionBase
const AssignmentExpressionBase: typeof BinaryExpression;
variable AwaitExpressionBase
const AwaitExpressionBase: Constructor<UnaryExpressionedNode> & typeof UnaryExpression;
variable BinaryExpressionBase
const BinaryExpressionBase: typeof Expression;
variable BindingElementBase
const BindingElementBase: Constructor<InitializerExpressionableNode> & Constructor<BindingNamedNode> & typeof Node;
variable BlockBase
const BlockBase: Constructor<TextInsertableNode> & Constructor<StatementedNode> & typeof Statement;
variable BooleanLiteralBase
const BooleanLiteralBase: typeof PrimaryExpression;
variable BreakStatementBase
const BreakStatementBase: Constructor<ChildOrderableNode> & typeof Statement;
variable CallExpressionBase
const CallExpressionBase: Constructor<TypeArgumentedNode> & Constructor<ArgumentedNode> & Constructor<LeftHandSideExpressionedNode> & typeof LeftHandSideExpression;
variable CallSignatureDeclarationBase
const CallSignatureDeclarationBase: Constructor<TypeParameteredNode> & Constructor<ChildOrderableNode> & Constructor<JSDocableNode> & Constructor<SignaturedDeclaration> & typeof TypeElement;
variable CaseBlockBase
const CaseBlockBase: Constructor<TextInsertableNode> & typeof Node;
variable CaseClauseBase
const CaseClauseBase: Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<StatementedNode> & typeof Node;
variable CatchClauseBase
const CatchClauseBase: typeof Node;
variable ClassDeclarationBase
const ClassDeclarationBase: Constructor<ChildOrderableNode> & Constructor<NamespaceChildableNode> & Constructor<AmbientableNode> & Constructor<ExportableNode> & Constructor<ClassLikeDeclarationBase> & typeof Statement;
variable ClassExpressionBase
const ClassExpressionBase: Constructor<ClassLikeDeclarationBase> & typeof PrimaryExpression;
variable CommaListExpressionBase
const CommaListExpressionBase: typeof Expression;
variable ConditionalExpressionBase
const ConditionalExpressionBase: typeof Expression;
variable ConstructorDeclarationBase
const ConstructorDeclarationBase: Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<OverloadableNode> & Constructor<ScopedNode> & Constructor<FunctionLikeDeclaration> & Constructor<BodyableNode> & typeof Node;
variable ConstructorDeclarationOverloadBase
const ConstructorDeclarationOverloadBase: Constructor<TypeParameteredNode> & Constructor<JSDocableNode> & Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<ScopedNode> & Constructor<ModifierableNode> & Constructor<SignaturedDeclaration> & typeof Node;
variable ConstructSignatureDeclarationBase
const ConstructSignatureDeclarationBase: Constructor<TypeParameteredNode> & Constructor<ChildOrderableNode> & Constructor<JSDocableNode> & Constructor<SignaturedDeclaration> & typeof TypeElement;
variable ContinueStatementBase
const ContinueStatementBase: Constructor<ChildOrderableNode> & typeof Statement;
variable DebuggerStatementBase
const DebuggerStatementBase: typeof Statement;
variable DecoratorBase
const DecoratorBase: typeof Node;
variable DefaultClauseBase
const DefaultClauseBase: Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<StatementedNode> & typeof Node;
variable DeleteExpressionBase
const DeleteExpressionBase: Constructor<UnaryExpressionedNode> & typeof UnaryExpression;
variable DoStatementBase
const DoStatementBase: typeof IterationStatement;
variable ElementAccessExpressionBase
const ElementAccessExpressionBase: Constructor<LeftHandSideExpressionedNode> & typeof MemberExpression;
variable EmptyStatementBase
const EmptyStatementBase: typeof Statement;
variable EnumDeclarationBase
const EnumDeclarationBase: Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<NamespaceChildableNode> & Constructor<JSDocableNode> & Constructor<AmbientableNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & Constructor<NamedNode> & typeof Statement;
variable EnumMemberBase
const EnumMemberBase: Constructor<JSDocableNode> & Constructor<InitializerExpressionableNode> & Constructor<PropertyNamedNode> & typeof Node;
variable ExportAssignmentBase
const ExportAssignmentBase: typeof Statement;
variable ExportDeclarationBase
const ExportDeclarationBase: typeof Statement;
variable ExportSpecifierBase
const ExportSpecifierBase: typeof Node;
variable ExpressionStatementBase
const ExpressionStatementBase: Constructor<JSDocableNode> & Constructor<ChildOrderableNode> & typeof Statement;
variable ExpressionWithTypeArgumentsBase
const ExpressionWithTypeArgumentsBase: Constructor<LeftHandSideExpressionedNode> & typeof TypeNode;
variable ForInStatementBase
const ForInStatementBase: typeof IterationStatement;
variable ForOfStatementBase
const ForOfStatementBase: Constructor<AwaitableNode> & typeof IterationStatement;
variable ForStatementBase
const ForStatementBase: typeof IterationStatement;
variable FunctionDeclarationBase
const FunctionDeclarationBase: Constructor<ChildOrderableNode> & Constructor<UnwrappableNode> & Constructor<TextInsertableNode> & Constructor<OverloadableNode> & Constructor<BodyableNode> & Constructor<AsyncableNode> & Constructor<GeneratorableNode> & Constructor<FunctionLikeDeclaration> & Constructor<StatementedNode> & Constructor<AmbientableNode> & Constructor<NamespaceChildableNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & Constructor<NameableNode> & typeof Node;
variable FunctionDeclarationOverloadBase
const FunctionDeclarationOverloadBase: Constructor<ChildOrderableNode> & Constructor<UnwrappableNode> & Constructor<TextInsertableNode> & Constructor<AsyncableNode> & Constructor<GeneratorableNode> & Constructor<ModifierableNode> & Constructor<SignaturedDeclaration> & Constructor<StatementedNode> & Constructor<AmbientableNode> & Constructor<NamespaceChildableNode> & Constructor<JSDocableNode> & Constructor<TypeParameteredNode> & Constructor<ExportableNode> & typeof Node;
variable FunctionExpressionBase
const FunctionExpressionBase: Constructor<JSDocableNode> & Constructor<TextInsertableNode> & Constructor<BodiedNode> & Constructor<AsyncableNode> & Constructor<GeneratorableNode> & Constructor<StatementedNode> & Constructor<TypeParameteredNode> & Constructor<SignaturedDeclaration> & Constructor<ModifierableNode> & Constructor<NameableNode> & typeof PrimaryExpression;
variable FunctionOrConstructorTypeNodeBaseBase
const FunctionOrConstructorTypeNodeBaseBase: Constructor<SignaturedDeclaration> & typeof TypeNode;
variable FunctionTypeNodeBase
const FunctionTypeNodeBase: Constructor<TypeParameteredNode> & typeof FunctionOrConstructorTypeNodeBase;
variable GetAccessorDeclarationBase
const GetAccessorDeclarationBase: Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<DecoratableNode> & Constructor<AbstractableNode> & Constructor<ScopedNode> & Constructor<StaticableNode> & Constructor<FunctionLikeDeclaration> & Constructor<BodyableNode> & Constructor<PropertyNamedNode> & typeof Node;
variable IdentifierBase
const IdentifierBase: Constructor<ReferenceFindableNode> & Constructor<RenameableNode> & typeof PrimaryExpression;
variable IfStatementBase
const IfStatementBase: Constructor<ChildOrderableNode> & typeof Statement;
variable ImportClauseBase
const ImportClauseBase: typeof Node;
variable ImportDeclarationBase
const ImportDeclarationBase: typeof Statement;
variable ImportEqualsDeclarationBase
const ImportEqualsDeclarationBase: Constructor<JSDocableNode> & Constructor<NamedNode> & typeof Statement;
variable ImportExpressionBase
const ImportExpressionBase: typeof PrimaryExpression;
variable ImportSpecifierBase
const ImportSpecifierBase: typeof Node;
variable ImportTypeNodeBase
const ImportTypeNodeBase: Constructor<TypeArgumentedNode> & typeof TypeNode;
variable IndexSignatureDeclarationBase
const IndexSignatureDeclarationBase: Constructor<ReturnTypedNode> & Constructor<ChildOrderableNode> & Constructor<JSDocableNode> & Constructor<ReadonlyableNode> & Constructor<ModifierableNode> & typeof TypeElement;
variable InterfaceDeclarationBase
const InterfaceDeclarationBase: Constructor<TypeElementMemberedNode> & Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<ExtendsClauseableNode> & Constructor<HeritageClauseableNode> & Constructor<TypeParameteredNode> & Constructor<JSDocableNode> & Constructor<AmbientableNode> & Constructor<NamespaceChildableNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & Constructor<NamedNode> & typeof Statement;
variable IterationStatementBase
const IterationStatementBase: Constructor<ChildOrderableNode> & typeof Statement;
variable JSDocBase
const JSDocBase: typeof Node;
variable JSDocParameterTagBase
const JSDocParameterTagBase: Constructor<JSDocPropertyLikeTag> & typeof JSDocTag;
variable JSDocPropertyTagBase
const JSDocPropertyTagBase: Constructor<JSDocPropertyLikeTag> & typeof JSDocTag;
variable JsxAttributeBase
const JsxAttributeBase: Constructor<NamedNode> & typeof Node;
variable JsxClosingElementBase
const JsxClosingElementBase: Constructor<JsxTagNamedNode> & typeof Node;
variable JsxElementBase
const JsxElementBase: typeof PrimaryExpression;
variable JsxOpeningElementBase
const JsxOpeningElementBase: Constructor<JsxAttributedNode> & Constructor<JsxTagNamedNode> & typeof Expression;
variable JsxSelfClosingElementBase
const JsxSelfClosingElementBase: Constructor<JsxAttributedNode> & Constructor<JsxTagNamedNode> & typeof PrimaryExpression;
variable JsxSpreadAttributeBase
const JsxSpreadAttributeBase: typeof Node;
variable LabeledStatementBase
const LabeledStatementBase: Constructor<JSDocableNode> & Constructor<ChildOrderableNode> & typeof Statement;
variable LiteralExpressionBase
const LiteralExpressionBase: Constructor<LiteralLikeNode> & typeof PrimaryExpression;
variable MetaPropertyBase
const MetaPropertyBase: Constructor<NamedNode> & typeof PrimaryExpression;
variable MethodDeclarationBase
const MethodDeclarationBase: Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<OverloadableNode> & Constructor<BodyableNode> & Constructor<DecoratableNode> & Constructor<AbstractableNode> & Constructor<ScopedNode> & Constructor<QuestionTokenableNode> & Constructor<StaticableNode> & Constructor<AsyncableNode> & Constructor<GeneratorableNode> & Constructor<FunctionLikeDeclaration> & Constructor<PropertyNamedNode> & typeof Node;
variable MethodDeclarationOverloadBase
const MethodDeclarationOverloadBase: Constructor<JSDocableNode> & Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<ScopedNode> & Constructor<TypeParameteredNode> & Constructor<AbstractableNode> & Constructor<QuestionTokenableNode> & Constructor<StaticableNode> & Constructor<AsyncableNode> & Constructor<ModifierableNode> & Constructor<GeneratorableNode> & Constructor<SignaturedDeclaration> & typeof Node;
variable MethodSignatureBase
const MethodSignatureBase: Constructor<ChildOrderableNode> & Constructor<JSDocableNode> & Constructor<QuestionTokenableNode> & Constructor<TypeParameteredNode> & Constructor<SignaturedDeclaration> & Constructor<PropertyNamedNode> & typeof TypeElement;
variable ModuleBlockBase
const ModuleBlockBase: Constructor<StatementedNode> & typeof Statement;
variable NamedExportsBase
const NamedExportsBase: typeof Node;
variable NamedImportsBase
const NamedImportsBase: typeof Node;
variable NamespaceDeclarationBase
const NamespaceDeclarationBase: Constructor<ModuledNode> & Constructor<ChildOrderableNode> & Constructor<UnwrappableNode> & Constructor<TextInsertableNode> & Constructor<BodiedNode> & Constructor<NamespaceChildableNode> & Constructor<StatementedNode> & Constructor<JSDocableNode> & Constructor<AmbientableNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & Constructor<NamedNode> & typeof Statement;
variable NamespaceImportBase
const NamespaceImportBase: Constructor<RenameableNode> & typeof Node;
variable NewExpressionBase
const NewExpressionBase: Constructor<TypeArgumentedNode> & Constructor<ArgumentedNode> & Constructor<LeftHandSideExpressionedNode> & typeof PrimaryExpression;
variable NonNullExpressionBase
const NonNullExpressionBase: Constructor<ExpressionedNode> & typeof LeftHandSideExpression;
variable NoSubstitutionTemplateLiteralBase
const NoSubstitutionTemplateLiteralBase: typeof LiteralExpression;
variable NotEmittedStatementBase
const NotEmittedStatementBase: typeof Statement;
variable NullLiteralBase
const NullLiteralBase: typeof PrimaryExpression;
variable NumericLiteralBase
const NumericLiteralBase: typeof LiteralExpression;
variable ObjectDestructuringAssignmentBase
const ObjectDestructuringAssignmentBase: typeof AssignmentExpression;
variable ObjectLiteralExpressionBase
const ObjectLiteralExpressionBase: typeof PrimaryExpression;
variable OmittedExpressionBase
const OmittedExpressionBase: typeof Expression;
variable ParameterDeclarationBase
const ParameterDeclarationBase: Constructor<QuestionTokenableNode> & Constructor<DecoratableNode> & Constructor<ScopeableNode> & Constructor<ReadonlyableNode> & Constructor<ModifierableNode> & Constructor<TypedNode> & Constructor<InitializerExpressionableNode> & Constructor<DeclarationNamedNode> & typeof Node;
variable ParenthesizedExpressionBase
const ParenthesizedExpressionBase: Constructor<ExpressionedNode> & typeof Expression;
variable PartiallyEmittedExpressionBase
const PartiallyEmittedExpressionBase: Constructor<ExpressionedNode> & typeof Expression;
variable PostfixUnaryExpressionBase
const PostfixUnaryExpressionBase: typeof UnaryExpression;
variable PrefixUnaryExpressionBase
const PrefixUnaryExpressionBase: typeof UnaryExpression;
variable PropertyAccessExpressionBase
const PropertyAccessExpressionBase: Constructor<NamedNode> & Constructor<LeftHandSideExpressionedNode> & typeof MemberExpression;
variable PropertyAssignmentBase
const PropertyAssignmentBase: Constructor<InitializerGetExpressionableNode> & Constructor<QuestionTokenableNode> & Constructor<PropertyNamedNode> & typeof Node;
variable PropertyDeclarationBase
const PropertyDeclarationBase: Constructor<ChildOrderableNode> & Constructor<DecoratableNode> & Constructor<AbstractableNode> & Constructor<ScopedNode> & Constructor<StaticableNode> & Constructor<JSDocableNode> & Constructor<ReadonlyableNode> & Constructor<ExclamationTokenableNode> & Constructor<QuestionTokenableNode> & Constructor<InitializerExpressionableNode> & Constructor<TypedNode> & Constructor<PropertyNamedNode> & Constructor<ModifierableNode> & typeof Node;
variable PropertySignatureBase
const PropertySignatureBase: Constructor<ChildOrderableNode> & Constructor<JSDocableNode> & Constructor<ReadonlyableNode> & Constructor<QuestionTokenableNode> & Constructor<InitializerExpressionableNode> & Constructor<TypedNode> & Constructor<PropertyNamedNode> & Constructor<ModifierableNode> & typeof TypeElement;
variable RegularExpressionLiteralBase
const RegularExpressionLiteralBase: typeof LiteralExpression;
variable ReturnStatementBase
const ReturnStatementBase: Constructor<ChildOrderableNode> & typeof Statement;
variable SetAccessorDeclarationBase
const SetAccessorDeclarationBase: Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<DecoratableNode> & Constructor<AbstractableNode> & Constructor<ScopedNode> & Constructor<StaticableNode> & Constructor<FunctionLikeDeclaration> & Constructor<BodyableNode> & Constructor<PropertyNamedNode> & typeof Node;
variable ShorthandPropertyAssignmentBase
const ShorthandPropertyAssignmentBase: Constructor<InitializerGetExpressionableNode> & Constructor<QuestionTokenableNode> & Constructor<NamedNode> & typeof Node;
variable SourceFileBase
const SourceFileBase: Constructor<ModuledNode> & Constructor<StatementedNode> & Constructor<TextInsertableNode> & typeof Node;
variable SpreadAssignmentBase
const SpreadAssignmentBase: Constructor<ExpressionedNode> & typeof Node;
variable SpreadElementBase
const SpreadElementBase: Constructor<ExpressionedNode> & typeof Expression;
variable StringLiteralBase
const StringLiteralBase: typeof LiteralExpression;
variable SuperElementAccessExpressionBase
const SuperElementAccessExpressionBase: Constructor<SuperExpressionedNode> & typeof ElementAccessExpression;
variable SuperExpressionBase
const SuperExpressionBase: typeof PrimaryExpression;
variable SuperPropertyAccessExpressionBase
const SuperPropertyAccessExpressionBase: Constructor<SuperExpressionedNode> & typeof PropertyAccessExpression;
variable SwitchStatementBase
const SwitchStatementBase: Constructor<ChildOrderableNode> & typeof Statement;
variable TemplateExpressionBase
const TemplateExpressionBase: typeof PrimaryExpression;
variable TemplateHeadBase
const TemplateHeadBase: Constructor<LiteralLikeNode> & typeof Node;
variable TemplateMiddleBase
const TemplateMiddleBase: Constructor<LiteralLikeNode> & typeof Node;
variable TemplateSpanBase
const TemplateSpanBase: Constructor<ExpressionedNode> & typeof Node;
variable TemplateTailBase
const TemplateTailBase: Constructor<LiteralLikeNode> & typeof Node;
variable ThisExpressionBase
const ThisExpressionBase: typeof PrimaryExpression;
variable ThrowStatementBase
const ThrowStatementBase: typeof Statement;
variable TryStatementBase
const TryStatementBase: typeof Statement;
variable TypeAliasDeclarationBase
const TypeAliasDeclarationBase: Constructor<ChildOrderableNode> & Constructor<TypeParameteredNode> & Constructor<TypedNode> & Constructor<JSDocableNode> & Constructor<AmbientableNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & Constructor<NamedNode> & typeof Statement;
variable TypeAssertionBase
const TypeAssertionBase: Constructor<TypedNode> & Constructor<UnaryExpressionedNode> & typeof UnaryExpression;
variable TypeLiteralNodeBase
const TypeLiteralNodeBase: Constructor<TypeElementMemberedNode> & typeof TypeNode;
variable TypeOfExpressionBase
const TypeOfExpressionBase: Constructor<UnaryExpressionedNode> & typeof UnaryExpression;
variable TypeParameterDeclarationBase
const TypeParameterDeclarationBase: Constructor<NamedNode> & typeof Node;
variable VariableDeclarationBase
const VariableDeclarationBase: Constructor<ExclamationTokenableNode> & Constructor<TypedNode> & Constructor<InitializerExpressionableNode> & Constructor<BindingNamedNode> & typeof Node;
variable VariableDeclarationListBase
const VariableDeclarationListBase: Constructor<ModifierableNode> & typeof Node;
variable VariableStatementBase
const VariableStatementBase: Constructor<ChildOrderableNode> & Constructor<NamespaceChildableNode> & Constructor<JSDocableNode> & Constructor<AmbientableNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & typeof Statement;
variable VoidExpressionBase
const VoidExpressionBase: Constructor<UnaryExpressionedNode> & typeof UnaryExpression;
variable WhileStatementBase
const WhileStatementBase: typeof IterationStatement;
variable WithStatementBase
const WithStatementBase: Constructor<ChildOrderableNode> & typeof Statement;
variable YieldExpressionBase
const YieldExpressionBase: Constructor<GeneratorableNode> & typeof Expression;
Functions
function AbstractableNode
AbstractableNode: <T extends Constructor<AbstractableNodeExtensionType>>( Base: T) => Constructor<AbstractableNode> & T;
function AmbientableNode
AmbientableNode: <T extends Constructor<AmbientableNodeExtensionType>>( Base: T) => Constructor<AmbientableNode> & T;
function ArgumentedNode
ArgumentedNode: <T extends Constructor<ArgumentedNodeExtensionType>>( Base: T) => Constructor<ArgumentedNode> & T;
function AsyncableNode
AsyncableNode: <T extends Constructor<AsyncableNodeExtensionType>>( Base: T) => Constructor<AsyncableNode> & T;
function AwaitableNode
AwaitableNode: <T extends Constructor<AwaitableNodeExtensionType>>( Base: T) => Constructor<AwaitableNode> & T;
function BindingNamedNode
BindingNamedNode: <T extends Constructor<BindingNamedNodeExtensionType>>( Base: T) => Constructor<BindingNamedNode> & T;
function BodiedNode
BodiedNode: <T extends Constructor<BodiedNodeExtensionType>>( Base: T) => Constructor<BodiedNode> & T;
function BodyableNode
BodyableNode: <T extends Constructor<BodyableNodeExtensionType>>( Base: T) => Constructor<BodyableNode> & T;
function ChildOrderableNode
ChildOrderableNode: <T extends Constructor<ChildOrderableNodeExtensionType>>( Base: T) => Constructor<ChildOrderableNode> & T;
function ClassLikeDeclarationBase
ClassLikeDeclarationBase: < T extends Constructor<ClassLikeDeclarationBaseExtensionType>>( Base: T) => Constructor<ClassLikeDeclarationBase> & T;
function ClassLikeDeclarationBaseSpecific
ClassLikeDeclarationBaseSpecific: < T extends Constructor<ClassLikeDeclarationBaseSpecificExtensionType>>( Base: T) => Constructor<ClassLikeDeclarationBaseSpecific> & T;
function createWrappedNode
createWrappedNode: <T extends ts.Node = ts.Node>( node: T, opts?: CreateWrappedNodeOptions) => CompilerNodeToWrappedType<T>;
Creates a wrapped node from a compiler node.
Parameter node
Node to create a wrapped node from.
Parameter info
Info for creating the wrapped node.
function DeclarationNamedNode
DeclarationNamedNode: <T extends Constructor<DeclarationNamedNodeExtensionType>>( Base: T) => Constructor<DeclarationNamedNode> & T;
function DecoratableNode
DecoratableNode: <T extends Constructor<DecoratableNodeExtensionType>>( Base: T) => Constructor<DecoratableNode> & T;
function ExclamationTokenableNode
ExclamationTokenableNode: < T extends Constructor<ExclamationTokenableNodeExtensionType>>( Base: T) => Constructor<ExclamationTokenableNode> & T;
function ExportableNode
ExportableNode: <T extends Constructor<ExportableNodeExtensionType>>( Base: T) => Constructor<ExportableNode> & T;
function ExpressionedNode
ExpressionedNode: <T extends Constructor<ExpressionedNodeExtensionType>>( Base: T) => Constructor<ExpressionedNode> & T;
function ExtendsClauseableNode
ExtendsClauseableNode: < T extends Constructor<ExtendsClauseableNodeExtensionType>>( Base: T) => Constructor<ExtendsClauseableNode> & T;
function FunctionLikeDeclaration
FunctionLikeDeclaration: < T extends Constructor<FunctionLikeDeclarationExtensionType>>( Base: T) => Constructor<FunctionLikeDeclaration> & T;
function GeneratorableNode
GeneratorableNode: <T extends Constructor<GeneratorableNodeExtensionType>>( Base: T) => Constructor<GeneratorableNode> & T;
function getCompilerOptionsFromTsConfig
getCompilerOptionsFromTsConfig: ( filePath: string, options?: CompilerOptionsFromTsConfigOptions) => CompilerOptionsFromTsConfigResult;
Gets the compiler options from a specified tsconfig.json
Parameter filePath
File path to the tsconfig.json.
Parameter options
Options.
function HeritageClauseableNode
HeritageClauseableNode: < T extends Constructor<HeritageClauseableNodeExtensionType>>( Base: T) => Constructor<HeritageClauseableNode> & T;
function ImplementsClauseableNode
ImplementsClauseableNode: < T extends Constructor<ImplementsClauseableNodeExtensionType>>( Base: T) => Constructor<ImplementsClauseableNode> & T;
function ImportExpressionedNode
ImportExpressionedNode: < T extends Constructor<ImportExpressionedNodeExtensionType>>( Base: T) => Constructor<ImportExpressionedNode> & T;
function InitializerExpressionableNode
InitializerExpressionableNode: < T extends Constructor<InitializerExpressionableNodeExtensionType>>( Base: T) => Constructor<InitializerExpressionableNode> & T;
function InitializerGetExpressionableNode
InitializerGetExpressionableNode: < T extends Constructor<InitializerGetExpressionableNodeExtensionType>>( Base: T) => Constructor<InitializerGetExpressionableNode> & T;
function InitializerSetExpressionableNode
InitializerSetExpressionableNode: < T extends Constructor<InitializerSetExpressionableNodeExtensionType>>( Base: T) => Constructor<InitializerSetExpressionableNode> & T;
function JSDocableNode
JSDocableNode: <T extends Constructor<JSDocableNodeExtensionType>>( Base: T) => Constructor<JSDocableNode> & T;
function JSDocPropertyLikeTag
JSDocPropertyLikeTag: <T extends Constructor<JSDocPropertyLikeTagExtensionType>>( Base: T) => Constructor<JSDocPropertyLikeTag> & T;
function JsxAttributedNode
JsxAttributedNode: <T extends Constructor<JsxAttributedNodeExtensionType>>( Base: T) => Constructor<JsxAttributedNode> & T;
function JsxTagNamedNode
JsxTagNamedNode: <T extends Constructor<JsxTagNamedNodeExtensionType>>( Base: T) => Constructor<JsxTagNamedNode> & T;
function LeftHandSideExpressionedNode
LeftHandSideExpressionedNode: < T extends Constructor<LeftHandSideExpressionedNodeExtensionType>>( Base: T) => Constructor<LeftHandSideExpressionedNode> & T;
function LiteralLikeNode
LiteralLikeNode: <T extends Constructor<LiteralLikeNodeExtensionType>>( Base: T) => Constructor<LiteralLikeNode> & T;
function ModifierableNode
ModifierableNode: <T extends Constructor<ModifierableNodeExtensionType>>( Base: T) => Constructor<ModifierableNode> & T;
function ModuledNode
ModuledNode: <T extends Constructor<ModuledNodeExtensionType>>( Base: T) => Constructor<ModuledNode> & T;
function NameableNode
NameableNode: <T extends Constructor<NameableNodeExtensionType>>( Base: T) => Constructor<NameableNode> & T;
function NamedNode
NamedNode: <T extends Constructor<NamedNodeExtensionType>>( Base: T) => Constructor<NamedNode> & T;
function NamedNodeBase
NamedNodeBase: < TCompilerNode extends ts.Node, U extends Constructor<NamedNodeBaseExtensionType<TCompilerNode>>>( Base: U) => Constructor<NamedNodeSpecificBase<CompilerNodeToWrappedType<TCompilerNode>>> & U;
function NamespaceChildableNode
NamespaceChildableNode: < T extends Constructor<NamespaceChildableNodeExtensionType>>( Base: T) => Constructor<NamespaceChildableNode> & T;
function OverloadableNode
OverloadableNode: <T extends Constructor<OverloadableNodeExtensionType>>( Base: T) => Constructor<OverloadableNode> & T;
function ParameteredNode
ParameteredNode: <T extends Constructor<ParameteredNodeExtensionType>>( Base: T) => Constructor<ParameteredNode> & T;
function printNode
printNode: { (node: ts.Node, options?: PrintNodeOptions): string; (node: ts.Node, sourceFile: ts.SourceFile, options?: PrintNodeOptions): string;};
Prints the provided node using the compiler's printer.
Parameter node
Compiler node.
Parameter options
Options.
Remarks
If the node was not constructed with the compiler API factory methods and the node does not have parents set, then use the other overload that accepts a source file.
Prints the provided node using the compiler's printer.
Parameter node
Compiler node.
Parameter sourceFile
Compiler source file.
Parameter options
Options.
function PropertyNamedNode
PropertyNamedNode: <T extends Constructor<PropertyNamedNodeExtensionType>>( Base: T) => Constructor<PropertyNamedNode> & T;
function QuestionTokenableNode
QuestionTokenableNode: < T extends Constructor<QuestionTokenableNodeExtensionType>>( Base: T) => Constructor<QuestionTokenableNode> & T;
function ReadonlyableNode
ReadonlyableNode: <T extends Constructor<ReadonlyableNodeExtensionType>>( Base: T) => Constructor<ReadonlyableNode> & T;
function ReferenceFindableNode
ReferenceFindableNode: < T extends Constructor<ReferenceFindableNodeExtensionType>>( Base: T) => Constructor<ReferenceFindableNode> & T;
function RenameableNode
RenameableNode: <T extends Constructor<RenameableNodeExtensionType>>( Base: T) => Constructor<RenameableNode> & T;
function ReturnTypedNode
ReturnTypedNode: <T extends Constructor<ReturnTypedNodeExtensionType>>( Base: T) => Constructor<ReturnTypedNode> & T;
function ScopeableNode
ScopeableNode: <T extends Constructor<ScopeableNodeExtensionType>>( Base: T) => Constructor<ScopeableNode> & T;
function ScopedNode
ScopedNode: <T extends Constructor<ScopedNodeExtensionType>>( Base: T) => Constructor<ScopedNode> & T;
function SignaturedDeclaration
SignaturedDeclaration: < T extends Constructor<SignaturedDeclarationExtensionType>>( Base: T) => Constructor<SignaturedDeclaration> & T;
function StatementedNode
StatementedNode: <T extends Constructor<StatementedNodeExtensionType>>( Base: T) => Constructor<StatementedNode> & T;
function StaticableNode
StaticableNode: <T extends Constructor<StaticableNodeExtensionType>>( Base: T) => Constructor<StaticableNode> & T;
function SuperExpressionedNode
SuperExpressionedNode: < T extends Constructor<SuperExpressionedNodeExtensionType>>( Base: T) => Constructor<SuperExpressionedNode> & T;
function TextInsertableNode
TextInsertableNode: <T extends Constructor<TextInsertableNodeExtensionType>>( Base: T) => Constructor<TextInsertableNode> & T;
function TypeArgumentedNode
TypeArgumentedNode: <T extends Constructor<TypeArgumentedNodeExtensionType>>( Base: T) => Constructor<TypeArgumentedNode> & T;
function TypedNode
TypedNode: <T extends Constructor<TypedNodeExtensionType>>( Base: T) => Constructor<TypedNode> & T;
function TypeElementMemberedNode
TypeElementMemberedNode: < T extends Constructor<TypeElementMemberedNodeExtensionType>>( Base: T) => Constructor<TypeElementMemberedNode> & T;
function TypeParameteredNode
TypeParameteredNode: <T extends Constructor<TypeParameteredNodeExtensionType>>( Base: T) => Constructor<TypeParameteredNode> & T;
function UnaryExpressionedNode
UnaryExpressionedNode: < T extends Constructor<UnaryExpressionedNodeExtensionType>>( Base: T) => Constructor<UnaryExpressionedNode> & T;
function UnwrappableNode
UnwrappableNode: <T extends Constructor<UnwrappableNodeExtensionType>>( Base: T) => Constructor<UnwrappableNode> & T;
Classes
class ArgumentError
class ArgumentError extends BaseError {}
constructor
protected constructor();
class ArgumentNullOrWhitespaceError
class ArgumentNullOrWhitespaceError extends ArgumentError {}
class ArgumentOutOfRangeError
class ArgumentOutOfRangeError extends ArgumentError {}
class ArgumentTypeError
class ArgumentTypeError extends ArgumentError {}
class ArrayBindingPattern
class ArrayBindingPattern extends Node<ts.ArrayBindingPattern> {}
method getElements
getElements: () => (BindingElement | OmittedExpression)[];
Gets the array binding pattern's elements.
class ArrayDestructuringAssignment
class ArrayDestructuringAssignment extends ArrayDestructuringAssignmentBase<ts.ArrayDestructuringAssignment> {}
method getLeft
getLeft: () => ArrayLiteralExpression;
Gets the left array literal expression of the array destructuring assignment.
class ArrayLiteralExpression
class ArrayLiteralExpression extends PrimaryExpression<ts.ArrayLiteralExpression> {}
method addElement
addElement: ( textOrWriterFunction: string | WriterFunction, options?: { useNewLines?: boolean }) => Expression<ts.Expression>;
Adds an element to the array.
Parameter textOrWriterFunction
Text to add as an element.
Parameter options
Options.
method addElements
addElements: ( textsOrWriterFunction: | ReadonlyArray<string | WriterFunction> | WriterFunction, options?: { useNewLines?: boolean }) => Expression<ts.Expression>[];
Adds elements to the array.
Parameter textsOrWriterFunction
Texts to add as elements.
Parameter options
Options.
method getElements
getElements: () => Expression[];
Gets the array's elements.
method insertElement
insertElement: ( index: number, textOrWriterFunction: string | WriterFunction, options?: { useNewLines?: boolean }) => Expression<ts.Expression>;
Insert an element into the array.
Parameter index
Child index to insert at.
Parameter text
Text to insert as an element.
Parameter options
Options.
method insertElements
insertElements: ( index: number, textsOrWriterFunction: | ReadonlyArray<string | WriterFunction> | WriterFunction, options?: { useNewLines?: boolean }) => Expression<ts.Expression>[];
Insert elements into the array.
Parameter index
Child index to insert at.
Parameter textsOrWriterFunction
Texts to insert as elements.
Parameter options
Options.
method removeElement
removeElement: { (index: number): void; (element: Expression<ts.Expression>): void;};
Removes an element from the array.
Parameter index
Index to remove from.
Removes an element from the array.
Parameter element
Element to remove.
class ArrayTypeNode
class ArrayTypeNode extends TypeNode<ts.ArrayTypeNode> {}
method getElementTypeNode
getElementTypeNode: () => TypeNode;
Gets the array type node's element type node.
class ArrowFunction
class ArrowFunction extends ArrowFunctionBase<ts.ArrowFunction> {}
method getEqualsGreaterThan
getEqualsGreaterThan: () => Node<ts.Token<SyntaxKind.EqualsGreaterThanToken>>;
Gets the equals greater than token of the arrow function.
class AsExpression
class AsExpression extends AsExpressionBase<ts.AsExpression> {}
class AssignmentExpression
class AssignmentExpression< T extends ts.AssignmentExpression<ts.AssignmentOperatorToken> = ts.AssignmentExpression<ts.AssignmentOperatorToken>> extends AssignmentExpressionBase<T> {}
method getOperatorToken
getOperatorToken: () => Node<ts.Token<ts.AssignmentOperator>>;
Gets the operator token of the assignment expression.
class AwaitExpression
class AwaitExpression extends AwaitExpressionBase<ts.AwaitExpression> {}
class BaseError
abstract class BaseError extends Error {}
constructor
protected constructor();
property message
readonly message: string;
class BinaryExpression
class BinaryExpression< T extends ts.BinaryExpression = ts.BinaryExpression> extends BinaryExpressionBase<T> {}
method getLeft
getLeft: () => Expression;
Gets the left side of the binary expression.
method getOperatorToken
getOperatorToken: () => Node<ts.Token<ts.BinaryOperator>>;
Gets the operator token of the binary expression.
method getRight
getRight: () => Expression;
Gets the right side of the binary expression.
class BindingElement
class BindingElement extends BindingElementBase<ts.BindingElement> {}
method getDotDotDotToken
getDotDotDotToken: () => Node<ts.Token<SyntaxKind.DotDotDotToken>> | undefined;
Gets the binding element's dot dot dot token (...) if it exists or returns undefined.
method getDotDotDotTokenOrThrow
getDotDotDotTokenOrThrow: () => Node<ts.Token<SyntaxKind.DotDotDotToken>>;
Gets the binding element's dot dot dot token (...) if it exists or throws if not.
method getPropertyNameNode
getPropertyNameNode: () => | Identifier | NumericLiteral | StringLiteral | ComputedPropertyName | undefined;
Gets binding element's property name node or returns undefined if not found.
For example in
const { a: b } = { a: 5 }
,a
would be the property name.
method getPropertyNameNodeOrThrow
getPropertyNameNodeOrThrow: () => PropertyName;
Gets binding element's property name node or throws if not found.
For example in
const { a: b } = { a: 5 }
,a
would be the property name.
class Block
class Block extends BlockBase<ts.Block> {}
class BooleanLiteral
class BooleanLiteral extends BooleanLiteralBase<ts.BooleanLiteral> {}
method getLiteralValue
getLiteralValue: () => boolean;
Gets the literal value.
method setLiteralValue
setLiteralValue: (value: boolean) => BooleanLiteral;
Sets the literal value.
Note: For the time being, this forgets the current node and returns the new node.
Parameter value
Value to set.
class BreakStatement
class BreakStatement extends BreakStatementBase<ts.BreakStatement> {}
method getLabel
getLabel: () => Identifier | undefined;
Gets this break statement's label or undefined if it does not exist.
method getLabelOrThrow
getLabelOrThrow: () => Identifier;
Gets this break statement's label or throw if it does not exist.
class CallExpression
class CallExpression< T extends ts.CallExpression = ts.CallExpression> extends CallExpressionBase<T> {}
method getReturnType
getReturnType: () => Type;
Gets the return type of the call expression.
class CallSignatureDeclaration
class CallSignatureDeclaration extends CallSignatureDeclarationBase<ts.CallSignatureDeclaration> {}
method getStructure
getStructure: () => CallSignatureDeclarationStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes this call signature.
method set
set: (structure: Partial<CallSignatureDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class CaseBlock
class CaseBlock extends CaseBlockBase<ts.CaseBlock> {}
method getClauses
getClauses: () => CaseOrDefaultClause[];
Gets the clauses.
method removeClause
removeClause: (index: number) => this;
Removes the clause at the specified index.
Parameter index
Index.
method removeClauses
removeClauses: (indexRange: [number, number]) => this;
Removes the clauses in the specified range.
Parameter indexRange
Index range.
class CaseClause
class CaseClause extends CaseClauseBase<ts.CaseClause> {}
method getExpression
getExpression: () => Expression;
Gets this switch statement's expression.
method remove
remove: () => void;
Removes this case clause.
class CatchClause
class CatchClause extends CatchClauseBase<ts.CatchClause> {}
method getBlock
getBlock: () => Block;
Gets this catch clause's block.
method getVariableDeclaration
getVariableDeclaration: () => VariableDeclaration | undefined;
Gets this catch clause's variable declaration or undefined if none exists.
method getVariableDeclarationOrThrow
getVariableDeclarationOrThrow: () => VariableDeclaration;
Gets this catch clause's variable declaration or throws if none exists.
class ClassDeclaration
class ClassDeclaration extends ClassDeclarationBase<ts.ClassDeclaration> {}
method extractInterface
extractInterface: (name?: string) => InterfaceDeclarationStructure;
Extracts an interface declaration structure from the class.
Parameter name
Name of the interface. Falls back to the same name as the class and then the filepath's base name.
method extractStaticInterface
extractStaticInterface: (name: string) => InterfaceDeclarationStructure;
Extracts an interface declaration structure from the static part of the class.
Parameter name
Name of the interface.
method getStructure
getStructure: () => ClassDeclarationStructure;
Gets the structure equivalent to this node.
method set
set: (structure: Partial<ClassDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class ClassExpression
class ClassExpression extends ClassExpressionBase<ts.ClassExpression> {}
class CodeAction
class CodeAction<TCompilerObject extends ts.CodeAction = ts.CodeAction> {}
Represents a code action.
constructor
protected constructor();
property compilerObject
readonly compilerObject: ts.CodeAction;
Gets the compiler object.
method getChanges
getChanges: () => FileTextChanges[];
Text changes to apply to each file as part of the code action.
method getDescription
getDescription: () => string;
Description of the code action.
class CodeBlockWriter
class CodeBlockWriter {}
constructor
constructor(opts?: Partial<CodeBlockWriterOptions>);
method blankLine
blankLine: () => this;
Writes a blank line.
method blankLineIfLastNot
blankLineIfLastNot: () => this;
Writes a blank line if the last written text was not a blank line.
method block
block: (block?: () => void) => this;
Writes a block using braces.
Parameter block
Write using the writer within this block.
method conditionalBlankLine
conditionalBlankLine: (condition: boolean | undefined) => this;
Writes a blank line if the condition is true.
Parameter condition
Condition to evaluate.
method conditionalNewLine
conditionalNewLine: (condition: boolean | undefined) => this;
Writes a newline if the condition is true.
Parameter condition
Condition to evaluate.
method conditionalWrite
conditionalWrite: { (condition: boolean | undefined, textFunc: () => string): this; (condition: boolean, text: string): this;};
Conditionally writes text.
Parameter condition
Condition to evaluate.
Parameter textFunc
A function that returns a string to write if the condition is true.
Conditionally writes text.
Parameter condition
Condition to evaluate.
Parameter text
Text to write if the condition is true.
method conditionalWriteLine
conditionalWriteLine: { (condition: boolean | undefined, textFunc: () => string): this; (condition: boolean, text: string): this;};
Conditionally writes a line of text.
Parameter condition
Condition to evaluate.
Parameter textFunc
A function that returns a string to write if the condition is true.
Conditionally writes a line of text.
Parameter condition
Condition to evaluate.
Parameter text
Text to write if the condition is true.
method getIndentationLevel
getIndentationLevel: () => number;
Gets the current indentation level.
method getLastChar
getLastChar: () => string | undefined;
Gets the last char written.
method getLength
getLength: () => number;
Gets the length of the string in the writer.
method getOptions
getOptions: () => CodeBlockWriterOptions;
Gets the options.
method indent
indent: () => this;
Indents the code one level for the current line.
method indentBlock
indentBlock: (block: () => void) => this;
Indents a block of code.
Parameter block
Block to indent.
method inlineBlock
inlineBlock: (block?: () => void) => this;
Writes an inline block with braces.
Parameter block
Write using the writer within this block.
method isAtStartOfFirstLineOfBlock
isAtStartOfFirstLineOfBlock: () => boolean;
Gets if the writer is currently at the start of the first line of the text, block, or indentation block.
method isInComment
isInComment: () => boolean;
Gets if the writer is currently in a comment.
method isInString
isInString: () => boolean;
Gets if the writer is currently in a string.
method isLastBlankLine
isLastBlankLine: () => boolean;
Gets if the last chars written were for a blank line.
method isLastNewLine
isLastNewLine: () => boolean;
Gets if the last chars written were for a newline.
method isLastSpace
isLastSpace: () => boolean;
Gets if the last char written was a space.
method isLastTab
isLastTab: () => boolean;
Gets if the last char written was a tab.
method isOnFirstLineOfBlock
isOnFirstLineOfBlock: () => boolean;
Gets if the writer is currently on the first line of the text, block, or indentation block.
method newLine
newLine: () => this;
Writes a newline.
method newLineIfLastNot
newLineIfLastNot: () => this;
Writes a newline if the last line was not a newline.
method queueIndentationLevel
queueIndentationLevel: { (indentationLevel: number): this; (indentationText: string): this;};
Queues the indentation level for the next lines written.
Parameter indentationLevel
Indentation level to queue.
Queues the indentation level for the next lines written using the provided indentation text.
Parameter indentationText
Gets the indentation level from the indentation text.
method quote
quote: { (): this; (text: string): this };
Writes a quote character.
Writes text surrounded in quotes.
Parameter text
Text to write.
method setIndentationLevel
setIndentationLevel: { (indentationLevel: number): this; (indentationText: string): this;};
Sets the current indentation level.
Parameter indentationLevel
Indentation level to be at.
Sets the current indentation using the provided indentation text.
Parameter indentationText
Gets the indentation level from the indentation text.
method space
space: (times?: number) => this;
Writes a space.
Parameter times
Number of times to write a space.
method spaceIfLastNot
spaceIfLastNot: () => this;
Writes a space if the last character was not a space.
method tab
tab: (times?: number) => this;
Writes a tab.
Parameter times
Number of times to write a tab.
method tabIfLastNot
tabIfLastNot: () => this;
Writes a tab if the last character was not a tab.
method toString
toString: () => string;
Gets the writer's text.
method write
write: (text: string) => this;
Writes the provided text.
Parameter text
Text to write.
method writeLine
writeLine: (text: string) => this;
Writes a line of text.
Parameter text
String to write.
class CodeFixAction
class CodeFixAction extends CodeAction<ts.CodeFixAction> {}
Represents a code fix action.
method getFixAllDescription
getFixAllDescription: () => string | undefined;
Gets the description of the code fix when fixing everything.
method getFixId
getFixId: () => {} | undefined;
If present, one may call 'getCombinedCodeFix' with this fixId. This may be omitted to indicate that the code fix can't be applied in a group.
method getFixName
getFixName: () => string;
Short name to identify the fix, for use by telemetry.
class CombinedCodeActions
class CombinedCodeActions {}
Represents file changes.
Commands are currently not implemented.
property compilerObject
readonly compilerObject: ts.CombinedCodeActions;
Gets the compiler object.
method getChanges
getChanges: () => FileTextChanges[];
Text changes to apply to each file.
class CommaListExpression
class CommaListExpression extends CommaListExpressionBase<ts.CommaListExpression> {}
method getElements
getElements: () => Expression[];
Gets the elements.
class CommentRange
class CommentRange {}
property compilerObject
readonly compilerObject: ts.CommentRange;
Gets the underlying compiler object.
method getEnd
getEnd: () => number;
Gets the end.
method getKind
getKind: () => ts.CommentKind;
Gets the comment syntax kind.
method getPos
getPos: () => number;
Gets the position.
method getSourceFile
getSourceFile: () => SourceFile;
Gets the source file of the comment range.
method getText
getText: () => string;
Gets the text of the comment range.
method getWidth
getWidth: () => number;
Gets the width of the comment range.
method wasForgotten
wasForgotten: () => boolean;
Gets if the comment range was forgotten.
This will be true after any manipulations have occured to the source file this comment range was generated from.
class CompilerOptionsContainer
class CompilerOptionsContainer extends SettingsContainer<CompilerOptions> {}
Holds the compiler options.
constructor
constructor();
method set
set: (settings: CompilerOptions) => void;
Sets one or all of the compiler options.
WARNING: Setting the compiler options will cause a complete reparse of all the source files.
Parameter settings
Compiler options to set.
class ComputedPropertyName
class ComputedPropertyName extends Node<ts.ComputedPropertyName> {}
method getExpression
getExpression: () => Expression;
Gets the expression.
class ConditionalExpression
class ConditionalExpression extends ConditionalExpressionBase<ts.ConditionalExpression> {}
method getColonToken
getColonToken: () => Node<ts.Token<SyntaxKind.ColonToken>>;
Gets the colon token of the conditional expression.
method getCondition
getCondition: () => Expression;
Gets the condition of the conditional expression.
method getQuestionToken
getQuestionToken: () => Node<ts.Token<SyntaxKind.QuestionToken>>;
Gets the question token of the conditional expression.
method getWhenFalse
getWhenFalse: () => Expression;
Gets the when false expression of the conditional expression.
method getWhenTrue
getWhenTrue: () => Expression;
Gets the when true expression of the conditional expression.
class ConstructorDeclaration
class ConstructorDeclaration extends ConstructorDeclarationBase<ts.ConstructorDeclaration> {}
method addOverload
addOverload: ( structure: ConstructorDeclarationOverloadStructure) => ConstructorDeclaration;
Add a constructor overload.
Parameter structure
Structure to add.
method addOverloads
addOverloads: ( structures: ReadonlyArray<ConstructorDeclarationOverloadStructure>) => ConstructorDeclaration[];
Add constructor overloads.
Parameter structures
Structures to add.
method getStructure
getStructure: () => | ConstructorDeclarationStructure | ConstructorDeclarationOverloadStructure;
Gets the structure equivalent to this node.
method insertOverload
insertOverload: ( index: number, structure: ConstructorDeclarationOverloadStructure) => ConstructorDeclaration;
Inserts a constructor overload.
Parameter index
Child index to insert at.
Parameter structure
Structures to insert.
method insertOverloads
insertOverloads: ( index: number, structures: ReadonlyArray<ConstructorDeclarationOverloadStructure>) => ConstructorDeclaration[];
Inserts constructor overloads.
Parameter index
Child index to insert at.
Parameter structures
Structures to insert.
method remove
remove: () => void;
Remove the constructor.
method set
set: (structure: Partial<ConstructorDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class ConstructorTypeNode
class ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase<ts.ConstructorTypeNode> {}
class ConstructSignatureDeclaration
class ConstructSignatureDeclaration extends ConstructSignatureDeclarationBase<ts.ConstructSignatureDeclaration> {}
method getStructure
getStructure: () => ConstructSignatureDeclarationStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes this construct signature.
method set
set: (structure: Partial<ConstructSignatureDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class ContinueStatement
class ContinueStatement extends ContinueStatementBase<ts.ContinueStatement> {}
method getLabel
getLabel: () => Identifier | undefined;
Gets this continue statement's label or undefined if it does not exist.
method getLabelOrThrow
getLabelOrThrow: () => Identifier;
Gets this continue statement's label or throw if it does not exist.
class DebuggerStatement
class DebuggerStatement extends DebuggerStatementBase<ts.DebuggerStatement> {}
class Decorator
class Decorator extends DecoratorBase<ts.Decorator> {}
method addArgument
addArgument: (argumentText: string | WriterFunction) => Node<ts.Node>;
Adds an argument.
Parameter argumentTexts
Argument text.
method addArguments
addArguments: ( argumentTexts: ReadonlyArray<string | WriterFunction> | WriterFunction) => Node<ts.Node>[];
Adds arguments.
Parameter argumentTexts
Argument texts.
method addTypeArgument
addTypeArgument: (argumentText: string) => TypeNode<ts.TypeNode>;
Adds a type argument.
Parameter argumentTexts
Argument text.
method addTypeArguments
addTypeArguments: ( argumentTexts: ReadonlyArray<string>) => TypeNode<ts.TypeNode>[];
Adds type arguments.
Parameter argumentTexts
Argument texts.
method getArguments
getArguments: () => Node[];
Gets the decorator's arguments from its call expression.
method getCallExpression
getCallExpression: () => CallExpression | undefined;
Gets the call expression if a decorator factory.
method getCallExpressionOrThrow
getCallExpressionOrThrow: () => CallExpression;
Gets the call expression if a decorator factory, or throws.
method getExpression
getExpression: () => Expression<ts.LeftHandSideExpression>;
Gets the expression.
method getFullName
getFullName: () => string;
Gets the full decorator name.
method getName
getName: () => string;
Gets the decorator name.
method getNameNode
getNameNode: () => Identifier;
Gets the name node of the decorator.
method getStructure
getStructure: () => DecoratorStructure;
Gets the structure equivalent to this node.
method getTypeArguments
getTypeArguments: () => TypeNode[];
Gets the decorator's type arguments from its call expression.
method insertArgument
insertArgument: ( index: number, argumentText: string | WriterFunction) => Node<ts.Node>;
Inserts an argument.
Parameter index
Child index to insert at.
Parameter argumentTexts
Argument text.
method insertArguments
insertArguments: ( index: number, argumentTexts: ReadonlyArray<string | WriterFunction> | WriterFunction) => Node<ts.Node>[];
Inserts arguments.
Parameter index
Child index to insert at.
Parameter argumentTexts
Argument texts.
method insertTypeArgument
insertTypeArgument: ( index: number, argumentText: string) => TypeNode<ts.TypeNode>;
Inserts a type argument.
Parameter index
Child index to insert at.
Parameter argumentTexts
Argument text.
method insertTypeArguments
insertTypeArguments: ( index: number, argumentTexts: ReadonlyArray<string>) => TypeNode<ts.TypeNode>[];
Inserts type arguments.
Parameter index
Child index to insert at.
Parameter argumentTexts
Argument texts.
method isDecoratorFactory
isDecoratorFactory: () => boolean;
Gets if the decorator is a decorator factory.
method remove
remove: () => void;
Removes this decorator.
method removeArgument
removeArgument: { (node: Node): this; (index: number): this };
Removes an argument based on the node.
Parameter node
Argument's node to remove.
Removes an argument based on the specified index.
Parameter index
Index to remove.
method removeTypeArgument
removeTypeArgument: { (typeArg: Node): this; (index: number): this };
Removes a type argument.
Parameter typeArg
Type argument to remove.
Removes a type argument.
Parameter index
Index to remove.
method set
set: (structure: Partial<DecoratorStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setIsDecoratorFactory
setIsDecoratorFactory: (isDecoratorFactory: boolean) => this;
Set if this decorator is a decorator factory.
Parameter isDecoratorFactory
If it should be a decorator factory or not.
class DefaultClause
class DefaultClause extends DefaultClauseBase<ts.DefaultClause> {}
method remove
remove: () => void;
Removes the default clause.
class DefinitionInfo
class DefinitionInfo< TCompilerObject extends ts.DefinitionInfo = ts.DefinitionInfo> extends DocumentSpan<TCompilerObject> {}
Definition info.
constructor
protected constructor();
method getContainerKind
getContainerKind: () => ts.ScriptElementKind;
Gets the container kind.
method getContainerName
getContainerName: () => string;
Gets the container name.
method getDeclarationNode
getDeclarationNode: () => Node | undefined;
Gets the declaration node.
method getKind
getKind: () => ts.ScriptElementKind;
Gets the kind.
method getName
getName: () => string;
Gets the name.
class DeleteExpression
class DeleteExpression extends DeleteExpressionBase<ts.DeleteExpression> {}
class Diagnostic
class Diagnostic<TCompilerObject extends ts.Diagnostic = ts.Diagnostic> {}
Diagnostic.
constructor
protected constructor();
property compilerObject
readonly compilerObject: ts.Diagnostic;
Gets the underlying compiler diagnostic.
method getCategory
getCategory: () => DiagnosticCategory;
Gets the diagnostic category.
method getCode
getCode: () => number;
Gets the code of the diagnostic.
method getLength
getLength: () => number | undefined;
Gets the length.
method getLineNumber
getLineNumber: () => number | undefined;
Gets the line number.
method getMessageText
getMessageText: () => string | DiagnosticMessageChain;
Gets the message text.
method getSource
getSource: () => string | undefined;
Gets the source.
method getSourceFile
getSourceFile: () => SourceFile | undefined;
Gets the source file.
method getStart
getStart: () => number | undefined;
Gets the start.
class DiagnosticMessageChain
class DiagnosticMessageChain {}
Diagnostic message chain.
property compilerObject
readonly compilerObject: ts.DiagnosticMessageChain;
Gets the underlying compiler object.
method getCategory
getCategory: () => DiagnosticCategory;
Gets the category of the diagnostic message chain.
method getCode
getCode: () => number;
Gets the code of the diagnostic message chain.
method getMessageText
getMessageText: () => string;
Gets the message text.
method getNext
getNext: () => DiagnosticMessageChain | undefined;
Gets th enext diagnostic message chain in the chain.
class DiagnosticWithLocation
class DiagnosticWithLocation extends Diagnostic<ts.DiagnosticWithLocation> {}
method getLength
getLength: () => number;
Gets the length
method getLineNumber
getLineNumber: () => number;
Gets the line number.
method getSourceFile
getSourceFile: () => SourceFile;
Gets the source file.
method getStart
getStart: () => number;
Gets the start.
class Directory
class Directory {}
method addExistingDirectory
addExistingDirectory: ( dirPath: string, options?: DirectoryAddOptions) => Directory;
Adds an existing directory from the relative path or directory name, or throws if it doesn't exist.
Will return the directory if it was already added.
Parameter dirPath
Directory name or path to the directory that should be added.
Throws
DirectoryNotFoundError if the directory does not exist.
method addExistingDirectoryIfExists
addExistingDirectoryIfExists: ( dirPath: string, options?: DirectoryAddOptions) => Directory | undefined;
Adds an existing directory from the relative path or directory name, or returns undefined if it doesn't exist.
Will return the directory if it was already added.
Parameter dirPath
Directory name or path to the directory that should be added.
Parameter options
Options.
method addExistingSourceFile
addExistingSourceFile: (relativeFilePath: string) => SourceFile;
Adds an existing source file, relative to this directory, or throws if it doesn't exist.
Will return the source file if it was already added.
Parameter relativeFilePath
Relative file path to add.
Throws
FileNotFoundError when the file doesn't exist.
method addExistingSourceFileIfExists
addExistingSourceFileIfExists: ( relativeFilePath: string) => SourceFile | undefined;
Adds an existing source file, relative to this directory, or returns undefined.
Will return the source file if it was already added.
Parameter relativeFilePath
Relative file path to add.
method addExistingSourceFiles
addExistingSourceFiles: ( fileGlobs: string | ReadonlyArray<string>) => SourceFile[];
Add source files based on file globs.
Parameter fileGlobs
File glob or globs to add files based on.
Returns
The matched source files.
method copy
copy: ( relativeOrAbsolutePath: string, options?: DirectoryCopyOptions) => Directory;
Copies the directory to a new directory.
Parameter relativeOrAbsolutePath
The relative or absolute path to the new directory.
Parameter options
Options.
Returns
The directory the copy was made to.
method copyImmediately
copyImmediately: ( relativeOrAbsolutePath: string, options?: DirectoryCopyOptions) => Promise<Directory>;
Immediately copies the directory to the specified path asynchronously.
Parameter relativeOrAbsolutePath
Directory path as an absolute or relative path.
Parameter options
Options for moving the directory.
Remarks
If includeTrackedFiles is true, then it will execute the pending operations in the current directory.
method copyImmediatelySync
copyImmediatelySync: ( relativeOrAbsolutePath: string, options?: DirectoryCopyOptions) => Directory;
Immediately copies the directory to the specified path synchronously.
Parameter relativeOrAbsolutePath
Directory path as an absolute or relative path.
Parameter options
Options for moving the directory.
Remarks
If includeTrackedFiles is true, then it will execute the pending operations in the current directory.
method copyToDirectory
copyToDirectory: ( dirPathOrDirectory: string | Directory, options?: DirectoryCopyOptions) => Directory;
Copies the directory to a subdirectory of the specified directory.
Parameter dirPathOrDirectory
Directory path or directory object to copy the directory to.
Parameter options
Options for copying.
Returns
The new copied directory.
method createDirectory
createDirectory: (dirPath: string) => Directory;
Creates a directory if it doesn't exist.
Parameter dirPath
Relative or absolute path to the directory that should be created.
method createSourceFile
createSourceFile: ( relativeFilePath: string, sourceFileText?: string | SourceFileStructure | WriterFunction, options?: SourceFileCreateOptions) => SourceFile;
Creates a source file, relative to this directory.
Note: The file will not be created and saved to the file system until .save() is called on the source file.
Parameter relativeFilePath
Relative file path of the source file to create.
Parameter sourceFileText
Text, structure, or writer function to create the source file text with.
Parameter options
Options.
Throws
- InvalidOperationError if a source file already exists at the provided file name.
method delete
delete: () => void;
Queues a deletion of the directory to the file system.
The directory will be deleted when calling ast.save(). If you wish to delete the file immediately, then use deleteImmediately().
method deleteImmediately
deleteImmediately: () => Promise<void>;
Asyncronously deletes the directory and all its descendants from the file system.
method deleteImmediatelySync
deleteImmediatelySync: () => void;
Synchronously deletes the directory and all its descendants from the file system.
method emit
emit: (options?: { emitOnlyDtsFiles?: boolean; outDir?: string; declarationDir?: string;}) => Promise<DirectoryEmitResult>;
Emits the files in the directory.
Parameter options
Options for emitting.
method emitSync
emitSync: (options?: { emitOnlyDtsFiles?: boolean; outDir?: string; declarationDir?: string;}) => DirectoryEmitResult;
Emits the files in the directory synchronously.
Remarks: This might be very slow compared to the asynchronous version if there are a lot of files.
Parameter options
Options for emitting.
method forget
forget: () => void;
Forgets the directory and all its descendants from the Project.
Note: Does not delete the directory from the file system.
method getBaseName
getBaseName: () => string;
Gets the directory path's base name.
method getDescendantDirectories
getDescendantDirectories: () => Directory[];
Gets the descendant directories.
method getDescendantSourceFiles
getDescendantSourceFiles: () => SourceFile[];
Gets the source files in the current directory and all the descendant directories.
method getDirectories
getDirectories: () => Directory[];
Gets the child directories.
method getDirectory
getDirectory: { (path: string): Directory | undefined; (condition: (directory: Directory) => boolean): Directory;};
Gets a directory with the specified path or undefined if not found.
Parameter path
Relative path from this directory or absolute path.
Gets a child directory by the specified condition or undefined if not found.
Parameter condition
Condition to check the directory with.
method getDirectoryOrThrow
getDirectoryOrThrow: { (path: string): Directory; (condition: (directory: Directory) => boolean): Directory;};
Gets a child directory with the specified path or throws if not found.
Parameter path
Relative path from this directory or absolute path.
Gets a child directory by the specified condition or throws if not found.
Parameter condition
Condition to check the directory with.
method getParent
getParent: () => Directory | undefined;
Gets the parent directory if it exists and was added to the project.
method getParentOrThrow
getParentOrThrow: () => Directory;
Gets the parent directory or throws if it doesn't exist or was never added to the project.
method getPath
getPath: () => string;
Gets the path to the directory.
method getRelativePathAsModuleSpecifierTo
getRelativePathAsModuleSpecifierTo: { (sourceFile: SourceFile): string; (directory: Directory): string;};
Gets the relative path to the specified source file as a module specifier.
Parameter sourceFile
Source file.
Gets the relative path to the specified directory as a module specifier.
Parameter directory
Directory.
method getRelativePathTo
getRelativePathTo: { (sourceFile: SourceFile): string; (directory: Directory): string;};
Gets the relative path to another source file.
Parameter sourceFile
Source file.
Gets the relative path to another directory.
Parameter directory
Directory.
method getSourceFile
getSourceFile: { (path: string): SourceFile | undefined; (condition: (sourceFile: SourceFile) => boolean): SourceFile;};
Gets a child source file with the specified path or undefined if not found.
Parameter path
Relative or absolute path to the file.
Gets a child source file by the specified condition or undefined if not found.
Parameter condition
Condition to check the source file with.
method getSourceFileOrThrow
getSourceFileOrThrow: { (path: string): SourceFile; (condition: (sourceFile: SourceFile) => boolean): SourceFile;};
Gets a child source file with the specified path or throws if not found.
Parameter path
Relative or absolute path to the file.
Gets a child source file by the specified condition or throws if not found.
Parameter condition
Condition to check the source file with.
method getSourceFiles
getSourceFiles: () => SourceFile[];
Gets the source files within this directory.
method isAncestorOf
isAncestorOf: (possibleDescendant: Directory | SourceFile) => boolean;
Checks if this directory is an ancestor of the provided directory.
Parameter possibleDescendant
Directory or source file that's a possible descendant.
method isDescendantOf
isDescendantOf: (possibleAncestor: Directory) => boolean;
Checks if this directory is a descendant of the provided directory.
Parameter possibleAncestor
Directory or source file that's a possible ancestor.
method move
move: (relativeOrAbsolutePath: string, options?: DirectoryMoveOptions) => this;
Moves the directory to a new path.
Parameter relativeOrAbsolutePath
Directory path as an absolute or relative path.
Parameter options
Options for moving the directory.
method moveImmediately
moveImmediately: ( relativeOrAbsolutePath: string, options?: DirectoryMoveOptions) => Promise<this>;
Immediately moves the directory to a new path asynchronously.
Parameter relativeOrAbsolutePath
Directory path as an absolute or relative path.
Parameter options
Options for moving the directory.
method moveImmediatelySync
moveImmediatelySync: ( relativeOrAbsolutePath: string, options?: DirectoryMoveOptions) => this;
Immediately moves the directory to a new path synchronously.
Parameter relativeOrAbsolutePath
Directory path as an absolute or relative path.
Parameter options
Options for moving the directory.
method moveToDirectory
moveToDirectory: ( dirPathOrDirectory: string | Directory, options?: DirectoryMoveOptions) => this;
Moves the directory to a subdirectory of the specified directory.
Parameter dirPathOrDirectory
Directory path or directory object to move the directory to.
Parameter options
Options for moving.
method save
save: () => Promise<void>;
Asynchronously saves the directory and all the unsaved source files to the disk.
method saveSync
saveSync: () => void;
Synchronously saves the directory and all the unsaved source files to the disk.
method wasForgotten
wasForgotten: () => boolean;
Gets if the directory was forgotten.
class DirectoryEmitResult
class DirectoryEmitResult {}
method getEmitSkipped
getEmitSkipped: () => boolean;
Gets if the emit was skipped.
method getOutputFilePaths
getOutputFilePaths: () => string[];
Gets the output file paths.
class DirectoryNotFoundError
class DirectoryNotFoundError extends PathNotFoundError {}
class DocumentSpan
class DocumentSpan<TCompilerObject extends ts.DocumentSpan = ts.DocumentSpan> {}
Document span.
constructor
protected constructor();
property compilerObject
readonly compilerObject: ts.DocumentSpan;
Gets the compiler object.
method getNode
getNode: () => Node<ts.Node>;
Gets the node at the start of the text span.
method getOriginalFileName
getOriginalFileName: () => string | undefined;
Gets the original file name if the span represents a location that was remapped.
method getOriginalTextSpan
getOriginalTextSpan: () => TextSpan | undefined;
Gets the original text span if the span represents a location that was remapped.
method getSourceFile
getSourceFile: () => SourceFile;
Gets the source file this reference is in.
method getTextSpan
getTextSpan: () => TextSpan;
Gets the text span.
class DoStatement
class DoStatement extends DoStatementBase<ts.DoStatement> {}
method getExpression
getExpression: () => Expression;
Gets this do statement's expression.
class ElementAccessExpression
class ElementAccessExpression< T extends ts.ElementAccessExpression = ts.ElementAccessExpression> extends ElementAccessExpressionBase<T> {}
method getArgumentExpression
getArgumentExpression: () => Expression | undefined;
Gets this element access expression's argument expression or undefined if none exists.
method getArgumentExpressionOrThrow
getArgumentExpressionOrThrow: () => Expression<ts.Expression>;
Gets this element access expression's argument expression or throws if none exists.
class EmitOutput
class EmitOutput {}
Output of an emit on a single file.
property compilerObject
readonly compilerObject: ts.EmitOutput;
TypeScript compiler emit result.
method getEmitSkipped
getEmitSkipped: () => boolean;
Gets if the emit was skipped.
method getOutputFiles
getOutputFiles: () => OutputFile[];
Gets the output files.
class EmitResult
class EmitResult {}
Result of an emit.
constructor
protected constructor();
property compilerObject
readonly compilerObject: ts.EmitResult;
TypeScript compiler emit result.
method getDiagnostics
getDiagnostics: () => Diagnostic<ts.Diagnostic>[];
Contains declaration emit diagnostics.
This is the semantic, syntactic, global, options, and if enabled declaration diagnostics.
method getEmitSkipped
getEmitSkipped: () => boolean;
If the emit was skipped.
class EmptyStatement
class EmptyStatement extends EmptyStatementBase<ts.EmptyStatement> {}
class EnumDeclaration
class EnumDeclaration extends EnumDeclarationBase<ts.EnumDeclaration> {}
method addMember
addMember: (structure: EnumMemberStructure) => EnumMember;
Adds a member to the enum.
Parameter structure
Structure of the enum.
method addMembers
addMembers: (structures: ReadonlyArray<EnumMemberStructure>) => EnumMember[];
Adds members to the enum.
Parameter structures
Structures of the enums.
method getConstKeyword
getConstKeyword: () => Node<ts.Node> | undefined;
Gets the const enum keyword or undefined if not exists.
method getMember
getMember: { (name: string): EnumMember | undefined; (findFunction: (declaration: EnumMember) => boolean): EnumMember;};
Gets an enum member.
Parameter name
Name of the member.
Gets an enum member.
Parameter findFunction
Function to use to find the member.
method getMemberOrThrow
getMemberOrThrow: { (name: string): EnumMember; (findFunction: (declaration: EnumMember) => boolean): EnumMember;};
Gets an enum member or throws if not found.
Parameter name
Name of the member.
Gets an enum member or throws if not found.
Parameter findFunction
Function to use to find the member.
method getMembers
getMembers: () => EnumMember[];
Gets the enum's members.
method getStructure
getStructure: () => EnumDeclarationStructure;
Gets the structure equivalent to this node.
method insertMember
insertMember: (index: number, structure: EnumMemberStructure) => EnumMember;
Inserts a member to the enum.
Parameter index
Child index to insert at.
Parameter structure
Structure of the enum.
method insertMembers
insertMembers: ( index: number, structures: ReadonlyArray<EnumMemberStructure>) => EnumMember[];
Inserts members to an enum.
Parameter index
Child index to insert at.
Parameter structures
Structures of the enums.
method isConstEnum
isConstEnum: () => boolean;
Gets if it's a const enum.
method set
set: (structure: Partial<EnumDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setIsConstEnum
setIsConstEnum: (value: boolean) => this;
Toggle if it's a const enum.
class EnumMember
class EnumMember extends EnumMemberBase<ts.EnumMember> {}
method getStructure
getStructure: () => EnumMemberStructure;
Gets the structure equivalent to this node.
method getValue
getValue: () => string | number | undefined;
Gets the constant value of the enum.
method remove
remove: () => void;
Removes this enum member.
method set
set: (structure: Partial<EnumMemberStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setValue
setValue: (value: string | number) => this;
Sets the enum value.
Parameter value
Enum value.
class ExportAssignment
class ExportAssignment extends ExportAssignmentBase<ts.ExportAssignment> {}
method getExpression
getExpression: () => Expression;
Gets the export assignment expression.
method getStructure
getStructure: () => ExportAssignmentStructure;
Gets the structure equivalent to this node.
method isExportEquals
isExportEquals: () => boolean;
Gets if this is an export equals assignment.
If this is false, then it's
export default
.
method set
set: (structure: Partial<ExportAssignmentStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setExpression
setExpression: (textOrWriterFunction: string | WriterFunction) => this;
Sets the expression of the export assignment.
Parameter textOrWriterFunction
Text or writer function to set as the export assignment expression.
method setIsExportEquals
setIsExportEquals: (value: boolean) => this;
Sets if this is an export equals assignment or export default.
Parameter value
Whether it should be an export equals assignment.
class ExportDeclaration
class ExportDeclaration extends ExportDeclarationBase<ts.ExportDeclaration> {}
method addNamedExport
addNamedExport: ( namedExport: ExportSpecifierStructure | string | WriterFunction) => ExportSpecifier;
Adds a named export.
Parameter namedExport
Structure, name, or writer function to write the named export.
method addNamedExports
addNamedExports: ( namedExports: | ReadonlyArray<ExportSpecifierStructure | string | WriterFunction> | WriterFunction) => ExportSpecifier[];
Adds named exports.
Parameter namedExports
Structures, names, or writer function to write the named exports.
method getModuleSpecifier
getModuleSpecifier: () => StringLiteral | undefined;
Gets the module specifier or undefined if it doesn't exist.
method getModuleSpecifierSourceFile
getModuleSpecifierSourceFile: () => SourceFile | undefined;
Gets the source file referenced in the module specifier.
method getModuleSpecifierSourceFileOrThrow
getModuleSpecifierSourceFileOrThrow: () => SourceFile;
Gets the source file referenced in the module specifier or throws if it can't find it or it doesn't exist.
method getModuleSpecifierValue
getModuleSpecifierValue: () => string | undefined;
Gets the module specifier value or undefined if it doesn't exist.
method getNamedExports
getNamedExports: () => ExportSpecifier[];
Gets the named exports.
method getStructure
getStructure: () => ExportDeclarationStructure;
Gets the structure equivalent to this node.
method hasModuleSpecifier
hasModuleSpecifier: () => boolean;
Gets if the module specifier exists
method hasNamedExports
hasNamedExports: () => boolean;
Gets if the export declaration has named exports.
method insertNamedExport
insertNamedExport: ( index: number, namedExport: ExportSpecifierStructure | string | WriterFunction) => ExportSpecifier;
Inserts a named export.
Parameter index
Child index to insert at.
Parameter namedExport
Structure, name, or writer function to write the named export.
method insertNamedExports
insertNamedExports: ( index: number, namedExports: | ReadonlyArray<ExportSpecifierStructure | string | WriterFunction> | WriterFunction) => ExportSpecifier[];
Inserts named exports into the export declaration.
Parameter index
Child index to insert at.
Parameter namedExports
Structures, names, or writer funciton to write the named exports.
method isModuleSpecifierRelative
isModuleSpecifierRelative: () => boolean;
Gets if the module specifier starts with
./
or../
.
method isNamespaceExport
isNamespaceExport: () => boolean;
Gets if this export declaration is a namespace export.
method removeModuleSpecifier
removeModuleSpecifier: () => this;
Removes the module specifier.
method set
set: (structure: Partial<ExportDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setModuleSpecifier
setModuleSpecifier: { (text: string): this; (sourceFile: SourceFile): this };
Sets the import specifier.
Parameter text
Text to set as the module specifier.
Sets the import specifier.
Parameter sourceFile
Source file to set the module specifier from.
method toNamespaceExport
toNamespaceExport: () => this;
Changes the export declaration to namespace export. Removes all the named exports.
class ExportSpecifier
class ExportSpecifier extends ExportSpecifierBase<ts.ExportSpecifier> {}
method getAliasNode
getAliasNode: () => Identifier | undefined;
Gets the alias identifier, if it exists.
method getExportDeclaration
getExportDeclaration: () => ExportDeclaration;
Gets the export declaration associated with this export specifier.
method getLocalTargetDeclarations
getLocalTargetDeclarations: () => Node[];
Gets all the declarations referenced by the export specifier.
method getLocalTargetSymbol
getLocalTargetSymbol: () => Symbol | undefined;
Gets the local target symbol of the export specifier or undefined if it doesn't exist.
method getLocalTargetSymbolOrThrow
getLocalTargetSymbolOrThrow: () => Symbol;
Gets the local target symbol of the export specifier or throws if it doesn't exist.
method getName
getName: () => string;
Gets the name of the export specifier.
method getNameNode
getNameNode: () => Identifier;
Gets the name node of what's being exported.
method getStructure
getStructure: () => ExportSpecifierStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes the export specifier.
method removeAlias
removeAlias: () => this;
Removes the alias without renaming.
Remarks
Use removeAliasWithRename() if you want it to rename any usages to the name of the export specifier.
method removeAliasWithRename
removeAliasWithRename: () => this;
Removes the alias and renames any usages to the name of the export specifier.
method renameAlias
renameAlias: (alias: string) => this;
Sets the alias for the name being exported and renames all the usages.
Parameter alias
Alias to set.
method set
set: (structure: Partial<ExportSpecifierStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setAlias
setAlias: (alias: string) => this;
Sets the alias without renaming all the usages.
Parameter alias
Alias to set.
method setName
setName: (name: string) => this;
Sets the name of what's being exported.
class Expression
class Expression<T extends ts.Expression = ts.Expression> extends Node<T> {}
method getContextualType
getContextualType: () => Type | undefined;
Gets the contextual type of the expression.
class ExpressionStatement
class ExpressionStatement extends ExpressionStatementBase<ts.ExpressionStatement> {}
method getExpression
getExpression: () => Expression;
Gets this expression statement's expression.
class ExpressionWithTypeArguments
class ExpressionWithTypeArguments extends ExpressionWithTypeArgumentsBase<ts.ExpressionWithTypeArguments> {}
method getTypeArguments
getTypeArguments: () => TypeNode[];
Gets the type arguments.
class ExternalModuleReference
class ExternalModuleReference extends Node<ts.ExternalModuleReference> {}
method getExpression
getExpression: () => Expression | undefined;
Gets the expression or undefined of the yield expression.
method getExpressionOrThrow
getExpressionOrThrow: () => Expression<ts.Expression>;
Gets the expression of the yield expression or throws if it does not exist.
method getReferencedSourceFile
getReferencedSourceFile: () => SourceFile | undefined;
Gets the source file referenced or returns undefined if it can't find it.
method getReferencedSourceFileOrThrow
getReferencedSourceFileOrThrow: () => SourceFile;
Gets the source file referenced or throws if it can't find it.
method isRelative
isRelative: () => boolean;
Gets if the external module reference is relative.
class FileNotFoundError
class FileNotFoundError extends PathNotFoundError {}
class FileTextChanges
class FileTextChanges {}
method getFilePath
getFilePath: () => string;
Gets the file path.
method getSourceFile
getSourceFile: () => SourceFile | undefined;
Gets the source file if it was in the cache at the time of this class' creation.
method getTextChanges
getTextChanges: () => TextChange[];
Gets the text changes
method isNewFile
isNewFile: () => boolean;
Gets if this change is for creating a new file.
class ForInStatement
class ForInStatement extends ForInStatementBase<ts.ForInStatement> {}
method getExpression
getExpression: () => Expression;
Gets this for in statement's expression.
method getInitializer
getInitializer: () => VariableDeclarationList | Expression;
Gets this for in statement's initializer.
class ForOfStatement
class ForOfStatement extends ForOfStatementBase<ts.ForOfStatement> {}
method getExpression
getExpression: () => Expression;
Gets this for of statement's expression.
method getInitializer
getInitializer: () => VariableDeclarationList | Expression;
Gets this for of statement's initializer.
class ForStatement
class ForStatement extends ForStatementBase<ts.ForStatement> {}
method getCondition
getCondition: () => Expression | undefined;
Gets this for statement's condition or undefined if none exists.
method getConditionOrThrow
getConditionOrThrow: () => Expression<ts.Expression>;
Gets this for statement's condition or throws if none exists.
method getIncrementor
getIncrementor: () => Expression | undefined;
Gets this for statement's incrementor.
method getIncrementorOrThrow
getIncrementorOrThrow: () => Expression<ts.Expression>;
Gets this for statement's incrementor or throws if none exists.
method getInitializer
getInitializer: () => VariableDeclarationList | Expression | undefined;
Gets this for statement's initializer or undefined if none exists.
method getInitializerOrThrow
getInitializerOrThrow: () => Expression<ts.Expression> | VariableDeclarationList;
Gets this for statement's initializer or throws if none exists.
class FunctionDeclaration
class FunctionDeclaration extends FunctionDeclarationBase<ts.FunctionDeclaration> {}
method addOverload
addOverload: ( structure: FunctionDeclarationOverloadStructure) => FunctionDeclaration;
Adds a function overload.
Parameter structure
Structure of the overload.
method addOverloads
addOverloads: ( structures: ReadonlyArray<FunctionDeclarationOverloadStructure>) => FunctionDeclaration[];
Adds function overloads.
Parameter structures
Structures of the overloads.
method getStructure
getStructure: () => | FunctionDeclarationStructure | FunctionDeclarationOverloadStructure;
Gets the structure equivalent to this node.
method insertOverload
insertOverload: ( index: number, structure: FunctionDeclarationOverloadStructure) => FunctionDeclaration;
Inserts a function overload.
Parameter index
Child index to insert at.
Parameter structure
Structure of the overload.
method insertOverloads
insertOverloads: ( index: number, structures: ReadonlyArray<FunctionDeclarationOverloadStructure>) => FunctionDeclaration[];
Inserts function overloads.
Parameter index
Child index to insert at.
Parameter structure
Structures of the overloads.
method remove
remove: () => void;
Removes this function declaration.
method set
set: (structure: Partial<FunctionDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class FunctionExpression
class FunctionExpression extends FunctionExpressionBase<ts.FunctionExpression> {}
class FunctionOrConstructorTypeNodeBase
class FunctionOrConstructorTypeNodeBase< T extends ts.FunctionOrConstructorTypeNode = ts.FunctionOrConstructorTypeNode> extends FunctionOrConstructorTypeNodeBaseBase<T> {}
class FunctionTypeNode
class FunctionTypeNode extends FunctionTypeNodeBase<ts.FunctionTypeNode> {}
class GetAccessorDeclaration
class GetAccessorDeclaration extends GetAccessorDeclarationBase<ts.GetAccessorDeclaration> {}
method getSetAccessor
getSetAccessor: () => SetAccessorDeclaration | undefined;
Gets the corresponding set accessor if one exists.
method getSetAccessorOrThrow
getSetAccessorOrThrow: () => SetAccessorDeclaration;
Gets the corresponding set accessor or throws if not exists.
method getStructure
getStructure: () => GetAccessorDeclarationStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes the get accessor.
method set
set: (structure: Partial<GetAccessorDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class HeritageClause
class HeritageClause extends Node<ts.HeritageClause> {}
method getToken
getToken: () => SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword;
Gets the heritage clause token.
method getTypeNodes
getTypeNodes: () => ExpressionWithTypeArguments[];
Gets all the type nodes for the heritage clause.
method removeExpression
removeExpression: { (index: number): this; (expressionNode: ExpressionWithTypeArguments): this;};
Remove the expression from the heritage clause.
Parameter index
Index of the expression to remove.
Removes the expression from the heritage clause.
Parameter expressionNode
Expression to remove.
class Identifier
class Identifier extends IdentifierBase<ts.Identifier> {}
method getDefinitionNodes
getDefinitionNodes: () => Node[];
Gets the definition nodes of the identifier.
Remarks
This is similar to "go to definition" and
.getDefinitions()
, but only returns the nodes.
method getDefinitions
getDefinitions: () => DefinitionInfo[];
Gets the definitions of the identifier.
Remarks
This is similar to "go to definition." Use
.getDefinitionNodes()
if you only care about the nodes.
method getImplementations
getImplementations: () => ImplementationLocation[];
Gets the implementations of the identifier.
This is similar to "go to implementation."
method getText
getText: () => string;
Gets the text for the identifier.
class IfStatement
class IfStatement extends IfStatementBase<ts.IfStatement> {}
method getElseStatement
getElseStatement: () => Statement | undefined;
Gets this if statement's else statement.
method getExpression
getExpression: () => Expression;
Gets this if statement's expression.
method getThenStatement
getThenStatement: () => Statement;
Gets this if statement's then statement.
class ImplementationLocation
class ImplementationLocation extends DocumentSpan<ts.ImplementationLocation> {}
method getDisplayParts
getDisplayParts: () => SymbolDisplayPart[];
Gets the display parts.
method getKind
getKind: () => ts.ScriptElementKind;
Gets the kind.
class ImportClause
class ImportClause extends ImportClauseBase<ts.ImportClause> {}
method getDefaultImport
getDefaultImport: () => Identifier | undefined;
Gets the default import or returns undefined if it doesn't exist.
method getDefaultImportOrThrow
getDefaultImportOrThrow: () => Identifier;
Gets the default import or throws if it doesn't exit.
method getNamedBindings
getNamedBindings: () => NamespaceImport | NamedImports | undefined;
Gets the named bindings of the import clause or returns undefined if it doesn't exist.
method getNamedBindingsOrThrow
getNamedBindingsOrThrow: () => NamespaceImport | NamedImports;
Gets the named bindings of the import clause or throws if it doesn't exist.
method getNamedImports
getNamedImports: () => ImportSpecifier[];
Gets the namespace import identifier, if it exists.
method getNamespaceImport
getNamespaceImport: () => Identifier | undefined;
Gets the namespace import identifier, if it exists.
method getNamespaceImportOrThrow
getNamespaceImportOrThrow: () => Identifier;
Gets the namespace import if it exists or throws.
class ImportDeclaration
class ImportDeclaration extends ImportDeclarationBase<ts.ImportDeclaration> {}
method addNamedImport
addNamedImport: ( namedImport: ImportSpecifierStructure | string | WriterFunction) => ImportSpecifier;
Adds a named import.
Parameter namedImport
Name, structure, or writer to write the named import with.
method addNamedImports
addNamedImports: ( namedImports: | ReadonlyArray<ImportSpecifierStructure | string | WriterFunction> | WriterFunction) => ImportSpecifier[];
Adds named imports.
Parameter namedImport
Structures, names, or writer function to write the named import with.
method getDefaultImport
getDefaultImport: () => Identifier | undefined;
Gets the default import or returns undefined if it doesn't exist.
method getDefaultImportOrThrow
getDefaultImportOrThrow: () => Identifier;
Gets the default import or throws if it doesn't exit.
method getImportClause
getImportClause: () => ImportClause | undefined;
Gets the import clause or returns undefined if it doesn't exist.
method getImportClauseOrThrow
getImportClauseOrThrow: () => ImportClause;
Gets the import clause or throws if it doesn't exist.
method getModuleSpecifier
getModuleSpecifier: () => StringLiteral;
Gets the module specifier.
method getModuleSpecifierSourceFile
getModuleSpecifierSourceFile: () => SourceFile | undefined;
Gets the source file referenced in the module specifier or returns undefined if it can't find it.
method getModuleSpecifierSourceFileOrThrow
getModuleSpecifierSourceFileOrThrow: () => SourceFile;
Gets the source file referenced in the module specifier or throws if it can't find it.
method getModuleSpecifierValue
getModuleSpecifierValue: () => string;
Gets the module specifier string literal value.
method getNamedImports
getNamedImports: () => ImportSpecifier[];
Gets the named imports.
method getNamespaceImport
getNamespaceImport: () => Identifier | undefined;
Gets the namespace import identifier, if it exists.
method getNamespaceImportOrThrow
getNamespaceImportOrThrow: () => Identifier;
Gets the namespace import if it exists or throws.
method getStructure
getStructure: () => ImportDeclarationStructure;
Gets the structure equivalent to this node.
method insertNamedImport
insertNamedImport: ( index: number, namedImport: ImportSpecifierStructure | string | WriterFunction) => ImportSpecifier;
Inserts a named import.
Parameter index
Child index to insert at.
Parameter namedImport
Structure, name, or writer function to write the named import with.
method insertNamedImports
insertNamedImports: ( index: number, namedImports: | ReadonlyArray<ImportSpecifierStructure | string | WriterFunction> | WriterFunction) => ImportSpecifier[];
Inserts named imports into the import declaration.
Parameter index
Child index to insert at.
Parameter namedImports
Structures, names, or writer function to write the named import with.
method isModuleSpecifierRelative
isModuleSpecifierRelative: () => boolean;
Gets if the module specifier starts with
./
or../
.
method removeDefaultImport
removeDefaultImport: () => this;
Removes the default import.
method removeNamedImports
removeNamedImports: () => this;
Removes all the named imports.
method removeNamespaceImport
removeNamespaceImport: () => this;
Removes the namespace import.
method renameDefaultImport
renameDefaultImport: (text: string) => this;
Renames or sets the provided default import.
Parameter text
Text to set or rename the default import with.
method set
set: (structure: Partial<ImportDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setDefaultImport
setDefaultImport: (text: string) => this;
Sets the default import.
Parameter text
Text to set as the default import.
Remarks
Use renameDefaultImport to rename.
method setModuleSpecifier
setModuleSpecifier: { (text: string): this; (sourceFile: SourceFile): this };
Sets the import specifier.
Parameter text
Text to set as the module specifier.
Sets the import specifier.
Parameter sourceFile
Source file to set the module specifier from.
method setNamespaceImport
setNamespaceImport: (text: string) => this;
Sets the namespace import.
Parameter text
Text to set as the namespace import.
Throws
- InvalidOperationError if a named import exists.
class ImportEqualsDeclaration
class ImportEqualsDeclaration extends ImportEqualsDeclarationBase<ts.ImportEqualsDeclaration> {}
method getExternalModuleReferenceSourceFile
getExternalModuleReferenceSourceFile: () => SourceFile | undefined;
Gets the source file referenced in the external module reference or returns undefined if it doesn't exist.
method getExternalModuleReferenceSourceFileOrThrow
getExternalModuleReferenceSourceFileOrThrow: () => SourceFile;
Gets the source file referenced in the external module reference or throws if it doesn't exist.
method getModuleReference
getModuleReference: () => ModuleReference;
Gets the module reference of the import equals declaration.
method isExternalModuleReferenceRelative
isExternalModuleReferenceRelative: () => boolean;
Gets if the external module reference is relative.
method setExternalModuleReference
setExternalModuleReference: { (externalModuleReference: string): this; (sourceFile: SourceFile): this;};
Sets the external module reference.
Parameter externalModuleReference
External module reference as a string.
Sets the external module reference.
Parameter sourceFile
Source file to set the external module reference to.
class ImportExpression
class ImportExpression extends ImportExpressionBase<ts.ImportExpression> {}
class ImportSpecifier
class ImportSpecifier extends ImportSpecifierBase<ts.ImportSpecifier> {}
method getAliasNode
getAliasNode: () => Identifier | undefined;
Gets the alias identifier, if it exists.
method getImportDeclaration
getImportDeclaration: () => ImportDeclaration;
Gets the import declaration associated with this import specifier.
method getName
getName: () => string;
Gets the name of the import specifier.
method getNameNode
getNameNode: () => Identifier;
Gets the name node of what's being imported.
method getStructure
getStructure: () => ImportSpecifierStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Remove the import specifier.
method removeAlias
removeAlias: () => this;
Removes the alias without renaming.
Remarks
Use removeAliasWithRename() if you want it to rename any usages to the name of the import specifier.
method removeAliasWithRename
removeAliasWithRename: () => this;
Removes the alias and renames any usages to the name of the import specifier.
method renameAlias
renameAlias: (alias: string) => this;
Sets the alias for the name being imported and renames all the usages.
Parameter alias
Alias to set.
method set
set: (structure: Partial<ImportSpecifierStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setAlias
setAlias: (alias: string) => this;
Sets the alias without renaming all the usages.
Parameter alias
Alias to set.
method setName
setName: (name: string) => this;
Sets the identifier being imported.
Parameter name
Name being imported.
class ImportTypeNode
class ImportTypeNode extends ImportTypeNodeBase<ts.ImportTypeNode> {}
method getArgument
getArgument: () => TypeNode;
Gets the argument passed into the import type.
method getQualifier
getQualifier: () => EntityName | undefined;
Gets the qualifier of the import type if it exists or returns undefined.
method getQualifierOrThrow
getQualifierOrThrow: () => EntityName;
Gets the qualifier of the import type if it exists or throws
method setArgument
setArgument: (text: string) => this;
Sets the argument text.
Parameter text
Text of the argument.
method setQualifier
setQualifier: (text: string) => this;
Sets the qualifier text.
Parameter text
Text.
class IndexSignatureDeclaration
class IndexSignatureDeclaration extends IndexSignatureDeclarationBase<ts.IndexSignatureDeclaration> {}
method getKeyName
getKeyName: () => string;
Gets the key name.
method getKeyNameNode
getKeyNameNode: () => BindingName;
Gets the key name node.
method getKeyType
getKeyType: () => Type;
Gets the key type.
method getKeyTypeNode
getKeyTypeNode: () => TypeNode;
Gets the key type node.
method getStructure
getStructure: () => IndexSignatureDeclarationStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes this index signature.
method set
set: (structure: Partial<IndexSignatureDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setKeyName
setKeyName: (name: string) => void;
Sets the key name.
Parameter name
New name.
method setKeyType
setKeyType: (type: string) => this;
Sets the key type.
Parameter type
Type.
class InterfaceDeclaration
class InterfaceDeclaration extends InterfaceDeclarationBase<ts.InterfaceDeclaration> {}
method getBaseDeclarations
getBaseDeclarations: () => ( | TypeAliasDeclaration | InterfaceDeclaration | ClassDeclaration)[];
Gets the base declarations.
method getBaseTypes
getBaseTypes: () => Type[];
Gets the base types.
method getImplementations
getImplementations: () => ImplementationLocation[];
Gets all the implementations of the interface.
This is similar to "go to implementation."
method getStructure
getStructure: () => InterfaceDeclarationStructure;
Gets the structure equivalent to this node.
method set
set: (structure: Partial<InterfaceDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class IntersectionTypeNode
class IntersectionTypeNode extends TypeNode<ts.IntersectionTypeNode> {}
method getTypeNodes
getTypeNodes: () => TypeNode[];
Gets the intersection type nodes.
class InvalidOperationError
class InvalidOperationError extends BaseError {}
class IterationStatement
class IterationStatement< T extends ts.IterationStatement = ts.IterationStatement> extends IterationStatementBase<T> {}
method getStatement
getStatement: () => Statement;
Gets this iteration statement's statement.
class JSDoc
class JSDoc extends JSDocBase<ts.JSDoc> {}
JS doc node.
method getComment
getComment: () => string | undefined;
Gets the comment.
method getInnerText
getInnerText: () => string;
Gets the JSDoc's text without the surrounding comment.
method getStructure
getStructure: () => JSDocStructure;
Gets the structure equivalent to this node.
method getTags
getTags: () => JSDocTag[];
Gets the tags of the JSDoc.
method remove
remove: () => void;
Removes this JSDoc.
method set
set: (structure: Partial<JSDocStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setComment
setComment: (textOrWriterFunction: string | WriterFunction) => this;
Sets the comment.
Parameter textOrWriterFunction
Text or writer function to set.
class JSDocAugmentsTag
class JSDocAugmentsTag extends JSDocTag<ts.JSDocAugmentsTag> {}
JS doc augments tag node.
class JSDocClassTag
class JSDocClassTag extends JSDocTag<ts.JSDocClassTag> {}
JS doc class tag node.
class JSDocParameterTag
class JSDocParameterTag extends JSDocParameterTagBase<ts.JSDocParameterTag> {}
JS doc parameter tag node.
class JSDocPropertyTag
class JSDocPropertyTag extends JSDocPropertyTagBase<ts.JSDocPropertyTag> {}
JS doc property tag node.
class JSDocReturnTag
class JSDocReturnTag extends JSDocTag<ts.JSDocReturnTag> {}
JS doc return tag node.
class JSDocTag
class JSDocTag<NodeType extends ts.JSDocTag = ts.JSDocTag> extends Node<NodeType> {}
JS doc tag node.
method getComment
getComment: () => string | undefined;
Gets the tag's comment.
method getTagName
getTagName: () => string;
Gets the tag's name as a string.
method getTagNameNode
getTagNameNode: () => Identifier;
Gets the tag name node.
class JSDocTagInfo
class JSDocTagInfo {}
JS doc tag info.
property compilerObject
readonly compilerObject: ts.JSDocTagInfo;
Gets the compiler JS doc tag info.
method getName
getName: () => string;
Gets the name.
method getText
getText: () => string | undefined;
Gets the text.
class JSDocTypedefTag
class JSDocTypedefTag extends JSDocTag<ts.JSDocTypedefTag> {}
JS doc type def tag node.
class JSDocTypeTag
class JSDocTypeTag extends JSDocTag<ts.JSDocTypeTag> {}
JS doc type tag node.
class JSDocUnknownTag
class JSDocUnknownTag extends JSDocTag<ts.JSDocUnknownTag> {}
JS doc unknown tag node.
class JsxAttribute
class JsxAttribute extends JsxAttributeBase<ts.JsxAttribute> {}
method getInitializer
getInitializer: () => StringLiteral | JsxExpression | undefined;
Gets the JSX attribute's initializer or returns undefined if it doesn't exist.
method getInitializerOrThrow
getInitializerOrThrow: () => StringLiteral | JsxExpression;
Gets the JSX attribute's initializer or throws if it doesn't exist.
method getStructure
getStructure: () => JsxAttributeStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes the JSX attribute.
method removeInitializer
removeInitializer: () => this;
Removes the initializer.
method set
set: (structure: Partial<JsxAttributeStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setInitializer
setInitializer: (textOrWriterFunction: string | WriterFunction) => this;
Sets the initializer.
Parameter textOrWriterFunction
Text or writer function to set the initializer with.
Remarks
You need to provide the quotes or braces.
class JsxClosingElement
class JsxClosingElement extends JsxClosingElementBase<ts.JsxClosingElement> {}
class JsxClosingFragment
class JsxClosingFragment extends Expression<ts.JsxClosingFragment> {}
class JsxElement
class JsxElement extends JsxElementBase<ts.JsxElement> {}
method getClosingElement
getClosingElement: () => JsxClosingElement;
Gets the closing element.
method getJsxChildren
getJsxChildren: () => JsxChild[];
Gets the children of the JSX element.
method getOpeningElement
getOpeningElement: () => JsxOpeningElement;
Gets the opening element.
method getStructure
getStructure: () => JsxElementStructure;
Gets the structure equivalent to this node.
method set
set: (structure: Partial<JsxElementStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setBodyText
setBodyText: (textOrWriterFunction: string | WriterFunction) => this;
Sets the body text.
Parameter textOrWriterFunction
Text or writer function to set as the body.
method setBodyTextInline
setBodyTextInline: (textOrWriterFunction: string | WriterFunction) => this;
Sets the body text without surrounding new lines.
Parameter textOrWriterFunction
Text to set as the body.
class JsxExpression
class JsxExpression extends Expression<ts.JsxExpression> {}
method getDotDotDotToken
getDotDotDotToken: () => Node<ts.Token<SyntaxKind.DotDotDotToken>> | undefined;
Gets the dot dot dot token (...) or returns undefined if it doesn't exist.
method getDotDotDotTokenOrThrow
getDotDotDotTokenOrThrow: () => Node<ts.Token<SyntaxKind.DotDotDotToken>>;
Gets the dot dot dot token (...) or throws if it doesn't exist.
method getExpression
getExpression: () => Expression | undefined;
Gets the expression or returns undefined if it doesn't exist
method getExpressionOrThrow
getExpressionOrThrow: () => Expression<ts.Expression>;
Gets the expression or throws if it doesn't exist.
class JsxFragment
class JsxFragment extends PrimaryExpression<ts.JsxFragment> {}
method getClosingFragment
getClosingFragment: () => JsxClosingFragment;
Gets the closing fragment.
method getJsxChildren
getJsxChildren: () => JsxChild[];
Gets the children of the JSX fragment.
method getOpeningFragment
getOpeningFragment: () => JsxOpeningFragment;
Gets the opening fragment.
class JsxOpeningElement
class JsxOpeningElement extends JsxOpeningElementBase<ts.JsxOpeningElement> {}
class JsxOpeningFragment
class JsxOpeningFragment extends Expression<ts.JsxOpeningFragment> {}
class JsxSelfClosingElement
class JsxSelfClosingElement extends JsxSelfClosingElementBase<ts.JsxSelfClosingElement> {}
method getStructure
getStructure: () => JsxElementStructure;
Gets the structure equivalent to this node.
method set
set: (structure: Partial<JsxElementStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class JsxSpreadAttribute
class JsxSpreadAttribute extends JsxSpreadAttributeBase<ts.JsxSpreadAttribute> {}
method getExpression
getExpression: () => Expression<ts.Expression>;
Gets the JSX spread attribute's expression.
method getStructure
getStructure: () => JsxSpreadAttributeStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes the JSX spread attribute.
method set
set: (structure: Partial<JsxSpreadAttributeStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setExpression
setExpression: (textOrWriterFunction: string | WriterFunction) => this;
Sets the expression.
Parameter textOrWriterFunction
Text to set the expression with.
class JsxText
class JsxText extends Node<ts.JsxText> {}
method containsOnlyWhiteSpaces
containsOnlyWhiteSpaces: () => boolean;
Gets if the JSX text contains only white spaces.
class LabeledStatement
class LabeledStatement extends LabeledStatementBase<ts.LabeledStatement> {}
method getLabel
getLabel: () => Identifier;
Gets this labeled statement's label
method getStatement
getStatement: () => Statement;
Gets this labeled statement's statement
class LanguageService
class LanguageService {}
property compilerObject
readonly compilerObject: ts.LanguageService;
Gets the compiler language service.
method findReferences
findReferences: (node: Node) => ReferencedSymbol[];
Finds references based on the specified node.
Parameter node
Node to find references for.
method findReferencesAsNodes
findReferencesAsNodes: (node: Node) => Node<ts.Node>[];
Finds the nodes that reference the definition(s) of the specified node.
Parameter node
Node.
method findReferencesAtPosition
findReferencesAtPosition: ( sourceFile: SourceFile, pos: number) => ReferencedSymbol[];
Finds references based on the specified position.
Parameter sourceFile
Source file.
Parameter pos
Position to find the reference at.
method findRenameLocations
findRenameLocations: (node: Node, options?: RenameOptions) => RenameLocation[];
Find the rename locations for the specified node.
Parameter node
Node to get the rename locations for.
Parameter options
Options for renaming.
method getCodeFixesAtPosition
getCodeFixesAtPosition: ( filePathOrSourceFile: string | SourceFile, start: number, end: number, errorCodes: ReadonlyArray<number>, formatOptions?: FormatCodeSettings, preferences?: UserPreferences) => CodeFixAction[];
Gets the edit information for applying a code fix at the provided text range in a source file.
Parameter filePathOrSourceFile
File path or source file to get the code fixes for.
Parameter start
Start position of the text range to be fixed.
Parameter end
End position of the text range to be fixed.
Parameter errorCodes
One or more error codes associated with the code fixes to retrieve.
Parameter formatOptions
Format code settings.
Parameter preferences
User preferences for refactoring.
method getCombinedCodeFix
getCombinedCodeFix: ( filePathOrSourceFile: string | SourceFile, fixId: {}, formatSettings?: FormatCodeSettings, preferences?: UserPreferences) => CombinedCodeActions;
Gets file changes and actions to perform for the provided fixId.
Parameter filePathOrSourceFile
File path or source file to get the combined code fixes for.
Parameter fixId
Identifier for the code fix (ex. "fixMissingImport"). These ids are found in the
ts.codefix
namespace in the compiler api source.Parameter formatSettings
Format code settings.
Parameter preferences
User preferences for refactoring.
method getDefinitions
getDefinitions: (node: Node) => DefinitionInfo[];
Gets the definitions for the specified node.
Parameter node
Node.
method getDefinitionsAtPosition
getDefinitionsAtPosition: ( sourceFile: SourceFile, pos: number) => DefinitionInfo[];
Gets the definitions at the specified position.
Parameter sourceFile
Source file.
Parameter pos
Position.
method getEditsForRefactor
getEditsForRefactor: ( filePathOrSourceFile: string | SourceFile, formatSettings: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences?: UserPreferences) => RefactorEditInfo | undefined;
Gets the edit information for applying a refactor at a the provided position in a source file.
Parameter filePathOrSourceFile
File path or source file to get the edits for.
Parameter formatSettings
Fomat code settings.
Parameter positionOrRange
Position in the source file where to apply given refactor.
Parameter refactorName
Refactor name.
Parameter actionName
Refactor action name.
Parameter preferences
User preferences for refactoring.
method getEmitOutput
getEmitOutput: { (sourceFile: SourceFile, emitOnlyDtsFiles?: boolean): EmitOutput; (filePath: string, emitOnlyDtsFiles?: boolean): EmitOutput;};
Gets the emit output of a source file.
Parameter sourceFile
Source file.
Parameter emitOnlyDtsFiles
Whether to only emit the d.ts files.
Gets the emit output of a source file.
Parameter filePath
File path.
Parameter emitOnlyDtsFiles
Whether to only emit the d.ts files.
method getFormattedDocumentText
getFormattedDocumentText: ( filePath: string, formatSettings: FormatCodeSettings) => string;
Gets the formatted text for a document.
Parameter filePath
File path of the source file.
Parameter formatSettings
Format code settings.
method getFormattingEditsForDocument
getFormattingEditsForDocument: ( filePath: string, formatSettings: FormatCodeSettings) => TextChange[];
Gets the formatting edits for a document.
Parameter filePath
File path of the source file.
Parameter formatSettings
Format code settings.
method getFormattingEditsForRange
getFormattingEditsForRange: ( filePath: string, range: [number, number], formatSettings: FormatCodeSettings) => TextChange[];
Gets the formatting edits for a range.
Parameter filePath
File path.
Parameter range
Position range.
Parameter formatSettings
Format code settings.
method getIdentationAtPosition
getIdentationAtPosition: { ( sourceFile: SourceFile, position: number, settings?: EditorSettings ): number; (filePath: string, position: number, settings?: EditorSettings): number;};
Gets the indentation at the specified position.
Parameter sourceFile
Source file.
Parameter position
Position.
Parameter settings
Editor settings.
Gets the indentation at the specified position.
Parameter filePath
File path.
Parameter position
Position.
Parameter settings
Editor settings.
method getImplementations
getImplementations: (node: Node) => ImplementationLocation[];
Gets the implementations for the specified node.
Parameter node
Node.
method getImplementationsAtPosition
getImplementationsAtPosition: ( sourceFile: SourceFile, pos: number) => ImplementationLocation[];
Gets the implementations at the specified position.
Parameter sourceFile
Source file.
Parameter pos
Position.
method getProgram
getProgram: () => Program;
Gets the language service's program.
method getSuggestionDiagnostics
getSuggestionDiagnostics: ( filePathOrSourceFile: SourceFile | string) => DiagnosticWithLocation[];
Gets the suggestion diagnostics.
Parameter filePathOrSourceFile
The source file or file path to get suggestions for.
method organizeImports
organizeImports: { ( sourceFile: SourceFile, formatSettings?: FormatCodeSettings, userPreferences?: UserPreferences ): FileTextChanges[]; ( filePath: string, formatSettings?: FormatCodeSettings, userPreferences?: UserPreferences ): FileTextChanges[];};
Gets the file text changes for organizing the imports in a source file.
Parameter sourceFile
Source file.
Parameter formatSettings
Format code settings.
Parameter userPreferences
User preferences for refactoring.
Gets the file text changes for organizing the imports in a source file.
Parameter filePath
File path of the source file.
Parameter formatSettings
Format code settings.
Parameter userPreferences
User preferences for refactoring.
method renameLocations
renameLocations: ( renameLocations: ReadonlyArray<RenameLocation>, newName: string) => void;
Rename the provided rename locations.
Parameter renameLocations
Rename locations.
Parameter newName
New name for the node.
method renameNode
renameNode: (node: Node, newName: string, options?: RenameOptions) => void;
Rename the specified node.
Parameter node
Node to rename.
Parameter newName
New name for the node.
Parameter options
Options for renaming the node.
class LeftHandSideExpression
class LeftHandSideExpression< T extends ts.LeftHandSideExpression = ts.LeftHandSideExpression> extends UpdateExpression<T> {}
class LiteralExpression
class LiteralExpression< T extends ts.LiteralExpression = ts.LiteralExpression> extends LiteralExpressionBase<T> {}
class LiteralTypeNode
class LiteralTypeNode extends TypeNode<ts.LiteralTypeNode> {}
method getLiteral
getLiteral: () => BooleanLiteral | LiteralExpression | PrefixUnaryExpression;
Gets the literal type node's literal.
class ManipulationSettingsContainer
class ManipulationSettingsContainer extends SettingsContainer<ManipulationSettings> {}
Holds the manipulation settings.
constructor
constructor();
method getEditorSettings
getEditorSettings: () => EditorSettings;
Gets the editor settings based on the current manipulation settings.
method getFormatCodeSettings
getFormatCodeSettings: () => Readonly<SupportedFormatCodeSettings>;
Gets the format code settings.
method getIndentationText
getIndentationText: () => IndentationText;
Gets the indentation text;
method getNewLineKind
getNewLineKind: () => NewLineKind;
Gets the new line kind.
method getNewLineKindAsString
getNewLineKindAsString: () => '\n' | '\r\n';
Gets the new line kind as a string.
method getQuoteKind
getQuoteKind: () => QuoteKind;
Gets the quote kind used for string literals.
method getUserPreferences
getUserPreferences: () => Readonly<UserPreferences>;
Gets the user preferences.
method set
set: (settings: Partial<ManipulationSettings>) => void;
Sets one or all of the settings.
Parameter settings
Settings to set.
class MemberExpression
class MemberExpression< T extends ts.MemberExpression = ts.MemberExpression> extends LeftHandSideExpression<T> {}
class MemoryEmitResult
class MemoryEmitResult extends EmitResult {}
Result of an emit to memory.
method getFiles
getFiles: () => MemoryEmitResultFile[];
Gets the files that were emitted to memory.
class MetaProperty
class MetaProperty extends MetaPropertyBase<ts.MetaProperty> {}
method getKeywordToken
getKeywordToken: () => SyntaxKind.ImportKeyword | SyntaxKind.NewKeyword;
Gets the keyword token.
class MethodDeclaration
class MethodDeclaration extends MethodDeclarationBase<ts.MethodDeclaration> {}
method addOverload
addOverload: ( structure: MethodDeclarationOverloadStructure) => MethodDeclaration;
Add a method overload.
Parameter structure
Structure to add.
method addOverloads
addOverloads: ( structures: ReadonlyArray<MethodDeclarationOverloadStructure>) => MethodDeclaration[];
Add method overloads.
Parameter structures
Structures to add.
method getStructure
getStructure: () => | MethodDeclarationStructure | MethodDeclarationOverloadStructure;
Gets the structure equivalent to this node.
method insertOverload
insertOverload: ( index: number, structure: MethodDeclarationOverloadStructure) => MethodDeclaration;
Inserts a method overload.
Parameter index
Child index to insert at.
Parameter structure
Structures to insert.
method insertOverloads
insertOverloads: ( index: number, structures: ReadonlyArray<MethodDeclarationOverloadStructure>) => MethodDeclaration[];
Inserts method overloads.
Parameter index
Child index to insert at.
Parameter structures
Structures to insert.
method remove
remove: () => void;
Removes the method.
method set
set: (structure: Partial<MethodDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class MethodSignature
class MethodSignature extends MethodSignatureBase<ts.MethodSignature> {}
method getStructure
getStructure: () => MethodSignatureStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes this method signature.
method set
set: (structure: Partial<MethodSignatureStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class ModuleBlock
class ModuleBlock extends ModuleBlockBase<ts.ModuleBlock> {}
class NamedExports
class NamedExports extends NamedExportsBase<ts.NamedExports> {}
method getElements
getElements: () => ExportSpecifier[];
Gets the export specifiers.
class NamedImports
class NamedImports extends NamedImportsBase<ts.NamedImports> {}
method getElements
getElements: () => ImportSpecifier[];
Gets the import specifiers.
class NamespaceDeclaration
class NamespaceDeclaration extends NamespaceDeclarationBase<ts.NamespaceDeclaration> {}
method getDeclarationKind
getDeclarationKind: () => NamespaceDeclarationKind;
Gets the namesapce declaration kind.
method getDeclarationKindKeyword
getDeclarationKindKeyword: () => Node<ts.Node> | undefined;
Gets the namespace or module keyword or returns undefined if it's global.
method getName
getName: () => string;
Gets the full name of the namespace.
method getNameNodes
getNameNodes: () => Identifier[];
Gets the name nodes.
method getStructure
getStructure: () => NamespaceDeclarationStructure;
Gets the structure equivalent to this node.
method hasModuleKeyword
hasModuleKeyword: () => boolean;
Gets if this namespace has a namespace keyword.
method hasNamespaceKeyword
hasNamespaceKeyword: () => boolean;
Gets if this namespace has a namespace keyword.
method rename
rename: (newName: string) => this;
Renames the name.
Parameter newName
New name.
method set
set: (structure: Partial<NamespaceDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setDeclarationKind
setDeclarationKind: (kind: NamespaceDeclarationKind) => this;
Sets the namespace declaration kind.
Parameter kind
Kind to set.
method setName
setName: (newName: string) => this;
Sets the name without renaming references.
Parameter newName
New full namespace name.
class NamespaceImport
class NamespaceImport extends NamespaceImportBase<ts.NamespaceImport> {}
method getName
getName: () => string;
Gets the name of the namespace import.
method getNameNode
getNameNode: () => Identifier;
Gets the namespace import's name node.
method setName
setName: (name: string) => this;
Sets the name of the namespace import.
class NewExpression
class NewExpression extends NewExpressionBase<ts.NewExpression> {}
class Node
class Node<NodeType extends ts.Node = ts.Node> implements TextRange {}
constructor
protected constructor();
property compilerNode
readonly compilerNode: ts.Node;
Gets the underlying compiler node.
method appendWhitespace
appendWhitespace: (textOrWriterFunction: string | WriterFunction) => void;
Appends the specified whitespace to current node.
Parameter textOrWriterFunction
Text or writer function.
method containsRange
containsRange: (pos: number, end: number) => boolean;
If the node contains the provided range (inclusive).
Parameter pos
Start position.
Parameter end
End position.
method forEachChild
forEachChild: ( cbNode: (node: Node, traversal: ForEachChildTraversalControl) => void, cbNodeArray?: ( nodes: Node[], traversal: ForEachChildTraversalControl ) => void) => void;
Invokes the
cbNode
callback for each child and thecbNodeArray
for every array of nodes stored in properties of the node. IfcbNodeArray
is not defined, then it will pass every element of the array tocbNode
.Parameter cbNode
Callback invoked for each child.
Parameter cbNodeArray
Callback invoked for each array of nodes.
Remarks
There exists a
traversal.stop()
function on the second parameter that allows stopping iteration.
method forEachDescendant
forEachDescendant: ( cbNode: (node: Node, traversal: ForEachDescendantTraversalControl) => void, cbNodeArray?: ( nodes: Node[], traversal: ForEachDescendantTraversalControl ) => void) => void;
Invokes the
cbNode
callback for each descendant and thecbNodeArray
for every array of nodes stored in properties of the node and descendant nodes. IfcbNodeArray
is not defined, then it will pass every element of the array tocbNode
.Parameter cbNode
Callback invoked for each descendant.
Parameter cbNodeArray
Callback invoked for each array of nodes.
Remarks
There exists a
traversal
object on the second parameter that allows various control of iteration.
method forget
forget: () => void;
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.
method forgetDescendants
forgetDescendants: () => this;
Forgets the descendants of this node.
method formatText
formatText: (settings?: FormatCodeSettings) => void;
Formats the node's text using the internal TypeScript formatting API.
Parameter settings
Format code settings.
method getAncestors
getAncestors: () => Node[];
Goes up the tree getting all the parents in ascending order.
method getChildAtIndex
getChildAtIndex: (index: number) => Node;
Gets the child at the specified index.
Parameter index
Index of the child.
method getChildAtIndexIfKind
getChildAtIndexIfKind: <TKind extends SyntaxKind>( index: number, kind: TKind) => KindToNodeMappings[TKind] | undefined;
Gets the child at the specified index if it's the specified kind or returns undefined.
Parameter index
Child index to get.
Parameter kind
Expected kind.
method getChildAtIndexIfKindOrThrow
getChildAtIndexIfKindOrThrow: <TKind extends SyntaxKind>( index: number, kind: TKind) => KindToNodeMappings[TKind];
Gets the child at the specified index if it's the specified kind or throws an exception.
Parameter index
Child index to get.
Parameter kind
Expected kind.
method getChildAtPos
getChildAtPos: (pos: number) => Node | undefined;
Gets the child at the provided text position, or undefined if not found.
Parameter pos
Text position to search for.
method getChildCount
getChildCount: () => number;
Gets the number of children the node has.
method getChildIndentationLevel
getChildIndentationLevel: () => number;
Gets the child indentation level of the current node.
method getChildIndentationText
getChildIndentationText: (offset?: number) => string;
Gets the next indentation level text.
Parameter offset
Optional number of levels of indentation to add or remove.
method getChildIndex
getChildIndex: () => number;
Gets the child index of this node relative to the parent.
method getChildren
getChildren: () => Node[];
Gets all the children of the node.
method getChildrenOfKind
getChildrenOfKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind][];
Gets the children based on a kind.
Parameter kind
Syntax kind.
method getChildSyntaxList
getChildSyntaxList: () => SyntaxList | undefined;
Gets the child syntax list if it exists.
method getChildSyntaxListOrThrow
getChildSyntaxListOrThrow: () => SyntaxList;
Gets the child syntax list or throws if it doesn't exist.
method getCombinedModifierFlags
getCombinedModifierFlags: () => ts.ModifierFlags;
Gets the combined modifier flags.
method getDescendantAtPos
getDescendantAtPos: (pos: number) => Node | undefined;
Gets the most specific descendant at the provided text position, or undefined if not found.
Parameter pos
Text position to search for.
method getDescendantAtStartWithWidth
getDescendantAtStartWithWidth: ( start: number, width: number) => Node | undefined;
Gets the most specific descendant at the provided start text position with the specified width, or undefined if not found.
Parameter start
Start text position to search for.
Parameter width
Text length of the node to search for.
method getDescendants
getDescendants: () => Node[];
Gets the node's descendants.
method getDescendantsOfKind
getDescendantsOfKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind][];
Gets the descendants that match a specified syntax kind.
Parameter kind
Kind to check.
method getDescendantStatements
getDescendantStatements: () => Statement[];
Gets the node's descendant statements.
method getEnd
getEnd: () => number;
Gets the source file text position where the node ends.
Remarks
This does not include the following trivia (comments and whitespace).
method getEndLineNumber
getEndLineNumber: () => number;
Gets the line number of the end of the node.
method getFirstAncestor
getFirstAncestor: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): | T | undefined; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the first ancestor that matches the provided condition or returns undefined if not found.
Parameter condition
Condition to match.
method getFirstAncestorByKind
getFirstAncestorByKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
Get the first ancestor by syntax kind.
Parameter kind
Syntax kind.
method getFirstAncestorByKindOrThrow
getFirstAncestorByKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
Gets the first ancestor by syntax kind or throws if not found.
Parameter kind
Syntax kind.
method getFirstAncestorOrThrow
getFirstAncestorOrThrow: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): T; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the first ancestor that matches the provided condition or throws if not found.
Parameter condition
Condition to match.
method getFirstChild
getFirstChild: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): | T | undefined; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the first child by a condition.
Parameter condition
Condition.
method getFirstChildByKind
getFirstChildByKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
Gets the first child by syntax kind.
Parameter kind
Syntax kind.
method getFirstChildByKindOrThrow
getFirstChildByKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
Gets the first child by syntax kind or throws an error if not found.
Parameter kind
Syntax kind.
method getFirstChildIfKind
getFirstChildIfKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
Gets the first child if it matches the specified syntax kind.
Parameter kind
Syntax kind.
method getFirstChildIfKindOrThrow
getFirstChildIfKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
Gets the first child if it matches the specified syntax kind or throws an error if not found.
Parameter kind
Syntax kind.
method getFirstChildOrThrow
getFirstChildOrThrow: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): T; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the first child by a condition or throws.
Parameter condition
Condition.
method getFirstDescendant
getFirstDescendant: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): | T | undefined; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the first descendant by a condition.
Parameter condition
Condition.
method getFirstDescendantByKind
getFirstDescendantByKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
Gets the first descendant by syntax kind.
Parameter kind
Syntax kind.
method getFirstDescendantByKindOrThrow
getFirstDescendantByKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
Gets the first descendant by syntax kind or throws.
Parameter kind
Syntax kind.
method getFirstDescendantOrThrow
getFirstDescendantOrThrow: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): T; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the first descendant by a condition or throws.
Parameter condition
Condition.
method getFullStart
getFullStart: () => number;
Gets the source file text position of the end of the last significant token or the start of the source file.
method getFullText
getFullText: () => string;
Gets the full text with leading trivia (comments and whitespace).
method getFullWidth
getFullWidth: () => number;
Gets the text length of the node with trivia.
method getIndentationLevel
getIndentationLevel: () => number;
Gets the indentation level of the current node.
method getIndentationText
getIndentationText: (offset?: number) => string;
Gets the indentation text.
Parameter offset
Optional number of levels of indentation to add or remove.
method getKind
getKind: () => SyntaxKind;
Gets the syntax kind.
method getKindName
getKindName: () => string;
Gets the syntax kind name.
method getLastChild
getLastChild: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): | T | undefined; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the last child by a condition.
Parameter condition
Condition.
method getLastChildByKind
getLastChildByKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
Gets the last child by syntax kind.
Parameter kind
Syntax kind.
method getLastChildByKindOrThrow
getLastChildByKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
Gets the last child by syntax kind or throws an error if not found.
Parameter kind
Syntax kind.
method getLastChildIfKind
getLastChildIfKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
Gets the last child if it matches the specified syntax kind.
Parameter kind
Syntax kind.
method getLastChildIfKindOrThrow
getLastChildIfKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
Gets the last child if it matches the specified syntax kind or throws an error if not found.
Parameter kind
Syntax kind.
method getLastChildOrThrow
getLastChildOrThrow: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): T; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the last child by a condition or throws.
Parameter condition
Condition.
method getLastToken
getLastToken: () => Node;
Gets the last token of this node. Usually this is a close brace.
method getLeadingCommentRanges
getLeadingCommentRanges: () => CommentRange[];
Gets the leading comment ranges of the current node.
method getLeadingTriviaWidth
getLeadingTriviaWidth: () => number;
Gets the node's leading trivia's text length.
method getNextSibling
getNextSibling: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): | T | undefined; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the next sibling.
Parameter condition
Optional condition for getting the next sibling.
method getNextSiblingIfKind
getNextSiblingIfKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
Gets the next sibling if it matches the specified kind.
Parameter kind
Kind to check.
method getNextSiblingIfKindOrThrow
getNextSiblingIfKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
Gets the next sibiling if it matches the specified kind, or throws.
Parameter kind
Kind to check.
method getNextSiblingOrThrow
getNextSiblingOrThrow: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): T; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the next sibling or throws.
Parameter condition
Optional condition for getting the next sibling.
method getNextSiblings
getNextSiblings: () => Node[];
Gets the next siblings.
Note: Closest sibling is the zero index.
method getNodeProperty
getNodeProperty: < KeyType extends keyof LocalNodeType, LocalNodeType extends ts.Node = NodeType>( propertyName: KeyType) => NodePropertyToWrappedType<LocalNodeType, KeyType>;
Gets a compiler node property wrapped in a Node.
Parameter propertyName
Property name.
method getNonWhitespaceStart
getNonWhitespaceStart: () => number;
Gets the first source file text position that is not whitespace.
method getParent
getParent: <T extends Node<ts.Node> = NodeParentType<NodeType>>() => T;
Get the node's parent.
method getParentIfKind
getParentIfKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
Gets the parent if it's a certain syntax kind.
method getParentIfKindOrThrow
getParentIfKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
Gets the parent if it's a certain syntax kind of throws.
method getParentOrThrow
getParentOrThrow: < T extends Node<ts.Node> = NodeParentType<NodeType>>() => NonNullable<T>;
Gets the parent or throws an error if it doesn't exist.
method getParentSyntaxList
getParentSyntaxList: () => SyntaxList | undefined;
Gets the parent if it's a syntax list.
method getParentSyntaxListOrThrow
getParentSyntaxListOrThrow: () => SyntaxList;
Gets the parent if it's a syntax list or throws an error otherwise.
method getParentWhile
getParentWhile: { <T extends Node<ts.Node>>(condition: (node: Node) => node is T): | T | undefined; (condition: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Goes up the parents (ancestors) of the node while a condition is true. Returns undefined if the initial parent doesn't match the condition.
Parameter condition
Condition that tests the parent to see if the expression is true.
method getParentWhileKind
getParentWhileKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
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.
Parameter kind
Syntax kind to check for.
method getParentWhileKindOrThrow
getParentWhileKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
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.
Parameter kind
Syntax kind to check for.
method getParentWhileOrThrow
getParentWhileOrThrow: { <T extends Node<ts.Node>>(condition: (node: Node) => node is T): T; (condition: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Goes up the parents (ancestors) of the node while a condition is true. Throws if the initial parent doesn't match the condition.
Parameter condition
Condition that tests the parent to see if the expression is true.
method getPos
getPos: () => number;
Gets the source file text position where the node starts that includes the leading trivia (comments and whitespace).
method getPreviousSibling
getPreviousSibling: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): | T | undefined; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the previous sibling.
Parameter condition
Optional condition for getting the previous sibling.
method getPreviousSiblingIfKind
getPreviousSiblingIfKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
Gets the previous sibling if it matches the specified kind.
Parameter kind
Kind to check.
method getPreviousSiblingIfKindOrThrow
getPreviousSiblingIfKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
Gets the previous sibiling if it matches the specified kind, or throws.
Parameter kind
Kind to check.
method getPreviousSiblingOrThrow
getPreviousSiblingOrThrow: { <T extends Node<ts.Node>>(condition?: (node: Node) => node is T): T; (condition?: (node: Node<ts.Node>) => boolean): Node<ts.Node>;};
Gets the previous sibling or throws.
Parameter condition
Optional condition for getting the previous sibling.
method getPreviousSiblings
getPreviousSiblings: () => Node[];
Gets the previous siblings.
Note: Closest sibling is the zero index.
method getSourceFile
getSourceFile: () => SourceFile;
Gets the source file.
method getStart
getStart: (includeJsDocComment?: boolean) => number;
Gets the source file text position where the node starts that does not include the leading trivia (comments and whitespace).
Parameter includeJsDocComment
Whether to include the JS doc comment.
method getStartLineNumber
getStartLineNumber: (includeJsDocComment?: boolean) => number;
Gets the line number at the start of the node.
Parameter includeJsDocComment
Whether to include the JS doc comment or not.
method getStartLinePos
getStartLinePos: (includeJsDocComment?: boolean) => number;
Gets the position of the start of the line that this node starts on.
Parameter includeJsDocComment
Whether to include the JS doc comment or not.
method getSymbol
getSymbol: () => Symbol | undefined;
Gets the compiler symbol or undefined if it doesn't exist.
method getSymbolOrThrow
getSymbolOrThrow: () => Symbol;
Gets the symbol or throws an error if it doesn't exist.
method getText
getText: (includeJsDocComment?: boolean) => string;
Gets the text without leading trivia (comments and whitespace).
Parameter includeJsDocComment
method getTrailingCommentRanges
getTrailingCommentRanges: () => CommentRange[];
Gets the trailing comment ranges of the current node.
method getTrailingTriviaEnd
getTrailingTriviaEnd: () => number;
Gets the text position of the next significant token or new line.
method getTrailingTriviaWidth
getTrailingTriviaWidth: () => number;
Gets the text length from the end of the current node to the next significant token or new line.
method getType
getType: () => Type;
Gets the type of the node.
method getWidth
getWidth: () => number;
Gets the text length of the node without trivia.
method isFirstNodeOnLine
isFirstNodeOnLine: () => boolean;
Gets if this is the first node on the current line.
method isInStringAtPos
isInStringAtPos: (pos: number) => boolean;
Gets if the specified position is within a string.
Parameter pos
Position.
method isInSyntaxList
isInSyntaxList: () => boolean;
Gets if this node is in a syntax list.
method prependWhitespace
prependWhitespace: (textOrWriterFunction: string | WriterFunction) => void;
Prepends the specified whitespace to current node.
Parameter textOrWriterFunction
Text or writer function.
method print
print: (options?: PrintNodeOptions) => string;
Prints the node using the compiler's printer.
Parameter options
Options.
method replaceWithText
replaceWithText: (textOrWriterFunction: string | WriterFunction) => Node;
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.
Parameter textOrWriterFunction
Text or writer function to replace with.
Returns
The new node.
method transform
transform: ( visitNode: (traversal: TransformTraversalControl) => ts.Node) => this;
Transforms the node using the compiler api nodes and functions (experimental).
WARNING: This will forget descendants of transformed nodes.
Example 1
Increments all the numeric literals in a source file.
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;});Example 2
Updates the class declaration node without visiting the children.
const classDec = sourceFile.getClassOrThrow("MyClass");classDec.transform(traversal => {const node = traversal.currentNode;return ts.updateClassDeclaration(node, undefined, undefined, ts.createIdentifier("MyUpdatedClass"), undefined, undefined, []);});
method wasForgotten
wasForgotten: () => boolean;
Gets if the compiler node was forgotten.
This will be true when the compiler node was forgotten or removed.
class NonNullExpression
class NonNullExpression extends NonNullExpressionBase<ts.NonNullExpression> {}
class NoSubstitutionTemplateLiteral
class NoSubstitutionTemplateLiteral extends NoSubstitutionTemplateLiteralBase<ts.NoSubstitutionTemplateLiteral> {}
method getLiteralValue
getLiteralValue: () => string;
Gets the literal value.
method setLiteralValue
setLiteralValue: (value: string) => TemplateLiteral;
Sets the literal value.
Note: This could possibly replace the node if you add a tagged template.
Parameter value
Value to set.
Returns
The new node if the kind changed; the current node otherwise.
class NotEmittedStatement
class NotEmittedStatement extends NotEmittedStatementBase<ts.NotEmittedStatement> {}
class NotImplementedError
class NotImplementedError extends BaseError {}
class NotSupportedError
class NotSupportedError extends BaseError {}
class NullLiteral
class NullLiteral extends NullLiteralBase<ts.NullLiteral> {}
class NumericLiteral
class NumericLiteral extends NumericLiteralBase<ts.NumericLiteral> {}
method getLiteralValue
getLiteralValue: () => number;
Gets the literal value.
method setLiteralValue
setLiteralValue: (value: number) => this;
Sets the literal value.
Parameter value
Value to set.
class ObjectBindingPattern
class ObjectBindingPattern extends Node<ts.ObjectBindingPattern> {}
method getElements
getElements: () => BindingElement[];
Gets the object binding pattern's elements.
class ObjectDestructuringAssignment
class ObjectDestructuringAssignment extends ObjectDestructuringAssignmentBase<ts.ObjectDestructuringAssignment> {}
method getLeft
getLeft: () => ObjectLiteralExpression;
Gets the left object literal expression of the object destructuring assignment.
class ObjectLiteralExpression
class ObjectLiteralExpression extends ObjectLiteralExpressionBase<ts.ObjectLiteralExpression> {}
method addGetAccessor
addGetAccessor: ( structure: GetAccessorDeclarationStructure) => GetAccessorDeclaration;
Adds a get accessor.
Parameter structure
Structure that represents the property assignment to add.
method addGetAccessors
addGetAccessors: ( structures: ReadonlyArray<GetAccessorDeclarationStructure>) => GetAccessorDeclaration[];
Adds get accessors.
Parameter structures
Structure that represents the get accessors to add.
method addMethod
addMethod: (structure: MethodDeclarationStructure) => MethodDeclaration;
Adds a method.
Parameter structure
Structure that represents the method to add.
method addMethods
addMethods: ( structures: ReadonlyArray<MethodDeclarationStructure>) => MethodDeclaration[];
Adds methods.
Parameter structures
Structure that represents the methods to add.
method addPropertyAssignment
addPropertyAssignment: ( structure: PropertyAssignmentStructure) => PropertyAssignment;
Adds a property assignment.
Parameter structure
Structure that represents the property assignment to add.
method addPropertyAssignments
addPropertyAssignments: ( structures: ReadonlyArray<PropertyAssignmentStructure>) => PropertyAssignment[];
Adds property assignments.
Parameter structures
Structure that represents the property assignments to add.
method addSetAccessor
addSetAccessor: ( structure: SetAccessorDeclarationStructure) => SetAccessorDeclaration;
Adds a set accessor.
Parameter structure
Structure that represents the property assignment to add.
method addSetAccessors
addSetAccessors: ( structures: ReadonlyArray<SetAccessorDeclarationStructure>) => SetAccessorDeclaration[];
Adds set accessors.
Parameter structures
Structure that represents the set accessors to add.
method addShorthandPropertyAssignment
addShorthandPropertyAssignment: ( structure: ShorthandPropertyAssignmentStructure) => ShorthandPropertyAssignment;
Adds a shorthand property assignment.
Parameter structure
Structure that represents the shorthand property assignment to add.
method addShorthandPropertyAssignments
addShorthandPropertyAssignments: ( structures: ReadonlyArray<ShorthandPropertyAssignmentStructure>) => ShorthandPropertyAssignment[];
Adds shorthand property assignments.
Parameter structures
Structure that represents the shorthand property assignments to add.
method addSpreadAssignment
addSpreadAssignment: (structure: SpreadAssignmentStructure) => SpreadAssignment;
Adds a spread assignment.
Parameter structure
Structure that represents the spread assignment to add.
method addSpreadAssignments
addSpreadAssignments: ( structures: ReadonlyArray<SpreadAssignmentStructure>) => SpreadAssignment[];
Adds spread assignments.
Parameter structures
Structure that represents the spread assignments to add.
method getProperties
getProperties: () => ObjectLiteralElementLike[];
Gets the properties.
method getProperty
getProperty: { (name: string): ObjectLiteralElementLike | undefined; ( findFunction: (property: ObjectLiteralElementLike) => boolean ): ObjectLiteralElementLike;};
Gets the first property by the provided name or returns undefined.
Parameter name
Name of the property.
Gets the first property that matches the provided find function or returns undefined.
Parameter findFunction
Find function.
method getPropertyOrThrow
getPropertyOrThrow: { (name: string): ObjectLiteralElementLike; ( findFunction: (property: ObjectLiteralElementLike) => boolean ): ObjectLiteralElementLike;};
Gets the first property by the provided name or throws.
Parameter name
Name of the property.
Gets the first property that matches the provided find function or throws.
Parameter findFunction
Find function.
method insertGetAccessor
insertGetAccessor: ( index: number, structure: GetAccessorDeclarationStructure) => GetAccessorDeclaration;
Inserts a get accessor at the specified index.
Parameter index
Child index to insert at.
Parameter structure
Structure that represents the get accessor to insert.
method insertGetAccessors
insertGetAccessors: ( index: number, structures: ReadonlyArray<GetAccessorDeclarationStructure>) => GetAccessorDeclaration[];
Inserts get accessors at the specified index.
Parameter index
Child index to insert at.
Parameter structures
Structures that represent the get accessors to insert.
method insertMethod
insertMethod: ( index: number, structure: MethodDeclarationStructure) => MethodDeclaration;
Inserts a method at the specified index.
Parameter index
Child index to insert at.
Parameter structure
Structure that represents the method to insert.
method insertMethods
insertMethods: ( index: number, structures: ReadonlyArray<MethodDeclarationStructure>) => MethodDeclaration[];
Inserts methods at the specified index.
Parameter index
Child index to insert at.
Parameter structures
Structures that represent the methods to insert.
method insertPropertyAssignment
insertPropertyAssignment: ( index: number, structure: PropertyAssignmentStructure) => PropertyAssignment;
Inserts a property assignment at the specified index.
Parameter index
Child index to insert at.
Parameter structure
Structure that represents the property assignment to insert.
method insertPropertyAssignments
insertPropertyAssignments: ( index: number, structures: ReadonlyArray<PropertyAssignmentStructure>) => PropertyAssignment[];
Inserts property assignments at the specified index.
Parameter index
Child index to insert at.
Parameter structures
Structures that represent the property assignments to insert.
method insertSetAccessor
insertSetAccessor: ( index: number, structure: SetAccessorDeclarationStructure) => SetAccessorDeclaration;
Inserts a set accessor at the specified index.
Parameter index
Child index to insert at.
Parameter structure
Structure that represents the set accessor to insert.
method insertSetAccessors
insertSetAccessors: ( index: number, structures: ReadonlyArray<SetAccessorDeclarationStructure>) => SetAccessorDeclaration[];
Inserts set accessors at the specified index.
Parameter index
Child index to insert at.
Parameter structures
Structures that represent the set accessors to insert.
method insertShorthandPropertyAssignment
insertShorthandPropertyAssignment: ( index: number, structure: ShorthandPropertyAssignmentStructure) => ShorthandPropertyAssignment;
Inserts a shorthand property assignment at the specified index.
Parameter index
Child index to insert at.
Parameter structure
Structure that represents the shorthand property assignment to insert.
method insertShorthandPropertyAssignments
insertShorthandPropertyAssignments: ( index: number, structures: ReadonlyArray<ShorthandPropertyAssignmentStructure>) => ShorthandPropertyAssignment[];
Inserts shorthand property assignments at the specified index.
Parameter index
Child index to insert at.
Parameter structures
Structures that represent the shorthand property assignments to insert.
method insertSpreadAssignment
insertSpreadAssignment: ( index: number, structure: SpreadAssignmentStructure) => SpreadAssignment;
Inserts a spread assignment at the specified index.
Parameter index
Child index to insert at.
Parameter structure
Structure that represents the spread assignment to insert.
method insertSpreadAssignments
insertSpreadAssignments: ( index: number, structures: ReadonlyArray<SpreadAssignmentStructure>) => SpreadAssignment[];
Inserts spread assignments at the specified index.
Parameter index
Child index to insert at.
Parameter structures
Structures that represent the spread assignments to insert.
class OmittedExpression
class OmittedExpression extends OmittedExpressionBase<ts.OmittedExpression> {}
class OutputFile
class OutputFile {}
Output file of an emit.
property compilerObject
readonly compilerObject: ts.OutputFile;
TypeScript compiler output file.
method getFilePath
getFilePath: () => string;
Gets the file path.
method getText
getText: () => string;
Gets the file text.
method getWriteByteOrderMark
getWriteByteOrderMark: () => boolean;
Gets whether the byte order mark should be written.
class ParameterDeclaration
class ParameterDeclaration extends ParameterDeclarationBase<ts.ParameterDeclaration> {}
method getDotDotDotToken
getDotDotDotToken: () => Node<ts.Token<SyntaxKind.DotDotDotToken>> | undefined;
Gets the dot dot dot token (...) if it exists, for a rest parameter.
method getStructure
getStructure: () => ParameterDeclarationStructure;
Gets the structure equivalent to this node.
method isOptional
isOptional: () => boolean;
Gets if it's optional.
method isParameterProperty
isParameterProperty: () => boolean;
Gets if this is a property with a scope or readonly keyword (found in class constructors).
method isRestParameter
isRestParameter: () => boolean;
Gets if it's a rest parameter.
method remove
remove: () => void;
Remove this parameter.
method set
set: (structure: Partial<ParameterDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setHasQuestionToken
setHasQuestionToken: (value: boolean) => this;
Sets if this node has a question token.
Parameter value
If it should have a question token or not.
method setInitializer
setInitializer: (textOrWriterFunction: string | WriterFunction) => this;
Sets the initializer.
Parameter text
Text or writer function to set for the initializer.
method setIsRestParameter
setIsRestParameter: (value: boolean) => this;
Sets if it's a rest parameter.
Parameter value
Sets if it's a rest parameter or not.
method setType
setType: (textOrWriterFunction: string | WriterFunction) => this;
Sets the type.
Parameter textOrWriterFunction
Text or writer function to set the type with.
class ParenthesizedExpression
class ParenthesizedExpression extends ParenthesizedExpressionBase<ts.ParenthesizedExpression> {}
class ParenthesizedTypeNode
class ParenthesizedTypeNode extends TypeNode<ts.ParenthesizedTypeNode> {}
method getTypeNode
getTypeNode: () => TypeNode;
Gets the node within the parentheses.
method setType
setType: (textOrWriterFunction: string | WriterFunction) => this;
Sets the type within the parentheses.
Parameter textOrWriterFunction
Text or writer function to set the type with.
class PartiallyEmittedExpression
class PartiallyEmittedExpression extends PartiallyEmittedExpressionBase<ts.PartiallyEmittedExpression> {}
class PathNotFoundError
class PathNotFoundError extends BaseError {}
constructor
protected constructor();
property code
readonly code: string;
property path
readonly path: string;
class PostfixUnaryExpression
class PostfixUnaryExpression extends PostfixUnaryExpressionBase<ts.PostfixUnaryExpression> {}
method getOperand
getOperand: () => LeftHandSideExpression;
Gets the operand of the postfix unary expression.
method getOperatorToken
getOperatorToken: () => ts.PostfixUnaryOperator;
Gets the operator token of the postfix unary expression.
class PrefixUnaryExpression
class PrefixUnaryExpression extends PrefixUnaryExpressionBase<ts.PrefixUnaryExpression> {}
method getOperand
getOperand: () => UnaryExpression;
Gets the operand of the prefix unary expression.
method getOperatorToken
getOperatorToken: () => ts.PrefixUnaryOperator;
Gets the operator token of the prefix unary expression.
class PrimaryExpression
class PrimaryExpression< T extends ts.PrimaryExpression = ts.PrimaryExpression> extends MemberExpression<T> {}
class Program
class Program {}
Wrapper around Program.
property compilerObject
readonly compilerObject: ts.Program;
Gets the underlying compiler program.
method emit
emit: (options?: ProgramEmitOptions) => EmitResult;
Emits the TypeScript files to JavaScript files.
Parameter options
Options for emitting.
method emitToMemory
emitToMemory: (options?: EmitOptions) => MemoryEmitResult;
Emits the TypeScript files to JavaScript files to memory.
Parameter options
Options for emitting.
method getDeclarationDiagnostics
getDeclarationDiagnostics: (sourceFile?: SourceFile) => DiagnosticWithLocation[];
Gets the declaration diagnostics.
Parameter sourceFile
Optional source file to filter by.
method getEmitModuleResolutionKind
getEmitModuleResolutionKind: () => ModuleResolutionKind;
Gets the emit module resolution kind.
method getGlobalDiagnostics
getGlobalDiagnostics: () => Diagnostic[];
Gets the global diagnostics.
method getSemanticDiagnostics
getSemanticDiagnostics: (sourceFile?: SourceFile) => Diagnostic[];
Gets the semantic diagnostics.
Parameter sourceFile
Optional source file to filter by.
method getSyntacticDiagnostics
getSyntacticDiagnostics: (sourceFile?: SourceFile) => DiagnosticWithLocation[];
Gets the syntactic diagnostics.
Parameter sourceFile
Optional source file to filter by.
method getTypeChecker
getTypeChecker: () => TypeChecker;
Get the program's type checker.
method isSourceFileFromExternalLibrary
isSourceFileFromExternalLibrary: (sourceFile: SourceFile) => boolean;
Gets if the provided source file was discovered while loading an external library.
Parameter sourceFile
Source file.
class Project
class Project {}
Project that holds source files.
constructor
constructor(options?: ProjectOptions);
Initializes a new instance.
Parameter options
Optional options.
property compilerOptions
readonly compilerOptions: CompilerOptionsContainer;
Gets the compiler options for modification.
property manipulationSettings
readonly manipulationSettings: ManipulationSettingsContainer;
Gets the manipulation settings.
method addExistingDirectory
addExistingDirectory: ( dirPath: string, options?: DirectoryAddOptions) => Directory;
Adds an existing directory from the path or throws if it doesn't exist.
Will return the directory if it was already added.
Parameter dirPath
Path to add the directory at.
Parameter options
Options.
Throws
DirectoryNotFoundError when the directory does not exist.
method addExistingDirectoryIfExists
addExistingDirectoryIfExists: ( dirPath: string, options?: DirectoryAddOptions) => Directory | undefined;
Adds an existing directory from the path or returns undefined if it doesn't exist.
Will return the directory if it was already added.
Parameter dirPath
Path to add the directory at.
Parameter options
Options.
method addExistingSourceFile
addExistingSourceFile: (filePath: string) => SourceFile;
Adds an existing source file from a file path or throws if it doesn't exist.
Will return the source file if it was already added.
Parameter filePath
File path to get the file from.
Throws
FileNotFoundError when the file is not found.
method addExistingSourceFileIfExists
addExistingSourceFileIfExists: (filePath: string) => SourceFile | undefined;
Adds a source file from a file path if it exists or returns undefined.
Will return the source file if it was already added.
Parameter filePath
File path to get the file from.
method addExistingSourceFiles
addExistingSourceFiles: ( fileGlobs: string | ReadonlyArray<string>) => SourceFile[];
Adds source files based on file globs.
Parameter fileGlobs
File glob or globs to add files based on.
Returns
The matched source files.
method addSourceFilesFromTsConfig
addSourceFilesFromTsConfig: (tsConfigFilePath: string) => SourceFile[];
Adds all the source files from the specified tsconfig.json.
Note that this is done by default when specifying a tsconfig file in the constructor and not explicitly setting the addFilesFromTsConfig option to false.
Parameter tsConfigFilePath
File path to the tsconfig.json file.
method applyFileTextChanges
applyFileTextChanges: ( fileTextChanges: ReadonlyArray<FileTextChanges>, options?: { overwrite?: boolean }) => void;
Applies the given file text changes to this project. This modifies and possibly creates new SourceFiles.
WARNING: This will forget any previously navigated descendant nodes of changed files. It's best to do this when you're all done.
Parameter fileTextChanges
Collections of file changes to apply to this project.
Parameter options
Options for applying the text changes.
method createDirectory
createDirectory: (dirPath: string) => Directory;
Creates a directory at the specified path.
Parameter dirPath
Path to create the directory at.
method createSourceFile
createSourceFile: ( filePath: string, sourceFileText?: string | SourceFileStructure | WriterFunction, options?: SourceFileCreateOptions) => SourceFile;
Creates a source file at the specified file path with the specified text.
Note: The file will not be created and saved to the file system until .save() is called on the source file.
Parameter filePath
File path of the source file.
Parameter sourceFileText
Text, structure, or writer function for the source file text.
Parameter options
Options.
Throws
- InvalidOperationError if a source file already exists at the provided file path.
method createWriter
createWriter: () => CodeBlockWriter;
Creates a writer with the current manipulation settings.
Remarks
Generally it's best to use a provided writer, but this may be useful in some scenarios.
method emit
emit: (emitOptions?: EmitOptions) => EmitResult;
Emits all the source files.
Parameter emitOptions
Optional emit options.
method emitToMemory
emitToMemory: (emitOptions?: EmitOptions) => MemoryEmitResult;
Emits all the source files to memory.
Parameter emitOptions
Optional emit options.
method enableLogging
enableLogging: (enabled?: boolean) => void;
Enables logging to the console.
Parameter enabled
Enabled.
method forgetNodesCreatedInBlock
forgetNodesCreatedInBlock: { (block: (remember: (...node: Node[]) => void) => void): void; ( block: (remember: (...node: Node<ts.Node>[]) => void) => Promise<void> ): void;};
Forgets the nodes created in the scope of the passed in block.
This is an advanced method that can be used to easily "forget" all the nodes created within the scope of the block.
Parameter block
Block of code to run.
Forgets the nodes created in the scope of the passed in block asynchronously.
This is an advanced method that can be used to easily "forget" all the nodes created within the scope of the block.
Parameter block
Block of code to run.
method formatDiagnosticsWithColorAndContext
formatDiagnosticsWithColorAndContext: ( diagnostics: ReadonlyArray<Diagnostic>, opts?: { newLineChar?: '\n' | '\r\n' }) => string;
Formats an array of diagnostics with their color and context into a string.
Parameter diagnostics
Diagnostics to get a string of.
Parameter options
Collection of options. For exmaple, the new line character to use (defaults to the OS' new line character).
method getAmbientModule
getAmbientModule: (moduleName: string) => Symbol | undefined;
Gets the specified ambient module symbol or returns undefined if not found.
Parameter moduleName
The ambient module name with or without quotes.
method getAmbientModuleOrThrow
getAmbientModuleOrThrow: (moduleName: string) => Symbol;
Gets the specified ambient module symbol or throws if not found.
Parameter moduleName
The ambient module name with or without quotes.
method getAmbientModules
getAmbientModules: () => Symbol[];
Gets the ambient module symbols (ex. modules in the folder or node_modules).
method getCompilerOptions
getCompilerOptions: () => CompilerOptions;
Gets the compiler options.
method getDirectories
getDirectories: () => Directory[];
Gets all the directories.
method getDirectory
getDirectory: (dirPath: string) => Directory | undefined;
Gets a directory by the specified path or returns undefined if it doesn't exist.
Parameter dirPath
Directory path.
method getDirectoryOrThrow
getDirectoryOrThrow: (dirPath: string) => Directory;
Gets a directory by the specified path or throws if it doesn't exist.
Parameter dirPath
Path to create the directory at.
method getFileSystem
getFileSystem: () => FileSystemHost;
Gets the file system.
method getLanguageService
getLanguageService: () => LanguageService;
Gets the language service.
method getPreEmitDiagnostics
getPreEmitDiagnostics: () => Diagnostic[];
Gets the pre-emit diagnostics.
method getProgram
getProgram: () => Program;
Gets the program.
method getRootDirectories
getRootDirectories: () => Directory[];
Gets the directories without a parent.
method getSourceFile
getSourceFile: { (fileNameOrPath: string): SourceFile | undefined; (searchFunction: (file: SourceFile) => boolean): SourceFile;};
Gets a source file by a file name or file path. Returns undefined if none exists.
Parameter fileNameOrPath
File name or path that the path could end with or equal.
Gets a source file by a search function. Returns undefined if none exists.
Parameter searchFunction
Search function.
method getSourceFileOrThrow
getSourceFileOrThrow: { (fileNameOrPath: string): SourceFile; (searchFunction: (file: SourceFile) => boolean): SourceFile;};
Gets a source file by a file name or file path. Throws an error if it doesn't exist.
Parameter fileNameOrPath
File name or path that the path could end with or equal.
Gets a source file by a search function. Throws an erorr if it doesn't exist.
Parameter searchFunction
Search function.
method getSourceFiles
getSourceFiles: { (): SourceFile[]; (globPattern: string): SourceFile[]; (globPatterns: readonly string[]): SourceFile[];};
Gets all the source files added to the project.
Parameter globPattern
Glob pattern for filtering out the source files.
Gets all the source files added to the project that match a pattern.
Parameter globPattern
Glob pattern for filtering out the source files.
Gets all the source files added to the project that match the passed in patterns.
Parameter globPatterns
Glob patterns for filtering out the source files.
method getTypeChecker
getTypeChecker: () => TypeChecker;
Gets the type checker.
method removeSourceFile
removeSourceFile: (sourceFile: SourceFile) => boolean;
Removes a source file from the AST.
Parameter sourceFile
Source file to remove.
Returns
True if removed.
method resolveSourceFileDependencies
resolveSourceFileDependencies: () => SourceFile[];
Adds the source files the project's source files depend on to the project.
Returns
The added source files.
Remarks
* This should be done after source files are added to the project, preferably once to avoid doing more work than necessary. * This is done by default when creating a Project and providing a tsconfig.json and not specifying to not add the source files.
method save
save: () => Promise<void>;
Saves all the unsaved source files to the file system and deletes all deleted files.
method saveSync
saveSync: () => void;
Synchronously saves all the unsaved source files to the file system and deletes all deleted files.
Remarks: This might be very slow compared to the asynchronous version if there are a lot of files.
class PropertyAccessExpression
class PropertyAccessExpression< T extends ts.PropertyAccessExpression = ts.PropertyAccessExpression> extends PropertyAccessExpressionBase<T> {}
class PropertyAssignment
class PropertyAssignment extends PropertyAssignmentBase<ts.PropertyAssignment> {}
method getStructure
getStructure: () => PropertyAssignmentStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes this property.
method removeInitializer
removeInitializer: () => ShorthandPropertyAssignment;
Removes the initializer and returns the new shorthand property assignment.
Note: The current node will no longer be valid because it's no longer a property assignment.
method set
set: ( structure: Partial<PropertyAssignmentStructure>) => this | ShorthandPropertyAssignment;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setInitializer
setInitializer: (textOrWriterFunction: string | WriterFunction) => this;
Sets the initializer.
Parameter textOrWriterFunction
New text ot set for the initializer.
class PropertyDeclaration
class PropertyDeclaration extends PropertyDeclarationBase<ts.PropertyDeclaration> {}
method getStructure
getStructure: () => PropertyDeclarationStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes the property.
method set
set: (structure: Partial<PropertyDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class PropertySignature
class PropertySignature extends PropertySignatureBase<ts.PropertySignature> {}
method getStructure
getStructure: () => PropertySignatureStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes this property signature.
method set
set: (structure: Partial<PropertySignatureStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class QualifiedName
class QualifiedName extends Node<ts.QualifiedName> {}
class RefactorEditInfo
class RefactorEditInfo {}
Set of edits to make in response to a refactor action, plus an optional location where renaming should be invoked from.
property compilerObject
readonly compilerObject: ts.RefactorEditInfo;
Gets the compiler refactor edit info.
method getEdits
getEdits: () => FileTextChanges[];
Gets refactor file text changes
method getRenameFilePath
getRenameFilePath: () => string | undefined;
Gets the file path for a rename refactor.
method getRenameLocation
getRenameLocation: () => number | undefined;
Location where renaming should be invoked from.
class ReferencedSymbol
class ReferencedSymbol {}
Referenced symbol.
property compilerObject
readonly compilerObject: ts.ReferencedSymbol;
Gets the compiler referenced symbol.
method getDefinition
getDefinition: () => ReferencedSymbolDefinitionInfo;
Gets the definition.
method getReferences
getReferences: () => ReferenceEntry[];
Gets the references.
class ReferencedSymbolDefinitionInfo
class ReferencedSymbolDefinitionInfo extends DefinitionInfo<ts.ReferencedSymbolDefinitionInfo> {}
method getDisplayParts
getDisplayParts: () => SymbolDisplayPart[];
Gets the display parts.
class ReferenceEntry
class ReferenceEntry extends DocumentSpan<ts.ReferenceEntry> {}
method isDefinition
isDefinition: () => boolean;
If this is the definition reference.
method isInString
isInString: () => true | undefined;
method isWriteAccess
isWriteAccess: () => boolean;
class RegularExpressionLiteral
class RegularExpressionLiteral extends RegularExpressionLiteralBase<ts.RegularExpressionLiteral> {}
method getLiteralValue
getLiteralValue: () => RegExp;
Gets the literal value.
method setLiteralValue
setLiteralValue: { (pattern: string, flags?: string): this; (regExp: RegExp): this;};
Sets the literal value according to a pattern and some flags.
Parameter pattern
Pattern.
Parameter flags
Flags.
Sets the literal value according to a regular expression object.
Parameter regExp
Regular expression.
class RenameLocation
class RenameLocation extends DocumentSpan<ts.RenameLocation> {}
Rename location.
class ReturnStatement
class ReturnStatement extends ReturnStatementBase<ts.ReturnStatement> {}
method getExpression
getExpression: () => Expression | undefined;
Gets this return statement's expression if it exists.
method getExpressionOrThrow
getExpressionOrThrow: () => Expression<ts.Expression>;
Gets this return statement's expression if it exists or throws.
class SetAccessorDeclaration
class SetAccessorDeclaration extends SetAccessorDeclarationBase<ts.SetAccessorDeclaration> {}
method getGetAccessor
getGetAccessor: () => GetAccessorDeclaration | undefined;
Gets the corresponding get accessor if one exists.
method getGetAccessorOrThrow
getGetAccessorOrThrow: () => GetAccessorDeclaration;
Gets the corresponding get accessor or throws if not exists.
method getStructure
getStructure: () => SetAccessorDeclarationStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes the set accessor.
method set
set: (structure: Partial<SetAccessorDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class SettingsContainer
abstract class SettingsContainer<T extends object> {}
constructor
protected constructor();
method get
get: () => T;
Gets a copy of the settings as an object.
method reset
reset: () => void;
Resets the settings to the default.
method set
set: (settings: Partial<T>) => void;
Sets one or all of the settings.
Parameter settings
Settings to set.
class ShorthandPropertyAssignment
class ShorthandPropertyAssignment extends ShorthandPropertyAssignmentBase<ts.ShorthandPropertyAssignment> {}
method getEqualsToken
getEqualsToken: () => Node<ts.Token<SyntaxKind.EqualsToken>> | undefined;
Gets the equals token if it exists.
method getEqualsTokenOrThrow
getEqualsTokenOrThrow: () => Node<ts.Token<SyntaxKind.EqualsToken>>;
Gets the equals token or throws if it doesn't exist.
method getObjectAssignmentInitializer
getObjectAssignmentInitializer: () => Expression | undefined;
Gets the object assignment initializer if it exists.
method getObjectAssignmentInitializerOrThrow
getObjectAssignmentInitializerOrThrow: () => Expression<ts.Expression>;
Gets the object assignment initializer or throws if it doesn't exist.
method getStructure
getStructure: () => ShorthandPropertyAssignmentStructure;
Gets the structure equivalent to this node.
method hasObjectAssignmentInitializer
hasObjectAssignmentInitializer: () => boolean;
Gets if the shorthand property assignment has an object assignment initializer.
method remove
remove: () => void;
Removes this property.
method removeObjectAssignmentInitializer
removeObjectAssignmentInitializer: () => this;
Remove the object assignment initializer.
This is only useful to remove bad code.
method set
set: (structure: Partial<ShorthandPropertyAssignmentStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setInitializer
setInitializer: (text: string) => PropertyAssignment;
Sets the initializer.
Note: The current node will no longer be valid because it's no longer a shorthand property assignment.
Parameter text
New text to set for the initializer.
class Signature
class Signature {}
property compilerSignature
readonly compilerSignature: ts.Signature;
Gets the underlying compiler signature.
method getDocumentationComments
getDocumentationComments: () => SymbolDisplayPart[];
Get the documentation comments.
method getJsDocTags
getJsDocTags: () => JSDocTagInfo[];
Gets the JS doc tags.
method getParameters
getParameters: () => Symbol[];
Gets the parameters.
method getReturnType
getReturnType: () => Type;
Gets the signature return type.
method getTypeParameters
getTypeParameters: () => TypeParameter[];
Gets the type parameters.
class SourceFile
class SourceFile extends SourceFileBase<ts.SourceFile> {}
method applyTextChanges
applyTextChanges: (textChanges: ReadonlyArray<TextChange>) => this;
Applies the text changes to the source file.
WARNING! This will forget all the nodes in the file! It's best to do this after you're all done with the file.
Parameter textChanges
Text changes.
method copy
copy: (filePath: string, options?: SourceFileCopyOptions) => SourceFile;
Copy this source file to a new file.
This will modify the module specifiers in the new file, if necessary.
Parameter filePath
New file path. Can be relative to the original file or an absolute path.
Parameter options
Options for copying.
method copyImmediately
copyImmediately: ( filePath: string, options?: SourceFileCopyOptions) => Promise<SourceFile>;
Copy this source file to a new file and immediately saves it to the file system asynchronously.
This will modify the module specifiers in the new file, if necessary.
Parameter filePath
New file path. Can be relative to the original file or an absolute path.
Parameter options
Options for copying.
method copyImmediatelySync
copyImmediatelySync: ( filePath: string, options?: SourceFileCopyOptions) => SourceFile;
Copy this source file to a new file and immediately saves it to the file system synchronously.
This will modify the module specifiers in the new file, if necessary.
Parameter filePath
New file path. Can be relative to the original file or an absolute path.
Parameter options
Options for copying.
method copyToDirectory
copyToDirectory: ( dirPathOrDirectory: string | Directory, options?: SourceFileCopyOptions) => SourceFile;
Copies this source file to the specified directory.
This will modify the module specifiers in the new file, if necessary.
Parameter dirPathOrDirectory
Directory path or directory object to copy the file to.
Parameter options
Options for copying.
Returns
The source file the copy was made to.
method delete
delete: () => void;
Queues a deletion of the file to the file system.
The file will be deleted when you call ast.save(). If you wish to immediately delete the file, then use deleteImmediately().
method deleteImmediately
deleteImmediately: () => Promise<void>;
Asynchronously deletes the file from the file system.
method deleteImmediatelySync
deleteImmediatelySync: () => void;
Synchronously deletes the file from the file system.
method emit
emit: (options?: SourceFileEmitOptions) => EmitResult;
Emits the source file.
method fixMissingImports
fixMissingImports: ( formatSettings?: FormatCodeSettings, userPreferences?: UserPreferences) => this;
Code fix to add import declarations for identifiers that are referenced, but not imported in the source file.
Parameter formatSettings
Format code settings.
Parameter userPreferences
User preferences for refactoring.
method formatText
formatText: (settings?: FormatCodeSettings) => void;
Formats the source file text using the internal TypeScript formatting API.
Parameter settings
Format code settings.
method getBaseName
getBaseName: () => string;
Gets the file path's base name.
method getBaseNameWithoutExtension
getBaseNameWithoutExtension: () => string;
Gets the file path's base name without the extension.
method getDirectory
getDirectory: () => Directory;
Gets the directory that the source file is contained in.
method getDirectoryPath
getDirectoryPath: () => string;
Gets the directory path that the source file is contained in.
method getEmitOutput
getEmitOutput: (options?: { emitOnlyDtsFiles?: boolean }) => EmitOutput;
Gets the emit output of this source file.
Parameter options
Emit options.
method getExtension
getExtension: () => string;
Gets the file path's extension.
method getFilePath
getFilePath: () => string;
Gets the file path.
method getFullText
getFullText: () => string;
Gets the full text with leading trivia.
method getImportStringLiterals
getImportStringLiterals: () => StringLiteral[];
Gets all the descendant string literals that reference a source file.
method getLanguageVariant
getLanguageVariant: () => LanguageVariant;
Gets the language variant of the source file.
method getLanguageVersion
getLanguageVersion: () => ScriptTarget;
Gets the script target of the source file.
method getLengthFromLineStartAtPos
getLengthFromLineStartAtPos: (pos: number) => number;
Gets the character count from the start of the line to the provided position.
Parameter pos
Position.
method getLineNumberAtPos
getLineNumberAtPos: (pos: number) => number;
Gets the line number at the provided position.
Parameter pos
Position
method getPreEmitDiagnostics
getPreEmitDiagnostics: () => Diagnostic[];
Gets the pre-emit diagnostics of the specified source file.
method getReferencedFiles
getReferencedFiles: () => SourceFile[];
Gets any source files referenced via
/// <reference path="..." />
comments.
method getReferencingLiteralsInOtherSourceFiles
getReferencingLiteralsInOtherSourceFiles: () => StringLiteral[];
Gets the string literals in other source files that reference this source file.
method getReferencingNodesInOtherSourceFiles
getReferencingNodesInOtherSourceFiles: () => SourceFileReferencingNodes[];
Gets the import and exports in other source files that reference this source file.
method getReferencingSourceFiles
getReferencingSourceFiles: () => SourceFile[];
Get any source files that reference this source file.
method getRelativePathAsModuleSpecifierTo
getRelativePathAsModuleSpecifierTo: { (sourceFile: SourceFile): string; (directory: Directory): string;};
Gets the relative path to the specified source file as a module specifier.
Parameter sourceFile
Source file.
Gets the relative path to the specified directory as a module specifier.
Parameter directory
Directory.
method getRelativePathTo
getRelativePathTo: { (sourceFile: SourceFile): string; (directory: Directory): string;};
Gets the relative path to another source file.
Parameter sourceFile
Source file.
Gets the relative path to another directory.
Parameter directory
Directory.
method getStructure
getStructure: () => SourceFileStructure;
Gets the structure equivalent to this node.
method getTypeReferenceDirectives
getTypeReferenceDirectives: () => SourceFile[];
Gets any source files referenced via
/// <reference types="..." />
comments.
method indent
indent: { (pos: number, times?: number): this; (positionRange: [number, number], times?: number): this;};
Indents the line at the specified position.
Parameter pos
Position.
Parameter times
Times to indent. Specify a negative value to unindent.
Indents the lines within the specified range.
Parameter positionRange
Position range.
Parameter times
Times to indent. Specify a negative value to unindent.
method isDeclarationFile
isDeclarationFile: () => boolean;
Gets if this is a declaration file.
method isFromExternalLibrary
isFromExternalLibrary: () => boolean;
Gets if the source file was discovered while loading an external library.
method isInNodeModules
isInNodeModules: () => boolean;
Gets if the source file is a descendant of a node_modules directory.
method isSaved
isSaved: () => boolean;
Gets if this source file has been saved or if the latest changes have been saved.
method move
move: (filePath: string, options?: SourceFileMoveOptions) => SourceFile;
Moves this source file to a new file.
This will modify the module specifiers in other files that specify this file and the module specifiers in the current file, if necessary.
Parameter filePath
New file path. Can be relative to the original file or an absolute path.
Parameter options
Options for moving.
method moveImmediately
moveImmediately: ( filePath: string, options?: SourceFileMoveOptions) => Promise<SourceFile>;
Moves this source file to a new file and asynchronously updates the file system immediately.
This will modify the module specifiers in other files that specify this file and the module specifiers in the current file, if necessary.
Parameter filePath
New file path. Can be relative to the original file or an absolute path.
Parameter options
Options for moving.
method moveImmediatelySync
moveImmediatelySync: ( filePath: string, options?: SourceFileMoveOptions) => SourceFile;
Moves this source file to a new file and synchronously updates the file system immediately.
This will modify the module specifiers in other files that specify this file and the module specifiers in the current file, if necessary.
Parameter filePath
New file path. Can be relative to the original file or an absolute path.
Parameter options
Options for moving.
method moveToDirectory
moveToDirectory: ( dirPathOrDirectory: string | Directory, options?: SourceFileMoveOptions) => SourceFile;
Moves this source file to the specified directory.
This will modify the module specifiers in other files that specify this file and the module specifiers in the current file, if necessary.
Parameter dirPathOrDirectory
Directory path or directory object to move the file to.
Parameter options
Options for moving.
method onModified
onModified: ( subscription: (sender: SourceFile) => void, subscribe?: boolean) => this;
Subscribe to when the source file is modified.
Parameter subscription
Subscription.
Parameter subscribe
Optional and defaults to true. Use an explicit false to unsubscribe.
method organizeImports
organizeImports: ( formatSettings?: FormatCodeSettings, userPreferences?: UserPreferences) => this;
Organizes the imports in the file.
WARNING! This will forget all the nodes in the file! It's best to do this after you're all done with the file.
Parameter formatSettings
Format code settings.
Parameter userPreferences
User preferences for refactoring.
method refreshFromFileSystem
refreshFromFileSystem: () => Promise<FileSystemRefreshResult>;
Refresh the source file from the file system.
WARNING: When updating from the file system, this will "forget" any previously navigated nodes.
Returns
What action ended up taking place.
method refreshFromFileSystemSync
refreshFromFileSystemSync: () => FileSystemRefreshResult;
Synchronously refreshes the source file from the file system.
WARNING: When updating from the file system, this will "forget" any previously navigated nodes.
Returns
What action ended up taking place.
method save
save: () => Promise<void>;
Asynchronously saves this file with any changes.
method saveSync
saveSync: () => void;
Synchronously saves this file with any changes.
method set
set: (structure: Partial<SourceFileStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method unindent
unindent: { (pos: number, times?: number): this; (positionRange: [number, number], times?: number): this;};
Deindents the line at the specified position.
Parameter pos
Position.
Parameter times
Times to unindent. Specify a negative value to indent.
Deindents the lines within the specified range.
Parameter positionRange
Position range.
Parameter times
Times to unindent. Specify a negative value to indent.
class SpreadAssignment
class SpreadAssignment extends SpreadAssignmentBase<ts.SpreadAssignment> {}
method getStructure
getStructure: () => SpreadAssignmentStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes this property.
method set
set: (structure: Partial<SpreadAssignmentStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class SpreadElement
class SpreadElement extends SpreadElementBase<ts.SpreadElement> {}
class Statement
class Statement<T extends ts.Statement = ts.Statement> extends Node<T> {}
method remove
remove: () => void;
Removes the statement.
class StringLiteral
class StringLiteral extends StringLiteralBase<ts.StringLiteral> {}
method getLiteralValue
getLiteralValue: () => string;
Gets the literal value.
This is equivalent to .getLiteralText() for string literals and only exists for consistency with other literals.
method getQuoteKind
getQuoteKind: () => QuoteKind;
Gets the quote kind.
method setLiteralValue
setLiteralValue: (value: string) => this;
Sets the literal value.
Parameter value
Value to set.
class SuperElementAccessExpression
class SuperElementAccessExpression extends SuperElementAccessExpressionBase<ts.SuperElementAccessExpression> {}
class SuperExpression
class SuperExpression extends SuperExpressionBase<ts.SuperExpression> {}
class SuperPropertyAccessExpression
class SuperPropertyAccessExpression extends SuperPropertyAccessExpressionBase<ts.SuperPropertyAccessExpression> {}
class SwitchStatement
class SwitchStatement extends SwitchStatementBase<ts.SwitchStatement> {}
method getCaseBlock
getCaseBlock: () => CaseBlock;
Gets this switch statement's case block.
method getClauses
getClauses: () => CaseOrDefaultClause[];
Gets the switch statement's case block's clauses.
method getExpression
getExpression: () => Expression;
Gets this switch statement's expression.
method removeClause
removeClause: (index: number) => CaseBlock;
Removes the specified clause based on the provided index.
Parameter index
Index.
method removeClauses
removeClauses: (indexRange: [number, number]) => CaseBlock;
Removes the specified clauses based on the provided index range.
Parameter indexRange
Index range.
class Symbol
class Symbol {}
property compilerSymbol
readonly compilerSymbol: ts.Symbol;
Gets the underlying compiler symbol.
method getAliasedSymbol
getAliasedSymbol: () => Symbol | undefined;
Gets the aliased symbol or returns undefined if it doesn't exist.
method getAliasedSymbolOrThrow
getAliasedSymbolOrThrow: () => Symbol;
Gets the aliased symbol or throws if it doesn't exist.
method getDeclarations
getDeclarations: () => Node[];
Gets the symbol declarations.
method getDeclaredType
getDeclaredType: () => Type;
Gets the declared type of the symbol.
method getEscapedName
getEscapedName: () => string;
Gets the escaped name.
method getExportByName
getExportByName: (name: string) => Symbol | undefined;
Gets the export of the symbol by the specified name or returns undefined if not exists.
Parameter name
Name of the export.
method getExportByNameOrThrow
getExportByNameOrThrow: (name: string) => Symbol;
Gets the export of the symbol by the specified name or throws if not exists.
Parameter name
Name of the export.
method getExports
getExports: () => Symbol[];
Gets the exports from the symbol.
method getFlags
getFlags: () => SymbolFlags;
Gets the symbol flags.
method getFullyQualifiedName
getFullyQualifiedName: () => string;
Gets the fully qualified name.
method getGlobalExportByName
getGlobalExportByName: (name: string) => Symbol | undefined;
Gets the global export of the symbol by the specified name or returns undefined if not exists.
Parameter name
Name of the global export.
method getGlobalExportByNameOrThrow
getGlobalExportByNameOrThrow: (name: string) => Symbol;
Gets the global export of the symbol by the specified name or throws if not exists.
Parameter name
Name of the global export.
method getGlobalExports
getGlobalExports: () => Symbol[];
Gets the global exports from the symbol.
method getMemberByName
getMemberByName: (name: string) => Symbol | undefined;
Gets the member of the symbol by the specified name or returns undefined if not exists.
Parameter name
Name of the member.
method getMemberByNameOrThrow
getMemberByNameOrThrow: (name: string) => Symbol;
Gets the member of the symbol by the specified name or throws if not exists.
Parameter name
Name of the export.
method getMembers
getMembers: () => Symbol[];
Gets the members of the symbol
method getName
getName: () => string;
Gets the symbol name.
method getTypeAtLocation
getTypeAtLocation: (node: Node) => Type<ts.Type>;
Gets the type of the symbol at a location.
Parameter node
Location to get the type at for this symbol.
method getValueDeclaration
getValueDeclaration: () => Node | undefined;
Gets the value declaration of the symbol or returns undefined if it doesn't exist.
method getValueDeclarationOrThrow
getValueDeclarationOrThrow: () => Node;
Gets the value declaration of a symbol or throws if it doesn't exist.
method hasFlags
hasFlags: (flags: SymbolFlags) => boolean;
Gets if the symbol has the specified flags.
Parameter flags
Flags to check if the symbol has.
method isAlias
isAlias: () => boolean;
Gets if the symbol is an alias.
class SymbolDisplayPart
class SymbolDisplayPart {}
Symbol display part.
property compilerObject
readonly compilerObject: ts.SymbolDisplayPart;
Gets the compiler symbol display part.
method getKind
getKind: () => string;
Gets the kind.
Examples: "text", "lineBreak"
method getText
getText: () => string;
Gets the text.
class SyntaxList
class SyntaxList extends Node<ts.SyntaxList> {}
method addChildText
addChildText: (textOrWriterFunction: string | WriterFunction) => Node<ts.Node>[];
Adds text at the end of the current children.
Parameter textOrWriterFunction
Text to add or function that provides a writer to write with.
Returns
The children that were added.
method insertChildText
insertChildText: ( index: number, textOrWriterFunction: string | WriterFunction) => Node<ts.Node>[];
Inserts text at the specified child index.
Parameter index
Child index to insert at.
Parameter textOrWriterFunction
Text to insert or function that provides a writer to write with.
Returns
The children that were inserted.
class TaggedTemplateExpression
class TaggedTemplateExpression extends MemberExpression<ts.TaggedTemplateExpression> {}
method getTag
getTag: () => LeftHandSideExpression;
Gets the tag.
method getTemplate
getTemplate: () => TemplateLiteral;
Gets the template literal.
method removeTag
removeTag: () => TemplateLiteral;
Removes the tag from the tagged template.
Returns
The new template expression.
class TemplateExpression
class TemplateExpression extends TemplateExpressionBase<ts.TemplateExpression> {}
method getHead
getHead: () => TemplateHead;
Gets the template head.
method getTemplateSpans
getTemplateSpans: () => TemplateSpan[];
Gets the template spans.
method setLiteralValue
setLiteralValue: (value: string) => TemplateLiteral;
Sets the literal value.
Note: This could possibly replace the node if you remove all the tagged templates.
Parameter value
Value to set.
Returns
The new node if the kind changed; the current node otherwise.
class TemplateHead
class TemplateHead extends TemplateHeadBase<ts.TemplateHead> {}
class TemplateMiddle
class TemplateMiddle extends TemplateMiddleBase<ts.TemplateMiddle> {}
class TemplateSpan
class TemplateSpan extends TemplateSpanBase<ts.TemplateSpan> {}
method getLiteral
getLiteral: () => TemplateMiddle | TemplateTail;
Gets the template literal.
class TemplateTail
class TemplateTail extends TemplateTailBase<ts.TemplateTail> {}
class TextChange
class TextChange {}
Represents a text change.
property compilerObject
readonly compilerObject: ts.TextChange;
Gets the compiler text change.
method getNewText
getNewText: () => string;
Gets the new text.
method getSpan
getSpan: () => TextSpan;
Gets the text span.
class TextSpan
class TextSpan {}
Represents a span of text.
property compilerObject
readonly compilerObject: ts.TextSpan;
Gets the compiler text span.
method getEnd
getEnd: () => number;
Gets the start + length.
method getLength
getLength: () => number;
Gets the length.
method getStart
getStart: () => number;
Gets the start.
class ThisExpression
class ThisExpression extends ThisExpressionBase<ts.ThisExpression> {}
class ThrowStatement
class ThrowStatement extends ThrowStatementBase<ts.ThrowStatement> {}
method getExpression
getExpression: () => Expression | undefined;
Gets the throw statement's expression.
method getExpressionOrThrow
getExpressionOrThrow: () => Expression;
Gets the throw statement's expression or throws undefined if it doesn't exist.
class TryStatement
class TryStatement extends TryStatementBase<ts.TryStatement> {}
method getCatchClause
getCatchClause: () => CatchClause | undefined;
Gets this try statement's catch clause or undefined if none exists.
method getCatchClauseOrThrow
getCatchClauseOrThrow: () => CatchClause;
Gets this try statement's catch clause or throws if none exists.
method getFinallyBlock
getFinallyBlock: () => Block | undefined;
Gets this try statement's finally block or undefined if none exists.
method getFinallyBlockOrThrow
getFinallyBlockOrThrow: () => Block;
Gets this try statement's finally block or throws if none exists.
method getTryBlock
getTryBlock: () => Block;
Gets this try statement's try block.
class TupleTypeNode
class TupleTypeNode extends TypeNode<ts.TupleTypeNode> {}
method getElementTypeNodes
getElementTypeNodes: () => TypeNode[];
Gets the tuple element type nodes.
class Type
class Type<TType extends ts.Type = ts.Type> {}
constructor
protected constructor();
property compilerType
readonly compilerType: ts.Type;
Gets the underlying compiler type.
method getAliasSymbol
getAliasSymbol: () => Symbol | undefined;
Gets the alias symbol if it exists.
method getAliasSymbolOrThrow
getAliasSymbolOrThrow: () => Symbol;
Gets the alias symbol if it exists, or throws.
method getAliasTypeArguments
getAliasTypeArguments: () => Type[];
Gets the alias type arguments.
method getApparentProperties
getApparentProperties: () => Symbol[];
Gets the apparent properties of the type.
method getApparentProperty
getApparentProperty: { (name: string): Symbol | undefined; (findFunction: (declaration: Symbol) => boolean): Symbol;};
Gets an apparent property.
Parameter name
By a name.
Parameter findFunction
Function for searching for an apparent property.
method getApparentType
getApparentType: () => Type;
Gets the apparent type.
method getArrayType
getArrayType: () => Type<ts.Type> | undefined;
Gets the array type
method getBaseTypeOfLiteralType
getBaseTypeOfLiteralType: () => Type<ts.Type>;
Gets the base type of a literal type.
For example, for a number literal type it will return the number type.
method getBaseTypes
getBaseTypes: () => Type<ts.BaseType>[];
Gets the base types.
method getCallSignatures
getCallSignatures: () => Signature[];
Gets the call signatures.
method getConstraint
getConstraint: () => Type<ts.Type> | undefined;
Gets the constraint or returns undefined if it doesn't exist.
method getConstraintOrThrow
getConstraintOrThrow: () => Type<ts.Type>;
Gets the constraint or throws if it doesn't exist.
method getConstructSignatures
getConstructSignatures: () => Signature[];
Gets the construct signatures.
method getDefault
getDefault: () => Type<ts.Type> | undefined;
Gets the default type or returns undefined if it doesn't exist.
method getDefaultOrThrow
getDefaultOrThrow: () => Type<ts.Type>;
Gets the default type or throws if it doesn't exist.
method getFlags
getFlags: () => TypeFlags;
Gets the type flags.
method getIntersectionTypes
getIntersectionTypes: () => Type[];
Gets the intersection types.
method getNonNullableType
getNonNullableType: () => Type;
Gets the non-nullable type.
method getNumberIndexType
getNumberIndexType: () => Type | undefined;
Gets the number index type.
method getObjectFlags
getObjectFlags: () => ObjectFlags | 0;
Gets the object flags.
Remarks
Returns 0 for a non-object type.
method getProperties
getProperties: () => Symbol[];
Gets the properties of the type.
method getProperty
getProperty: { (name: string): Symbol | undefined; (findFunction: (declaration: Symbol) => boolean): Symbol;};
Gets a property.
Parameter name
By a name.
Parameter findFunction
Function for searching for a property.
method getStringIndexType
getStringIndexType: () => Type | undefined;
Gets the string index type.
method getSymbol
getSymbol: () => Symbol | undefined;
Gets the symbol of the type.
method getSymbolOrThrow
getSymbolOrThrow: () => Symbol;
Gets the symbol of the type or throws.
method getTargetType
getTargetType: () => Type<ts.GenericType> | undefined;
Gets the target type of a type reference if it exists.
method getTargetTypeOrThrow
getTargetTypeOrThrow: () => Type<ts.GenericType>;
Gets the target type of a type reference or throws if it doesn't exist.
method getText
getText: (enclosingNode?: Node, typeFormatFlags?: TypeFormatFlags) => string;
Gets the type text.
Parameter enclosingNode
The enclosing node.
Parameter typeFormatFlags
Format flags for the type text.
method getTupleElements
getTupleElements: () => Type[];
Gets the individual element types of the tuple.
method getTypeArguments
getTypeArguments: () => Type[];
Gets type arguments.
method getUnionTypes
getUnionTypes: () => Type[];
Gets the union types.
method isAnonymous
isAnonymous: () => boolean;
Gets if this is an anonymous type.
method isArray
isArray: () => boolean;
Gets if this is an array type.
method isBoolean
isBoolean: () => boolean;
Gets if this is a boolean type.
method isBooleanLiteral
isBooleanLiteral: () => boolean;
Gets if this is a boolean literal type.
method isClass
isClass: () => boolean;
Gets if this is a class type.
method isClassOrInterface
isClassOrInterface: () => boolean;
Gets if this is a class or interface type.
method isEnum
isEnum: () => boolean;
Gets if this is an enum type.
method isEnumLiteral
isEnumLiteral: () => boolean;
Gets if this is an enum literal type.
method isInterface
isInterface: () => boolean;
Gets if this is an interface type.
method isIntersection
isIntersection: () => boolean;
Gets if this is an intersection type.
method isLiteral
isLiteral: () => boolean;
Gets if this is a literal type.
method isNull
isNull: () => boolean;
Gets if this is the null type.
method isNullable
isNullable: () => boolean;
Gets if the type is possibly null or undefined.
method isNumber
isNumber: () => boolean;
Gets if this is a number type.
method isNumberLiteral
isNumberLiteral: () => boolean;
Gets if this is a number literal type.
method isObject
isObject: () => boolean;
Gets if this is an object type.
method isString
isString: () => boolean;
Gets if this is a string type.
method isStringLiteral
isStringLiteral: () => boolean;
Gets if this is a string literal type.
method isTuple
isTuple: () => boolean;
Gets if this is a tuple type.
method isTypeParameter
isTypeParameter: () => this is TypeParameter;
Gets if this is a type parameter.
method isUndefined
isUndefined: () => boolean;
Gets if this is the undefined type.
method isUnion
isUnion: () => boolean;
Gets if this is a union type.
method isUnionOrIntersection
isUnionOrIntersection: () => boolean;
Gets if this is a union or intersection type.
class TypeAliasDeclaration
class TypeAliasDeclaration extends TypeAliasDeclarationBase<ts.TypeAliasDeclaration> {}
method getStructure
getStructure: () => TypeAliasDeclarationStructure;
Gets the structure equivalent to this node.
method set
set: (structure: Partial<TypeAliasDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class TypeAssertion
class TypeAssertion extends TypeAssertionBase<ts.TypeAssertion> {}
class TypeChecker
class TypeChecker {}
Wrapper around the TypeChecker.
property compilerObject
readonly compilerObject: ts.TypeChecker;
Gets the compiler's TypeChecker.
method getAliasedSymbol
getAliasedSymbol: (symbol: Symbol) => Symbol | undefined;
Gets the aliased symbol of a symbol.
Parameter symbol
Symbol to get the alias symbol of.
method getAmbientModules
getAmbientModules: () => Symbol[];
Gets the ambient module symbols (ex. modules in the folder or node_modules).
method getApparentType
getApparentType: (type: Type) => Type<ts.Type>;
Gets the apparent type of a type.
Parameter type
Type to get the apparent type of.
method getBaseTypeOfLiteralType
getBaseTypeOfLiteralType: (type: Type) => Type<ts.Type>;
Gets the base type of a literal type.
For example, for a number literal type it will return the number type.
Parameter type
Literal type to get the base type of.
method getConstantValue
getConstantValue: (node: EnumMember) => string | number | undefined;
Gets the constant value of a declaration.
Parameter node
Node to get the constant value from.
method getContextualType
getContextualType: (expression: Expression) => Type | undefined;
Gets the contextual type of an expression.
Parameter expression
Expression.
method getDeclaredTypeOfSymbol
getDeclaredTypeOfSymbol: (symbol: Symbol) => Type;
Gets the declared type of a symbol.
Parameter symbol
Symbol to get the type for.
method getExportsOfModule
getExportsOfModule: (moduleSymbol: Symbol) => Symbol[];
Gets the exports of a module.
Parameter moduleSymbol
Module symbol.
method getExportSpecifierLocalTargetSymbol
getExportSpecifierLocalTargetSymbol: ( exportSpecifier: ExportSpecifier) => Symbol | undefined;
Gets the local target symbol of the provided export specifier.
Parameter exportSpecifier
Export specifier.
method getFullyQualifiedName
getFullyQualifiedName: (symbol: Symbol) => string;
Gets the fully qualified name of a symbol.
Parameter symbol
Symbol to get the fully qualified name of.
method getPropertiesOfType
getPropertiesOfType: (type: Type) => Symbol[];
Gets the properties of a type.
Parameter type
Type.
method getReturnTypeOfSignature
getReturnTypeOfSignature: (signature: Signature) => Type;
Gets the return type of a signature.
Parameter signature
Signature to get the return type of.
method getSignatureFromNode
getSignatureFromNode: ( node: Node<ts.SignatureDeclaration>) => Signature | undefined;
Gets a signature from a node.
Parameter node
Node to get the signature from.
method getSymbolAtLocation
getSymbolAtLocation: (node: Node) => Symbol | undefined;
Gets the symbol at the specified location or undefined if none exists.
Parameter node
Node to get the symbol for.
method getTypeAtLocation
getTypeAtLocation: (node: Node) => Type;
Gets the type at the specified location.
Parameter node
Node to get the type for.
method getTypeOfSymbolAtLocation
getTypeOfSymbolAtLocation: (symbol: Symbol, node: Node) => Type;
Gets the type of a symbol at the specified location.
Parameter symbol
Symbol to get the type for.
Parameter node
Location to get the type for.
method getTypeText
getTypeText: ( type: Type, enclosingNode?: Node, typeFormatFlags?: TypeFormatFlags) => string;
Gets the type text
Parameter type
Type to get the text of.
Parameter enclosingNode
Enclosing node.
Parameter typeFormatFlags
Type format flags.
class TypeElement
class TypeElement< TNode extends ts.TypeElement = ts.TypeElement> extends Node<TNode> {}
class TypeGuards
class TypeGuards {}
Type guards for checking the type of a node.
method hasBody
static hasBody: (node: Node) => node is Node<ts.Node> & { getBody(): Node };
Gets if the node has a body.
Parameter node
Node to check.
method hasExpression
static hasExpression: ( node: Node) => node is Node<ts.Node> & { getExpression(): Expression };
Gets if the node has an expression.
Parameter node
Node to check.
method hasName
static hasName: ( node: Node) => node is Node<ts.Node> & { getName(): string; getNameNode(): Node };
Gets if the node has a name.
Parameter node
Node to check.
method isAbstractableNode
static isAbstractableNode: ( node: Node) => node is AbstractableNode & Node<ts.Node> & ModifierableNode;
Gets if the node is an AbstractableNode.
Parameter node
Node to check.
method isAmbientableNode
static isAmbientableNode: ( node: Node) => node is AmbientableNode & Node<ts.Node> & ModifierableNode;
Gets if the node is an AmbientableNode.
Parameter node
Node to check.
method isAnyKeyword
static isAnyKeyword: (node: Node) => node is Expression<ts.Expression>;
Gets if the node is an AnyKeyword.
Parameter node
Node to check.
method isArgumentedNode
static isArgumentedNode: ( node: Node) => node is ArgumentedNode & ArgumentedNodeExtensionType;
Gets if the node is an ArgumentedNode.
Parameter node
Node to check.
method isArrayBindingPattern
static isArrayBindingPattern: (node: Node) => node is ArrayBindingPattern;
Gets if the node is an ArrayBindingPattern.
Parameter node
Node to check.
method isArrayLiteralExpression
static isArrayLiteralExpression: (node: Node) => node is ArrayLiteralExpression;
Gets if the node is an ArrayLiteralExpression.
Parameter node
Node to check.
method isArrayTypeNode
static isArrayTypeNode: (node: Node) => node is ArrayTypeNode;
Gets if the node is an ArrayTypeNode.
Parameter node
Node to check.
method isArrowFunction
static isArrowFunction: (node: Node) => node is ArrowFunction;
Gets if the node is an ArrowFunction.
Parameter node
Node to check.
method isAsExpression
static isAsExpression: (node: Node) => node is AsExpression;
Gets if the node is an AsExpression.
Parameter node
Node to check.
method isAsyncableNode
static isAsyncableNode: ( node: Node) => node is AsyncableNode & Node<ts.Node> & ModifierableNode;
Gets if the node is an AsyncableNode.
Parameter node
Node to check.
method isAwaitableNode
static isAwaitableNode: ( node: Node) => node is AwaitableNode & AwaitableNodeExtensionType;
Gets if the node is an AwaitableNode.
Parameter node
Node to check.
method isAwaitExpression
static isAwaitExpression: (node: Node) => node is AwaitExpression;
Gets if the node is an AwaitExpression.
Parameter node
Node to check.
method isBinaryExpression
static isBinaryExpression: ( node: Node) => node is BinaryExpression<ts.BinaryExpression>;
Gets if the node is a BinaryExpression.
Parameter node
Node to check.
method isBindingElement
static isBindingElement: (node: Node) => node is BindingElement;
Gets if the node is a BindingElement.
Parameter node
Node to check.
method isBindingNamedNode
static isBindingNamedNode: ( node: Node) => node is BindingNamedNode & BindingNamedNodeExtensionType;
Gets if the node is a BindingNamedNode.
Parameter node
Node to check.
method isBlock
static isBlock: (node: Node) => node is Block;
Gets if the node is a Block.
Parameter node
Node to check.
method isBodiedNode
static isBodiedNode: ( node: Node) => node is BodiedNode & BodiedNodeExtensionType;
Gets if the node is a BodiedNode.
Parameter node
Node to check.
method isBodyableNode
static isBodyableNode: ( node: Node) => node is BodyableNode & BodyableNodeExtensionType;
Gets if the node is a BodyableNode.
Parameter node
Node to check.
method isBooleanKeyword
static isBooleanKeyword: (node: Node) => node is Expression<ts.Expression>;
Gets if the node is a BooleanKeyword.
Parameter node
Node to check.
method isBooleanLiteral
static isBooleanLiteral: (node: Node) => node is BooleanLiteral;
Gets if the node is a BooleanLiteral.
Parameter node
Node to check.
method isBreakStatement
static isBreakStatement: (node: Node) => node is BreakStatement;
Gets if the node is a BreakStatement.
Parameter node
Node to check.
method isCallExpression
static isCallExpression: ( node: Node) => node is CallExpression<ts.CallExpression>;
Gets if the node is a CallExpression.
Parameter node
Node to check.
method isCallSignatureDeclaration
static isCallSignatureDeclaration: ( node: Node) => node is CallSignatureDeclaration;
Gets if the node is a CallSignatureDeclaration.
Parameter node
Node to check.
method isCaseBlock
static isCaseBlock: (node: Node) => node is CaseBlock;
Gets if the node is a CaseBlock.
Parameter node
Node to check.
method isCaseClause
static isCaseClause: (node: Node) => node is CaseClause;
Gets if the node is a CaseClause.
Parameter node
Node to check.
method isCatchClause
static isCatchClause: (node: Node) => node is CatchClause;
Gets if the node is a CatchClause.
Parameter node
Node to check.
method isChildOrderableNode
static isChildOrderableNode: ( node: Node) => node is ChildOrderableNode & ChildOrderableNodeExtensionType;
Gets if the node is a ChildOrderableNode.
Parameter node
Node to check.
method isClassDeclaration
static isClassDeclaration: (node: Node) => node is ClassDeclaration;
Gets if the node is a ClassDeclaration.
Parameter node
Node to check.
method isClassExpression
static isClassExpression: (node: Node) => node is ClassExpression;
Gets if the node is a ClassExpression.
Parameter node
Node to check.
method isClassLikeDeclarationBase
static isClassLikeDeclarationBase: ( node: Node) => node is ClassLikeDeclarationBase & ClassLikeDeclarationBaseExtensionType;
Gets if the node is a ClassLikeDeclarationBase.
Parameter node
Node to check.
method isCommaListExpression
static isCommaListExpression: (node: Node) => node is CommaListExpression;
Gets if the node is a CommaListExpression.
Parameter node
Node to check.
method isComputedPropertyName
static isComputedPropertyName: (node: Node) => node is ComputedPropertyName;
Gets if the node is a ComputedPropertyName.
Parameter node
Node to check.
method isConditionalExpression
static isConditionalExpression: (node: Node) => node is ConditionalExpression;
Gets if the node is a ConditionalExpression.
Parameter node
Node to check.
method isConstructorDeclaration
static isConstructorDeclaration: (node: Node) => node is ConstructorDeclaration;
Gets if the node is a ConstructorDeclaration.
Parameter node
Node to check.
method isConstructorTypeNode
static isConstructorTypeNode: (node: Node) => node is ConstructorTypeNode;
Gets if the node is a ConstructorTypeNode.
Parameter node
Node to check.
method isConstructSignatureDeclaration
static isConstructSignatureDeclaration: ( node: Node) => node is ConstructSignatureDeclaration;
Gets if the node is a ConstructSignatureDeclaration.
Parameter node
Node to check.
method isContinueStatement
static isContinueStatement: (node: Node) => node is ContinueStatement;
Gets if the node is a ContinueStatement.
Parameter node
Node to check.
method isDebuggerStatement
static isDebuggerStatement: (node: Node) => node is DebuggerStatement;
Gets if the node is a DebuggerStatement.
Parameter node
Node to check.
method isDeclarationNamedNode
static isDeclarationNamedNode: ( node: Node) => node is DeclarationNamedNode & DeclarationNamedNodeExtensionType;
Gets if the node is a DeclarationNamedNode.
Parameter node
Node to check.
method isDecoratableNode
static isDecoratableNode: ( node: Node) => node is DecoratableNode & DecoratableNodeExtensionType;
Gets if the node is a DecoratableNode.
Parameter node
Node to check.
method isDecorator
static isDecorator: (node: Node) => node is Decorator;
Gets if the node is a Decorator.
Parameter node
Node to check.
method isDefaultClause
static isDefaultClause: (node: Node) => node is DefaultClause;
Gets if the node is a DefaultClause.
Parameter node
Node to check.
method isDeleteExpression
static isDeleteExpression: (node: Node) => node is DeleteExpression;
Gets if the node is a DeleteExpression.
Parameter node
Node to check.
method isDoStatement
static isDoStatement: (node: Node) => node is DoStatement;
Gets if the node is a DoStatement.
Parameter node
Node to check.
method isElementAccessExpression
static isElementAccessExpression: ( node: Node) => node is ElementAccessExpression<ts.ElementAccessExpression>;
Gets if the node is an ElementAccessExpression.
Parameter node
Node to check.
method isEmptyStatement
static isEmptyStatement: (node: Node) => node is EmptyStatement;
Gets if the node is an EmptyStatement.
Parameter node
Node to check.
method isEnumDeclaration
static isEnumDeclaration: (node: Node) => node is EnumDeclaration;
Gets if the node is an EnumDeclaration.
Parameter node
Node to check.
method isEnumMember
static isEnumMember: (node: Node) => node is EnumMember;
Gets if the node is an EnumMember.
Parameter node
Node to check.
method isExclamationTokenableNode
static isExclamationTokenableNode: ( node: Node) => node is ExclamationTokenableNode & ExclamationTokenableNodeExtensionType;
Gets if the node is an ExclamationTokenableNode.
Parameter node
Node to check.
method isExportableNode
static isExportableNode: ( node: Node) => node is ExportableNode & Node<ts.Node> & ModifierableNode;
Gets if the node is an ExportableNode.
Parameter node
Node to check.
method isExportAssignment
static isExportAssignment: (node: Node) => node is ExportAssignment;
Gets if the node is an ExportAssignment.
Parameter node
Node to check.
method isExportDeclaration
static isExportDeclaration: (node: Node) => node is ExportDeclaration;
Gets if the node is an ExportDeclaration.
Parameter node
Node to check.
method isExportSpecifier
static isExportSpecifier: (node: Node) => node is ExportSpecifier;
Gets if the node is an ExportSpecifier.
Parameter node
Node to check.
method isExpression
static isExpression: (node: Node) => node is Expression<ts.Expression>;
Gets if the node is an Expression.
Parameter node
Node to check.
method isExpressionedNode
static isExpressionedNode: ( node: Node) => node is ExpressionedNode & ExpressionedNodeExtensionType;
Gets if the node is an ExpressionedNode.
Parameter node
Node to check.
method isExpressionStatement
static isExpressionStatement: (node: Node) => node is ExpressionStatement;
Gets if the node is an ExpressionStatement.
Parameter node
Node to check.
method isExpressionWithTypeArguments
static isExpressionWithTypeArguments: ( node: Node) => node is ExpressionWithTypeArguments;
Gets if the node is an ExpressionWithTypeArguments.
Parameter node
Node to check.
method isExtendsClauseableNode
static isExtendsClauseableNode: ( node: Node) => node is ExtendsClauseableNode & Node<ts.Node> & HeritageClauseableNode;
Gets if the node is an ExtendsClauseableNode.
Parameter node
Node to check.
method isExternalModuleReference
static isExternalModuleReference: ( node: Node) => node is ExternalModuleReference;
Gets if the node is an ExternalModuleReference.
Parameter node
Node to check.
method isFalseKeyword
static isFalseKeyword: (node: Node) => node is BooleanLiteral;
Gets if the node is a FalseKeyword.
Parameter node
Node to check.
method isForInStatement
static isForInStatement: (node: Node) => node is ForInStatement;
Gets if the node is a ForInStatement.
Parameter node
Node to check.
method isForOfStatement
static isForOfStatement: (node: Node) => node is ForOfStatement;
Gets if the node is a ForOfStatement.
Parameter node
Node to check.
method isForStatement
static isForStatement: (node: Node) => node is ForStatement;
Gets if the node is a ForStatement.
Parameter node
Node to check.
method isFunctionDeclaration
static isFunctionDeclaration: (node: Node) => node is FunctionDeclaration;
Gets if the node is a FunctionDeclaration.
Parameter node
Node to check.
method isFunctionExpression
static isFunctionExpression: (node: Node) => node is FunctionExpression;
Gets if the node is a FunctionExpression.
Parameter node
Node to check.
method isFunctionLikeDeclaration
static isFunctionLikeDeclaration: ( node: Node) => node is FunctionLikeDeclaration & FunctionLikeDeclarationExtensionType;
Gets if the node is a FunctionLikeDeclaration.
Parameter node
Node to check.
method isFunctionOrConstructorTypeNodeBase
static isFunctionOrConstructorTypeNodeBase: ( node: Node) => node is FunctionOrConstructorTypeNodeBase<ts.FunctionOrConstructorTypeNode>;
Gets if the node is a FunctionOrConstructorTypeNodeBase.
Parameter node
Node to check.
method isFunctionTypeNode
static isFunctionTypeNode: (node: Node) => node is FunctionTypeNode;
Gets if the node is a FunctionTypeNode.
Parameter node
Node to check.
method isGeneratorableNode
static isGeneratorableNode: ( node: Node) => node is GeneratorableNode & GeneratorableNodeExtensionType;
Gets if the node is a GeneratorableNode.
Parameter node
Node to check.
method isGetAccessorDeclaration
static isGetAccessorDeclaration: (node: Node) => node is GetAccessorDeclaration;
Gets if the node is a GetAccessorDeclaration.
Parameter node
Node to check.
method isHeritageClause
static isHeritageClause: (node: Node) => node is HeritageClause;
Gets if the node is a HeritageClause.
Parameter node
Node to check.
method isHeritageClauseableNode
static isHeritageClauseableNode: ( node: Node) => node is HeritageClauseableNode & HeritageClauseableNodeExtensionType;
Gets if the node is a HeritageClauseableNode.
Parameter node
Node to check.
method isIdentifier
static isIdentifier: (node: Node) => node is Identifier;
Gets if the node is a Identifier.
Parameter node
Node to check.
method isIfStatement
static isIfStatement: (node: Node) => node is IfStatement;
Gets if the node is a IfStatement.
Parameter node
Node to check.
method isImplementsClauseableNode
static isImplementsClauseableNode: ( node: Node) => node is ImplementsClauseableNode & Node<ts.Node> & HeritageClauseableNode;
Gets if the node is a ImplementsClauseableNode.
Parameter node
Node to check.
method isImportClause
static isImportClause: (node: Node) => node is ImportClause;
Gets if the node is a ImportClause.
Parameter node
Node to check.
method isImportDeclaration
static isImportDeclaration: (node: Node) => node is ImportDeclaration;
Gets if the node is a ImportDeclaration.
Parameter node
Node to check.
method isImportEqualsDeclaration
static isImportEqualsDeclaration: ( node: Node) => node is ImportEqualsDeclaration;
Gets if the node is a ImportEqualsDeclaration.
Parameter node
Node to check.
method isImportExpression
static isImportExpression: (node: Node) => node is ImportExpression;
Gets if the node is a ImportExpression.
Parameter node
Node to check.
method isImportSpecifier
static isImportSpecifier: (node: Node) => node is ImportSpecifier;
Gets if the node is a ImportSpecifier.
Parameter node
Node to check.
method isImportTypeNode
static isImportTypeNode: (node: Node) => node is ImportTypeNode;
Gets if the node is a ImportTypeNode.
Parameter node
Node to check.
method isIndexSignatureDeclaration
static isIndexSignatureDeclaration: ( node: Node) => node is IndexSignatureDeclaration;
Gets if the node is a IndexSignatureDeclaration.
Parameter node
Node to check.
method isInitializerExpressionableNode
static isInitializerExpressionableNode: ( node: Node) => node is InitializerExpressionableNode & InitializerExpressionableNodeExtensionType;
Gets if the node is a InitializerExpressionableNode.
Parameter node
Node to check.
method isInitializerGetExpressionableNode
static isInitializerGetExpressionableNode: ( node: Node) => node is InitializerGetExpressionableNode & InitializerGetExpressionableNodeExtensionType;
Gets if the node is a InitializerGetExpressionableNode.
Parameter node
Node to check.
method isInitializerSetExpressionableNode
static isInitializerSetExpressionableNode: ( node: Node) => node is InitializerSetExpressionableNode & Node<any> & InitializerGetExpressionableNode;
Gets if the node is a InitializerSetExpressionableNode.
Parameter node
Node to check.
method isInterfaceDeclaration
static isInterfaceDeclaration: (node: Node) => node is InterfaceDeclaration;
Gets if the node is a InterfaceDeclaration.
Parameter node
Node to check.
method isIntersectionTypeNode
static isIntersectionTypeNode: (node: Node) => node is IntersectionTypeNode;
Gets if the node is a IntersectionTypeNode.
Parameter node
Node to check.
method isIterationStatement
static isIterationStatement: ( node: Node) => node is IterationStatement<ts.IterationStatement>;
Gets if the node is a IterationStatement.
Parameter node
Node to check.
method isJSDoc
static isJSDoc: (node: Node) => node is JSDoc;
Gets if the node is a JSDoc.
Parameter node
Node to check.
method isJSDocableNode
static isJSDocableNode: ( node: Node) => node is JSDocableNode & JSDocableNodeExtensionType;
Gets if the node is a JSDocableNode.
Parameter node
Node to check.
method isJSDocAugmentsTag
static isJSDocAugmentsTag: (node: Node) => node is JSDocAugmentsTag;
Gets if the node is a JSDocAugmentsTag.
Parameter node
Node to check.
method isJSDocClassTag
static isJSDocClassTag: (node: Node) => node is JSDocClassTag;
Gets if the node is a JSDocClassTag.
Parameter node
Node to check.
method isJSDocParameterTag
static isJSDocParameterTag: (node: Node) => node is JSDocParameterTag;
Gets if the node is a JSDocParameterTag.
Parameter node
Node to check.
method isJSDocPropertyLikeTag
static isJSDocPropertyLikeTag: ( node: Node) => node is JSDocPropertyLikeTag & Node<ts.JSDocPropertyLikeTag> & JSDocTag<ts.JSDocTag>;
Gets if the node is a JSDocPropertyLikeTag.
Parameter node
Node to check.
method isJSDocPropertyTag
static isJSDocPropertyTag: (node: Node) => node is JSDocPropertyTag;
Gets if the node is a JSDocPropertyTag.
Parameter node
Node to check.
method isJSDocReturnTag
static isJSDocReturnTag: (node: Node) => node is JSDocReturnTag;
Gets if the node is a JSDocReturnTag.
Parameter node
Node to check.
method isJSDocTag
static isJSDocTag: (node: Node) => node is JSDocTag<ts.JSDocTag>;
Gets if the node is a JSDocTag.
Parameter node
Node to check.
method isJSDocTypedefTag
static isJSDocTypedefTag: (node: Node) => node is JSDocTypedefTag;
Gets if the node is a JSDocTypedefTag.
Parameter node
Node to check.
method isJSDocTypeTag
static isJSDocTypeTag: (node: Node) => node is JSDocTypeTag;
Gets if the node is a JSDocTypeTag.
Parameter node
Node to check.
method isJSDocUnknownTag
static isJSDocUnknownTag: (node: Node) => node is JSDocUnknownTag;
Gets if the node is a JSDocUnknownTag.
Parameter node
Node to check.
method isJsxAttribute
static isJsxAttribute: (node: Node) => node is JsxAttribute;
Gets if the node is a JsxAttribute.
Parameter node
Node to check.
method isJsxAttributedNode
static isJsxAttributedNode: ( node: Node) => node is JsxAttributedNode & Node<any> & JsxTagNamedNode;
Gets if the node is a JsxAttributedNode.
Parameter node
Node to check.
method isJsxClosingElement
static isJsxClosingElement: (node: Node) => node is JsxClosingElement;
Gets if the node is a JsxClosingElement.
Parameter node
Node to check.
method isJsxClosingFragment
static isJsxClosingFragment: (node: Node) => node is JsxClosingFragment;
Gets if the node is a JsxClosingFragment.
Parameter node
Node to check.
method isJsxElement
static isJsxElement: (node: Node) => node is JsxElement;
Gets if the node is a JsxElement.
Parameter node
Node to check.
method isJsxExpression
static isJsxExpression: (node: Node) => node is JsxExpression;
Gets if the node is a JsxExpression.
Parameter node
Node to check.
method isJsxFragment
static isJsxFragment: (node: Node) => node is JsxFragment;
Gets if the node is a JsxFragment.
Parameter node
Node to check.
method isJsxOpeningElement
static isJsxOpeningElement: (node: Node) => node is JsxOpeningElement;
Gets if the node is a JsxOpeningElement.
Parameter node
Node to check.
method isJsxOpeningFragment
static isJsxOpeningFragment: (node: Node) => node is JsxOpeningFragment;
Gets if the node is a JsxOpeningFragment.
Parameter node
Node to check.
method isJsxSelfClosingElement
static isJsxSelfClosingElement: (node: Node) => node is JsxSelfClosingElement;
Gets if the node is a JsxSelfClosingElement.
Parameter node
Node to check.
method isJsxSpreadAttribute
static isJsxSpreadAttribute: (node: Node) => node is JsxSpreadAttribute;
Gets if the node is a JsxSpreadAttribute.
Parameter node
Node to check.
method isJsxTagNamedNode
static isJsxTagNamedNode: ( node: Node) => node is JsxTagNamedNode & JsxTagNamedNodeExtensionType;
Gets if the node is a JsxTagNamedNode.
Parameter node
Node to check.
method isJsxText
static isJsxText: (node: Node) => node is JsxText;
Gets if the node is a JsxText.
Parameter node
Node to check.
method isLabeledStatement
static isLabeledStatement: (node: Node) => node is LabeledStatement;
Gets if the node is a LabeledStatement.
Parameter node
Node to check.
method isLeftHandSideExpression
static isLeftHandSideExpression: ( node: Node) => node is LeftHandSideExpression<ts.LeftHandSideExpression>;
Gets if the node is a LeftHandSideExpression.
Parameter node
Node to check.
method isLeftHandSideExpressionedNode
static isLeftHandSideExpressionedNode: ( node: Node) => node is LeftHandSideExpressionedNode & LeftHandSideExpressionedNodeExtensionType;
Gets if the node is a LeftHandSideExpressionedNode.
Parameter node
Node to check.
method isLiteralExpression
static isLiteralExpression: ( node: Node) => node is LiteralExpression<ts.LiteralExpression>;
Gets if the node is a LiteralExpression.
Parameter node
Node to check.
method isLiteralLikeNode
static isLiteralLikeNode: ( node: Node) => node is LiteralLikeNode & LiteralLikeNodeExtensionType;
Gets if the node is a LiteralLikeNode.
Parameter node
Node to check.
method isLiteralTypeNode
static isLiteralTypeNode: (node: Node) => node is LiteralTypeNode;
Gets if the node is a LiteralTypeNode.
Parameter node
Node to check.
method isMemberExpression
static isMemberExpression: ( node: Node) => node is MemberExpression<ts.MemberExpression>;
Gets if the node is a MemberExpression.
Parameter node
Node to check.
method isMetaProperty
static isMetaProperty: (node: Node) => node is MetaProperty;
Gets if the node is a MetaProperty.
Parameter node
Node to check.
method isMethodDeclaration
static isMethodDeclaration: (node: Node) => node is MethodDeclaration;
Gets if the node is a MethodDeclaration.
Parameter node
Node to check.
method isMethodSignature
static isMethodSignature: (node: Node) => node is MethodSignature;
Gets if the node is a MethodSignature.
Parameter node
Node to check.
method isModifierableNode
static isModifierableNode: ( node: Node) => node is ModifierableNode & ModifierableNodeExtensionType;
Gets if the node is a ModifierableNode.
Parameter node
Node to check.
method isModuleBlock
static isModuleBlock: (node: Node) => node is ModuleBlock;
Gets if the node is a ModuleBlock.
Parameter node
Node to check.
method isModuledNode
static isModuledNode: ( node: Node) => node is ModuledNode & Node<any> & StatementedNode;
Gets if the node is a ModuledNode.
Parameter node
Node to check.
method isNameableNode
static isNameableNode: ( node: Node) => node is NameableNode & NameableNodeExtensionType;
Gets if the node is a NameableNode.
Parameter node
Node to check.
method isNamedExports
static isNamedExports: (node: Node) => node is NamedExports;
Gets if the node is a NamedExports.
Parameter node
Node to check.
method isNamedImports
static isNamedImports: (node: Node) => node is NamedImports;
Gets if the node is a NamedImports.
Parameter node
Node to check.
method isNamedNode
static isNamedNode: (node: Node) => node is NamedNode & NamedNodeExtensionType;
Gets if the node is a NamedNode.
Parameter node
Node to check.
method isNamespaceChildableNode
static isNamespaceChildableNode: ( node: Node) => node is NamespaceChildableNode & NamespaceChildableNodeExtensionType;
Gets if the node is a NamespaceChildableNode.
Parameter node
Node to check.
method isNamespaceDeclaration
static isNamespaceDeclaration: (node: Node) => node is NamespaceDeclaration;
Gets if the node is a NamespaceDeclaration.
Parameter node
Node to check.
method isNamespaceImport
static isNamespaceImport: (node: Node) => node is NamespaceImport;
Gets if the node is a NamespaceImport.
Parameter node
Node to check.
method isNeverKeyword
static isNeverKeyword: (node: Node) => node is Expression<ts.Expression>;
Gets if the node is a NeverKeyword.
Parameter node
Node to check.
method isNewExpression
static isNewExpression: (node: Node) => node is NewExpression;
Gets if the node is a NewExpression.
Parameter node
Node to check.
method isNonNullExpression
static isNonNullExpression: (node: Node) => node is NonNullExpression;
Gets if the node is a NonNullExpression.
Parameter node
Node to check.
method isNoSubstitutionTemplateLiteral
static isNoSubstitutionTemplateLiteral: ( node: Node) => node is NoSubstitutionTemplateLiteral;
Gets if the node is a NoSubstitutionTemplateLiteral.
Parameter node
Node to check.
method isNotEmittedStatement
static isNotEmittedStatement: (node: Node) => node is NotEmittedStatement;
Gets if the node is a NotEmittedStatement.
Parameter node
Node to check.
method isNullLiteral
static isNullLiteral: (node: Node) => node is NullLiteral;
Gets if the node is a NullLiteral.
Parameter node
Node to check.
method isNumberKeyword
static isNumberKeyword: (node: Node) => node is Expression<ts.Expression>;
Gets if the node is a NumberKeyword.
Parameter node
Node to check.
method isNumericLiteral
static isNumericLiteral: (node: Node) => node is NumericLiteral;
Gets if the node is a NumericLiteral.
Parameter node
Node to check.
method isObjectBindingPattern
static isObjectBindingPattern: (node: Node) => node is ObjectBindingPattern;
Gets if the node is a ObjectBindingPattern.
Parameter node
Node to check.
method isObjectKeyword
static isObjectKeyword: (node: Node) => node is Expression<ts.Expression>;
Gets if the node is a ObjectKeyword.
Parameter node
Node to check.
method isObjectLiteralExpression
static isObjectLiteralExpression: ( node: Node) => node is ObjectLiteralExpression;
Gets if the node is a ObjectLiteralExpression.
Parameter node
Node to check.
method isOmittedExpression
static isOmittedExpression: (node: Node) => node is OmittedExpression;
Gets if the node is a OmittedExpression.
Parameter node
Node to check.
method isOverloadableNode
static isOverloadableNode: ( node: Node) => node is OverloadableNode & Node<ts.Node> & BodyableNode;
Gets if the node is a OverloadableNode.
Parameter node
Node to check.
method isParameterDeclaration
static isParameterDeclaration: (node: Node) => node is ParameterDeclaration;
Gets if the node is a ParameterDeclaration.
Parameter node
Node to check.
method isParameteredNode
static isParameteredNode: ( node: Node) => node is ParameteredNode & ParameteredNodeExtensionType;
Gets if the node is a ParameteredNode.
Parameter node
Node to check.
method isParenthesizedExpression
static isParenthesizedExpression: ( node: Node) => node is ParenthesizedExpression;
Gets if the node is a ParenthesizedExpression.
Parameter node
Node to check.
method isParenthesizedTypeNode
static isParenthesizedTypeNode: (node: Node) => node is ParenthesizedTypeNode;
Gets if the node is a ParenthesizedTypeNode.
Parameter node
Node to check.
method isPartiallyEmittedExpression
static isPartiallyEmittedExpression: ( node: Node) => node is PartiallyEmittedExpression;
Gets if the node is a PartiallyEmittedExpression.
Parameter node
Node to check.
method isPostfixUnaryExpression
static isPostfixUnaryExpression: (node: Node) => node is PostfixUnaryExpression;
Gets if the node is a PostfixUnaryExpression.
Parameter node
Node to check.
method isPrefixUnaryExpression
static isPrefixUnaryExpression: (node: Node) => node is PrefixUnaryExpression;
Gets if the node is a PrefixUnaryExpression.
Parameter node
Node to check.
method isPrimaryExpression
static isPrimaryExpression: ( node: Node) => node is PrimaryExpression<ts.PrimaryExpression>;
Gets if the node is a PrimaryExpression.
Parameter node
Node to check.
method isPropertyAccessExpression
static isPropertyAccessExpression: ( node: Node) => node is PropertyAccessExpression<ts.PropertyAccessExpression>;
Gets if the node is a PropertyAccessExpression.
Parameter node
Node to check.
method isPropertyAssignment
static isPropertyAssignment: (node: Node) => node is PropertyAssignment;
Gets if the node is a PropertyAssignment.
Parameter node
Node to check.
method isPropertyDeclaration
static isPropertyDeclaration: (node: Node) => node is PropertyDeclaration;
Gets if the node is a PropertyDeclaration.
Parameter node
Node to check.
method isPropertyNamedNode
static isPropertyNamedNode: ( node: Node) => node is PropertyNamedNode & PropertyNamedNodeExtensionType;
Gets if the node is a PropertyNamedNode.
Parameter node
Node to check.
method isPropertySignature
static isPropertySignature: (node: Node) => node is PropertySignature;
Gets if the node is a PropertySignature.
Parameter node
Node to check.
method isQualifiedName
static isQualifiedName: (node: Node) => node is QualifiedName;
Gets if the node is a QualifiedName.
Parameter node
Node to check.
method isQuestionTokenableNode
static isQuestionTokenableNode: ( node: Node) => node is QuestionTokenableNode & QuestionTokenableNodeExtensionType;
Gets if the node is a QuestionTokenableNode.
Parameter node
Node to check.
method isReadonlyableNode
static isReadonlyableNode: ( node: Node) => node is ReadonlyableNode & Node<ts.Node> & ModifierableNode;
Gets if the node is a ReadonlyableNode.
Parameter node
Node to check.
method isReferenceFindableNode
static isReferenceFindableNode: ( node: Node) => node is ReferenceFindableNode & ReferenceFindableNodeExtensionType;
Gets if the node is a ReferenceFindableNode.
Parameter node
Node to check.
method isRegularExpressionLiteral
static isRegularExpressionLiteral: ( node: Node) => node is RegularExpressionLiteral;
Gets if the node is a RegularExpressionLiteral.
Parameter node
Node to check.
method isRenameableNode
static isRenameableNode: ( node: Node) => node is RenameableNode & RenameableNodeExtensionType;
Gets if the node is a RenameableNode.
Parameter node
Node to check.
method isReturnStatement
static isReturnStatement: (node: Node) => node is ReturnStatement;
Gets if the node is a ReturnStatement.
Parameter node
Node to check.
method isReturnTypedNode
static isReturnTypedNode: ( node: Node) => node is ReturnTypedNode & ReturnTypedNodeExtensionType;
Gets if the node is a ReturnTypedNode.
Parameter node
Node to check.
method isScopeableNode
static isScopeableNode: ( node: Node) => node is ScopeableNode & Node<ts.Node> & ModifierableNode;
Gets if the node is a ScopeableNode.
Parameter node
Node to check.
method isScopedNode
static isScopedNode: ( node: Node) => node is ScopedNode & Node<ts.Node> & ModifierableNode;
Gets if the node is a ScopedNode.
Parameter node
Node to check.
method isSemicolonToken
static isSemicolonToken: (node: Node) => node is Node<ts.Node>;
Gets if the node is a SemicolonToken.
Parameter node
Node to check.
method isSetAccessorDeclaration
static isSetAccessorDeclaration: (node: Node) => node is SetAccessorDeclaration;
Gets if the node is a SetAccessorDeclaration.
Parameter node
Node to check.
method isShorthandPropertyAssignment
static isShorthandPropertyAssignment: ( node: Node) => node is ShorthandPropertyAssignment;
Gets if the node is a ShorthandPropertyAssignment.
Parameter node
Node to check.
method isSignaturedDeclaration
static isSignaturedDeclaration: ( node: Node) => node is SignaturedDeclaration & SignaturedDeclarationExtensionType;
Gets if the node is a SignaturedDeclaration.
Parameter node
Node to check.
method isSourceFile
static isSourceFile: (node: Node) => node is SourceFile;
Gets if the node is a SourceFile.
Parameter node
Node to check.
method isSpreadAssignment
static isSpreadAssignment: (node: Node) => node is SpreadAssignment;
Gets if the node is a SpreadAssignment.
Parameter node
Node to check.
method isSpreadElement
static isSpreadElement: (node: Node) => node is SpreadElement;
Gets if the node is a SpreadElement.
Parameter node
Node to check.
method isStatement
static isStatement: (node: Node) => node is Statement<ts.Statement>;
Gets if the node is a Statement.
Parameter node
Node to check.
method isStatementedNode
static isStatementedNode: ( node: Node) => node is StatementedNode & StatementedNodeExtensionType;
Gets if the node is a StatementedNode.
Parameter node
Node to check.
method isStaticableNode
static isStaticableNode: ( node: Node) => node is StaticableNode & Node<ts.Node> & ModifierableNode;
Gets if the node is a StaticableNode.
Parameter node
Node to check.
method isStringKeyword
static isStringKeyword: (node: Node) => node is Expression<ts.Expression>;
Gets if the node is a StringKeyword.
Parameter node
Node to check.
method isStringLiteral
static isStringLiteral: (node: Node) => node is StringLiteral;
Gets if the node is a StringLiteral.
Parameter node
Node to check.
method isSuperExpression
static isSuperExpression: (node: Node) => node is SuperExpression;
Gets if the node is a SuperExpression.
Parameter node
Node to check.
method isSwitchStatement
static isSwitchStatement: (node: Node) => node is SwitchStatement;
Gets if the node is a SwitchStatement.
Parameter node
Node to check.
method isSymbolKeyword
static isSymbolKeyword: (node: Node) => node is Expression<ts.Expression>;
Gets if the node is a SymbolKeyword.
Parameter node
Node to check.
method isSyntaxList
static isSyntaxList: (node: Node) => node is SyntaxList;
Gets if the node is a SyntaxList.
Parameter node
Node to check.
method isTaggedTemplateExpression
static isTaggedTemplateExpression: ( node: Node) => node is TaggedTemplateExpression;
Gets if the node is a TaggedTemplateExpression.
Parameter node
Node to check.
method isTemplateExpression
static isTemplateExpression: (node: Node) => node is TemplateExpression;
Gets if the node is a TemplateExpression.
Parameter node
Node to check.
method isTemplateHead
static isTemplateHead: (node: Node) => node is TemplateHead;
Gets if the node is a TemplateHead.
Parameter node
Node to check.
method isTemplateMiddle
static isTemplateMiddle: (node: Node) => node is TemplateMiddle;
Gets if the node is a TemplateMiddle.
Parameter node
Node to check.
method isTemplateSpan
static isTemplateSpan: (node: Node) => node is TemplateSpan;
Gets if the node is a TemplateSpan.
Parameter node
Node to check.
method isTemplateTail
static isTemplateTail: (node: Node) => node is TemplateTail;
Gets if the node is a TemplateTail.
Parameter node
Node to check.
method isTextInsertableNode
static isTextInsertableNode: ( node: Node) => node is TextInsertableNode & TextInsertableNodeExtensionType;
Gets if the node is a TextInsertableNode.
Parameter node
Node to check.
method isThisExpression
static isThisExpression: (node: Node) => node is ThisExpression;
Gets if the node is a ThisExpression.
Parameter node
Node to check.
method isThrowStatement
static isThrowStatement: (node: Node) => node is ThrowStatement;
Gets if the node is a ThrowStatement.
Parameter node
Node to check.
method isTrueKeyword
static isTrueKeyword: (node: Node) => node is BooleanLiteral;
Gets if the node is a TrueKeyword.
Parameter node
Node to check.
method isTryStatement
static isTryStatement: (node: Node) => node is TryStatement;
Gets if the node is a TryStatement.
Parameter node
Node to check.
method isTupleTypeNode
static isTupleTypeNode: (node: Node) => node is TupleTypeNode;
Gets if the node is a TupleTypeNode.
Parameter node
Node to check.
method isTypeAliasDeclaration
static isTypeAliasDeclaration: (node: Node) => node is TypeAliasDeclaration;
Gets if the node is a TypeAliasDeclaration.
Parameter node
Node to check.
method isTypeArgumentedNode
static isTypeArgumentedNode: ( node: Node) => node is TypeArgumentedNode & TypeArgumentedNodeExtensionType;
Gets if the node is a TypeArgumentedNode.
Parameter node
Node to check.
method isTypeAssertion
static isTypeAssertion: (node: Node) => node is TypeAssertion;
Gets if the node is a TypeAssertion.
Parameter node
Node to check.
method isTypedNode
static isTypedNode: (node: Node) => node is TypedNode & TypedNodeExtensionType;
Gets if the node is a TypedNode.
Parameter node
Node to check.
method isTypeElement
static isTypeElement: (node: Node) => node is TypeElement<ts.TypeElement>;
Gets if the node is a TypeElement.
Parameter node
Node to check.
method isTypeElementMemberedNode
static isTypeElementMemberedNode: ( node: Node) => node is TypeElementMemberedNode & TypeElementMemberedNodeExtensionType;
Gets if the node is a TypeElementMemberedNode.
Parameter node
Node to check.
method isTypeLiteralNode
static isTypeLiteralNode: (node: Node) => node is TypeLiteralNode;
Gets if the node is a TypeLiteralNode.
Parameter node
Node to check.
method isTypeNode
static isTypeNode: (node: Node) => node is TypeNode<ts.TypeNode>;
Gets if the node is a TypeNode.
Parameter node
Node to check.
method isTypeOfExpression
static isTypeOfExpression: (node: Node) => node is TypeOfExpression;
Gets if the node is a TypeOfExpression.
Parameter node
Node to check.
method isTypeParameterDeclaration
static isTypeParameterDeclaration: ( node: Node) => node is TypeParameterDeclaration;
Gets if the node is a TypeParameterDeclaration.
Parameter node
Node to check.
method isTypeParameteredNode
static isTypeParameteredNode: ( node: Node) => node is TypeParameteredNode & TypeParameteredNodeExtensionType;
Gets if the node is a TypeParameteredNode.
Parameter node
Node to check.
method isTypeReferenceNode
static isTypeReferenceNode: (node: Node) => node is TypeReferenceNode;
Gets if the node is a TypeReferenceNode.
Parameter node
Node to check.
method isUnaryExpression
static isUnaryExpression: ( node: Node) => node is UnaryExpression<ts.UnaryExpression>;
Gets if the node is a UnaryExpression.
Parameter node
Node to check.
method isUnaryExpressionedNode
static isUnaryExpressionedNode: ( node: Node) => node is UnaryExpressionedNode & UnaryExpressionedNodeExtensionType;
Gets if the node is a UnaryExpressionedNode.
Parameter node
Node to check.
method isUndefinedKeyword
static isUndefinedKeyword: (node: Node) => node is Expression<ts.Expression>;
Gets if the node is a UndefinedKeyword.
Parameter node
Node to check.
method isUnionTypeNode
static isUnionTypeNode: (node: Node) => node is UnionTypeNode;
Gets if the node is a UnionTypeNode.
Parameter node
Node to check.
method isUnwrappableNode
static isUnwrappableNode: ( node: Node) => node is UnwrappableNode & UnwrappableNodeExtensionType;
Gets if the node is a UnwrappableNode.
Parameter node
Node to check.
method isUpdateExpression
static isUpdateExpression: ( node: Node) => node is UpdateExpression<ts.UpdateExpression>;
Gets if the node is a UpdateExpression.
Parameter node
Node to check.
method isVariableDeclaration
static isVariableDeclaration: (node: Node) => node is VariableDeclaration;
Gets if the node is a VariableDeclaration.
Parameter node
Node to check.
method isVariableDeclarationList
static isVariableDeclarationList: ( node: Node) => node is VariableDeclarationList;
Gets if the node is a VariableDeclarationList.
Parameter node
Node to check.
method isVariableStatement
static isVariableStatement: (node: Node) => node is VariableStatement;
Gets if the node is a VariableStatement.
Parameter node
Node to check.
method isVoidExpression
static isVoidExpression: (node: Node) => node is VoidExpression;
Gets if the node is a VoidExpression.
Parameter node
Node to check.
method isWhileStatement
static isWhileStatement: (node: Node) => node is WhileStatement;
Gets if the node is a WhileStatement.
Parameter node
Node to check.
method isWithStatement
static isWithStatement: (node: Node) => node is WithStatement;
Gets if the node is a WithStatement.
Parameter node
Node to check.
method isYieldExpression
static isYieldExpression: (node: Node) => node is YieldExpression;
Gets if the node is a YieldExpression.
Parameter node
Node to check.
class TypeLiteralNode
class TypeLiteralNode extends TypeLiteralNodeBase<ts.TypeLiteralNode> {}
class TypeNode
class TypeNode<T extends ts.TypeNode = ts.TypeNode> extends Node<T> {}
class TypeOfExpression
class TypeOfExpression extends TypeOfExpressionBase<ts.TypeOfExpression> {}
class TypeParameter
class TypeParameter extends Type<ts.TypeParameter> {}
method getConstraint
getConstraint: () => Type | undefined;
Gets the constraint type.
method getConstraintOrThrow
getConstraintOrThrow: () => Type;
Gets the constraint or throws if it doesn't exist.
method getDefault
getDefault: () => Type | undefined;
Gets the default type or undefined if it doesn't exist.
method getDefaultOrThrow
getDefaultOrThrow: () => Type;
Gets the default type or throws if it doesn't exist.
class TypeParameterDeclaration
class TypeParameterDeclaration extends TypeParameterDeclarationBase<ts.TypeParameterDeclaration> {}
method getConstraint
getConstraint: () => TypeNode | undefined;
Gets the constraint of the type parameter.
method getConstraintOrThrow
getConstraintOrThrow: () => TypeNode<ts.TypeNode>;
Gets the constraint of the type parameter or throws if it doesn't exist.
method getDefault
getDefault: () => TypeNode | undefined;
Gets the default node of the type parameter.
method getDefaultOrThrow
getDefaultOrThrow: () => TypeNode<ts.TypeNode>;
Gets the default node of the type parameter or throws if it doesn't exist.
method getStructure
getStructure: () => TypeParameterDeclarationStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes this type parameter.
method removeConstraint
removeConstraint: () => this;
Removes the constraint type node.
method removeDefault
removeDefault: () => this;
Removes the default type node.
method set
set: (structure: Partial<TypeParameterDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setConstraint
setConstraint: (text: string | WriterFunction) => this;
Sets the type parameter constraint.
Parameter text
Text to set as the constraint.
method setDefault
setDefault: (text: string | WriterFunction) => this;
Sets the type parameter default type node.
Parameter text
Text to set as the default type node.
class TypeReferenceNode
class TypeReferenceNode extends TypeNode<ts.TypeReferenceNode> {}
method getTypeArguments
getTypeArguments: () => TypeNode[];
Gets the type arguments.
method getTypeName
getTypeName: () => EntityName;
Gets the type name.
class UnaryExpression
class UnaryExpression< T extends ts.UnaryExpression = ts.UnaryExpression> extends Expression<T> {}
class UnionTypeNode
class UnionTypeNode extends TypeNode<ts.UnionTypeNode> {}
method getTypeNodes
getTypeNodes: () => TypeNode[];
Gets the union type nodes.
class UpdateExpression
class UpdateExpression< T extends ts.UpdateExpression = ts.UpdateExpression> extends UnaryExpression<T> {}
class VariableDeclaration
class VariableDeclaration extends VariableDeclarationBase<ts.VariableDeclaration> {}
method getStructure
getStructure: () => VariableDeclarationStructure;
Gets the structure equivalent to this node.
method remove
remove: () => void;
Removes this variable declaration.
method set
set: (structure: Partial<VariableDeclarationStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
class VariableDeclarationList
class VariableDeclarationList extends VariableDeclarationListBase<ts.VariableDeclarationList> {}
method addDeclaration
addDeclaration: (structure: VariableDeclarationStructure) => VariableDeclaration;
Add a variable declaration to the statement.
Parameter structure
Structure representing the variable declaration to add.
method addDeclarations
addDeclarations: ( structures: ReadonlyArray<VariableDeclarationStructure>) => VariableDeclaration[];
Adds variable declarations to the statement.
Parameter structures
Structures representing the variable declarations to add.
method getDeclarationKind
getDeclarationKind: () => VariableDeclarationKind;
Gets the variable declaration kind.
method getDeclarationKindKeyword
getDeclarationKindKeyword: () => Node;
Gets the variable declaration kind keyword.
method getDeclarations
getDeclarations: () => VariableDeclaration[];
Get the variable declarations.
method getStructure
getStructure: () => VariableDeclarationListStructure;
Gets the structure equivalent to this node.
method insertDeclaration
insertDeclaration: ( index: number, structure: VariableDeclarationStructure) => VariableDeclaration;
Inserts a variable declaration at the specified index within the statement.
Parameter index
Child index to insert at.
Parameter structure
Structure representing the variable declaration to insert.
method insertDeclarations
insertDeclarations: ( index: number, structures: ReadonlyArray<VariableDeclarationStructure>) => VariableDeclaration[];
Inserts variable declarations at the specified index within the statement.
Parameter index
Child index to insert at.
Parameter structures
Structures representing the variable declarations to insert.
method set
set: (structure: Partial<VariableDeclarationListStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setDeclarationKind
setDeclarationKind: (type: VariableDeclarationKind) => this;
Sets the variable declaration kind.
Parameter type
Type to set.
class VariableStatement
class VariableStatement extends VariableStatementBase<ts.VariableStatement> {}
method addDeclaration
addDeclaration: (structure: VariableDeclarationStructure) => VariableDeclaration;
Add a variable declaration to the statement.
Parameter structure
Structure representing the variable declaration to add.
method addDeclarations
addDeclarations: ( structures: ReadonlyArray<VariableDeclarationStructure>) => VariableDeclaration[];
Adds variable declarations to the statement.
Parameter structures
Structures representing the variable declarations to add.
method getDeclarationKind
getDeclarationKind: () => VariableDeclarationKind;
Gets the variable declaration kind.
method getDeclarationKindKeyword
getDeclarationKindKeyword: () => Node<ts.Node>;
Gets the variable declaration kind keyword.
method getDeclarationList
getDeclarationList: () => VariableDeclarationList;
Get variable declaration list.
method getDeclarations
getDeclarations: () => VariableDeclaration[];
Get the variable declarations.
method getStructure
getStructure: () => VariableStatementStructure;
Gets the structure equivalent to this node.
method insertDeclaration
insertDeclaration: ( index: number, structure: VariableDeclarationStructure) => VariableDeclaration;
Inserts a variable declaration at the specified index within the statement.
Parameter index
Child index to insert at.
Parameter structure
Structure representing the variable declaration to insert.
method insertDeclarations
insertDeclarations: ( index: number, structures: ReadonlyArray<VariableDeclarationStructure>) => VariableDeclaration[];
Inserts variable declarations at the specified index within the statement.
Parameter index
Child index to insert at.
Parameter structures
Structures representing the variable declarations to insert.
method set
set: (structure: Partial<VariableStatementStructure>) => this;
Sets the node from a structure.
Parameter structure
Structure to set the node with.
method setDeclarationKind
setDeclarationKind: (type: VariableDeclarationKind) => VariableDeclarationList;
Sets the variable declaration kind.
Parameter type
Type to set.
class VoidExpression
class VoidExpression extends VoidExpressionBase<ts.VoidExpression> {}
class WhileStatement
class WhileStatement extends WhileStatementBase<ts.WhileStatement> {}
method getExpression
getExpression: () => Expression;
Gets this while statement's expression.
class WithStatement
class WithStatement extends WithStatementBase<ts.WithStatement> {}
method getExpression
getExpression: () => Expression;
Gets this with statement's expression.
method getStatement
getStatement: () => Statement;
Gets this with statement's statement.
class WriterFunctions
class WriterFunctions {}
Functions for writing.
Remarks
These functions are currently very experimental.
method object
static object: (obj: { [key: string]: string | number | WriterFunction;}) => WriterFunction;
Gets a writer function for writing the provided object as an object literal expression.
Parameter obj
Object to write.
class YieldExpression
class YieldExpression extends YieldExpressionBase<ts.YieldExpression> {}
method getExpression
getExpression: () => Expression | undefined;
Gets the expression or undefined of the yield expression.
method getExpressionOrThrow
getExpressionOrThrow: () => Expression<ts.Expression>;
Gets the expression of the yield expression or throws if it does not exist.
Interfaces
interface AbstractableNode
interface AbstractableNode {}
method getAbstractKeyword
getAbstractKeyword: () => Node | undefined;
Gets the abstract keyword or undefined if it doesn't exist.
method getAbstractKeywordOrThrow
getAbstractKeywordOrThrow: () => Node;
Gets the abstract keyword or throws if it doesn't exist.
method isAbstract
isAbstract: () => boolean;
Gets if the node is abstract.
method setIsAbstract
setIsAbstract: (isAbstract: boolean) => this;
Sets if the node is abstract.
Parameter isAbstract
If it should be abstract or not.
interface AbstractableNodeStructure
interface AbstractableNodeStructure {}
property isAbstract
isAbstract?: boolean;
interface AmbientableNode
interface AmbientableNode {}
method getDeclareKeyword
getDeclareKeyword: () => Node | undefined;
Gets the declare keyword or undefined if none exists.
method getDeclareKeywordOrThrow
getDeclareKeywordOrThrow: () => Node;
Gets the declare keyword or throws if it doesn't exist.
method hasDeclareKeyword
hasDeclareKeyword: () => boolean;
If the node has the declare keyword.
method isAmbient
isAmbient: () => boolean;
Gets if the node is ambient.
method setHasDeclareKeyword
setHasDeclareKeyword: (value?: boolean) => this;
Sets if this node has a declare keyword.
Parameter value
To add the declare keyword or not.
interface AmbientableNodeStructure
interface AmbientableNodeStructure {}
property hasDeclareKeyword
hasDeclareKeyword?: boolean;
interface ArgumentedNode
interface ArgumentedNode {}
method addArgument
addArgument: (argumentText: string | WriterFunction) => Node;
Adds an argument.
Parameter argumentText
Argument text to add.
method addArguments
addArguments: ( argumentTexts: ReadonlyArray<string | WriterFunction> | WriterFunction) => Node[];
Adds arguments.
Parameter argumentTexts
Argument texts to add.
method getArguments
getArguments: () => Node[];
Gets all the arguments of the node.
method insertArgument
insertArgument: (index: number, argumentText: string | WriterFunction) => Node;
Inserts an argument.
Parameter index
Child index to insert at.
Parameter argumentText
Argument text to insert.
method insertArguments
insertArguments: ( index: number, argumentTexts: ReadonlyArray<string | WriterFunction> | WriterFunction) => Node[];
Inserts arguments.
Parameter index
Child index to insert at.
Parameter argumentTexts
Argument texts to insert.
method removeArgument
removeArgument: { (arg: Node): this; (index: number): this };
Removes an argument.
Parameter arg
Argument to remove.
Removes an argument.
Parameter index
Index to remove.
interface AsyncableNode
interface AsyncableNode {}
method getAsyncKeyword
getAsyncKeyword: () => Node<ts.Modifier> | undefined;
Gets the async keyword or undefined if none exists.
method getAsyncKeywordOrThrow
getAsyncKeywordOrThrow: () => Node<ts.Modifier>;
Gets the async keyword or throws if none exists.
method isAsync
isAsync: () => boolean;
If it's async.
method setIsAsync
setIsAsync: (value: boolean) => this;
Sets if the node is async.
Parameter value
If it should be async or not.
interface AsyncableNodeStructure
interface AsyncableNodeStructure {}
property isAsync
isAsync?: boolean;
interface AwaitableNode
interface AwaitableNode {}
method getAwaitKeyword
getAwaitKeyword: () => Node<ts.AwaitKeywordToken> | undefined;
Gets the await token or undefined if none exists.
method getAwaitKeywordOrThrow
getAwaitKeywordOrThrow: () => Node<ts.AwaitKeywordToken>;
Gets the await token or throws if none exists.
method isAwaited
isAwaited: () => boolean;
If it's an awaited node.
method setIsAwaited
setIsAwaited: (value: boolean) => this;
Sets if the node is awaited.
Parameter value
If it should be awaited or not.
interface AwaitableNodeStructure
interface AwaitableNodeStructure {}
property isAwaited
isAwaited?: boolean;
interface BindingNamedNode
interface BindingNamedNode extends BindingNamedNodeSpecific, ReferenceFindableNode, RenameableNode {}
interface BindingNamedNodeStructure
interface BindingNamedNodeStructure {}
property name
name: string;
interface BodiedNode
interface BodiedNode {}
method getBody
getBody: () => Node;
Gets the body.
method getBodyText
getBodyText: () => string;
Gets the body text without leading whitespace, leading indentation, or trailing whitespace.
method setBodyText
setBodyText: (textOrWriterFunction: string | WriterFunction) => this;
Sets the body text.
Parameter textOrWriterFunction
Text or writer function to set as the body.
interface BodiedNodeStructure
interface BodiedNodeStructure {}
property bodyText
bodyText?: string | WriterFunction;
interface BodyableNode
interface BodyableNode {}
method addBody
addBody: () => this;
Adds a body if it doesn't exists.
method getBody
getBody: () => Node | undefined;
Gets the body if it exists.
method getBodyOrThrow
getBodyOrThrow: () => Node;
Gets the body or throws an error if it doesn't exist.
method getBodyText
getBodyText: () => string | undefined;
Gets the body text without leading whitespace, leading indentation, or trailing whitespace. Returns undefined if there is no body.
method hasBody
hasBody: () => boolean;
Gets if the node has a body.
method removeBody
removeBody: () => this;
Removes the body if it exists.
method setBodyText
setBodyText: (textOrWriterFunction: string | WriterFunction) => this;
Sets the body text. A body is required to do this operation.
Parameter textOrWriterFunction
Text or writer function to set as the body.
interface BodyableNodeStructure
interface BodyableNodeStructure {}
property bodyText
bodyText?: string | WriterFunction;
interface CallSignatureDeclarationStructure
interface CallSignatureDeclarationStructure extends CallSignatureDeclarationSpecificStructure, JSDocableNodeStructure, SignaturedDeclarationStructure, TypeParameteredNodeStructure {}
interface ChildOrderableNode
interface ChildOrderableNode {}
method setOrder
setOrder: (order: number) => this;
Sets the child order of the node within the parent.
interface ClassDeclarationStructure
interface ClassDeclarationStructure extends ClassLikeDeclarationBaseStructure, ClassDeclarationSpecificStructure, AmbientableNodeStructure, ExportableNodeStructure {}
property name
name?: string;
The class name.
Remarks
Can be undefined. For example:
export default class { ... }
interface ClassLikeDeclarationBase
interface ClassLikeDeclarationBase extends NameableNode, TextInsertableNode, ImplementsClauseableNode, HeritageClauseableNode, AbstractableNode, JSDocableNode, TypeParameteredNode, DecoratableNode, ModifierableNode, ClassLikeDeclarationBaseSpecific {}
interface ClassLikeDeclarationBaseStructure
interface ClassLikeDeclarationBaseStructure extends NameableNodeStructure, ClassLikeDeclarationBaseSpecificStructure, ImplementsClauseableNodeStructure, DecoratableNodeStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, AbstractableNodeStructure {}
interface CodeBlockWriterOptions
interface CodeBlockWriterOptions {}
property indentNumberOfSpaces
indentNumberOfSpaces: number;
property newLine
newLine: string;
property useSingleQuote
useSingleQuote: boolean;
property useTabs
useTabs: boolean;
interface CompilerOptionsFromTsConfigOptions
interface CompilerOptionsFromTsConfigOptions {}
property encoding
encoding?: string;
property fileSystem
fileSystem?: FileSystemHost;
interface CompilerOptionsFromTsConfigResult
interface CompilerOptionsFromTsConfigResult {}
interface ConstructorDeclarationOverloadStructure
interface ConstructorDeclarationOverloadStructure extends ScopedNodeStructure, SignaturedDeclarationStructure, TypeParameteredNodeStructure, JSDocableNodeStructure {}
interface ConstructorDeclarationStructure
interface ConstructorDeclarationStructure extends ConstructorDeclarationSpecificStructure, ScopedNodeStructure, FunctionLikeDeclarationStructure, BodyableNodeStructure {}
interface ConstructSignatureDeclarationStructure
interface ConstructSignatureDeclarationStructure extends ConstructSignatureDeclarationSpecificStructure, JSDocableNodeStructure, SignaturedDeclarationStructure, TypeParameteredNodeStructure {}
interface CreateWrappedNodeOptions
interface CreateWrappedNodeOptions {}
property compilerOptions
compilerOptions?: CompilerOptions;
Compiler options.
property sourceFile
sourceFile?: ts.SourceFile;
Optional source file of the node. Will make it not bother going up the tree to find the source file.
property typeChecker
typeChecker?: ts.TypeChecker;
Type checker.
interface DeclarationNamedNode
interface DeclarationNamedNode extends DeclarationNamedNodeSpecific, ReferenceFindableNode, RenameableNode {}
interface DeclarationNamedNodeSpecific
interface DeclarationNamedNodeSpecific {}
method getName
getName: () => string | undefined;
Gets the name.
method getNameNode
getNameNode: () => Identifier | undefined;
Gets the name node.
method getNameNodeOrThrow
getNameNodeOrThrow: () => Identifier;
Gets the name node or throws an error if it doesn't exists.
method getNameOrThrow
getNameOrThrow: () => string;
Gets the name or throws if it doens't exist.
interface DeclarationNamedNodeStructure
interface DeclarationNamedNodeStructure {}
property name
name?: string;
interface DecoratableNode
interface DecoratableNode {}
method addDecorator
addDecorator: (structure: DecoratorStructure) => Decorator;
Adds a decorator.
Parameter structure
Structure of the decorator.
method addDecorators
addDecorators: (structures: ReadonlyArray<DecoratorStructure>) => Decorator[];
Adds decorators.
Parameter structures
Structures of the decorators.
method getDecorator
getDecorator: { (name: string): Decorator | undefined; (findFunction: (declaration: Decorator) => boolean): Decorator;};
Gets a decorator or undefined if it doesn't exist.
Parameter name
Name of the parameter.
Gets a decorator or undefined if it doesn't exist.
Parameter findFunction
Function to use to find the parameter.
method getDecoratorOrThrow
getDecoratorOrThrow: { (name: string): Decorator; (findFunction: (declaration: Decorator) => boolean): Decorator;};
Gets a decorator or throws if it doesn't exist.
Parameter name
Name of the parameter.
Gets a decorator or throws if it doesn't exist.
Parameter findFunction
Function to use to find the parameter.
method getDecorators
getDecorators: () => Decorator[];
Gets all the decorators of the node.
method insertDecorator
insertDecorator: (index: number, structure: DecoratorStructure) => Decorator;
Inserts a decorator.
Parameter index
Child index to insert at. Specify a negative index to insert from the reverse.
Parameter structure
Structure of the decorator.
method insertDecorators
insertDecorators: ( index: number, structures: ReadonlyArray<DecoratorStructure>) => Decorator[];
Insert decorators.
Parameter index
Child index to insert at.
Parameter structures
Structures to insert.
interface DecoratableNodeStructure
interface DecoratableNodeStructure {}
property decorators
decorators?: DecoratorStructure[];
interface DecoratorStructure
interface DecoratorStructure {}
property arguments
arguments?: (string | WriterFunction)[] | WriterFunction;
Arguments for a decorator factory.
Remarks
Provide an empty array to make the structure a decorator factory.
property name
name: string;
property typeArguments
typeArguments?: string[];
interface DirectoryAddOptions
interface DirectoryAddOptions {}
property recursive
recursive?: boolean;
Whether to also recursively add all the directory's descendant directories.
Remarks
Defaults to false.
interface DirectoryCopyOptions
interface DirectoryCopyOptions extends SourceFileCopyOptions {}
property includeUntrackedFiles
includeUntrackedFiles?: boolean;
Includes all the files in the directory and sub-directory when copying.
Remarks
- Defaults to true.
interface DirectoryMoveOptions
interface DirectoryMoveOptions extends SourceFileMoveOptions {}
interface EmitOptions
interface EmitOptions extends EmitOptionsBase {}
Options for emitting.
property targetSourceFile
targetSourceFile?: SourceFile;
Optional source file to only emit.
interface EmitOptionsBase
interface EmitOptionsBase {}
property customTransformers
customTransformers?: ts.CustomTransformers;
Transformers to act on the files when emitting.
property emitOnlyDtsFiles
emitOnlyDtsFiles?: boolean;
Whether only .d.ts files should be emitted.
interface EnumDeclarationStructure
interface EnumDeclarationStructure extends NamedNodeStructure, EnumDeclarationSpecificStructure, JSDocableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure {}
interface EnumMemberStructure
interface EnumMemberStructure extends EnumMemberSpecificStructure, PropertyNamedNodeStructure, JSDocableNodeStructure, InitializerExpressionableNodeStructure {}
interface ExclamationTokenableNode
interface ExclamationTokenableNode {}
method getExclamationTokenNode
getExclamationTokenNode: () => Node<ts.ExclamationToken> | undefined;
Gets the exclamation token node or returns undefined if it doesn't exist.
method getExclamationTokenNodeOrThrow
getExclamationTokenNodeOrThrow: () => Node<ts.ExclamationToken>;
Gets the exclamation token node or throws.
method hasExclamationToken
hasExclamationToken: () => boolean;
If it has a exclamation token.
method setHasExclamationToken
setHasExclamationToken: (value: boolean) => this;
Sets if this node has a exclamation token.
Parameter value
If it should have a exclamation token or not.
interface ExclamationTokenableNodeStructure
interface ExclamationTokenableNodeStructure {}
property hasExclamationToken
hasExclamationToken?: boolean;
interface ExportableNode
interface ExportableNode {}
method getDefaultKeyword
getDefaultKeyword: () => Node | undefined;
Gets the default keyword or undefined if none exists.
method getDefaultKeywordOrThrow
getDefaultKeywordOrThrow: () => Node;
Gets the default keyword or throws if none exists.
method getExportKeyword
getExportKeyword: () => Node | undefined;
Gets the export keyword or undefined if none exists.
method getExportKeywordOrThrow
getExportKeywordOrThrow: () => Node;
Gets the export keyword or throws if none exists.
method hasDefaultKeyword
hasDefaultKeyword: () => boolean;
If the node has the default keyword.
method hasExportKeyword
hasExportKeyword: () => boolean;
If the node has the export keyword.
method isDefaultExport
isDefaultExport: () => boolean;
Gets if this node is a default export of a file.
method isExported
isExported: () => boolean;
Gets if the node is exported from a namespace, is a default export, or is a named export.
method isNamedExport
isNamedExport: () => boolean;
Gets if this node is a named export of a file.
method setIsDefaultExport
setIsDefaultExport: (value: boolean) => this;
Sets if this node is a default export of a file.
Parameter value
If it should be a default export or not.
method setIsExported
setIsExported: (value: boolean) => this;
Sets if the node is exported.
Note: Will remove the default keyword if set.
Parameter value
If it should be exported or not.
interface ExportableNodeStructure
interface ExportableNodeStructure {}
property isDefaultExport
isDefaultExport?: boolean;
property isExported
isExported?: boolean;
interface ExportAssignmentStructure
interface ExportAssignmentStructure {}
property expression
expression: string | WriterFunction;
property isExportEquals
isExportEquals?: boolean;
interface ExportDeclarationStructure
interface ExportDeclarationStructure {}
property moduleSpecifier
moduleSpecifier?: string;
property namedExports
namedExports?: | (string | ExportSpecifierStructure | WriterFunction)[] | WriterFunction;
interface ExportSpecifierStructure
interface ExportSpecifierStructure {}
interface ExpressionedNode
interface ExpressionedNode {}
method getExpression
getExpression: () => Expression;
Gets the expression.
method setExpression
setExpression: (textOrWriterFunction: string | WriterFunction) => this;
Sets the expression.
Parameter textOrWriterFunction
Text to set the expression with.
interface ExpressionedNodeStructure
interface ExpressionedNodeStructure {}
property expression
expression: string | WriterFunction;
interface ExtendsClauseableNode
interface ExtendsClauseableNode {}
method addExtends
addExtends: { ( texts: ReadonlyArray<string | WriterFunction> | WriterFunction ): ExpressionWithTypeArguments[]; (text: string): ExpressionWithTypeArguments;};
Adds multiple extends clauses.
Parameter texts
Texts to add for the extends clause.
Adds an extends clause.
Parameter text
Text to add for the extends clause.
method getExtends
getExtends: () => ExpressionWithTypeArguments[];
Gets the extends clauses.
method insertExtends
insertExtends: { ( index: number, texts: ReadonlyArray<string | WriterFunction> | WriterFunction ): ExpressionWithTypeArguments[]; (index: number, text: string): ExpressionWithTypeArguments;};
Inserts multiple extends clauses.
Parameter texts
Texts to insert for the extends clause.
Inserts an extends clause.
Parameter text
Text to insert for the extends clause.
method removeExtends
removeExtends: { (index: number): this; (extendsNode: ExpressionWithTypeArguments): this;};
Removes the extends at the specified index.
Parameter index
Index to remove.
Removes the specified extends.
Parameter extendsNode
Node of the extend to remove.
interface ExtendsClauseableNodeStructure
interface ExtendsClauseableNodeStructure {}
property extends
extends?: (string | WriterFunction)[] | WriterFunction;
interface FileSystemHost
interface FileSystemHost {}
method copy
copy: (srcPath: string, destPath: string) => Promise<void>;
method copySync
copySync: (srcPath: string, destPath: string) => void;
method delete
delete: (path: string) => Promise<void>;
method deleteSync
deleteSync: (path: string) => void;
method directoryExists
directoryExists: (dirPath: string) => Promise<boolean>;
method directoryExistsSync
directoryExistsSync: (dirPath: string) => boolean;
method fileExists
fileExists: (filePath: string) => Promise<boolean>;
method fileExistsSync
fileExistsSync: (filePath: string) => boolean;
method getCurrentDirectory
getCurrentDirectory: () => string;
method glob
glob: (patterns: ReadonlyArray<string>) => string[];
method mkdir
mkdir: (dirPath: string) => Promise<void>;
method mkdirSync
mkdirSync: (dirPath: string) => void;
method move
move: (srcPath: string, destPath: string) => Promise<void>;
method moveSync
moveSync: (srcPath: string, destPath: string) => void;
method readDirSync
readDirSync: (dirPath: string) => string[];
method readFile
readFile: (filePath: string, encoding?: string) => Promise<string>;
method readFileSync
readFileSync: (filePath: string, encoding?: string) => string;
method writeFile
writeFile: (filePath: string, fileText: string) => Promise<void>;
method writeFileSync
writeFileSync: (filePath: string, fileText: string) => void;
interface ForEachChildTraversalControl
interface ForEachChildTraversalControl {}
method stop
stop: () => void;
Stops traversal.
interface ForEachDescendantTraversalControl
interface ForEachDescendantTraversalControl extends ForEachChildTraversalControl {}
interface FormatCodeSettings
interface FormatCodeSettings extends ts.FormatCodeSettings {}
property ensureNewLineAtEndOfFile
ensureNewLineAtEndOfFile?: boolean;
interface FunctionDeclarationOverloadStructure
interface FunctionDeclarationOverloadStructure extends SignaturedDeclarationStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, AsyncableNodeStructure, GeneratorableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure {}
interface FunctionDeclarationStructure
interface FunctionDeclarationStructure extends FunctionDeclarationSpecificStructure, NameableNodeStructure, FunctionLikeDeclarationStructure, StatementedNodeStructure, AsyncableNodeStructure, GeneratorableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure, BodyableNodeStructure {}
interface FunctionLikeDeclaration
interface FunctionLikeDeclaration extends JSDocableNode, TypeParameteredNode, SignaturedDeclaration, StatementedNode, ModifierableNode {}
interface FunctionLikeDeclarationStructure
interface FunctionLikeDeclarationStructure extends SignaturedDeclarationStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, StatementedNodeStructure {}
interface GeneratorableNode
interface GeneratorableNode {}
method getAsteriskToken
getAsteriskToken: () => Node<ts.AsteriskToken> | undefined;
Gets the asterisk token or undefined if none exists.
method getAsteriskTokenOrThrow
getAsteriskTokenOrThrow: () => Node<ts.AsteriskToken>;
Gets the asterisk token or throws if none exists.
method isGenerator
isGenerator: () => boolean;
If it's a generator function.
method setIsGenerator
setIsGenerator: (value: boolean) => this;
Sets if the node is a generator.
Parameter value
If it should be a generator or not.
interface GeneratorableNodeStructure
interface GeneratorableNodeStructure {}
property isGenerator
isGenerator?: boolean;
interface GetAccessorDeclarationStructure
interface GetAccessorDeclarationStructure extends GetAccessorDeclarationSpecificStructure, PropertyNamedNodeStructure, StaticableNodeStructure, DecoratableNodeStructure, AbstractableNodeStructure, ScopedNodeStructure, FunctionLikeDeclarationStructure, BodyableNodeStructure {}
interface HeritageClauseableNode
interface HeritageClauseableNode {}
method getHeritageClauseByKind
getHeritageClauseByKind: ( kind: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword) => HeritageClause | undefined;
Gets the heritage clause by kind. - Kind of heritage clause.
method getHeritageClauseByKindOrThrow
getHeritageClauseByKindOrThrow: ( kind: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword) => HeritageClause;
Gets the heritage clause by kind or throws if it doesn't exist. - Kind of heritage clause.
method getHeritageClauses
getHeritageClauses: () => HeritageClause[];
Gets the heritage clauses of the node.
interface ImplementedKindToNodeMappings
interface ImplementedKindToNodeMappings {}
property [SyntaxKind.AnyKeyword]
[SyntaxKind.AnyKeyword]: Expression;
property [SyntaxKind.ArrayBindingPattern]
[SyntaxKind.ArrayBindingPattern]: ArrayBindingPattern;
property [SyntaxKind.ArrayLiteralExpression]
[SyntaxKind.ArrayLiteralExpression]: ArrayLiteralExpression;
property [SyntaxKind.ArrayType]
[SyntaxKind.ArrayType]: ArrayTypeNode;
property [SyntaxKind.ArrowFunction]
[SyntaxKind.ArrowFunction]: ArrowFunction;
property [SyntaxKind.AsExpression]
[SyntaxKind.AsExpression]: AsExpression;
property [SyntaxKind.AwaitExpression]
[SyntaxKind.AwaitExpression]: AwaitExpression;
property [SyntaxKind.BinaryExpression]
[SyntaxKind.BinaryExpression]: BinaryExpression;
property [SyntaxKind.BindingElement]
[SyntaxKind.BindingElement]: BindingElement;
property [SyntaxKind.Block]
[SyntaxKind.Block]: Block;
property [SyntaxKind.BooleanKeyword]
[SyntaxKind.BooleanKeyword]: Expression;
property [SyntaxKind.BreakStatement]
[SyntaxKind.BreakStatement]: BreakStatement;
property [SyntaxKind.CallExpression]
[SyntaxKind.CallExpression]: CallExpression;
property [SyntaxKind.CallSignature]
[SyntaxKind.CallSignature]: CallSignatureDeclaration;
property [SyntaxKind.CaseBlock]
[SyntaxKind.CaseBlock]: CaseBlock;
property [SyntaxKind.CaseClause]
[SyntaxKind.CaseClause]: CaseClause;
property [SyntaxKind.CatchClause]
[SyntaxKind.CatchClause]: CatchClause;
property [SyntaxKind.ClassDeclaration]
[SyntaxKind.ClassDeclaration]: ClassDeclaration;
property [SyntaxKind.ClassExpression]
[SyntaxKind.ClassExpression]: ClassExpression;
property [SyntaxKind.CommaListExpression]
[SyntaxKind.CommaListExpression]: CommaListExpression;
property [SyntaxKind.ComputedPropertyName]
[SyntaxKind.ComputedPropertyName]: ComputedPropertyName;
property [SyntaxKind.ConditionalExpression]
[SyntaxKind.ConditionalExpression]: ConditionalExpression;
property [SyntaxKind.Constructor]
[SyntaxKind.Constructor]: ConstructorDeclaration;
property [SyntaxKind.ConstructorType]
[SyntaxKind.ConstructorType]: ConstructorTypeNode;
property [SyntaxKind.ConstructSignature]
[SyntaxKind.ConstructSignature]: ConstructSignatureDeclaration;
property [SyntaxKind.ContinueStatement]
[SyntaxKind.ContinueStatement]: ContinueStatement;
property [SyntaxKind.DebuggerStatement]
[SyntaxKind.DebuggerStatement]: DebuggerStatement;
property [SyntaxKind.Decorator]
[SyntaxKind.Decorator]: Decorator;
property [SyntaxKind.DefaultClause]
[SyntaxKind.DefaultClause]: DefaultClause;
property [SyntaxKind.DeleteExpression]
[SyntaxKind.DeleteExpression]: DeleteExpression;
property [SyntaxKind.DoStatement]
[SyntaxKind.DoStatement]: DoStatement;
property [SyntaxKind.ElementAccessExpression]
[SyntaxKind.ElementAccessExpression]: ElementAccessExpression;
property [SyntaxKind.EmptyStatement]
[SyntaxKind.EmptyStatement]: EmptyStatement;
property [SyntaxKind.EnumDeclaration]
[SyntaxKind.EnumDeclaration]: EnumDeclaration;
property [SyntaxKind.EnumMember]
[SyntaxKind.EnumMember]: EnumMember;
property [SyntaxKind.ExportAssignment]
[SyntaxKind.ExportAssignment]: ExportAssignment;
property [SyntaxKind.ExportDeclaration]
[SyntaxKind.ExportDeclaration]: ExportDeclaration;
property [SyntaxKind.ExportSpecifier]
[SyntaxKind.ExportSpecifier]: ExportSpecifier;
property [SyntaxKind.ExpressionStatement]
[SyntaxKind.ExpressionStatement]: ExpressionStatement;
property [SyntaxKind.ExpressionWithTypeArguments]
[SyntaxKind.ExpressionWithTypeArguments]: ExpressionWithTypeArguments;
property [SyntaxKind.ExternalModuleReference]
[SyntaxKind.ExternalModuleReference]: ExternalModuleReference;
property [SyntaxKind.FalseKeyword]
[SyntaxKind.FalseKeyword]: BooleanLiteral;
property [SyntaxKind.FirstJSDocTagNode]
[SyntaxKind.FirstJSDocTagNode]: JSDocUnknownTag;
property [SyntaxKind.FirstLiteralToken]
[SyntaxKind.FirstLiteralToken]: NumericLiteral;
property [SyntaxKind.FirstNode]
[SyntaxKind.FirstNode]: QualifiedName;
property [SyntaxKind.FirstTemplateToken]
[SyntaxKind.FirstTemplateToken]: NoSubstitutionTemplateLiteral;
property [SyntaxKind.FirstTypeNode]
[SyntaxKind.FirstTypeNode]: TypeNode;
property [SyntaxKind.ForInStatement]
[SyntaxKind.ForInStatement]: ForInStatement;
property [SyntaxKind.ForOfStatement]
[SyntaxKind.ForOfStatement]: ForOfStatement;
property [SyntaxKind.ForStatement]
[SyntaxKind.ForStatement]: ForStatement;
property [SyntaxKind.FunctionDeclaration]
[SyntaxKind.FunctionDeclaration]: FunctionDeclaration;
property [SyntaxKind.FunctionExpression]
[SyntaxKind.FunctionExpression]: FunctionExpression;
property [SyntaxKind.FunctionType]
[SyntaxKind.FunctionType]: FunctionTypeNode;
property [SyntaxKind.GetAccessor]
[SyntaxKind.GetAccessor]: GetAccessorDeclaration;
property [SyntaxKind.HeritageClause]
[SyntaxKind.HeritageClause]: HeritageClause;
property [SyntaxKind.Identifier]
[SyntaxKind.Identifier]: Identifier;
property [SyntaxKind.IfStatement]
[SyntaxKind.IfStatement]: IfStatement;
property [SyntaxKind.ImportClause]
[SyntaxKind.ImportClause]: ImportClause;
property [SyntaxKind.ImportDeclaration]
[SyntaxKind.ImportDeclaration]: ImportDeclaration;
property [SyntaxKind.ImportEqualsDeclaration]
[SyntaxKind.ImportEqualsDeclaration]: ImportEqualsDeclaration;
property [SyntaxKind.ImportKeyword]
[SyntaxKind.ImportKeyword]: ImportExpression;
property [SyntaxKind.ImportSpecifier]
[SyntaxKind.ImportSpecifier]: ImportSpecifier;
property [SyntaxKind.ImportType]
[SyntaxKind.ImportType]: ImportTypeNode;
property [SyntaxKind.IndexSignature]
[SyntaxKind.IndexSignature]: IndexSignatureDeclaration;
property [SyntaxKind.InterfaceDeclaration]
[SyntaxKind.InterfaceDeclaration]: InterfaceDeclaration;
property [SyntaxKind.IntersectionType]
[SyntaxKind.IntersectionType]: IntersectionTypeNode;
property [SyntaxKind.JSDocAugmentsTag]
[SyntaxKind.JSDocAugmentsTag]: JSDocAugmentsTag;
property [SyntaxKind.JSDocClassTag]
[SyntaxKind.JSDocClassTag]: JSDocClassTag;
property [SyntaxKind.JSDocComment]
[SyntaxKind.JSDocComment]: JSDoc;
property [SyntaxKind.JSDocParameterTag]
[SyntaxKind.JSDocParameterTag]: JSDocParameterTag;
property [SyntaxKind.JSDocPropertyTag]
[SyntaxKind.JSDocPropertyTag]: JSDocPropertyTag;
property [SyntaxKind.JSDocReturnTag]
[SyntaxKind.JSDocReturnTag]: JSDocReturnTag;
property [SyntaxKind.JSDocTag]
[SyntaxKind.JSDocTag]: JSDocUnknownTag;
property [SyntaxKind.JSDocTypedefTag]
[SyntaxKind.JSDocTypedefTag]: JSDocTypedefTag;
property [SyntaxKind.JSDocTypeTag]
[SyntaxKind.JSDocTypeTag]: JSDocTypeTag;
property [SyntaxKind.JsxAttribute]
[SyntaxKind.JsxAttribute]: JsxAttribute;
property [SyntaxKind.JsxClosingElement]
[SyntaxKind.JsxClosingElement]: JsxClosingElement;
property [SyntaxKind.JsxClosingFragment]
[SyntaxKind.JsxClosingFragment]: JsxClosingFragment;
property [SyntaxKind.JsxElement]
[SyntaxKind.JsxElement]: JsxElement;
property [SyntaxKind.JsxExpression]
[SyntaxKind.JsxExpression]: JsxExpression;
property [SyntaxKind.JsxFragment]
[SyntaxKind.JsxFragment]: JsxFragment;
property [SyntaxKind.JsxOpeningElement]
[SyntaxKind.JsxOpeningElement]: JsxOpeningElement;
property [SyntaxKind.JsxOpeningFragment]
[SyntaxKind.JsxOpeningFragment]: JsxOpeningFragment;
property [SyntaxKind.JsxSelfClosingElement]
[SyntaxKind.JsxSelfClosingElement]: JsxSelfClosingElement;
property [SyntaxKind.JsxSpreadAttribute]
[SyntaxKind.JsxSpreadAttribute]: JsxSpreadAttribute;
property [SyntaxKind.JsxText]
[SyntaxKind.JsxText]: JsxText;
property [SyntaxKind.LabeledStatement]
[SyntaxKind.LabeledStatement]: LabeledStatement;
property [SyntaxKind.LastJSDocNode]
[SyntaxKind.LastJSDocNode]: JSDocPropertyTag;
property [SyntaxKind.LastJSDocTagNode]
[SyntaxKind.LastJSDocTagNode]: JSDocPropertyTag;
property [SyntaxKind.LastLiteralToken]
[SyntaxKind.LastLiteralToken]: NoSubstitutionTemplateLiteral;
property [SyntaxKind.LastTemplateToken]
[SyntaxKind.LastTemplateToken]: TemplateTail;
property [SyntaxKind.LastTypeNode]
[SyntaxKind.LastTypeNode]: ImportTypeNode;
property [SyntaxKind.LiteralType]
[SyntaxKind.LiteralType]: LiteralTypeNode;
property [SyntaxKind.MetaProperty]
[SyntaxKind.MetaProperty]: MetaProperty;
property [SyntaxKind.MethodDeclaration]
[SyntaxKind.MethodDeclaration]: MethodDeclaration;
property [SyntaxKind.MethodSignature]
[SyntaxKind.MethodSignature]: MethodSignature;
property [SyntaxKind.ModuleBlock]
[SyntaxKind.ModuleBlock]: ModuleBlock;
property [SyntaxKind.ModuleDeclaration]
[SyntaxKind.ModuleDeclaration]: NamespaceDeclaration;
property [SyntaxKind.NamedExports]
[SyntaxKind.NamedExports]: NamedExports;
property [SyntaxKind.NamedImports]
[SyntaxKind.NamedImports]: NamedImports;
property [SyntaxKind.NamespaceImport]
[SyntaxKind.NamespaceImport]: NamespaceImport;
property [SyntaxKind.NeverKeyword]
[SyntaxKind.NeverKeyword]: Expression;
property [SyntaxKind.NewExpression]
[SyntaxKind.NewExpression]: NewExpression;
property [SyntaxKind.NonNullExpression]
[SyntaxKind.NonNullExpression]: NonNullExpression;
property [SyntaxKind.NoSubstitutionTemplateLiteral]
[SyntaxKind.NoSubstitutionTemplateLiteral]: NoSubstitutionTemplateLiteral;
property [SyntaxKind.NotEmittedStatement]
[SyntaxKind.NotEmittedStatement]: NotEmittedStatement;
property [SyntaxKind.NullKeyword]
[SyntaxKind.NullKeyword]: NullLiteral;
property [SyntaxKind.NumberKeyword]
[SyntaxKind.NumberKeyword]: Expression;
property [SyntaxKind.NumericLiteral]
[SyntaxKind.NumericLiteral]: NumericLiteral;
property [SyntaxKind.ObjectBindingPattern]
[SyntaxKind.ObjectBindingPattern]: ObjectBindingPattern;
property [SyntaxKind.ObjectKeyword]
[SyntaxKind.ObjectKeyword]: Expression;
property [SyntaxKind.ObjectLiteralExpression]
[SyntaxKind.ObjectLiteralExpression]: ObjectLiteralExpression;
property [SyntaxKind.OmittedExpression]
[SyntaxKind.OmittedExpression]: OmittedExpression;
property [SyntaxKind.Parameter]
[SyntaxKind.Parameter]: ParameterDeclaration;
property [SyntaxKind.ParenthesizedExpression]
[SyntaxKind.ParenthesizedExpression]: ParenthesizedExpression;
property [SyntaxKind.ParenthesizedType]
[SyntaxKind.ParenthesizedType]: ParenthesizedTypeNode;
property [SyntaxKind.PartiallyEmittedExpression]
[SyntaxKind.PartiallyEmittedExpression]: PartiallyEmittedExpression;
property [SyntaxKind.PostfixUnaryExpression]
[SyntaxKind.PostfixUnaryExpression]: PostfixUnaryExpression;
property [SyntaxKind.PrefixUnaryExpression]
[SyntaxKind.PrefixUnaryExpression]: PrefixUnaryExpression;
property [SyntaxKind.PropertyAccessExpression]
[SyntaxKind.PropertyAccessExpression]: PropertyAccessExpression;
property [SyntaxKind.PropertyAssignment]
[SyntaxKind.PropertyAssignment]: PropertyAssignment;
property [SyntaxKind.PropertyDeclaration]
[SyntaxKind.PropertyDeclaration]: PropertyDeclaration;
property [SyntaxKind.PropertySignature]
[SyntaxKind.PropertySignature]: PropertySignature;
property [SyntaxKind.QualifiedName]
[SyntaxKind.QualifiedName]: QualifiedName;
property [SyntaxKind.RegularExpressionLiteral]
[SyntaxKind.RegularExpressionLiteral]: RegularExpressionLiteral;
property [SyntaxKind.ReturnStatement]
[SyntaxKind.ReturnStatement]: ReturnStatement;
property [SyntaxKind.SemicolonToken]
[SyntaxKind.SemicolonToken]: Node;
property [SyntaxKind.SetAccessor]
[SyntaxKind.SetAccessor]: SetAccessorDeclaration;
property [SyntaxKind.ShorthandPropertyAssignment]
[SyntaxKind.ShorthandPropertyAssignment]: ShorthandPropertyAssignment;
property [SyntaxKind.SourceFile]
[SyntaxKind.SourceFile]: SourceFile;
property [SyntaxKind.SpreadAssignment]
[SyntaxKind.SpreadAssignment]: SpreadAssignment;
property [SyntaxKind.SpreadElement]
[SyntaxKind.SpreadElement]: SpreadElement;
property [SyntaxKind.StringKeyword]
[SyntaxKind.StringKeyword]: Expression;
property [SyntaxKind.StringLiteral]
[SyntaxKind.StringLiteral]: StringLiteral;
property [SyntaxKind.SuperKeyword]
[SyntaxKind.SuperKeyword]: SuperExpression;
property [SyntaxKind.SwitchStatement]
[SyntaxKind.SwitchStatement]: SwitchStatement;
property [SyntaxKind.SymbolKeyword]
[SyntaxKind.SymbolKeyword]: Expression;
property [SyntaxKind.SyntaxList]
[SyntaxKind.SyntaxList]: SyntaxList;
property [SyntaxKind.TaggedTemplateExpression]
[SyntaxKind.TaggedTemplateExpression]: TaggedTemplateExpression;
property [SyntaxKind.TemplateExpression]
[SyntaxKind.TemplateExpression]: TemplateExpression;
property [SyntaxKind.TemplateHead]
[SyntaxKind.TemplateHead]: TemplateHead;
property [SyntaxKind.TemplateMiddle]
[SyntaxKind.TemplateMiddle]: TemplateMiddle;
property [SyntaxKind.TemplateSpan]
[SyntaxKind.TemplateSpan]: TemplateSpan;
property [SyntaxKind.TemplateTail]
[SyntaxKind.TemplateTail]: TemplateTail;
property [SyntaxKind.ThisKeyword]
[SyntaxKind.ThisKeyword]: ThisExpression;
property [SyntaxKind.ThrowStatement]
[SyntaxKind.ThrowStatement]: ThrowStatement;
property [SyntaxKind.TrueKeyword]
[SyntaxKind.TrueKeyword]: BooleanLiteral;
property [SyntaxKind.TryStatement]
[SyntaxKind.TryStatement]: TryStatement;
property [SyntaxKind.TupleType]
[SyntaxKind.TupleType]: TupleTypeNode;
property [SyntaxKind.TypeAliasDeclaration]
[SyntaxKind.TypeAliasDeclaration]: TypeAliasDeclaration;
property [SyntaxKind.TypeAssertionExpression]
[SyntaxKind.TypeAssertionExpression]: TypeAssertion;
property [SyntaxKind.TypeLiteral]
[SyntaxKind.TypeLiteral]: TypeLiteralNode;
property [SyntaxKind.TypeOfExpression]
[SyntaxKind.TypeOfExpression]: TypeOfExpression;
property [SyntaxKind.TypeParameter]
[SyntaxKind.TypeParameter]: TypeParameterDeclaration;
property [SyntaxKind.TypePredicate]
[SyntaxKind.TypePredicate]: TypeNode;
property [SyntaxKind.TypeReference]
[SyntaxKind.TypeReference]: TypeReferenceNode;
property [SyntaxKind.UndefinedKeyword]
[SyntaxKind.UndefinedKeyword]: Expression;
property [SyntaxKind.UnionType]
[SyntaxKind.UnionType]: UnionTypeNode;
property [SyntaxKind.VariableDeclaration]
[SyntaxKind.VariableDeclaration]: VariableDeclaration;
property [SyntaxKind.VariableDeclarationList]
[SyntaxKind.VariableDeclarationList]: VariableDeclarationList;
property [SyntaxKind.VariableStatement]
[SyntaxKind.VariableStatement]: VariableStatement;
property [SyntaxKind.VoidExpression]
[SyntaxKind.VoidExpression]: VoidExpression;
property [SyntaxKind.WhileStatement]
[SyntaxKind.WhileStatement]: WhileStatement;
property [SyntaxKind.WithStatement]
[SyntaxKind.WithStatement]: WithStatement;
property [SyntaxKind.YieldExpression]
[SyntaxKind.YieldExpression]: YieldExpression;
interface ImplementsClauseableNode
interface ImplementsClauseableNode {}
method addImplements
addImplements: { (text: string): ExpressionWithTypeArguments; ( text: WriterFunction | readonly (string | WriterFunction)[] ): ExpressionWithTypeArguments[];};
Adds an implements clause.
Parameter text
Text to add for the implements clause.
Adds multiple implements clauses.
Parameter text
Texts to add for the implements clause.
method getImplements
getImplements: () => ExpressionWithTypeArguments[];
Gets the implements clauses.
method insertImplements
insertImplements: { ( index: number, texts: ReadonlyArray<string | WriterFunction> | WriterFunction ): ExpressionWithTypeArguments[]; (index: number, text: string): ExpressionWithTypeArguments;};
Inserts an implements clause.
Parameter text
Text to insert for the implements clause.
Inserts multiple implements clauses.
Parameter text
Texts to insert for the implements clause.
method removeImplements
removeImplements: { (index: number): this; (implementsNode: ExpressionWithTypeArguments): this;};
Removes the implements at the specified index.
Parameter index
Index to remove.
Removes the specified implements.
Parameter implementsNode
Node of the implements to remove.
interface ImplementsClauseableNodeStructure
interface ImplementsClauseableNodeStructure {}
property implements
implements?: (string | WriterFunction)[] | WriterFunction;
interface ImportDeclarationStructure
interface ImportDeclarationStructure {}
property defaultImport
defaultImport?: string;
property moduleSpecifier
moduleSpecifier: string;
property namedImports
namedImports?: | (ImportSpecifierStructure | string | WriterFunction)[] | WriterFunction;
property namespaceImport
namespaceImport?: string;
interface ImportExpressionedNode
interface ImportExpressionedNode {}
method getExpression
getExpression: () => ImportExpression;
Gets the expression.
interface ImportSpecifierStructure
interface ImportSpecifierStructure {}
interface IndexSignatureDeclarationStructure
interface IndexSignatureDeclarationStructure extends IndexSignatureDeclarationSpecificStructure, JSDocableNodeStructure, ReadonlyableNodeStructure, ReturnTypedNodeStructure {}
interface InitializerExpressionableNode
interface InitializerExpressionableNode extends InitializerGetExpressionableNode, InitializerSetExpressionableNode {}
interface InitializerExpressionableNodeStructure
interface InitializerExpressionableNodeStructure extends InitializerSetExpressionableNodeStructure {}
interface InitializerGetExpressionableNode
interface InitializerGetExpressionableNode {}
method getInitializer
getInitializer: () => Expression | undefined;
Gets the initializer.
method getInitializerIfKind
getInitializerIfKind: <TKind extends SyntaxKind>( kind: TKind) => KindToExpressionMappings[TKind] | undefined;
Gets the initializer if it's a certain kind.
method getInitializerIfKindOrThrow
getInitializerIfKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToExpressionMappings[TKind];
Gets the initializer if it's a certain kind or throws.
method getInitializerOrThrow
getInitializerOrThrow: () => Expression;
Gets the initializer or throw.
method hasInitializer
hasInitializer: () => boolean;
Gets if node has an initializer.
interface InitializerSetExpressionableNode
interface InitializerSetExpressionableNode {}
method removeInitializer
removeInitializer: () => this;
Removes the initailizer.
method setInitializer
setInitializer: (textOrWriterFunction: string | WriterFunction) => this;
Sets the initializer.
Parameter text
Text or writer function to set for the initializer.
interface InitializerSetExpressionableNodeStructure
interface InitializerSetExpressionableNodeStructure {}
property initializer
initializer?: string | WriterFunction;
interface InterfaceDeclarationStructure
interface InterfaceDeclarationStructure extends NamedNodeStructure, InterfaceDeclarationSpecificStructure, ExtendsClauseableNodeStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure, TypeElementMemberedNodeStructure {}
interface JSDocableNode
interface JSDocableNode {}
method addJsDoc
addJsDoc: (structure: JSDocStructure | string | WriterFunction) => JSDoc;
Adds a JS doc.
Parameter structure
Structure to add.
method addJsDocs
addJsDocs: ( structures: ReadonlyArray<JSDocStructure | string | WriterFunction>) => JSDoc[];
Adds JS docs.
Parameter structures
Structures to add.
method getJsDocs
getJsDocs: () => JSDoc[];
Gets the JS doc nodes.
method insertJsDoc
insertJsDoc: ( index: number, structure: JSDocStructure | string | WriterFunction) => JSDoc;
Inserts a JS doc.
Parameter index
Child index to insert at.
Parameter structure
Structure to insert.
method insertJsDocs
insertJsDocs: ( index: number, structures: ReadonlyArray<JSDocStructure | string | WriterFunction>) => JSDoc[];
Inserts JS docs.
Parameter index
Child index to insert at.
Parameter structures
Structures to insert.
interface JSDocableNodeStructure
interface JSDocableNodeStructure {}
property docs
docs?: (JSDocStructure | string)[];
interface JSDocPropertyLikeTag
interface JSDocPropertyLikeTag {}
method getName
getName: () => string;
Gets the name of the JS doc property like tag.
method getNameNode
getNameNode: () => EntityName;
Gets the name node of the JS doc property like tag.
interface JSDocStructure
interface JSDocStructure {}
property description
description: string | WriterFunction;
interface JsxAttributedNode
interface JsxAttributedNode {}
method addAttribute
addAttribute: ( attribute: JsxAttributeStructure | JsxSpreadAttributeStructure) => JsxAttributeLike;
Adds an attribute into the element.
method addAttributes
addAttributes: ( attributes: ReadonlyArray< JsxAttributeStructure | JsxSpreadAttributeStructure >) => JsxAttributeLike[];
Adds attributes into the element.
method getAttribute
getAttribute: { (name: string): JsxAttributeLike | undefined; (findFunction: (attribute: JsxAttributeLike) => boolean): JsxAttributeLike;};
Gets an attribute by name or returns undefined when it can't be found.
Parameter name
Name to search for.
Gets an attribute by a find function or returns undefined when it can't be found.
Parameter findFunction
Find function.
method getAttributeOrThrow
getAttributeOrThrow: { (name: string): JsxAttributeLike; (findFunction: (attribute: JsxAttributeLike) => boolean): JsxAttributeLike;};
Gets an attribute by name or throws when it can't be found.
Parameter name
Name to search for.
Gets an attribute by a find function or throws when it can't be found.
Parameter findFunction
Find function.
method getAttributes
getAttributes: () => JsxAttributeLike[];
Gets the JSX element's attributes.
method insertAttribute
insertAttribute: ( index: number, attribute: JsxAttributeStructure | JsxSpreadAttributeStructure) => JsxAttributeLike;
Inserts an attribute into the element.
method insertAttributes
insertAttributes: ( index: number, attributes: ReadonlyArray< JsxAttributeStructure | JsxSpreadAttributeStructure >) => JsxAttributeLike[];
Inserts attributes into the element.
interface JsxAttributeStructure
interface JsxAttributeStructure extends JsxAttributeSpecificStructure, NamedNodeStructure {}
interface JsxElementStructure
interface JsxElementStructure {}
property attributes
attributes?: (JsxAttributeStructure | JsxSpreadAttributeStructure)[];
property bodyText
bodyText?: string;
property children
children?: JsxElementStructure[];
property isSelfClosing
isSelfClosing?: boolean;
property name
name: string;
interface JsxSpreadAttributeStructure
interface JsxSpreadAttributeStructure {}
property expression
expression: string;
property isSpreadAttribute
isSpreadAttribute: true;
interface JsxTagNamedNode
interface JsxTagNamedNode {}
method getTagNameNode
getTagNameNode: () => JsxTagNameExpression;
Gets the tag name of the JSX closing element.
interface JsxTagNamePropertyAccess
interface JsxTagNamePropertyAccess extends PropertyAccessExpression {}
method getExpression
getExpression: () => JsxTagNameExpression;
interface KindToExpressionMappings
interface KindToExpressionMappings {}
property [SyntaxKind.AnyKeyword]
[SyntaxKind.AnyKeyword]: Expression;
property [SyntaxKind.ArrayLiteralExpression]
[SyntaxKind.ArrayLiteralExpression]: ArrayLiteralExpression;
property [SyntaxKind.ArrowFunction]
[SyntaxKind.ArrowFunction]: ArrowFunction;
property [SyntaxKind.AsExpression]
[SyntaxKind.AsExpression]: AsExpression;
property [SyntaxKind.AwaitExpression]
[SyntaxKind.AwaitExpression]: AwaitExpression;
property [SyntaxKind.BinaryExpression]
[SyntaxKind.BinaryExpression]: BinaryExpression;
property [SyntaxKind.BooleanKeyword]
[SyntaxKind.BooleanKeyword]: Expression;
property [SyntaxKind.CallExpression]
[SyntaxKind.CallExpression]: CallExpression;
property [SyntaxKind.ClassExpression]
[SyntaxKind.ClassExpression]: ClassExpression;
property [SyntaxKind.CommaListExpression]
[SyntaxKind.CommaListExpression]: CommaListExpression;
property [SyntaxKind.ConditionalExpression]
[SyntaxKind.ConditionalExpression]: ConditionalExpression;
property [SyntaxKind.DeleteExpression]
[SyntaxKind.DeleteExpression]: DeleteExpression;
property [SyntaxKind.ElementAccessExpression]
[SyntaxKind.ElementAccessExpression]: ElementAccessExpression;
property [SyntaxKind.FalseKeyword]
[SyntaxKind.FalseKeyword]: BooleanLiteral;
property [SyntaxKind.FirstLiteralToken]
[SyntaxKind.FirstLiteralToken]: NumericLiteral;
property [SyntaxKind.FirstTemplateToken]
[SyntaxKind.FirstTemplateToken]: NoSubstitutionTemplateLiteral;
property [SyntaxKind.FunctionExpression]
[SyntaxKind.FunctionExpression]: FunctionExpression;
property [SyntaxKind.Identifier]
[SyntaxKind.Identifier]: Identifier;
property [SyntaxKind.ImportKeyword]
[SyntaxKind.ImportKeyword]: ImportExpression;
property [SyntaxKind.JsxClosingFragment]
[SyntaxKind.JsxClosingFragment]: JsxClosingFragment;
property [SyntaxKind.JsxElement]
[SyntaxKind.JsxElement]: JsxElement;
property [SyntaxKind.JsxExpression]
[SyntaxKind.JsxExpression]: JsxExpression;
property [SyntaxKind.JsxFragment]
[SyntaxKind.JsxFragment]: JsxFragment;
property [SyntaxKind.JsxOpeningElement]
[SyntaxKind.JsxOpeningElement]: JsxOpeningElement;
property [SyntaxKind.JsxOpeningFragment]
[SyntaxKind.JsxOpeningFragment]: JsxOpeningFragment;
property [SyntaxKind.JsxSelfClosingElement]
[SyntaxKind.JsxSelfClosingElement]: JsxSelfClosingElement;
property [SyntaxKind.LastLiteralToken]
[SyntaxKind.LastLiteralToken]: NoSubstitutionTemplateLiteral;
property [SyntaxKind.MetaProperty]
[SyntaxKind.MetaProperty]: MetaProperty;
property [SyntaxKind.NeverKeyword]
[SyntaxKind.NeverKeyword]: Expression;
property [SyntaxKind.NewExpression]
[SyntaxKind.NewExpression]: NewExpression;
property [SyntaxKind.NonNullExpression]
[SyntaxKind.NonNullExpression]: NonNullExpression;
property [SyntaxKind.NoSubstitutionTemplateLiteral]
[SyntaxKind.NoSubstitutionTemplateLiteral]: NoSubstitutionTemplateLiteral;
property [SyntaxKind.NullKeyword]
[SyntaxKind.NullKeyword]: NullLiteral;
property [SyntaxKind.NumberKeyword]
[SyntaxKind.NumberKeyword]: Expression;
property [SyntaxKind.NumericLiteral]
[SyntaxKind.NumericLiteral]: NumericLiteral;
property [SyntaxKind.ObjectKeyword]
[SyntaxKind.ObjectKeyword]: Expression;
property [SyntaxKind.ObjectLiteralExpression]
[SyntaxKind.ObjectLiteralExpression]: ObjectLiteralExpression;
property [SyntaxKind.OmittedExpression]
[SyntaxKind.OmittedExpression]: OmittedExpression;
property [SyntaxKind.ParenthesizedExpression]
[SyntaxKind.ParenthesizedExpression]: ParenthesizedExpression;
property [SyntaxKind.PartiallyEmittedExpression]
[SyntaxKind.PartiallyEmittedExpression]: PartiallyEmittedExpression;
property [SyntaxKind.PostfixUnaryExpression]
[SyntaxKind.PostfixUnaryExpression]: PostfixUnaryExpression;
property [SyntaxKind.PrefixUnaryExpression]
[SyntaxKind.PrefixUnaryExpression]: PrefixUnaryExpression;
property [SyntaxKind.PropertyAccessExpression]
[SyntaxKind.PropertyAccessExpression]: PropertyAccessExpression;
property [SyntaxKind.RegularExpressionLiteral]
[SyntaxKind.RegularExpressionLiteral]: RegularExpressionLiteral;
property [SyntaxKind.SpreadElement]
[SyntaxKind.SpreadElement]: SpreadElement;
property [SyntaxKind.StringKeyword]
[SyntaxKind.StringKeyword]: Expression;
property [SyntaxKind.StringLiteral]
[SyntaxKind.StringLiteral]: StringLiteral;
property [SyntaxKind.SuperKeyword]
[SyntaxKind.SuperKeyword]: SuperExpression;
property [SyntaxKind.SymbolKeyword]
[SyntaxKind.SymbolKeyword]: Expression;
property [SyntaxKind.TaggedTemplateExpression]
[SyntaxKind.TaggedTemplateExpression]: TaggedTemplateExpression;
property [SyntaxKind.TemplateExpression]
[SyntaxKind.TemplateExpression]: TemplateExpression;
property [SyntaxKind.ThisKeyword]
[SyntaxKind.ThisKeyword]: ThisExpression;
property [SyntaxKind.TrueKeyword]
[SyntaxKind.TrueKeyword]: BooleanLiteral;
property [SyntaxKind.TypeAssertionExpression]
[SyntaxKind.TypeAssertionExpression]: TypeAssertion;
property [SyntaxKind.TypeOfExpression]
[SyntaxKind.TypeOfExpression]: TypeOfExpression;
property [SyntaxKind.UndefinedKeyword]
[SyntaxKind.UndefinedKeyword]: Expression;
property [SyntaxKind.VoidExpression]
[SyntaxKind.VoidExpression]: VoidExpression;
property [SyntaxKind.YieldExpression]
[SyntaxKind.YieldExpression]: YieldExpression;
index signature
[kind: number]: Node;
interface KindToNodeMappings
interface KindToNodeMappings extends ImplementedKindToNodeMappings {}
index signature
[kind: number]: Node;
interface LeftHandSideExpressionedNode
interface LeftHandSideExpressionedNode {}
method getExpression
getExpression: () => LeftHandSideExpression;
Gets the expression.
interface LiteralLikeNode
interface LiteralLikeNode {}
method getLiteralText
getLiteralText: () => string;
Get text of the literal.
method hasExtendedUnicodeEscape
hasExtendedUnicodeEscape: () => boolean;
Gets if the literal has an extended unicode escape.
method isTerminated
isTerminated: () => boolean;
Gets if the literal is terminated.
interface ManipulationSettings
interface ManipulationSettings extends SupportedFormatCodeSettingsOnly {}
Manipulation settings.
property indentationText
indentationText: IndentationText;
Indentation text
property newLineKind
newLineKind: NewLineKind;
New line kind
property quoteKind
quoteKind: QuoteKind;
Quote type used for string literals.
interface MemoryEmitResultFile
interface MemoryEmitResultFile {}
The emitted file in memory.
property filePath
filePath: string;
File path that was emitted to.
property text
text: string;
The text that was emitted.
property writeByteOrderMark
writeByteOrderMark: boolean;
Whether the byte order mark should be written.
interface MethodDeclarationOverloadStructure
interface MethodDeclarationOverloadStructure extends StaticableNodeStructure, AbstractableNodeStructure, ScopedNodeStructure, AsyncableNodeStructure, GeneratorableNodeStructure, SignaturedDeclarationStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, QuestionTokenableNodeStructure {}
interface MethodDeclarationStructure
interface MethodDeclarationStructure extends MethodDeclarationSpecificStructure, PropertyNamedNodeStructure, StaticableNodeStructure, DecoratableNodeStructure, AbstractableNodeStructure, ScopedNodeStructure, AsyncableNodeStructure, GeneratorableNodeStructure, FunctionLikeDeclarationStructure, BodyableNodeStructure, QuestionTokenableNodeStructure {}
interface MethodSignatureStructure
interface MethodSignatureStructure extends PropertyNamedNodeStructure, MethodSignatureSpecificStructure, QuestionTokenableNodeStructure, JSDocableNodeStructure, SignaturedDeclarationStructure, TypeParameteredNodeStructure {}
interface ModifierableNode
interface ModifierableNode {}
method getFirstModifierByKind
getFirstModifierByKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
Gets the first modifier of the specified syntax kind or undefined if none found.
Parameter kind
Syntax kind.
method getFirstModifierByKindOrThrow
getFirstModifierByKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
Gets the first modifier of the specified syntax kind or throws if none found.
Parameter kind
Syntax kind.
method getModifiers
getModifiers: () => Node[];
Gets the node's modifiers.
method hasModifier
hasModifier: { (kind: SyntaxKind): boolean; (text: ModifierTexts): boolean };
Gets if it has the specified modifier.
Parameter kind
Syntax kind to check for.
Gets if it has the specified modifier.
Parameter text
Text to check for.
method toggleModifier
toggleModifier: (text: ModifierTexts, value?: boolean) => this;
Toggles a modifier.
Parameter text
Text to toggle the modifier for.
Parameter value
Optional toggling value.
interface ModuledNode
interface ModuledNode {}
method addExportAssignment
addExportAssignment: (structure: ExportAssignmentStructure) => ExportAssignment;
Add export assignments.
Parameter structure
Structure that represents the export.
method addExportAssignments
addExportAssignments: ( structures: ReadonlyArray<ExportAssignmentStructure>) => ExportAssignment[];
Add export assignments.
Parameter structures
Structures that represent the exports.
method addExportDeclaration
addExportDeclaration: ( structure: ExportDeclarationStructure) => ExportDeclaration;
Add export declarations.
Parameter structure
Structure that represents the export.
method addExportDeclarations
addExportDeclarations: ( structures: ReadonlyArray<ExportDeclarationStructure>) => ExportDeclaration[];
Add export declarations.
Parameter structures
Structures that represent the exports.
method addImportDeclaration
addImportDeclaration: ( structure: ImportDeclarationStructure) => ImportDeclaration;
Adds an import.
Parameter structure
Structure that represents the import.
method addImportDeclarations
addImportDeclarations: ( structures: ReadonlyArray<ImportDeclarationStructure>) => ImportDeclaration[];
Adds imports.
Parameter structures
Structures that represent the imports.
method getDefaultExportSymbol
getDefaultExportSymbol: () => Symbol | undefined;
Gets the default export symbol.
method getDefaultExportSymbolOrThrow
getDefaultExportSymbolOrThrow: () => Symbol;
Gets the default export symbol or throws if it doesn't exist.
method getExportAssignment
getExportAssignment: ( condition: (exportAssignment: ExportAssignment) => boolean) => ExportAssignment | undefined;
Gets the first export assignment that matches a condition, or undefined if it doesn't exist.
Parameter condition
Condition to get the export assignment by.
method getExportAssignmentOrThrow
getExportAssignmentOrThrow: ( condition: (exportAssignment: ExportAssignment) => boolean) => ExportAssignment;
Gets the first export assignment that matches a condition, or throws if it doesn't exist.
Parameter condition
Condition to get the export assignment by.
method getExportAssignments
getExportAssignments: () => ExportAssignment[];
Get the file's export assignments.
method getExportDeclaration
getExportDeclaration: { (condition: (exportDeclaration: ExportDeclaration) => boolean): | ExportDeclaration | undefined; (moduleSpecifier: string): ExportDeclaration;};
Gets the first export declaration that matches a module specifier, or undefined if it doesn't exist.
Parameter module
Module specifier to get the export declaration by.
method getExportDeclarationOrThrow
getExportDeclarationOrThrow: { ( condition: (exportDeclaration: ExportDeclaration) => boolean ): ExportDeclaration; (moduleSpecifier: string): ExportDeclaration;};
Gets the first export declaration that matches a condition, or throws if it doesn't exist.
Parameter condition
Condition to get the export declaration by.
Gets the first export declaration that matches a module specifier, or throws if it doesn't exist.
Parameter module
Module specifier to get the export declaration by.
method getExportDeclarations
getExportDeclarations: () => ExportDeclaration[];
Get the export declarations.
method getExportedDeclarations
getExportedDeclarations: () => Node[];
Gets all the declarations that are exported from the module.
This will include declarations that are transitively exported from other modules. If you mean to get the export declarations then use
.getExportDeclarations()
.
method getExportSymbols
getExportSymbols: () => Symbol[];
Gets the export symbols.
method getImportDeclaration
getImportDeclaration: { (condition: (importDeclaration: ImportDeclaration) => boolean): | ImportDeclaration | undefined; (moduleSpecifier: string): ImportDeclaration;};
Gets the first import declaration that matches a condition, or undefined if it doesn't exist.
Parameter condition
Condition to get the import declaration by.
Gets the first import declaration that matches a module specifier, or undefined if it doesn't exist.
Parameter module
Module specifier to get the import declaration by.
method getImportDeclarationOrThrow
getImportDeclarationOrThrow: { ( condition: (importDeclaration: ImportDeclaration) => boolean ): ImportDeclaration; (moduleSpecifier: string): ImportDeclaration;};
Gets the first import declaration that matches a condition, or throws if it doesn't exist.
Parameter condition
Condition to get the import declaration by.
Gets the first import declaration that matches a module specifier, or throws if it doesn't exist.
Parameter module
Module specifier to get the import declaration by.
method getImportDeclarations
getImportDeclarations: () => ImportDeclaration[];
Get the module's import declarations.
method insertExportAssignment
insertExportAssignment: ( index: number, structure: ExportAssignmentStructure) => ExportAssignment;
Insert an export assignment.
Parameter index
Child index to insert at.
Parameter structure
Structure that represents the export.
method insertExportAssignments
insertExportAssignments: ( index: number, structures: ReadonlyArray<ExportAssignmentStructure>) => ExportAssignment[];
Insert export assignments into a file.
Parameter index
Child index to insert at.
Parameter structures
Structures that represent the exports to insert.
method insertExportDeclaration
insertExportDeclaration: ( index: number, structure: ExportDeclarationStructure) => ExportDeclaration;
Insert an export declaration.
Parameter index
Child index to insert at.
Parameter structure
Structure that represents the export.
method insertExportDeclarations
insertExportDeclarations: ( index: number, structures: ReadonlyArray<ExportDeclarationStructure>) => ExportDeclaration[];
Insert export declarations.
Parameter index
Child index to insert at.
Parameter structures
Structures that represent the exports to insert.
method insertImportDeclaration
insertImportDeclaration: ( index: number, structure: ImportDeclarationStructure) => ImportDeclaration;
Insert an import.
Parameter index
Child index to insert at.
Parameter structure
Structure that represents the import.
method insertImportDeclarations
insertImportDeclarations: ( index: number, structures: ReadonlyArray<ImportDeclarationStructure>) => ImportDeclaration[];
Inserts imports.
Parameter index
Child index to insert at.
Parameter structures
Structures that represent the imports to insert.
method removeDefaultExport
removeDefaultExport: (defaultExportSymbol?: Symbol | undefined) => this;
Removes any "export default".
interface ModuledNodeStructure
interface ModuledNodeStructure {}
interface NameableNode
interface NameableNode extends NameableNodeSpecific, ReferenceFindableNode, RenameableNode {}
interface NameableNodeSpecific
interface NameableNodeSpecific {}
method getName
getName: () => string | undefined;
Gets the name if it exists.
method getNameNode
getNameNode: () => Identifier | undefined;
Gets the name node if it exists.
method getNameNodeOrThrow
getNameNodeOrThrow: () => Identifier;
Gets the name node if it exists, or throws.
method getNameOrThrow
getNameOrThrow: () => string;
Gets the name if it exists, or throws.
method removeName
removeName: () => this;
Removes the name from the node.
interface NameableNodeStructure
interface NameableNodeStructure {}
property name
name?: string;
interface NamedNode
interface NamedNode extends NamedNodeSpecific, ReferenceFindableNode, RenameableNode {}
interface NamedNodeSpecificBase
interface NamedNodeSpecificBase<TNode extends Node> {}
method getName
getName: () => string;
Gets the name.
method getNameNode
getNameNode: () => TNode;
Gets the name node.
interface NamedNodeStructure
interface NamedNodeStructure {}
property name
name: string;
interface NamespaceChildableNode
interface NamespaceChildableNode {}
method getParentNamespace
getParentNamespace: () => NamespaceDeclaration | undefined;
Gets the parent namespace or undefined if it doesn't exist.
method getParentNamespaceOrThrow
getParentNamespaceOrThrow: () => NamespaceDeclaration;
Gets the parent namespace or throws if it doesn't exist.
interface NamespaceDeclarationStructure
interface NamespaceDeclarationStructure extends NamedNodeStructure, NamespaceDeclarationSpecificStructure, JSDocableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure, StatementedNodeStructure, BodiedNodeStructure, ModuledNodeStructure {}
interface OverloadableNode
interface OverloadableNode {}
Node that supports overloads.
method getImplementation
getImplementation: () => this | undefined;
Gets the implementation or undefined if it doesn't exist.
method getImplementationOrThrow
getImplementationOrThrow: () => this;
Gets the implementation or throws if it doesn't exist.
method getOverloads
getOverloads: () => this[];
Gets all the overloads associated with this node.
method isImplementation
isImplementation: () => boolean;
Gets if this is the implementation.
method isOverload
isOverload: () => boolean;
Gets if this is an overload.
interface ParameterDeclarationStructure
interface ParameterDeclarationStructure extends DeclarationNamedNodeStructure, TypedNodeStructure, ReadonlyableNodeStructure, DecoratableNodeStructure, QuestionTokenableNodeStructure, ScopeableNodeStructure, InitializerExpressionableNodeStructure, ParameterDeclarationSpecificStructure {}
interface ParameteredNode
interface ParameteredNode {}
method addParameter
addParameter: (structure: ParameterDeclarationStructure) => ParameterDeclaration;
Adds a parameter.
Parameter structure
Structure of the parameter.
method addParameters
addParameters: ( structures: ReadonlyArray<ParameterDeclarationStructure>) => ParameterDeclaration[];
Adds parameters.
Parameter structures
Structures of the parameters.
method getParameter
getParameter: { (name: string): ParameterDeclaration | undefined; ( findFunction: (declaration: ParameterDeclaration) => boolean ): ParameterDeclaration;};
Gets a parameter or undefined if it doesn't exist.
Parameter name
Name of the parameter.
Gets a parameter or undefined if it doesn't exist.
Parameter findFunction
Function to use to find the parameter.
method getParameterOrThrow
getParameterOrThrow: { (name: string): ParameterDeclaration; ( findFunction: (declaration: ParameterDeclaration) => boolean ): ParameterDeclaration;};
Gets a parameter or throws if it doesn't exist.
Parameter name
Name of the parameter.
Gets a parameter or throws if it doesn't exist.
Parameter findFunction
Function to use to find the parameter.
method getParameters
getParameters: () => ParameterDeclaration[];
Gets all the parameters of the node.
method insertParameter
insertParameter: ( index: number, structure: ParameterDeclarationStructure) => ParameterDeclaration;
Inserts a parameter.
Parameter index
Child index to insert at.
Parameter structures
Parameter to insert.
method insertParameters
insertParameters: ( index: number, structures: ReadonlyArray<ParameterDeclarationStructure>) => ParameterDeclaration[];
Inserts parameters.
Parameter index
Child index to insert at.
Parameter structures
Parameters to insert.
interface ParameteredNodeStructure
interface ParameteredNodeStructure {}
property parameters
parameters?: ParameterDeclarationStructure[];
interface PrintNodeOptions
interface PrintNodeOptions {}
Options for printing a node.
property emitHint
emitHint?: EmitHint;
From the compiler api: "A value indicating the purpose of a node. This is primarily used to distinguish between an
Identifier
used in an expression position, versus anIdentifier
used as anIdentifierName
as part of a declaration. For most nodes you should just passUnspecified
."Defaults to
Unspecified
.
property newLineKind
newLineKind?: NewLineKind;
New line kind.
Defaults to line feed.
property removeComments
removeComments?: boolean;
Whether to remove comments or not.
property scriptKind
scriptKind?: ScriptKind;
The script kind.
Remarks
This is only useful when passing in a compiler node that was constructed with the compiler API factory methods.
Defaults to TSX.
interface ProgramEmitOptions
interface ProgramEmitOptions extends EmitOptions {}
Options for emitting from a Program.
property writeFile
writeFile?: ts.WriteFileCallback;
interface ProjectOptions
interface ProjectOptions {}
property addFilesFromTsConfig
addFilesFromTsConfig?: boolean;
Whether to add the source files from the specified tsconfig.json or not. Defaults to true.
property compilerOptions
compilerOptions?: CompilerOptions;
Compiler options
property fileSystem
fileSystem?: FileSystemHost;
Optional file system host. Useful for mocking access to the file system.
Remarks
Consider using
useVirtualFileSystem
instead.
property manipulationSettings
manipulationSettings?: Partial<ManipulationSettings>;
Manipulation settings
property skipFileDependencyResolution
skipFileDependencyResolution?: boolean;
Skip resolving file dependencies when providing a ts config file path and adding the files from tsconfig.
property tsConfigFilePath
tsConfigFilePath?: string;
File path to the tsconfig.json file
property useVirtualFileSystem
useVirtualFileSystem?: boolean;
Whether to use a virtual file system.
interface PropertyAssignmentStructure
interface PropertyAssignmentStructure extends PropertyAssignmentSpecificStructure, PropertyNamedNodeStructure {}
interface PropertyDeclarationStructure
interface PropertyDeclarationStructure extends PropertyDeclarationSpecificStructure, PropertyNamedNodeStructure, TypedNodeStructure, QuestionTokenableNodeStructure, ExclamationTokenableNodeStructure, StaticableNodeStructure, ScopedNodeStructure, JSDocableNodeStructure, ReadonlyableNodeStructure, InitializerExpressionableNodeStructure, DecoratableNodeStructure, AbstractableNodeStructure {}
interface PropertyNameableNodeStructure
interface PropertyNameableNodeStructure {}
property name
name?: string;
interface PropertyNamedNode
interface PropertyNamedNode extends PropertyNamedNodeSpecific, ReferenceFindableNode, RenameableNode {}
interface PropertyNamedNodeStructure
interface PropertyNamedNodeStructure {}
property name
name: string;
interface PropertySignatureStructure
interface PropertySignatureStructure extends PropertySignatureSpecificStructure, PropertyNamedNodeStructure, TypedNodeStructure, QuestionTokenableNodeStructure, JSDocableNodeStructure, ReadonlyableNodeStructure, InitializerExpressionableNodeStructure {}
interface QuestionTokenableNode
interface QuestionTokenableNode {}
method getQuestionTokenNode
getQuestionTokenNode: () => Node<ts.QuestionToken> | undefined;
Gets the question token node or returns undefined if it doesn't exist.
method getQuestionTokenNodeOrThrow
getQuestionTokenNodeOrThrow: () => Node<ts.QuestionToken>;
Gets the question token node or throws.
method hasQuestionToken
hasQuestionToken: () => boolean;
If it has a question token.
method setHasQuestionToken
setHasQuestionToken: (value: boolean) => this;
Sets if this node has a question token.
Parameter value
If it should have a question token or not.
interface QuestionTokenableNodeStructure
interface QuestionTokenableNodeStructure {}
property hasQuestionToken
hasQuestionToken?: boolean;
interface ReadonlyableNode
interface ReadonlyableNode {}
method getReadonlyKeyword
getReadonlyKeyword: () => Node | undefined;
Gets the readonly keyword, or undefined if none exists.
method getReadonlyKeywordOrThrow
getReadonlyKeywordOrThrow: () => Node;
Gets the readonly keyword, or throws if none exists.
method isReadonly
isReadonly: () => boolean;
Gets if it's readonly.
method setIsReadonly
setIsReadonly: (value: boolean) => this;
Sets if this node is readonly.
Parameter value
If readonly or not.
interface ReadonlyableNodeStructure
interface ReadonlyableNodeStructure {}
property isReadonly
isReadonly?: boolean;
interface ReferenceFindableNode
interface ReferenceFindableNode {}
method findReferences
findReferences: () => ReferencedSymbol[];
Finds the references of the definition of the node.
method findReferencesAsNodes
findReferencesAsNodes: () => Node[];
Finds the nodes that reference the definition of the node.
interface RenameableNode
interface RenameableNode {}
method rename
rename: (newName: string, options?: RenameOptions) => this;
Renames the name of the node.
Parameter newName
New name.
Parameter options
Options for renaming.
interface RenameOptions
interface RenameOptions {}
Options for renaming a node.
property renameInComments
renameInComments?: boolean;
Whether comments referencing this node should be renamed.
Remarks
False by default.
property renameInStrings
renameInStrings?: boolean;
Whether strings referencing this node should be renamed.
Remarks
False by default.
interface ReturnTypedNode
interface ReturnTypedNode {}
method getReturnType
getReturnType: () => Type;
Gets the return type.
method getReturnTypeNode
getReturnTypeNode: () => TypeNode | undefined;
Gets the return type node or undefined if none exists.
method getReturnTypeNodeOrThrow
getReturnTypeNodeOrThrow: () => TypeNode;
Gets the return type node or throws if none exists.
method getSignature
getSignature: () => Signature;
Gets the signature of the node from the type checker.
method removeReturnType
removeReturnType: () => this;
Removes the return type.
method setReturnType
setReturnType: (textOrWriterFunction: string | WriterFunction) => this;
Sets the return type of the node.
Parameter textOrWriterFunction
Text or writer function to set the return type with.
interface ReturnTypedNodeStructure
interface ReturnTypedNodeStructure {}
property returnType
returnType?: string | WriterFunction;
interface ScopeableNode
interface ScopeableNode {}
method getScope
getScope: () => Scope | undefined;
Gets the scope.
method hasScopeKeyword
hasScopeKeyword: () => boolean;
Gets if the node has a scope keyword.
method setScope
setScope: (scope: Scope | undefined) => this;
Sets the scope.
Parameter scope
Scope to set to.
interface ScopeableNodeStructure
interface ScopeableNodeStructure {}
property scope
scope?: Scope;
interface ScopedNode
interface ScopedNode {}
method getScope
getScope: () => Scope;
Gets the scope.
method hasScopeKeyword
hasScopeKeyword: () => boolean;
Gets if the node has a scope keyword.
method setScope
setScope: (scope: Scope | undefined) => this;
Sets the scope.
Parameter scope
Scope to set to.
interface ScopedNodeStructure
interface ScopedNodeStructure {}
property scope
scope?: Scope;
interface SetAccessorDeclarationStructure
interface SetAccessorDeclarationStructure extends SetAccessorDeclarationSpecificStructure, PropertyNamedNodeStructure, StaticableNodeStructure, DecoratableNodeStructure, AbstractableNodeStructure, ScopedNodeStructure, FunctionLikeDeclarationStructure, BodyableNodeStructure {}
interface ShorthandPropertyAssignmentStructure
interface ShorthandPropertyAssignmentStructure extends ShorthandPropertyAssignmentSpecificStructure, NamedNodeStructure {}
interface SignaturedDeclaration
interface SignaturedDeclaration extends ParameteredNode, ReturnTypedNode {}
interface SignaturedDeclarationStructure
interface SignaturedDeclarationStructure extends ParameteredNodeStructure, ReturnTypedNodeStructure {}
interface SourceFileCopyOptions
interface SourceFileCopyOptions {}
property overwrite
overwrite?: boolean;
interface SourceFileCreateOptions
interface SourceFileCreateOptions {}
property overwrite
overwrite?: boolean;
interface SourceFileEmitOptions
interface SourceFileEmitOptions extends EmitOptionsBase {}
Options for emitting a source file.
interface SourceFileMoveOptions
interface SourceFileMoveOptions {}
property overwrite
overwrite?: boolean;
interface SourceFileStructure
interface SourceFileStructure extends SourceFileSpecificStructure, StatementedNodeStructure, ModuledNodeStructure {}
property bodyText
bodyText?: string | WriterFunction;
interface SpreadAssignmentStructure
interface SpreadAssignmentStructure extends ExpressionedNodeStructure {}
interface StatementedNode
interface StatementedNode {}
method addClass
addClass: (structure: ClassDeclarationStructure) => ClassDeclaration;
Adds an class declaration as a child.
Parameter structure
Structure of the class declaration to add.
method addClasses
addClasses: ( structures: ReadonlyArray<ClassDeclarationStructure>) => ClassDeclaration[];
Adds class declarations as a child.
Parameter structures
Structures of the class declarations to add.
method addEnum
addEnum: (structure: EnumDeclarationStructure) => EnumDeclaration;
Adds an enum declaration as a child.
Parameter structure
Structure of the enum declaration to add.
method addEnums
addEnums: ( structures: ReadonlyArray<EnumDeclarationStructure>) => EnumDeclaration[];
Adds enum declarations as a child.
Parameter structures
Structures of the enum declarations to add.
method addFunction
addFunction: (structure: FunctionDeclarationStructure) => FunctionDeclaration;
Adds a function declaration as a child.
Parameter structure
Structure of the function declaration to add.
method addFunctions
addFunctions: ( structures: ReadonlyArray<FunctionDeclarationStructure>) => FunctionDeclaration[];
Adds function declarations as a child.
Parameter structures
Structures of the function declarations to add.
method addInterface
addInterface: (structure: InterfaceDeclarationStructure) => InterfaceDeclaration;
Adds a interface declaration as a child.
Parameter structure
Structure of the interface declaration to add.
method addInterfaces
addInterfaces: ( structures: ReadonlyArray<InterfaceDeclarationStructure>) => InterfaceDeclaration[];
Adds interface declarations as a child.
Parameter structures
Structures of the interface declarations to add.
method addNamespace
addNamespace: (structure: NamespaceDeclarationStructure) => NamespaceDeclaration;
Adds a namespace declaration as a child.
Parameter structure
Structure of the namespace declaration to add.
method addNamespaces
addNamespaces: ( structures: ReadonlyArray<NamespaceDeclarationStructure>) => NamespaceDeclaration[];
Adds namespace declarations as a child.
Parameter structures
Structures of the namespace declarations to add.
method addStatements
addStatements: (textOrWriterFunction: string | WriterFunction) => Statement[];
Add statements.
Parameter textOrWriterFunction
Text or writer function to add the statement or statements with.
Returns
The statements that were added.
method addTypeAlias
addTypeAlias: (structure: TypeAliasDeclarationStructure) => TypeAliasDeclaration;
Adds a type alias declaration as a child.
Parameter structure
Structure of the type alias declaration to add.
method addTypeAliases
addTypeAliases: ( structures: ReadonlyArray<TypeAliasDeclarationStructure>) => TypeAliasDeclaration[];
Adds type alias declarations as a child.
Parameter structures
Structures of the type alias declarations to add.
method addVariableStatement
addVariableStatement: ( structure: VariableStatementStructure) => VariableStatement;
Adds a variable statement.
Parameter structure
Structure of the variable statement.
method addVariableStatements
addVariableStatements: ( structures: ReadonlyArray<VariableStatementStructure>) => VariableStatement[];
Adds variable statements.
Parameter structures
Structures of the variable statements.
method getClass
getClass: { (name: string): ClassDeclaration | undefined; (findFunction: (declaration: ClassDeclaration) => boolean): ClassDeclaration;};
Gets a class.
Parameter name
Name of the class.
Gets a class.
Parameter findFunction
Function to use to find the class.
method getClasses
getClasses: () => ClassDeclaration[];
Gets the direct class declaration children.
method getClassOrThrow
getClassOrThrow: { (name: string): ClassDeclaration; (findFunction: (declaration: ClassDeclaration) => boolean): ClassDeclaration;};
Gets a class or throws if it doesn't exist.
Parameter name
Name of the class.
Gets a class or throws if it doesn't exist.
Parameter findFunction
Function to use to find the class.
method getEnum
getEnum: { (name: string): EnumDeclaration | undefined; (findFunction: (declaration: EnumDeclaration) => boolean): EnumDeclaration;};
Gets an enum.
Parameter name
Name of the enum.
Gets an enum.
Parameter findFunction
Function to use to find the enum.
method getEnumOrThrow
getEnumOrThrow: { (name: string): EnumDeclaration; (findFunction: (declaration: EnumDeclaration) => boolean): EnumDeclaration;};
Gets an enum or throws if it doesn't exist.
Parameter name
Name of the enum.
Gets an enum or throws if it doesn't exist.
Parameter findFunction
Function to use to find the enum.
method getEnums
getEnums: () => EnumDeclaration[];
Gets the direct enum declaration children.
method getFunction
getFunction: { (name: string): FunctionDeclaration | undefined; ( findFunction: (declaration: FunctionDeclaration) => boolean ): FunctionDeclaration;};
Gets a function.
Parameter name
Name of the function.
Gets a function.
Parameter findFunction
Function to use to find the function.
method getFunctionOrThrow
getFunctionOrThrow: { (name: string): FunctionDeclaration; ( findFunction: (declaration: FunctionDeclaration) => boolean ): FunctionDeclaration;};
Gets a function or throws if it doesn't exist.
Parameter name
Name of the function.
Gets a function or throws if it doesn't exist.
Parameter findFunction
Function to use to find the function.
method getFunctions
getFunctions: () => FunctionDeclaration[];
Gets the direct function declaration children.
method getInterface
getInterface: { (name: string): InterfaceDeclaration | undefined; ( findFunction: (declaration: InterfaceDeclaration) => boolean ): InterfaceDeclaration;};
Gets an interface.
Parameter name
Name of the interface.
Gets an interface.
Parameter findFunction
Function to use to find the interface.
method getInterfaceOrThrow
getInterfaceOrThrow: { (name: string): InterfaceDeclaration; ( findFunction: (declaration: InterfaceDeclaration) => boolean ): InterfaceDeclaration;};
Gets an interface or throws if it doesn't exist.
Parameter name
Name of the interface.
Gets an interface or throws if it doesn't exist.
Parameter findFunction
Function to use to find the interface.
method getInterfaces
getInterfaces: () => InterfaceDeclaration[];
Gets the direct interface declaration children.
method getNamespace
getNamespace: { (name: string): NamespaceDeclaration | undefined; ( findFunction: (declaration: NamespaceDeclaration) => boolean ): NamespaceDeclaration;};
Gets a namespace.
Parameter name
Name of the namespace.
Gets a namespace.
Parameter findFunction
Function to use to find the namespace.
method getNamespaceOrThrow
getNamespaceOrThrow: { (name: string): NamespaceDeclaration; ( findFunction: (declaration: NamespaceDeclaration) => boolean ): NamespaceDeclaration;};
Gets a namespace or throws if it doesn't exist.
Parameter name
Name of the namespace.
Gets a namespace or throws if it doesn't exist.
Parameter findFunction
Function to use to find the namespace.
method getNamespaces
getNamespaces: () => NamespaceDeclaration[];
Gets the direct namespace declaration children.
method getStatement
getStatement: ( findFunction: (statement: Node) => boolean) => Statement | undefined;
Gets the first statement that matches the provided condition or returns undefined if it doesn't exist.
Parameter findFunction
Function to find the statement by.
method getStatementByKind
getStatementByKind: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind] | undefined;
Gets the first statement that matches the provided syntax kind or returns undefined if it doesn't exist.
Parameter kind
Syntax kind to find the node by.
method getStatementByKindOrThrow
getStatementByKindOrThrow: <TKind extends SyntaxKind>( kind: TKind) => KindToNodeMappings[TKind];
Gets the first statement that matches the provided syntax kind or throws if it doesn't exist.
Parameter kind
Syntax kind to find the node by.
method getStatementOrThrow
getStatementOrThrow: (findFunction: (statement: Node) => boolean) => Statement;
Gets the first statement that matches the provided condition or throws if it doesn't exist.
Parameter findFunction
Function to find the statement by.
method getStatements
getStatements: () => Statement[];
Gets the node's statements.
method getTypeAlias
getTypeAlias: { (name: string): TypeAliasDeclaration | undefined; ( findFunction: (declaration: TypeAliasDeclaration) => boolean ): TypeAliasDeclaration;};
Gets a type alias.
Parameter name
Name of the type alias.
Gets a type alias.
Parameter findFunction
Function to use to find the type alias.
method getTypeAliases
getTypeAliases: () => TypeAliasDeclaration[];
Gets the direct type alias declaration children.
method getTypeAliasOrThrow
getTypeAliasOrThrow: { (name: string): TypeAliasDeclaration; ( findFunction: (declaration: TypeAliasDeclaration) => boolean ): TypeAliasDeclaration;};
Gets a type alias or throws if it doesn't exist.
Parameter name
Name of the type alias.
Gets a type alias or throws if it doesn't exist.
Parameter findFunction
Function to use to find the type alias.
method getVariableDeclaration
getVariableDeclaration: { (name: string): VariableDeclaration | undefined; ( findFunction: (declaration: VariableDeclaration) => boolean ): VariableDeclaration;};
Gets a variable declaration.
Parameter name
Name of the variable declaration.
Gets a variable declaration.
Parameter findFunction
Function to use to find the variable declaration.
method getVariableDeclarationOrThrow
getVariableDeclarationOrThrow: { (name: string): VariableDeclaration; ( findFunction: (declaration: VariableDeclaration) => boolean ): VariableDeclaration;};
Gets a variable declaration or throws if it doesn't exist.
Parameter name
Name of the variable declaration.
Gets a variable declaration or throws if it doesn't exist.
Parameter findFunction
Function to use to find the variable declaration.
method getVariableDeclarations
getVariableDeclarations: () => VariableDeclaration[];
Gets all the variable declarations within all the variable declarations of the direct variable statement children.
method getVariableStatement
getVariableStatement: { (name: string): VariableStatement | undefined; ( findFunction: (declaration: VariableStatement) => boolean ): VariableStatement;};
Gets a variable statement.
Parameter name
Name of one of the variable statement's declarations.
Gets a variable statement.
Parameter findFunction
Function to use to find the variable statement.
method getVariableStatementOrThrow
getVariableStatementOrThrow: { (name: string): VariableStatement; ( findFunction: (declaration: VariableStatement) => boolean ): VariableStatement;};
Gets a variable statement or throws if it doesn't exist.
Parameter name
Name of one of the variable statement's declarations.
Gets a variable statement or throws if it doesn't exist.
Parameter findFunction
Function to use to find the variable statement.
method getVariableStatements
getVariableStatements: () => VariableStatement[];
Gets the direct variable statement children.
method insertClass
insertClass: ( index: number, structure: ClassDeclarationStructure) => ClassDeclaration;
Inserts an class declaration as a child.
Parameter index
Child index to insert at.
Parameter structure
Structure of the class declaration to insert.
method insertClasses
insertClasses: ( index: number, structures: ReadonlyArray<ClassDeclarationStructure>) => ClassDeclaration[];
Inserts class declarations as a child.
Parameter index
Child index to insert at.
Parameter structures
Structures of the class declarations to insert.
method insertEnum
insertEnum: ( index: number, structure: EnumDeclarationStructure) => EnumDeclaration;
Inserts an enum declaration as a child.
Parameter index
Child index to insert at.
Parameter structure
Structure of the enum declaration to insert.
method insertEnums
insertEnums: ( index: number, structures: ReadonlyArray<EnumDeclarationStructure>) => EnumDeclaration[];
Inserts enum declarations as a child.
Parameter index
Child index to insert at.
Parameter structures
Structures of the enum declarations to insert.
method insertFunction
insertFunction: ( index: number, structure: FunctionDeclarationStructure) => FunctionDeclaration;
Inserts an function declaration as a child.
Parameter index
Child index to insert at.
Parameter structure
Structure of the function declaration to insert.
method insertFunctions
insertFunctions: ( index: number, structures: ReadonlyArray<FunctionDeclarationStructure>) => FunctionDeclaration[];
Inserts function declarations as a child.
Parameter index
Child index to insert at.
Parameter structures
Structures of the function declarations to insert.
method insertInterface
insertInterface: ( index: number, structure: InterfaceDeclarationStructure) => InterfaceDeclaration;
Inserts an interface declaration as a child.
Parameter index
Child index to insert at.
Parameter structure
Structure of the interface declaration to insert.
method insertInterfaces
insertInterfaces: ( index: number, structures: ReadonlyArray<InterfaceDeclarationStructure>) => InterfaceDeclaration[];
Inserts interface declarations as a child.
Parameter index
Child index to insert at.
Parameter structures
Structures of the interface declarations to insert.
method insertNamespace
insertNamespace: ( index: number, structure: NamespaceDeclarationStructure) => NamespaceDeclaration;
Inserts an namespace declaration as a child.
Parameter index
Child index to insert at.
Parameter structure
Structure of the namespace declaration to insert.
method insertNamespaces
insertNamespaces: ( index: number, structures: ReadonlyArray<NamespaceDeclarationStructure>) => NamespaceDeclaration[];
Inserts namespace declarations as a child.
Parameter index
Child index to insert at.
Parameter structures
Structures of the namespace declarations to insert.
method insertStatements
insertStatements: ( index: number, textOrWriterFunction: string | WriterFunction) => Statement[];
Inserts statements at the specified index.
Parameter index
Child index to insert at.
Parameter textOrWriterFunction
Text or writer function to write the statement or statements with.
Returns
The statements that were inserted.
method insertTypeAlias
insertTypeAlias: ( index: number, structure: TypeAliasDeclarationStructure) => TypeAliasDeclaration;
Inserts an type alias declaration as a child.
Parameter index
Child index to insert at.
Parameter structure
Structure of the type alias declaration to insert.
method insertTypeAliases
insertTypeAliases: ( index: number, structures: ReadonlyArray<TypeAliasDeclarationStructure>) => TypeAliasDeclaration[];
Inserts type alias declarations as a child.
Parameter index
Child index to insert at.
Parameter structures
Structures of the type alias declarations to insert.
method insertVariableStatement
insertVariableStatement: ( index: number, structure: VariableStatementStructure) => VariableStatement;
Inserts a variable statement.
Parameter structure
Structure of the variable statement.
method insertVariableStatements
insertVariableStatements: ( index: number, structures: ReadonlyArray<VariableStatementStructure>) => VariableStatement[];
Inserts variable statements.
Parameter structures
Structures of the variable statements.
method removeStatement
removeStatement: (index: number) => this;
Removes the statement at the specified index.
Parameter index
Child index to remove the statement at.
method removeStatements
removeStatements: (indexRange: [number, number]) => this;
Removes the statements at the specified index range.
Parameter indexRange
The start and end inclusive index range to remove.
interface StatementedNodeStructure
interface StatementedNodeStructure {}
property classes
classes?: ClassDeclarationStructure[];
property enums
enums?: EnumDeclarationStructure[];
property functions
functions?: FunctionDeclarationStructure[];
property interfaces
interfaces?: InterfaceDeclarationStructure[];
property namespaces
namespaces?: NamespaceDeclarationStructure[];
property typeAliases
typeAliases?: TypeAliasDeclarationStructure[];
interface StaticableNode
interface StaticableNode {}
method getStaticKeyword
getStaticKeyword: () => Node | undefined;
Gets the static keyword, or undefined if none exists.
method getStaticKeywordOrThrow
getStaticKeywordOrThrow: () => Node;
Gets the static keyword, or throws if none exists.
method isStatic
isStatic: () => boolean;
Gets if it's static.
method setIsStatic
setIsStatic: (value: boolean) => this;
Sets if the node is static.
Parameter value
If it should be static or not.
interface StaticableNodeStructure
interface StaticableNodeStructure {}
property isStatic
isStatic?: boolean;
interface SuperExpressionedNode
interface SuperExpressionedNode {}
method getExpression
getExpression: () => SuperExpression;
Gets the expression.
interface SupportedFormatCodeSettings
interface SupportedFormatCodeSettings extends SupportedFormatCodeSettingsOnly, EditorSettings {}
FormatCodeSettings that are currently supported in the library.
interface SupportedFormatCodeSettingsOnly
interface SupportedFormatCodeSettingsOnly {}
FormatCodeSettings that are currently supported in the library.
property insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces
insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: boolean;
Whether to insert a space after opening and before closing non-empty braces.
ex.
import { Item } from "./Item";
orimport {Item} from "./Item";
interface TextInsertableNode
interface TextInsertableNode {}
method insertText
insertText: (pos: number, textOrWriterFunction: string | WriterFunction) => this;
Inserts text within the body of the node.
WARNING: This will forget any previously navigated descendant nodes.
Parameter pos
Position to insert at.
Parameter textOrWriterFunction
Text to insert.
method removeText
removeText: { (): this; (pos: number, end: number): this };
Removes all the text within the node
Removes text within the body of the node.
WARNING: This will forget any previously navigated descendant nodes.
Parameter pos
Start position to remove.
Parameter end
End position to remove.
method replaceText
replaceText: ( range: [number, number], textOrWriterFunction: string | WriterFunction) => this;
Replaces text within the body of the node.
WARNING: This will forget any previously navigated descendant nodes.
Parameter range
Start and end position of the text to replace.
Parameter textOrWriterFunction
Text to replace the range with.
interface TextRange
interface TextRange {}
interface TransformTraversalControl
interface TransformTraversalControl {}
property currentNode
currentNode: ts.Node;
The node currently being transformed.
Remarks
Use the result of
.visitChildren()
instead before transforming if visiting the children.
method visitChildren
visitChildren: () => ts.Node;
Visits the children of the current node and returns a new node for the current node.
interface TypeAliasDeclarationStructure
interface TypeAliasDeclarationStructure extends TypeAliasDeclarationSpecificStructure, NamedNodeStructure, TypedNodeStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure {}
property type
type: string | WriterFunction;
interface TypeArgumentedNode
interface TypeArgumentedNode {}
method addTypeArgument
addTypeArgument: (argumentText: string) => TypeNode;
Adds a type argument.
Parameter argumentText
Argument text to add.
method addTypeArguments
addTypeArguments: (argumentTexts: ReadonlyArray<string>) => TypeNode[];
Adds type arguments.
Parameter argumentTexts
Argument texts to add.
method getTypeArguments
getTypeArguments: () => TypeNode[];
Gets all the type arguments of the node.
method insertTypeArgument
insertTypeArgument: (index: number, argumentText: string) => TypeNode;
Inserts a type argument.
Parameter index
Child index to insert at.
Parameter argumentText
Argument text to insert.
method insertTypeArguments
insertTypeArguments: ( index: number, argumentTexts: ReadonlyArray<string>) => TypeNode[];
Inserts type arguments.
Parameter index
Child index to insert at.
Parameter argumentTexts
Argument texts to insert.
method removeTypeArgument
removeTypeArgument: { (typeArg: Node): this; (index: number): this };
Removes a type argument.
Parameter typeArg
Type argument to remove.
Removes a type argument.
Parameter index
Index to remove.
interface TypedNode
interface TypedNode {}
method getTypeNode
getTypeNode: () => TypeNode | undefined;
Gets the type node or undefined if none exists.
method getTypeNodeOrThrow
getTypeNodeOrThrow: () => TypeNode;
Gets the type node or throws if none exists.
method removeType
removeType: () => this;
Removes the type.
method setType
setType: (textOrWriterFunction: string | WriterFunction) => this;
Sets the type.
Parameter textOrWriterFunction
Text or writer function to set the type with.
interface TypedNodeStructure
interface TypedNodeStructure {}
property type
type?: string | WriterFunction;
interface TypeElementMemberedNode
interface TypeElementMemberedNode {}
method addCallSignature
addCallSignature: ( structure: CallSignatureDeclarationStructure) => CallSignatureDeclaration;
Add call signature.
Parameter structure
Structure representing the call signature.
method addCallSignatures
addCallSignatures: ( structures: ReadonlyArray<CallSignatureDeclarationStructure>) => CallSignatureDeclaration[];
Add call signatures.
Parameter structures
Structures representing the call signatures.
method addConstructSignature
addConstructSignature: ( structure: ConstructSignatureDeclarationStructure) => ConstructSignatureDeclaration;
Add construct signature.
Parameter structure
Structure representing the construct signature.
method addConstructSignatures
addConstructSignatures: ( structures: ReadonlyArray<ConstructSignatureDeclarationStructure>) => ConstructSignatureDeclaration[];
Add construct signatures.
Parameter structures
Structures representing the construct signatures.
method addIndexSignature
addIndexSignature: ( structure: IndexSignatureDeclarationStructure) => IndexSignatureDeclaration;
Add index signature.
Parameter structure
Structure representing the index signature.
method addIndexSignatures
addIndexSignatures: ( structures: ReadonlyArray<IndexSignatureDeclarationStructure>) => IndexSignatureDeclaration[];
Add index signatures.
Parameter structures
Structures representing the index signatures.
method addMethod
addMethod: (structure: MethodSignatureStructure) => MethodSignature;
Add method.
Parameter structure
Structure representing the method.
method addMethods
addMethods: ( structures: ReadonlyArray<MethodSignatureStructure>) => MethodSignature[];
Add methods.
Parameter structures
Structures representing the methods.
method addProperties
addProperties: ( structures: ReadonlyArray<PropertySignatureStructure>) => PropertySignature[];
Add properties.
Parameter structures
Structures representing the properties.
method addProperty
addProperty: (structure: PropertySignatureStructure) => PropertySignature;
Add property.
Parameter structure
Structure representing the property.
method getCallSignature
getCallSignature: ( findFunction: (member: CallSignatureDeclaration) => boolean) => CallSignatureDeclaration | undefined;
Gets the first call signature by a find function.
Parameter findFunction
Function to find the call signature by.
method getCallSignatureOrThrow
getCallSignatureOrThrow: ( findFunction: (member: CallSignatureDeclaration) => boolean) => CallSignatureDeclaration;
Gets the first call signature by a find function or throws if not found.
Parameter findFunction
Function to find the call signature by.
method getCallSignatures
getCallSignatures: () => CallSignatureDeclaration[];
Gets the interface call signatures.
method getConstructSignature
getConstructSignature: ( findFunction: (member: ConstructSignatureDeclaration) => boolean) => ConstructSignatureDeclaration | undefined;
Gets the first construct signature by a find function.
Parameter findFunction
Function to find the construct signature by.
method getConstructSignatureOrThrow
getConstructSignatureOrThrow: ( findFunction: (member: ConstructSignatureDeclaration) => boolean) => ConstructSignatureDeclaration;
Gets the first construct signature by a find function or throws if not found.
Parameter findFunction
Function to find the construct signature by.
method getConstructSignatures
getConstructSignatures: () => ConstructSignatureDeclaration[];
Gets the interface construct signatures.
method getIndexSignature
getIndexSignature: ( findFunction: (member: IndexSignatureDeclaration) => boolean) => IndexSignatureDeclaration | undefined;
Gets the first index signature by a find function.
Parameter findFunction
Function to find the index signature by.
method getIndexSignatureOrThrow
getIndexSignatureOrThrow: ( findFunction: (member: IndexSignatureDeclaration) => boolean) => IndexSignatureDeclaration;
Gets the first index signature by a find function or throws if not found.
Parameter findFunction
Function to find the index signature by.
method getIndexSignatures
getIndexSignatures: () => IndexSignatureDeclaration[];
Gets the interface index signatures.
method getMembers
getMembers: () => TypeElementTypes[];
Gets all the members.
method getMethod
getMethod: { (name: string): MethodSignature | undefined; (findFunction: (member: MethodSignature) => boolean): MethodSignature;};
Gets the first method by name.
Parameter name
Name.
Gets the first method by a find function.
Parameter findFunction
Function to find the method by.
method getMethodOrThrow
getMethodOrThrow: { (name: string): MethodSignature; (findFunction: (member: MethodSignature) => boolean): MethodSignature;};
Gets the first method by name or throws if not found.
Parameter name
Name.
Gets the first method by a find function or throws if not found.
Parameter findFunction
Function to find the method by.
method getMethods
getMethods: () => MethodSignature[];
Gets the interface method signatures.
method getProperties
getProperties: () => PropertySignature[];
Gets the interface property signatures.
method getProperty
getProperty: { (name: string): PropertySignature | undefined; (findFunction: (member: PropertySignature) => boolean): PropertySignature;};
Gets the first property by name.
Parameter name
Name.
Gets the first property by a find function.
Parameter findFunction
Function to find the property by.
method getPropertyOrThrow
getPropertyOrThrow: { (name: string): PropertySignature; (findFunction: (member: PropertySignature) => boolean): PropertySignature;};
Gets the first property by name or throws if not found.
Parameter name
Name.
Gets the first property by a find function or throws if not found.
Parameter findFunction
Function to find the property by.
method insertCallSignature
insertCallSignature: ( index: number, structure: CallSignatureDeclarationStructure) => CallSignatureDeclaration;
Insert call signature.
Parameter index
Child index to insert at.
Parameter structure
Structure representing the call signature.
method insertCallSignatures
insertCallSignatures: ( index: number, structures: ReadonlyArray<CallSignatureDeclarationStructure>) => CallSignatureDeclaration[];
Insert call signatures.
Parameter index
Child index to insert at.
Parameter structures
Structures representing the call signatures.
method insertConstructSignature
insertConstructSignature: ( index: number, structure: ConstructSignatureDeclarationStructure) => ConstructSignatureDeclaration;
Insert construct signature.
Parameter index
Child index to insert at.
Parameter structure
Structure representing the construct signature.
method insertConstructSignatures
insertConstructSignatures: ( index: number, structures: ReadonlyArray<ConstructSignatureDeclarationStructure>) => ConstructSignatureDeclaration[];
Insert construct signatures.
Parameter index
Child index to insert at.
Parameter structures
Structures representing the construct signatures.
method insertIndexSignature
insertIndexSignature: ( index: number, structure: IndexSignatureDeclarationStructure) => IndexSignatureDeclaration;
Insert index signature.
Parameter index
Child index to insert at.
Parameter structure
Structure representing the index signature.
method insertIndexSignatures
insertIndexSignatures: ( index: number, structures: ReadonlyArray<IndexSignatureDeclarationStructure>) => IndexSignatureDeclaration[];
Insert index signatures.
Parameter index
Child index to insert at.
Parameter structures
Structures representing the index signatures.
method insertMethod
insertMethod: ( index: number, structure: MethodSignatureStructure) => MethodSignature;
Insert method.
Parameter index
Child index to insert at.
Parameter structure
Structure representing the method.
method insertMethods
insertMethods: ( index: number, structures: ReadonlyArray<MethodSignatureStructure>) => MethodSignature[];
Insert methods.
Parameter index
Child index to insert at.
Parameter structures
Structures representing the methods.
method insertProperties
insertProperties: ( index: number, structures: ReadonlyArray<PropertySignatureStructure>) => PropertySignature[];
Insert properties.
Parameter index
Child index to insert at.
Parameter structures
Structures representing the properties.
method insertProperty
insertProperty: ( index: number, structure: PropertySignatureStructure) => PropertySignature;
Insert property.
Parameter index
Child index to insert at.
Parameter structure
Structure representing the property.
interface TypeElementMemberedNodeStructure
interface TypeElementMemberedNodeStructure {}
property callSignatures
callSignatures?: CallSignatureDeclarationStructure[];
property constructSignatures
constructSignatures?: ConstructSignatureDeclarationStructure[];
property indexSignatures
indexSignatures?: IndexSignatureDeclarationStructure[];
property methods
methods?: MethodSignatureStructure[];
property properties
properties?: PropertySignatureStructure[];
interface TypeParameterDeclarationStructure
interface TypeParameterDeclarationStructure extends TypeParameterDeclarationSpecificStructure, NamedNodeStructure {}
interface TypeParameteredNode
interface TypeParameteredNode {}
method addTypeParameter
addTypeParameter: ( structure: TypeParameterDeclarationStructure | string) => TypeParameterDeclaration;
Adds a type parameter.
Parameter structure
Structure of the type parameter.
method addTypeParameters
addTypeParameters: ( structures: ReadonlyArray<TypeParameterDeclarationStructure | string>) => TypeParameterDeclaration[];
Adds type parameters.
Parameter structures
Structures of the type parameters.
method getTypeParameter
getTypeParameter: { (name: string): TypeParameterDeclaration | undefined; ( findFunction: (declaration: TypeParameterDeclaration) => boolean ): TypeParameterDeclaration;};
Gets a type parameter or undefined if it doesn't exist.
Parameter name
Name of the parameter.
Gets a type parameter or undefined if it doesn't exist.
Parameter findFunction
Function to use to find the type parameter.
method getTypeParameterOrThrow
getTypeParameterOrThrow: { (name: string): TypeParameterDeclaration; ( findFunction: (declaration: TypeParameterDeclaration) => boolean ): TypeParameterDeclaration;};
Gets a type parameter or throws if it doesn't exist.
Parameter name
Name of the parameter.
Gets a type parameter or throws if it doesn't exist.
Parameter findFunction
Function to use to find the type parameter.
method getTypeParameters
getTypeParameters: () => TypeParameterDeclaration[];
Gets the type parameters.
method insertTypeParameter
insertTypeParameter: ( index: number, structure: TypeParameterDeclarationStructure | string) => TypeParameterDeclaration;
Inserts a type parameter.
Parameter index
Child index to insert at. Specify a negative index to insert from the reverse.
Parameter structure
Structure of the type parameter.
method insertTypeParameters
insertTypeParameters: ( index: number, structures: ReadonlyArray<TypeParameterDeclarationStructure | string>) => TypeParameterDeclaration[];
Inserts type parameters.
Parameter index
Child index to insert at. Specify a negative index to insert from the reverse.
Parameter structures
Structures of the type parameters.
interface TypeParameteredNodeStructure
interface TypeParameteredNodeStructure {}
property typeParameters
typeParameters?: (TypeParameterDeclarationStructure | string)[];
interface UnaryExpressionedNode
interface UnaryExpressionedNode {}
method getExpression
getExpression: () => UnaryExpression;
Gets the expression.
interface UnwrappableNode
interface UnwrappableNode {}
method unwrap
unwrap: () => void;
Replaces the node's text with its body's statements.
interface UserPreferences
interface UserPreferences extends ts.UserPreferences {}
User preferences for refactoring.
interface VariableDeclarationListStructure
interface VariableDeclarationListStructure extends VariableDeclarationListSpecificStructure {}
interface VariableDeclarationStructure
interface VariableDeclarationStructure extends VariableDeclarationSpecificStructure, BindingNamedNodeStructure, InitializerExpressionableNodeStructure, TypedNodeStructure, ExclamationTokenableNodeStructure {}
interface VariableStatementStructure
interface VariableStatementStructure extends VariableStatementSpecificStructure, JSDocableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure {}
Enums
enum FileSystemRefreshResult
enum FileSystemRefreshResult { NoChange = 0, Updated = 1, Deleted = 2,}
Result of refreshing a source file from the file system.
enum IndentationText
enum IndentationText { TwoSpaces = ' ', FourSpaces = ' ', EightSpaces = ' ', Tab = '\t',}
Kinds of indentation
member EightSpaces
EightSpaces = ' '
Eight spaces
member FourSpaces
FourSpaces = ' '
Four spaces
member Tab
Tab = '\t'
Tab
member TwoSpaces
TwoSpaces = ' '
Two spaces
enum NamespaceDeclarationKind
enum NamespaceDeclarationKind { Namespace = 'namespace', Module = 'module', Global = 'global',}
enum QuoteKind
enum QuoteKind { Single = "'", Double = '"',}
Quote type for a string literal.
enum Scope
enum Scope { Public = 'public', Protected = 'protected', Private = 'private',}
enum VariableDeclarationKind
enum VariableDeclarationKind { Var = 'var', Let = 'let', Const = 'const',}
Type Aliases
type AccessorDeclaration
type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;
type ArrayBindingElement
type ArrayBindingElement = BindingElement | OmittedExpression;
type BindingName
type BindingName = Identifier | BindingPattern;
type BindingNamedNodeSpecific
type BindingNamedNodeSpecific = NamedNodeSpecificBase<BindingName>;
type BindingPattern
type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;
type CaseOrDefaultClause
type CaseOrDefaultClause = CaseClause | DefaultClause;
type ClassInstanceMemberTypes
type ClassInstanceMemberTypes = MethodDeclaration | ClassInstancePropertyTypes;
type ClassInstancePropertyTypes
type ClassInstancePropertyTypes = ClassPropertyTypes | ParameterDeclaration;
type ClassMemberTypes
type ClassMemberTypes = | MethodDeclaration | PropertyDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration;
type ClassPropertyTypes
type ClassPropertyTypes = | PropertyDeclaration | GetAccessorDeclaration | SetAccessorDeclaration;
type ClassStaticMemberTypes
type ClassStaticMemberTypes = MethodDeclaration | ClassStaticPropertyTypes;
type ClassStaticPropertyTypes
type ClassStaticPropertyTypes = | PropertyDeclaration | GetAccessorDeclaration | SetAccessorDeclaration;
type CompilerNodeToWrappedType
type CompilerNodeToWrappedType<T extends ts.Node> = T extends ts.ObjectDestructuringAssignment ? ObjectDestructuringAssignment : T extends ts.ArrayDestructuringAssignment ? ArrayDestructuringAssignment : T extends ts.SuperElementAccessExpression ? SuperElementAccessExpression : T extends ts.SuperPropertyAccessExpression ? SuperPropertyAccessExpression : T extends ts.AssignmentExpression<infer U> ? AssignmentExpression<ts.AssignmentExpression<U>> : T['kind'] extends keyof ImplementedKindToNodeMappings ? ImplementedKindToNodeMappings[T['kind']] : T extends ts.SyntaxList ? SyntaxList : T extends ts.TypeNode ? TypeNode : T extends ts.TypeElement ? TypeElement : T extends ts.JSDocTag ? JSDocTag : T extends ts.LiteralExpression ? LiteralExpression : T extends ts.PrimaryExpression ? PrimaryExpression : T extends ts.MemberExpression ? MemberExpression : T extends ts.LeftHandSideExpression ? LeftHandSideExpression : T extends ts.UpdateExpression ? UpdateExpression : T extends ts.UnaryExpression ? UnaryExpression : T extends ts.Expression ? Expression : T extends ts.IterationStatement ? IterationStatement : T extends ts.Statement ? Statement : Node<T>;
type Constructor
type Constructor<T> = new (...args: any[]) => T;
type EntityName
type EntityName = Identifier | QualifiedName;
type JsxAttributeLike
type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
type JsxChild
type JsxChild = | JsxText | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
type JsxTagNameExpression
type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess;
type ModifierTexts
type ModifierTexts = | 'export' | 'default' | 'declare' | 'abstract' | 'public' | 'protected' | 'private' | 'readonly' | 'static' | 'async' | 'const';
type ModuleReference
type ModuleReference = EntityName | ExternalModuleReference;
type NamedNodeSpecific
type NamedNodeSpecific = NamedNodeSpecificBase<Identifier>;
type NodeParentType
type NodeParentType<NodeType extends ts.Node> = NodeType extends ts.SourceFile ? CompilerNodeToWrappedType<NodeType['parent']> | undefined : ts.Node extends NodeType ? CompilerNodeToWrappedType<NodeType['parent']> | undefined : CompilerNodeToWrappedType<NodeType['parent']>;
type NodePropertyToWrappedType
type NodePropertyToWrappedType< NodeType extends ts.Node, KeyName extends keyof NodeType, NonNullableNodeType = NonNullable<NodeType[KeyName]>> = NodeType[KeyName] extends | ts.NodeArray<infer ArrayNodeTypeForNullable> | undefined ? CompilerNodeToWrappedType<ArrayNodeTypeForNullable>[] | undefined : NodeType[KeyName] extends ts.NodeArray<infer ArrayNodeType> ? CompilerNodeToWrappedType<ArrayNodeType>[] : NodeType[KeyName] extends ts.Node ? CompilerNodeToWrappedType<NodeType[KeyName]> : NonNullableNodeType extends ts.Node ? CompilerNodeToWrappedType<NonNullableNodeType> | undefined : NodeType[KeyName];
type ObjectLiteralElementLike
type ObjectLiteralElementLike = | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration;
type PropertyName
type PropertyName = | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName;
type PropertyNamedNodeSpecific
type PropertyNamedNodeSpecific = NamedNodeSpecificBase<PropertyName>;
type SourceFileReferencingNodes
type SourceFileReferencingNodes = | ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration | CallExpression;
type TemplateLiteral
type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral;
type TypeElementTypes
type TypeElementTypes = | PropertySignature | MethodSignature | ConstructSignatureDeclaration | CallSignatureDeclaration | IndexSignatureDeclaration;
type WriterFunction
type WriterFunction = (writer: CodeBlockWriter) => void;
Package Files (2)
Dependencies (9)
Dev Dependencies (33)
- @types/chai
- @types/diff
- @types/fs-extra
- @types/glob-parent
- @types/is-negated-glob
- @types/mocha
- @types/multimatch
- @types/node
- @types/ts-nameof
- barrel-maintainer
- chai
- chalk
- conditional-type-checks
- coveralls
- cross-env
- diff
- mocha
- npx
- nyc
- rimraf
- shelljs
- shx
- source-map-support
- ts-nameof
- ts-node
- ts-simple-ast
- tslint
- ttypescript
- typescript-3.0.1
- typescript-3.0.3
- typescript-3.1.6
- typescript-3.2.4
- typescript-3.3.1
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ts-simple-ast
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/ts-simple-ast)
- HTML<a href="https://www.jsdocs.io/package/ts-simple-ast"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 22536 ms. - Missing or incorrect documentation? Open an issue for this package.