tsutils
- Version 3.21.0
- Published
- 382 kB
- 1 dependency
- MIT license
Install
npm i tsutils
yarn add tsutils
pnpm add tsutils
Overview
utilities for working with typescript's AST
Index
Functions
- callExpressionAffectsControlFlow()
- canHaveJsDoc()
- collectVariableUsage()
- commentText()
- convertAst()
- endsControlFlow()
- findImportLikeNodes()
- findImports()
- forEachComment()
- forEachDeclaredVariable()
- forEachDestructuringIdentifier()
- forEachToken()
- forEachTokenWithTrivia()
- formatPseudoBigInt()
- getAccessKind()
- getAstNodeAtPosition()
- getBaseClassMemberOfClassElement()
- getBaseOfClassLikeExpression()
- getCallSignaturesOfType()
- getCheckJsDirective()
- getChildOfKind()
- getCommentAtPosition()
- getConstructorTypeOfClassLikeDeclaration()
- getControlFlowEnd()
- getDeclarationDomain()
- getDeclarationOfBindingElement()
- getIIFE()
- getInstanceTypeOfClassLikeDeclaration()
- getIteratorYieldResultFromIteratorResult()
- getJsDoc()
- getLateBoundPropertyNames()
- getLateBoundPropertyNamesOfPropertyName()
- getLineBreakStyle()
- getLineRanges()
- getModifier()
- getNextStatement()
- getNextToken()
- getPreviousStatement()
- getPreviousToken()
- getPropertyName()
- getPropertyNameFromType()
- getPropertyNameOfWellKnownSymbol()
- getPropertyOfType()
- getSingleLateBoundPropertyNameOfPropertyName()
- getSymbolOfClassLikeDeclaration()
- getTokenAtPosition()
- getTsCheckDirective()
- getUsageDomain()
- getVariableDeclarationKind()
- getWellKnownSymbolPropertyOfType()
- getWrappedNodeAtPosition()
- hasAccessModifier()
- hasExhaustiveCaseClauses()
- hasModifier()
- hasOwnThisReference()
- hasSideEffects()
- intersectionTypeParts()
- isAccessorDeclaration()
- isAmbientModule()
- isAmbientModuleBlock()
- isArrayBindingPattern()
- isArrayLiteralExpression()
- isArrayTypeNode()
- isArrowFunction()
- isAsExpression()
- isAssertionExpression()
- isAssignmentKind()
- isAwaitExpression()
- isBigIntLiteral()
- isBinaryExpression()
- isBindableObjectDefinePropertyCall()
- isBindingElement()
- isBindingPattern()
- isBlock()
- isBlockLike()
- isBlockScopeBoundary()
- isBlockScopedDeclarationStatement()
- isBlockScopedVariableDeclaration()
- isBlockScopedVariableDeclarationList()
- isBooleanLiteral()
- isBooleanLiteralType()
- isBreakOrContinueStatement()
- isBreakStatement()
- isCallExpression()
- isCallLikeExpression()
- isCallSignatureDeclaration()
- isCaseBlock()
- isCaseClause()
- isCaseOrDefaultClause()
- isCatchClause()
- isClassDeclaration()
- isClassExpression()
- isClassLikeDeclaration()
- isCommaListExpression()
- isCompilerOptionEnabled()
- isComputedPropertyName()
- isConditionalExpression()
- isConditionalType()
- isConditionalTypeNode()
- isConstAssertion()
- isConstructorDeclaration()
- isConstructorTypeNode()
- isConstructSignatureDeclaration()
- isContinueStatement()
- isDebuggerStatement()
- isDecorator()
- isDefaultClause()
- isDeleteExpression()
- isDoStatement()
- isElementAccessExpression()
- isEmptyObjectType()
- isEmptyStatement()
- isEntityName()
- isEntityNameExpression()
- isEnumDeclaration()
- isEnumMember()
- isEnumType()
- isExportAssignment()
- isExportDeclaration()
- isExportSpecifier()
- isExpression()
- isExpressionStatement()
- isExpressionValueUsed()
- isExpressionWithTypeArguments()
- isExternalModuleReference()
- isFalsyType()
- isForInOrOfStatement()
- isForInStatement()
- isForOfStatement()
- isForStatement()
- isFunctionDeclaration()
- isFunctionExpression()
- isFunctionScopeBoundary()
- isFunctionTypeNode()
- isFunctionWithBody()
- isGenericType()
- isGetAccessorDeclaration()
- isIdentifier()
- isIfStatement()
- isImportClause()
- isImportDeclaration()
- isImportEqualsDeclaration()
- isImportSpecifier()
- isImportTypeNode()
- isInConstContext()
- isIndexedAccessType()
- isIndexedAccessTypeNode()
- isIndexedAccessype()
- isIndexSignatureDeclaration()
- isInferTypeNode()
- isInSingleStatementContext()
- isInstantiableType()
- isInterfaceDeclaration()
- isInterfaceType()
- isIntersectionType()
- isIntersectionTypeNode()
- isIterationStatement()
- isJsDoc()
- isJsDocKind()
- isJsxAttribute()
- isJsxAttributeLike()
- isJsxAttributes()
- isJsxClosingElement()
- isJsxClosingFragment()
- isJsxElement()
- isJsxExpression()
- isJsxFragment()
- isJsxOpeningElement()
- isJsxOpeningFragment()
- isJsxOpeningLikeElement()
- isJsxSelfClosingElement()
- isJsxSpreadAttribute()
- isJsxText()
- isKeywordKind()
- isLabeledStatement()
- isLiteralExpression()
- isLiteralType()
- isLiteralTypeNode()
- isMappedTypeNode()
- isMetaProperty()
- isMethodDeclaration()
- isMethodSignature()
- isModifierFlagSet()
- isModuleBlock()
- isModuleDeclaration()
- isNamedExports()
- isNamedImports()
- isNamespaceDeclaration()
- isNamespaceExportDeclaration()
- isNamespaceImport()
- isNewExpression()
- isNodeFlagSet()
- isNodeKind()
- isNonNullExpression()
- isNoSubstitutionTemplateLiteral()
- isNullLiteral()
- isNumericLiteral()
- isNumericOrStringLikeLiteral()
- isNumericPropertyName()
- isObjectBindingPattern()
- isObjectFlagSet()
- isObjectLiteralExpression()
- isObjectType()
- isOmittedExpression()
- isOptionalChainingUndefinedMarkerType()
- isOptionalTypeNode()
- isParameterDeclaration()
- isParameterProperty()
- isParenthesizedExpression()
- isParenthesizedTypeNode()
- isPositionInComment()
- isPostfixUnaryExpression()
- isPrefixUnaryExpression()
- isPropertyAccessExpression()
- isPropertyAssignment()
- isPropertyDeclaration()
- isPropertyReadonlyInType()
- isPropertySignature()
- isQualifiedName()
- isReadonlyAssignmentDeclaration()
- isReassignmentTarget()
- isRegularExpressionLiteral()
- isRestTypeNode()
- isReturnStatement()
- isSameLine()
- isScopeBoundary()
- isSetAccessorDeclaration()
- isShorthandPropertyAssignment()
- isSignatureDeclaration()
- isSourceFile()
- isSpreadAssignment()
- isSpreadElement()
- isStatementInAmbientContext()
- isStrictCompilerOptionEnabled()
- isStringLiteral()
- isSubstitutionType()
- isSwitchStatement()
- isSymbolFlagSet()
- isSyntaxList()
- isSyntheticExpression()
- isTaggedTemplateExpression()
- isTemplateExpression()
- isTemplateLiteral()
- isTextualLiteral()
- isThenableType()
- isThisParameter()
- isThrowStatement()
- isTokenKind()
- isTryStatement()
- isTupleType()
- isTupleTypeNode()
- isTupleTypeReference()
- isTypeAliasDeclaration()
- isTypeAssertion()
- isTypeAssignableToNumber()
- isTypeAssignableToString()
- isTypeFlagSet()
- isTypeLiteralNode()
- isTypeNodeKind()
- isTypeOfExpression()
- isTypeOperatorNode()
- isTypeParameter()
- isTypeParameterDeclaration()
- isTypePredicateNode()
- isTypeQueryNode()
- isTypeReference()
- isTypeReferenceNode()
- isTypeScopeBoundary()
- isTypeVariable()
- isUnionOrIntersectionType()
- isUnionType()
- isUnionTypeNode()
- isUniqueESSymbolType()
- isValidIdentifier()
- isValidJsxIdentifier()
- isValidNumericLiteral()
- isValidPropertyAccess()
- isValidPropertyName()
- isVariableDeclaration()
- isVariableDeclarationList()
- isVariableStatement()
- isVoidExpression()
- isWellKnownSymbolLiterally()
- isWhileStatement()
- isWithStatement()
- parseJsDocOfNode()
- removeOptionalChainingUndefinedMarkerType()
- removeOptionalityFromType()
- someTypePart()
- symbolHasReadonlyDeclaration()
- unionTypeParts()
- unwrapParentheses()
Interfaces
Enums
Type Aliases
Functions
function callExpressionAffectsControlFlow
callExpressionAffectsControlFlow: ( node: ts.CallExpression, checker: ts.TypeChecker) => SignatureEffect | undefined;
Dermines whether a top level CallExpression has a control flow effect according to TypeScript's rules. This handles functions returning
never
andasserts
.
function canHaveJsDoc
canHaveJsDoc: (node: ts.Node) => node is ts.HasJSDoc;
function collectVariableUsage
collectVariableUsage: ( sourceFile: ts.SourceFile) => Map<ts.Identifier, VariableInfo>;
function commentText
commentText: (sourceText: string, comment: ts.CommentRange) => string;
function convertAst
convertAst: (sourceFile: ts.SourceFile) => ConvertedAst;
Takes a
ts.SourceFile
and creates data structures that are easier (or more performant) to traverse. Note that there is only a performance gain if you can reuse these structures. It's not recommended for one-time AST walks.
function endsControlFlow
endsControlFlow: ( statement: ts.Statement | ts.BlockLike, checker?: ts.TypeChecker) => boolean;
function findImportLikeNodes
findImportLikeNodes: ( sourceFile: ts.SourceFile, kinds: ImportKind, ignoreFileName?: boolean) => ImportLike[];
function findImports
findImports: ( sourceFile: ts.SourceFile, kinds: ImportKind, ignoreFileName?: boolean) => (ts.StringLiteral | ts.NoSubstitutionTemplateLiteral)[];
function forEachComment
forEachComment: ( node: ts.Node, cb: ForEachCommentCallback, sourceFile?: ts.SourceFile) => void;
Iterate over all comments owned by
node
or its children
function forEachDeclaredVariable
forEachDeclaredVariable: <T>( declarationList: ts.VariableDeclarationList, cb: ( element: (ts.VariableDeclaration | ts.BindingElement) & { name: ts.Identifier; } ) => T) => T | undefined;
function forEachDestructuringIdentifier
forEachDestructuringIdentifier: <T>( pattern: ts.BindingPattern, fn: (element: ts.BindingElement & { name: ts.Identifier }) => T) => T | undefined;
function forEachToken
forEachToken: ( node: ts.Node, cb: (node: ts.Node) => void, sourceFile?: ts.SourceFile) => void;
Iterate over all tokens of
node
Parameter node
The node whose tokens should be visited
Parameter cb
Is called for every token contained in
node
function forEachTokenWithTrivia
forEachTokenWithTrivia: ( node: ts.Node, cb: ForEachTokenCallback, sourceFile?: ts.SourceFile) => void;
Iterate over all tokens and trivia of
node
JsDoc comments are treated like regular comments
Parameter node
The node whose tokens should be visited
Parameter cb
Is called for every token contained in
node
and trivia before the token
function formatPseudoBigInt
formatPseudoBigInt: (v: ts.PseudoBigInt) => `${string}n` | `-${string}n`;
function getAccessKind
getAccessKind: (node: ts.Node) => AccessKind;
function getAstNodeAtPosition
getAstNodeAtPosition: (node: ts.Node, pos: number) => ts.Node | undefined;
Returns the deepest AST Node at
pos
. Returns undefined ifpos
is outside of the range ofnode
function getBaseClassMemberOfClassElement
getBaseClassMemberOfClassElement: ( node: ts.PropertyDeclaration | ts.MethodDeclaration | ts.AccessorDeclaration, checker: ts.TypeChecker) => ts.Symbol | undefined;
Lookup the declaration of a class member in the super class.
function getBaseOfClassLikeExpression
getBaseOfClassLikeExpression: ( node: ts.ClassLikeDeclaration) => ts.ExpressionWithTypeArguments | undefined;
function getCallSignaturesOfType
getCallSignaturesOfType: (type: ts.Type) => ReadonlyArray<ts.Signature>;
function getCheckJsDirective
getCheckJsDirective: (source: string) => ts.CheckJsDirective | undefined;
Returns
the last
// @ts-check
or// @ts-nocheck
directive in the given file.Deprecated
use
getTsCheckDirective
instead since// @ts-nocheck
is no longer restricted to JS files.
function getChildOfKind
getChildOfKind: <T extends ts.SyntaxKind>( node: ts.Node, kind: T, sourceFile?: ts.SourceFile) => ts.Token<T> | undefined;
function getCommentAtPosition
getCommentAtPosition: ( sourceFile: ts.SourceFile, pos: number, parent?: ts.Node) => ts.CommentRange | undefined;
Return the comment at the specified position. You can pass an optional
parent
to avoid some work finding the corresponding token starting atsourceFile
. If theparent
parameter is passed,pos
must be betweenparent.pos
andparent.end
.
function getConstructorTypeOfClassLikeDeclaration
getConstructorTypeOfClassLikeDeclaration: ( node: ts.ClassLikeDeclaration, checker: ts.TypeChecker) => ts.Type;
function getControlFlowEnd
getControlFlowEnd: ( statement: ts.Statement | ts.BlockLike, checker?: ts.TypeChecker) => ControlFlowEnd;
function getDeclarationDomain
getDeclarationDomain: (node: ts.Identifier) => DeclarationDomain | undefined;
function getDeclarationOfBindingElement
getDeclarationOfBindingElement: ( node: ts.BindingElement) => ts.VariableDeclaration | ts.ParameterDeclaration;
Returns the VariableDeclaration or ParameterDeclaration that contains the BindingElement
function getIIFE
getIIFE: ( func: ts.FunctionExpression | ts.ArrowFunction) => ts.CallExpression | undefined;
function getInstanceTypeOfClassLikeDeclaration
getInstanceTypeOfClassLikeDeclaration: ( node: ts.ClassLikeDeclaration, checker: ts.TypeChecker) => ts.Type;
function getIteratorYieldResultFromIteratorResult
getIteratorYieldResultFromIteratorResult: ( type: ts.Type, node: ts.Node, checker: ts.TypeChecker) => ts.Type;
function getJsDoc
getJsDoc: (node: ts.Node, sourceFile?: ts.SourceFile) => ts.JSDoc[];
Gets the JSDoc of a node. For performance reasons this function should only be called when
canHaveJsDoc
returns true.
function getLateBoundPropertyNames
getLateBoundPropertyNames: ( node: ts.Expression, checker: ts.TypeChecker) => LateBoundPropertyNames;
function getLateBoundPropertyNamesOfPropertyName
getLateBoundPropertyNamesOfPropertyName: ( node: ts.PropertyName, checker: ts.TypeChecker) => LateBoundPropertyNames;
function getLineBreakStyle
getLineBreakStyle: (sourceFile: ts.SourceFile) => '\n' | '\r\n';
Get the line break style used in sourceFile. This function only looks at the first line break. If there is none, \n is assumed.
function getLineRanges
getLineRanges: (sourceFile: ts.SourceFile) => LineRange[];
function getModifier
getModifier: (node: ts.Node, kind: ts.Modifier) => ts.Modifier | undefined;
function getNextStatement
getNextStatement: (statement: ts.Statement) => ts.Statement | undefined;
function getNextToken
getNextToken: (node: ts.Node, sourceFile?: ts.SourceFile) => ts.Node | undefined;
Returns the next token that begins after the end of
node
. Returnsundefined
for SourceFile and EndOfFileToken
function getPreviousStatement
getPreviousStatement: (statement: ts.Statement) => ts.Statement | undefined;
function getPreviousToken
getPreviousToken: ( node: ts.Node, sourceFile?: ts.SourceFile) => ts.Node | undefined;
Returns the token before the start of
node
orundefined
if there is none.
function getPropertyName
getPropertyName: (propertyName: ts.PropertyName) => string | undefined;
function getPropertyNameFromType
getPropertyNameFromType: (type: ts.Type) => PropertyName | undefined;
Returns the the literal name or unique symbol name from a given type. Doesn't unwrap union types.
function getPropertyNameOfWellKnownSymbol
getPropertyNameOfWellKnownSymbol: (node: WellKnownSymbolLiteral) => PropertyName;
Deprecated
typescript 4.3 removed the concept of literal well known symbols. Use
getPropertyNameFromType
instead.
function getPropertyOfType
getPropertyOfType: (type: ts.Type, name: ts.__String) => ts.Symbol | undefined;
function getSingleLateBoundPropertyNameOfPropertyName
getSingleLateBoundPropertyNameOfPropertyName: ( node: ts.PropertyName, checker: ts.TypeChecker) => PropertyName | undefined;
Most declarations demand there to be only one statically known name, e.g. class members with computed name.
function getSymbolOfClassLikeDeclaration
getSymbolOfClassLikeDeclaration: ( node: ts.ClassLikeDeclaration, checker: ts.TypeChecker) => ts.Symbol;
function getTokenAtPosition
getTokenAtPosition: ( parent: ts.Node, pos: number, sourceFile?: ts.SourceFile, allowJsDoc?: boolean) => ts.Node | undefined;
Returns the token at or following the specified position or undefined if none is found inside
parent
.
function getTsCheckDirective
getTsCheckDirective: (source: string) => ts.CheckJsDirective | undefined;
Returns
the last
// @ts-check
or// @ts-nocheck
directive in the given file.
function getUsageDomain
getUsageDomain: (node: ts.Identifier) => UsageDomain | undefined;
function getVariableDeclarationKind
getVariableDeclarationKind: ( declarationList: ts.VariableDeclarationList) => VariableDeclarationKind;
function getWellKnownSymbolPropertyOfType
getWellKnownSymbolPropertyOfType: ( type: ts.Type, wellKnownSymbolName: string, checker: ts.TypeChecker) => ts.Symbol | undefined;
function getWrappedNodeAtPosition
getWrappedNodeAtPosition: (wrap: NodeWrap, pos: number) => NodeWrap | undefined;
Returns the NodeWrap of deepest AST node that contains
pos
between itspos
andend
. Only returns undefined if pos is outside ofwrap
function hasAccessModifier
hasAccessModifier: (node: ts.ClassElement | ts.ParameterDeclaration) => boolean;
function hasExhaustiveCaseClauses
hasExhaustiveCaseClauses: ( node: ts.SwitchStatement, checker: ts.TypeChecker) => boolean;
Determines whether the given
SwitchStatement
'scase
clauses cover every possible value of the switched expression. The logic is the same as TypeScript's control flow analysis. This does **not** check whether allcase
clauses do a certain action like assign a variable or return a value. This function ignores thedefault
clause if present.
function hasModifier
hasModifier: ( modifiers: ts.ModifiersArray | undefined, ...kinds: Array<ts.Modifier['kind']>) => boolean;
function hasOwnThisReference
hasOwnThisReference: (node: ts.Node) => boolean;
Returns true for scope boundaries that have their own
this
reference instead of inheriting it from the containing scope
function hasSideEffects
hasSideEffects: (node: ts.Expression, options?: SideEffectOptions) => boolean;
function intersectionTypeParts
intersectionTypeParts: (type: ts.Type) => ts.Type[];
Returns all types of a intersection type or an array containing
type
itself if it's no intersection type.
function isAccessorDeclaration
isAccessorDeclaration: (node: ts.Node) => node is ts.AccessorDeclaration;
function isAmbientModule
isAmbientModule: (node: ts.ModuleDeclaration) => boolean;
Has nothing to do with
isAmbientModuleBlock
.Returns
true
if it's a global augmentation or has a string name.
function isAmbientModuleBlock
isAmbientModuleBlock: (node: ts.Node) => node is ts.ModuleBlock;
Includes
declare namespace
,declare module
anddeclare global
and namespace nested in one of the aforementioned.
function isArrayBindingPattern
isArrayBindingPattern: (node: ts.Node) => node is ts.ArrayBindingPattern;
function isArrayLiteralExpression
isArrayLiteralExpression: (node: ts.Node) => node is ts.ArrayLiteralExpression;
function isArrayTypeNode
isArrayTypeNode: (node: ts.Node) => node is ts.ArrayTypeNode;
function isArrowFunction
isArrowFunction: (node: ts.Node) => node is ts.ArrowFunction;
function isAsExpression
isAsExpression: (node: ts.Node) => node is ts.AsExpression;
function isAssertionExpression
isAssertionExpression: (node: ts.Node) => node is ts.AssertionExpression;
function isAssignmentKind
isAssignmentKind: (kind: ts.SyntaxKind) => boolean;
function isAwaitExpression
isAwaitExpression: (node: ts.Node) => node is ts.AwaitExpression;
function isBigIntLiteral
isBigIntLiteral: (node: ts.Node) => node is ts.BigIntLiteral;
function isBinaryExpression
isBinaryExpression: (node: ts.Node) => node is ts.BinaryExpression;
function isBindableObjectDefinePropertyCall
isBindableObjectDefinePropertyCall: (node: ts.CallExpression) => boolean;
Determines whether a call to
Object.defineProperty
is statically analyzable.
function isBindingElement
isBindingElement: (node: ts.Node) => node is ts.BindingElement;
function isBindingPattern
isBindingPattern: (node: ts.Node) => node is ts.BindingPattern;
function isBlock
isBlock: (node: ts.Node) => node is ts.Block;
function isBlockLike
isBlockLike: (node: ts.Node) => node is ts.BlockLike;
function isBlockScopeBoundary
isBlockScopeBoundary: (node: ts.Node) => ScopeBoundary;
function isBlockScopedDeclarationStatement
isBlockScopedDeclarationStatement: ( statement: ts.Statement) => statement is ts.DeclarationStatement;
function isBlockScopedVariableDeclaration
isBlockScopedVariableDeclaration: ( declaration: ts.VariableDeclaration) => boolean;
function isBlockScopedVariableDeclarationList
isBlockScopedVariableDeclarationList: ( declarationList: ts.VariableDeclarationList) => boolean;
function isBooleanLiteral
isBooleanLiteral: (node: ts.Node) => node is ts.BooleanLiteral;
function isBooleanLiteralType
isBooleanLiteralType: (type: ts.Type, literal: boolean) => boolean;
Determines whether the given type is a boolean literal type and matches the given boolean literal (true or false).
function isBreakOrContinueStatement
isBreakOrContinueStatement: ( node: ts.Node) => node is ts.BreakOrContinueStatement;
function isBreakStatement
isBreakStatement: (node: ts.Node) => node is ts.BreakStatement;
function isCallExpression
isCallExpression: (node: ts.Node) => node is ts.CallExpression;
function isCallLikeExpression
isCallLikeExpression: (node: ts.Node) => node is ts.CallLikeExpression;
function isCallSignatureDeclaration
isCallSignatureDeclaration: ( node: ts.Node) => node is ts.CallSignatureDeclaration;
function isCaseBlock
isCaseBlock: (node: ts.Node) => node is ts.CaseBlock;
function isCaseClause
isCaseClause: (node: ts.Node) => node is ts.CaseClause;
function isCaseOrDefaultClause
isCaseOrDefaultClause: (node: ts.Node) => node is ts.CaseOrDefaultClause;
function isCatchClause
isCatchClause: (node: ts.Node) => node is ts.CatchClause;
function isClassDeclaration
isClassDeclaration: (node: ts.Node) => node is ts.ClassDeclaration;
function isClassExpression
isClassExpression: (node: ts.Node) => node is ts.ClassExpression;
function isClassLikeDeclaration
isClassLikeDeclaration: (node: ts.Node) => node is ts.ClassLikeDeclaration;
function isCommaListExpression
isCommaListExpression: (node: ts.Node) => node is ts.CommaListExpression;
function isCompilerOptionEnabled
isCompilerOptionEnabled: ( options: ts.CompilerOptions, option: BooleanCompilerOptions | 'stripInternal') => boolean;
Checks if a given compiler option is enabled. It handles dependencies of options, e.g.
declaration
is implicitly enabled bycomposite
orstrictNullChecks
is enabled bystrict
. However, it does not check dependencies that are already checked and reported as errors, e.g.checkJs
withoutallowJs
. This function only handles boolean flags.
function isComputedPropertyName
isComputedPropertyName: (node: ts.Node) => node is ts.ComputedPropertyName;
function isConditionalExpression
isConditionalExpression: (node: ts.Node) => node is ts.ConditionalExpression;
function isConditionalType
isConditionalType: (type: ts.Type) => type is ts.ConditionalType;
function isConditionalTypeNode
isConditionalTypeNode: (node: ts.Node) => node is ts.ConditionalTypeNode;
function isConstAssertion
isConstAssertion: (node: ts.AssertionExpression) => boolean;
function isConstructorDeclaration
isConstructorDeclaration: (node: ts.Node) => node is ts.ConstructorDeclaration;
function isConstructorTypeNode
isConstructorTypeNode: (node: ts.Node) => node is ts.ConstructorTypeNode;
function isConstructSignatureDeclaration
isConstructSignatureDeclaration: ( node: ts.Node) => node is ts.ConstructSignatureDeclaration;
function isContinueStatement
isContinueStatement: (node: ts.Node) => node is ts.ContinueStatement;
function isDebuggerStatement
isDebuggerStatement: (node: ts.Node) => node is ts.DebuggerStatement;
function isDecorator
isDecorator: (node: ts.Node) => node is ts.Decorator;
function isDefaultClause
isDefaultClause: (node: ts.Node) => node is ts.DefaultClause;
function isDeleteExpression
isDeleteExpression: (node: ts.Node) => node is ts.DeleteExpression;
function isDoStatement
isDoStatement: (node: ts.Node) => node is ts.DoStatement;
function isElementAccessExpression
isElementAccessExpression: (node: ts.Node) => node is ts.ElementAccessExpression;
function isEmptyObjectType
isEmptyObjectType: (type: ts.Type) => type is ts.ObjectType;
function isEmptyStatement
isEmptyStatement: (node: ts.Node) => node is ts.EmptyStatement;
function isEntityName
isEntityName: (node: ts.Node) => node is ts.EntityName;
function isEntityNameExpression
isEntityNameExpression: (node: ts.Node) => node is ts.EntityNameExpression;
function isEnumDeclaration
isEnumDeclaration: (node: ts.Node) => node is ts.EnumDeclaration;
function isEnumMember
isEnumMember: (node: ts.Node) => node is ts.EnumMember;
function isEnumType
isEnumType: (type: ts.Type) => type is ts.EnumType;
function isExportAssignment
isExportAssignment: (node: ts.Node) => node is ts.ExportAssignment;
function isExportDeclaration
isExportDeclaration: (node: ts.Node) => node is ts.ExportDeclaration;
function isExportSpecifier
isExportSpecifier: (node: ts.Node) => node is ts.ExportSpecifier;
function isExpression
isExpression: (node: ts.Node) => node is ts.Expression;
function isExpressionStatement
isExpressionStatement: (node: ts.Node) => node is ts.ExpressionStatement;
function isExpressionValueUsed
isExpressionValueUsed: (node: ts.Expression) => boolean;
function isExpressionWithTypeArguments
isExpressionWithTypeArguments: ( node: ts.Node) => node is ts.ExpressionWithTypeArguments;
function isExternalModuleReference
isExternalModuleReference: (node: ts.Node) => node is ts.ExternalModuleReference;
function isFalsyType
isFalsyType: (type: ts.Type) => boolean;
Determine if a type is definitely falsy. This function doesn't unwrap union types.
function isForInOrOfStatement
isForInOrOfStatement: (node: ts.Node) => node is ts.ForInOrOfStatement;
function isForInStatement
isForInStatement: (node: ts.Node) => node is ts.ForInStatement;
function isForOfStatement
isForOfStatement: (node: ts.Node) => node is ts.ForOfStatement;
function isForStatement
isForStatement: (node: ts.Node) => node is ts.ForStatement;
function isFunctionDeclaration
isFunctionDeclaration: (node: ts.Node) => node is ts.FunctionDeclaration;
function isFunctionExpression
isFunctionExpression: (node: ts.Node) => node is ts.FunctionExpression;
function isFunctionScopeBoundary
isFunctionScopeBoundary: (node: ts.Node) => ScopeBoundary;
function isFunctionTypeNode
isFunctionTypeNode: (node: ts.Node) => node is ts.FunctionTypeNode;
function isFunctionWithBody
isFunctionWithBody: (node: ts.Node) => node is any;
function isGenericType
isGenericType: (type: ts.Type) => type is ts.GenericType;
function isGetAccessorDeclaration
isGetAccessorDeclaration: (node: ts.Node) => node is ts.GetAccessorDeclaration;
function isIdentifier
isIdentifier: (node: ts.Node) => node is ts.Identifier;
function isIfStatement
isIfStatement: (node: ts.Node) => node is ts.IfStatement;
function isImportClause
isImportClause: (node: ts.Node) => node is ts.ImportClause;
function isImportDeclaration
isImportDeclaration: (node: ts.Node) => node is ts.ImportDeclaration;
function isImportEqualsDeclaration
isImportEqualsDeclaration: (node: ts.Node) => node is ts.ImportEqualsDeclaration;
function isImportSpecifier
isImportSpecifier: (node: ts.Node) => node is ts.ImportSpecifier;
function isImportTypeNode
isImportTypeNode: (node: ts.Node) => node is ts.ImportTypeNode;
function isInConstContext
isInConstContext: (node: ts.Expression) => boolean;
Detects whether an expression is affected by an enclosing 'as const' assertion and therefore treated literally.
function isIndexedAccessType
isIndexedAccessType: (type: ts.Type) => type is ts.IndexedAccessType;
function isIndexedAccessTypeNode
isIndexedAccessTypeNode: (node: ts.Node) => node is ts.IndexedAccessTypeNode;
function isIndexedAccessype
isIndexedAccessype: (type: ts.Type) => type is ts.IndexType;
function isIndexSignatureDeclaration
isIndexSignatureDeclaration: ( node: ts.Node) => node is ts.IndexSignatureDeclaration;
function isInferTypeNode
isInferTypeNode: (node: ts.Node) => node is ts.InferTypeNode;
function isInSingleStatementContext
isInSingleStatementContext: (statement: ts.Statement) => boolean;
function isInstantiableType
isInstantiableType: (type: ts.Type) => type is ts.InstantiableType;
function isInterfaceDeclaration
isInterfaceDeclaration: (node: ts.Node) => node is ts.InterfaceDeclaration;
function isInterfaceType
isInterfaceType: (type: ts.Type) => type is ts.InterfaceType;
function isIntersectionType
isIntersectionType: (type: ts.Type) => type is ts.IntersectionType;
function isIntersectionTypeNode
isIntersectionTypeNode: (node: ts.Node) => node is ts.IntersectionTypeNode;
function isIterationStatement
isIterationStatement: (node: ts.Node) => node is ts.IterationStatement;
function isJsDoc
isJsDoc: (node: ts.Node) => node is ts.JSDoc;
function isJsDocKind
isJsDocKind: (kind: ts.SyntaxKind) => boolean;
function isJsxAttribute
isJsxAttribute: (node: ts.Node) => node is ts.JsxAttribute;
function isJsxAttributeLike
isJsxAttributeLike: (node: ts.Node) => node is ts.JsxAttributeLike;
function isJsxAttributes
isJsxAttributes: (node: ts.Node) => node is ts.JsxAttributes;
function isJsxClosingElement
isJsxClosingElement: (node: ts.Node) => node is ts.JsxClosingElement;
function isJsxClosingFragment
isJsxClosingFragment: (node: ts.Node) => node is ts.JsxClosingFragment;
function isJsxElement
isJsxElement: (node: ts.Node) => node is ts.JsxElement;
function isJsxExpression
isJsxExpression: (node: ts.Node) => node is ts.JsxExpression;
function isJsxFragment
isJsxFragment: (node: ts.Node) => node is ts.JsxFragment;
function isJsxOpeningElement
isJsxOpeningElement: (node: ts.Node) => node is ts.JsxOpeningElement;
function isJsxOpeningFragment
isJsxOpeningFragment: (node: ts.Node) => node is ts.JsxOpeningFragment;
function isJsxOpeningLikeElement
isJsxOpeningLikeElement: (node: ts.Node) => node is ts.JsxOpeningLikeElement;
function isJsxSelfClosingElement
isJsxSelfClosingElement: (node: ts.Node) => node is ts.JsxSelfClosingElement;
function isJsxSpreadAttribute
isJsxSpreadAttribute: (node: ts.Node) => node is ts.JsxSpreadAttribute;
function isJsxText
isJsxText: (node: ts.Node) => node is ts.JsxText;
function isKeywordKind
isKeywordKind: (kind: ts.SyntaxKind) => boolean;
function isLabeledStatement
isLabeledStatement: (node: ts.Node) => node is ts.LabeledStatement;
function isLiteralExpression
isLiteralExpression: (node: ts.Node) => node is ts.LiteralExpression;
function isLiteralType
isLiteralType: (type: ts.Type) => type is ts.LiteralType;
function isLiteralTypeNode
isLiteralTypeNode: (node: ts.Node) => node is ts.LiteralTypeNode;
function isMappedTypeNode
isMappedTypeNode: (node: ts.Node) => node is ts.MappedTypeNode;
function isMetaProperty
isMetaProperty: (node: ts.Node) => node is ts.MetaProperty;
function isMethodDeclaration
isMethodDeclaration: (node: ts.Node) => node is ts.MethodDeclaration;
function isMethodSignature
isMethodSignature: (node: ts.Node) => node is ts.MethodSignature;
function isModifierFlagSet
isModifierFlagSet: (node: ts.Node, flag: ts.ModifierFlags) => boolean;
function isModuleBlock
isModuleBlock: (node: ts.Node) => node is ts.ModuleBlock;
function isModuleDeclaration
isModuleDeclaration: (node: ts.Node) => node is ts.ModuleDeclaration;
function isNamedExports
isNamedExports: (node: ts.Node) => node is ts.NamedExports;
function isNamedImports
isNamedImports: (node: ts.Node) => node is ts.NamedImports;
function isNamespaceDeclaration
isNamespaceDeclaration: (node: ts.Node) => node is ts.NamespaceDeclaration;
function isNamespaceExportDeclaration
isNamespaceExportDeclaration: ( node: ts.Node) => node is ts.NamespaceExportDeclaration;
function isNamespaceImport
isNamespaceImport: (node: ts.Node) => node is ts.NamespaceImport;
function isNewExpression
isNewExpression: (node: ts.Node) => node is ts.NewExpression;
function isNodeFlagSet
isNodeFlagSet: (node: ts.Node, flag: ts.NodeFlags) => boolean;
function isNodeKind
isNodeKind: (kind: ts.SyntaxKind) => boolean;
function isNonNullExpression
isNonNullExpression: (node: ts.Node) => node is ts.NonNullExpression;
function isNoSubstitutionTemplateLiteral
isNoSubstitutionTemplateLiteral: ( node: ts.Node) => node is ts.NoSubstitutionTemplateLiteral;
function isNullLiteral
isNullLiteral: (node: ts.Node) => node is ts.NullLiteral;
function isNumericLiteral
isNumericLiteral: (node: ts.Node) => node is ts.NumericLiteral;
function isNumericOrStringLikeLiteral
isNumericOrStringLikeLiteral: (node: ts.Node) => node is any;
function isNumericPropertyName
isNumericPropertyName: (name: string | ts.__String) => boolean;
function isObjectBindingPattern
isObjectBindingPattern: (node: ts.Node) => node is ts.ObjectBindingPattern;
function isObjectFlagSet
isObjectFlagSet: (objectType: ts.ObjectType, flag: ts.ObjectFlags) => boolean;
function isObjectLiteralExpression
isObjectLiteralExpression: (node: ts.Node) => node is ts.ObjectLiteralExpression;
function isObjectType
isObjectType: (type: ts.Type) => type is ts.ObjectType;
function isOmittedExpression
isOmittedExpression: (node: ts.Node) => node is ts.OmittedExpression;
function isOptionalChainingUndefinedMarkerType
isOptionalChainingUndefinedMarkerType: ( checker: ts.TypeChecker, t: ts.Type) => boolean;
function isOptionalTypeNode
isOptionalTypeNode: (node: ts.Node) => node is ts.OptionalTypeNode;
function isParameterDeclaration
isParameterDeclaration: (node: ts.Node) => node is ts.ParameterDeclaration;
function isParameterProperty
isParameterProperty: (node: ts.ParameterDeclaration) => boolean;
function isParenthesizedExpression
isParenthesizedExpression: (node: ts.Node) => node is ts.ParenthesizedExpression;
function isParenthesizedTypeNode
isParenthesizedTypeNode: (node: ts.Node) => node is ts.ParenthesizedTypeNode;
function isPositionInComment
isPositionInComment: ( sourceFile: ts.SourceFile, pos: number, parent?: ts.Node) => boolean;
Returns whether the specified position is inside a comment. You can pass an optional
parent
to avoid some work finding the corresponding token starting atsourceFile
. If theparent
parameter is passed,pos
must be betweenparent.pos
andparent.end
.
function isPostfixUnaryExpression
isPostfixUnaryExpression: (node: ts.Node) => node is ts.PostfixUnaryExpression;
function isPrefixUnaryExpression
isPrefixUnaryExpression: (node: ts.Node) => node is ts.PrefixUnaryExpression;
function isPropertyAccessExpression
isPropertyAccessExpression: ( node: ts.Node) => node is ts.PropertyAccessExpression;
function isPropertyAssignment
isPropertyAssignment: (node: ts.Node) => node is ts.PropertyAssignment;
function isPropertyDeclaration
isPropertyDeclaration: (node: ts.Node) => node is ts.PropertyDeclaration;
function isPropertyReadonlyInType
isPropertyReadonlyInType: ( type: ts.Type, name: ts.__String, checker: ts.TypeChecker) => boolean;
Determines if writing to a certain property of a given type is allowed.
function isPropertySignature
isPropertySignature: (node: ts.Node) => node is ts.PropertySignature;
function isQualifiedName
isQualifiedName: (node: ts.Node) => node is ts.QualifiedName;
function isReadonlyAssignmentDeclaration
isReadonlyAssignmentDeclaration: ( node: ts.CallExpression, checker: ts.TypeChecker) => boolean;
Returns true for
Object.defineProperty(o, 'prop', {value, writable: false})
andObject.defineProperty(o, 'prop', {get: () => 1})
function isReassignmentTarget
isReassignmentTarget: (node: ts.Expression) => boolean;
function isRegularExpressionLiteral
isRegularExpressionLiteral: ( node: ts.Node) => node is ts.RegularExpressionLiteral;
function isRestTypeNode
isRestTypeNode: (node: ts.Node) => node is ts.RestTypeNode;
function isReturnStatement
isReturnStatement: (node: ts.Node) => node is ts.ReturnStatement;
function isSameLine
isSameLine: (sourceFile: ts.SourceFile, pos1: number, pos2: number) => boolean;
function isScopeBoundary
isScopeBoundary: (node: ts.Node) => ScopeBoundary;
function isSetAccessorDeclaration
isSetAccessorDeclaration: (node: ts.Node) => node is ts.SetAccessorDeclaration;
function isShorthandPropertyAssignment
isShorthandPropertyAssignment: ( node: ts.Node) => node is ts.ShorthandPropertyAssignment;
function isSignatureDeclaration
isSignatureDeclaration: (node: ts.Node) => node is ts.SignatureDeclaration;
function isSourceFile
isSourceFile: (node: ts.Node) => node is ts.SourceFile;
function isSpreadAssignment
isSpreadAssignment: (node: ts.Node) => node is ts.SpreadAssignment;
function isSpreadElement
isSpreadElement: (node: ts.Node) => node is ts.SpreadElement;
function isStatementInAmbientContext
isStatementInAmbientContext: (node: ts.Statement) => boolean;
Ambient context means the statement itself has the
declare
keyword or is inside adeclare namespace
,delcare module
ordeclare global
.
function isStrictCompilerOptionEnabled
isStrictCompilerOptionEnabled: ( options: ts.CompilerOptions, option: StrictCompilerOption) => boolean;
function isStringLiteral
isStringLiteral: (node: ts.Node) => node is ts.StringLiteral;
function isSubstitutionType
isSubstitutionType: (type: ts.Type) => type is ts.SubstitutionType;
function isSwitchStatement
isSwitchStatement: (node: ts.Node) => node is ts.SwitchStatement;
function isSymbolFlagSet
isSymbolFlagSet: (symbol: ts.Symbol, flag: ts.SymbolFlags) => boolean;
function isSyntaxList
isSyntaxList: (node: ts.Node) => node is ts.SyntaxList;
function isSyntheticExpression
isSyntheticExpression: (node: ts.Node) => node is ts.SyntheticExpression;
function isTaggedTemplateExpression
isTaggedTemplateExpression: ( node: ts.Node) => node is ts.TaggedTemplateExpression;
function isTemplateExpression
isTemplateExpression: (node: ts.Node) => node is ts.TemplateExpression;
function isTemplateLiteral
isTemplateLiteral: (node: ts.Node) => node is ts.TemplateLiteral;
function isTextualLiteral
isTextualLiteral: (node: ts.Node) => node is any;
function isThenableType
isThenableType: { (checker: ts.TypeChecker, node: ts.Node, type: ts.Type): boolean; (checker: ts.TypeChecker, node: ts.Expression, type?: ts.Type): boolean;};
Determines if a type thenable and can be used with
await
.
function isThisParameter
isThisParameter: (parameter: ts.ParameterDeclaration) => boolean;
function isThrowStatement
isThrowStatement: (node: ts.Node) => node is ts.ThrowStatement;
function isTokenKind
isTokenKind: (kind: ts.SyntaxKind) => boolean;
function isTryStatement
isTryStatement: (node: ts.Node) => node is ts.TryStatement;
function isTupleType
isTupleType: (type: ts.Type) => type is ts.TupleType;
function isTupleTypeNode
isTupleTypeNode: (node: ts.Node) => node is ts.TupleTypeNode;
function isTupleTypeReference
isTupleTypeReference: (type: ts.Type) => type is any;
function isTypeAliasDeclaration
isTypeAliasDeclaration: (node: ts.Node) => node is ts.TypeAliasDeclaration;
function isTypeAssertion
isTypeAssertion: (node: ts.Node) => node is ts.TypeAssertion;
function isTypeAssignableToNumber
isTypeAssignableToNumber: (checker: ts.TypeChecker, type: ts.Type) => boolean;
function isTypeAssignableToString
isTypeAssignableToString: (checker: ts.TypeChecker, type: ts.Type) => boolean;
function isTypeFlagSet
isTypeFlagSet: (type: ts.Type, flag: ts.TypeFlags) => boolean;
function isTypeLiteralNode
isTypeLiteralNode: (node: ts.Node) => node is ts.TypeLiteralNode;
function isTypeNodeKind
isTypeNodeKind: (kind: ts.SyntaxKind) => boolean;
function isTypeOfExpression
isTypeOfExpression: (node: ts.Node) => node is ts.TypeOfExpression;
function isTypeOperatorNode
isTypeOperatorNode: (node: ts.Node) => node is ts.TypeOperatorNode;
function isTypeParameter
isTypeParameter: (type: ts.Type) => type is ts.TypeParameter;
function isTypeParameterDeclaration
isTypeParameterDeclaration: ( node: ts.Node) => node is ts.TypeParameterDeclaration;
function isTypePredicateNode
isTypePredicateNode: (node: ts.Node) => node is ts.TypePredicateNode;
function isTypeQueryNode
isTypeQueryNode: (node: ts.Node) => node is ts.TypeQueryNode;
function isTypeReference
isTypeReference: (type: ts.Type) => type is ts.TypeReference;
function isTypeReferenceNode
isTypeReferenceNode: (node: ts.Node) => node is ts.TypeReferenceNode;
function isTypeScopeBoundary
isTypeScopeBoundary: (node: ts.Node) => ScopeBoundary;
function isTypeVariable
isTypeVariable: (type: ts.Type) => type is any;
function isUnionOrIntersectionType
isUnionOrIntersectionType: (type: ts.Type) => type is ts.UnionOrIntersectionType;
function isUnionType
isUnionType: (type: ts.Type) => type is ts.UnionType;
function isUnionTypeNode
isUnionTypeNode: (node: ts.Node) => node is ts.UnionTypeNode;
function isUniqueESSymbolType
isUniqueESSymbolType: (type: ts.Type) => type is ts.UniqueESSymbolType;
function isValidIdentifier
isValidIdentifier: (text: string, languageVersion?: ts.ScriptTarget) => boolean;
Determines whether the given text parses as a standalone identifier. This is not a guarantee that it works in every context. The property name in PropertyAccessExpressions for example allows reserved words. Depending on the context it could be parsed as contextual keyword or TypeScript keyword.
function isValidJsxIdentifier
isValidJsxIdentifier: ( text: string, languageVersion?: ts.ScriptTarget) => boolean;
Determines whether the given text can be used as JSX tag or attribute name while preserving the exact name.
function isValidNumericLiteral
isValidNumericLiteral: ( text: string, languageVersion?: ts.ScriptTarget) => boolean;
Determines whether the given text can be parsed as a numeric literal.
function isValidPropertyAccess
isValidPropertyAccess: ( text: string, languageVersion?: ts.ScriptTarget) => boolean;
Determines whether the given text can be used to access a property with a PropertyAccessExpression while preserving the property's name.
function isValidPropertyName
isValidPropertyName: ( text: string, languageVersion?: ts.ScriptTarget) => boolean;
Determines whether the given text can be used as unquoted name of a property declaration while preserving the property's name.
function isVariableDeclaration
isVariableDeclaration: (node: ts.Node) => node is ts.VariableDeclaration;
function isVariableDeclarationList
isVariableDeclarationList: (node: ts.Node) => node is ts.VariableDeclarationList;
function isVariableStatement
isVariableStatement: (node: ts.Node) => node is ts.VariableStatement;
function isVoidExpression
isVoidExpression: (node: ts.Node) => node is ts.VoidExpression;
function isWellKnownSymbolLiterally
isWellKnownSymbolLiterally: ( node: ts.Expression) => node is WellKnownSymbolLiteral;
function isWhileStatement
isWhileStatement: (node: ts.Node) => node is ts.WhileStatement;
function isWithStatement
isWithStatement: (node: ts.Node) => node is ts.WithStatement;
function parseJsDocOfNode
parseJsDocOfNode: ( node: ts.Node, considerTrailingComments?: boolean, sourceFile?: ts.SourceFile) => ts.JSDoc[];
Parses the JsDoc of any node. This function is made for nodes that don't get their JsDoc parsed by the TypeScript parser.
Parameter considerTrailingComments
When set to
true
this function uses the trailing comments if the node starts on the same line as the previous node ends.
function removeOptionalChainingUndefinedMarkerType
removeOptionalChainingUndefinedMarkerType: ( checker: ts.TypeChecker, type: ts.Type) => ts.Type;
function removeOptionalityFromType
removeOptionalityFromType: (checker: ts.TypeChecker, type: ts.Type) => ts.Type;
function someTypePart
someTypePart: ( type: ts.Type, predicate: (t: ts.Type) => t is ts.UnionOrIntersectionType, cb: (t: ts.Type) => boolean) => boolean;
function symbolHasReadonlyDeclaration
symbolHasReadonlyDeclaration: ( symbol: ts.Symbol, checker: ts.TypeChecker) => boolean;
function unionTypeParts
unionTypeParts: (type: ts.Type) => ts.Type[];
Returns all types of a union type or an array containing
type
itself if it's no union type.
function unwrapParentheses
unwrapParentheses: (node: ts.Expression) => ts.Expression;
Interfaces
interface ControlFlowEnd
interface ControlFlowEnd {}
property end
readonly end: boolean;
true
if control flow definitely ends.
property statements
readonly statements: ReadonlyArray<ControlFlowStatement>;
Statements that may end control flow at this statement. Does not contain control flow statements that jump only inside the statement, for example a
continue
inside a nested for loop.
interface ConvertedAst
interface ConvertedAst {}
interface LateBoundPropertyNames
interface LateBoundPropertyNames {}
interface LineRange
interface LineRange extends ts.TextRange {}
property contentLength
contentLength: number;
interface NodeWrap
interface NodeWrap {}
Wraps an AST node. Can be used as a tree using
children
or a linked list usingnext
andskip
.
property children
children: NodeWrap[];
All immediate children of
node
that would be visited byts.forEachChild(node, cb)
.
property kind
kind: ts.SyntaxKind;
The SyntaxKind of
node
.
property next
next?: NodeWrap;
Link to the next NodeWrap, depth-first.
property node
node: ts.Node;
The real AST node.
property parent
parent?: NodeWrap;
Link to the parent NodeWrap
property skip
skip?: NodeWrap;
Link to the next NodeWrap skipping all children of the current node.
interface PropertyName
interface PropertyName {}
property displayName
displayName: string;
property symbolName
symbolName: ts.__String;
interface VariableInfo
interface VariableInfo {}
property declarations
declarations: ts.Identifier[];
property domain
domain: DeclarationDomain;
property exported
exported: boolean;
property inGlobalScope
inGlobalScope: boolean;
property uses
uses: VariableUse[];
interface VariableUse
interface VariableUse {}
interface WellKnownSymbolLiteral
interface WellKnownSymbolLiteral extends ts.PropertyAccessExpression {}
property expression
expression: ts.Identifier & { text: 'Symbol'; escapedText: 'symbol';};
interface WrappedAst
interface WrappedAst extends NodeWrap {}
Enums
enum AccessKind
enum AccessKind { None = 0, Read = 1, Write = 2, Delete = 4, ReadWrite = 3, Modification = 6,}
enum DeclarationDomain
enum DeclarationDomain { Namespace = 1, Type = 2, Value = 4, Import = 8, Any = 7,}
enum ImportKind
enum ImportKind { ImportDeclaration = 1, ImportEquals = 2, ExportFrom = 4, DynamicImport = 8, Require = 16, ImportType = 32, All = 63, AllImports = 59, AllStaticImports = 3, AllImportExpressions = 24, AllRequireLike = 18,}
member All
All = 63
member AllImportExpressions
AllImportExpressions = 24
member AllImports
AllImports = 59
member AllRequireLike
AllRequireLike = 18
member AllStaticImports
AllStaticImports = 3
member DynamicImport
DynamicImport = 8
member ExportFrom
ExportFrom = 4
member ImportDeclaration
ImportDeclaration = 1
member ImportEquals
ImportEquals = 2
member ImportType
ImportType = 32
member Require
Require = 16
enum ScopeBoundary
enum ScopeBoundary { None = 0, Function = 1, Block = 2, Type = 4, ConditionalType = 8,}
member Block
Block = 2
member ConditionalType
ConditionalType = 8
member Function
Function = 1
member None
None = 0
member Type
Type = 4
enum ScopeBoundarySelector
enum ScopeBoundarySelector { Function = 1, Block = 3, Type = 7, InferType = 8,}
enum SideEffectOptions
enum SideEffectOptions { None = 0, TaggedTemplate = 1, Constructor = 2, JsxElement = 4,}
member Constructor
Constructor = 2
member JsxElement
JsxElement = 4
member None
None = 0
member TaggedTemplate
TaggedTemplate = 1
enum SignatureEffect
enum SignatureEffect { Never = 1, Asserts = 2,}
enum UsageDomain
enum UsageDomain { Namespace = 1, Type = 2, Value = 4, ValueOrNamespace = 5, Any = 7, TypeQuery = 8,}
enum VariableDeclarationKind
enum VariableDeclarationKind { Var = 0, Let = 1, Const = 2,}
Type Aliases
type BooleanCompilerOptions
type BooleanCompilerOptions = { [K in keyof ts.CompilerOptions]: NonNullable< ts.CompilerOptions[K] > extends boolean ? K : never;} extends { [_ in keyof ts.CompilerOptions]: infer U;} ? U : never;
type ControlFlowStatement
type ControlFlowStatement = | ts.BreakStatement | ts.ContinueStatement | ts.ReturnStatement | ts.ThrowStatement | (ts.ExpressionStatement & { expression: ts.CallExpression; });
type ForEachCommentCallback
type ForEachCommentCallback = (fullText: string, comment: ts.CommentRange) => void;
type ForEachTokenCallback
type ForEachTokenCallback = ( fullText: string, kind: ts.SyntaxKind, range: ts.TextRange, parent: ts.Node) => void;
type ImportLike
type ImportLike = | ts.ImportDeclaration | (ts.ImportEqualsDeclaration & { moduleReference: ts.ExternalModuleReference; }) | (ts.ExportDeclaration & { moduleSpecifier: {}; }) | (ts.CallExpression & { expression: | ts.Token<ts.SyntaxKind.ImportKeyword> | (ts.Identifier & { text: 'require'; }); arguments: [ts.Expression, ...ts.Expression[]]; }) | ts.ImportTypeNode;
type StrictCompilerOption
type StrictCompilerOption = | 'noImplicitAny' | 'noImplicitThis' | 'strictNullChecks' | 'strictFunctionTypes' | 'strictPropertyInitialization' | 'alwaysStrict' | 'strictBindCallApply';
Package Files (12)
Dependencies (1)
Dev Dependencies (18)
Peer Dependencies (1)
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/tsutils
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/tsutils)
- HTML<a href="https://www.jsdocs.io/package/tsutils"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4030 ms. - Missing or incorrect documentation? Open an issue for this package.