1import * as ts from 'typescript'; 2 3// Workaround for 4// https://github.com/typescript-eslint/typescript-eslint/issues/2388 5// to support both TypeScript 3.9 & 4: 6declare module 'typescript' { 7 // eslint-disable-next-line @typescript-eslint/no-empty-interface 8 export interface NamedTupleMember extends ts.Node {} 9} 10 11export type TSToken = ts.Token<ts.SyntaxKind>; 12 13export type TSNode = 14 | ts.Modifier 15 | ts.Identifier 16 | ts.QualifiedName 17 | ts.ComputedPropertyName 18 | ts.Decorator 19 | ts.TypeParameterDeclaration 20 // | ts.SignatureDeclarationBase -> CallSignatureDeclaration, ConstructSignatureDeclaration 21 | ts.CallSignatureDeclaration 22 | ts.ConstructSignatureDeclaration 23 | ts.VariableDeclaration 24 | ts.VariableDeclarationList 25 | ts.ParameterDeclaration 26 | ts.BindingElement 27 | ts.PropertySignature 28 | ts.PropertyDeclaration 29 | ts.PropertyAssignment 30 | ts.ShorthandPropertyAssignment 31 | ts.SpreadAssignment 32 | ts.ObjectBindingPattern 33 | ts.ArrayBindingPattern 34 | ts.FunctionDeclaration 35 | ts.MethodSignature 36 | ts.MethodDeclaration 37 | ts.ConstructorDeclaration 38 | ts.SemicolonClassElement 39 | ts.GetAccessorDeclaration 40 | ts.SetAccessorDeclaration 41 | ts.IndexSignatureDeclaration 42 | ts.KeywordTypeNode // TODO: This node is bad, maybe we should report this 43 | ts.ImportTypeNode 44 | ts.ThisTypeNode 45 // | ts.FunctionOrConstructorTypeNodeBase -> FunctionTypeNode, ConstructorTypeNode 46 | ts.ConstructorTypeNode 47 | ts.FunctionTypeNode 48 | ts.TypeReferenceNode 49 | ts.TypePredicateNode 50 | ts.TypeQueryNode 51 | ts.TypeLiteralNode 52 | ts.ArrayTypeNode 53 | ts.NamedTupleMember 54 | ts.TupleTypeNode 55 | ts.OptionalTypeNode 56 | ts.RestTypeNode 57 | ts.UnionTypeNode 58 | ts.IntersectionTypeNode 59 | ts.ConditionalTypeNode 60 | ts.InferTypeNode 61 | ts.ParenthesizedTypeNode 62 | ts.TypeOperatorNode 63 | ts.IndexedAccessTypeNode 64 | ts.MappedTypeNode 65 | ts.LiteralTypeNode 66 | ts.StringLiteral 67 | ts.OmittedExpression 68 | ts.PartiallyEmittedExpression 69 | ts.PrefixUnaryExpression 70 | ts.PostfixUnaryExpression 71 | ts.NullLiteral 72 | ts.BooleanLiteral 73 | ts.ThisExpression 74 | ts.SuperExpression 75 | ts.ImportExpression 76 | ts.DeleteExpression 77 | ts.TypeOfExpression 78 | ts.VoidExpression 79 | ts.AwaitExpression 80 | ts.YieldExpression 81 | ts.SyntheticExpression 82 | ts.BinaryExpression 83 | ts.ConditionalExpression 84 | ts.FunctionExpression 85 | ts.ArrowFunction 86 | ts.RegularExpressionLiteral 87 | ts.NoSubstitutionTemplateLiteral 88 | ts.NumericLiteral 89 | ts.BigIntLiteral 90 | ts.TemplateHead 91 | ts.TemplateMiddle 92 | ts.TemplateTail 93 | ts.TemplateExpression 94 | ts.TemplateSpan 95 | ts.ParenthesizedExpression 96 | ts.ArrayLiteralExpression 97 | ts.SpreadElement 98 | ts.ObjectLiteralExpression 99 | ts.PropertyAccessExpression 100 | ts.ElementAccessExpression 101 | ts.CallExpression 102 | ts.ExpressionWithTypeArguments 103 | ts.NewExpression 104 | ts.TaggedTemplateExpression 105 | ts.AsExpression 106 | ts.TypeAssertion 107 | ts.NonNullExpression 108 | ts.MetaProperty 109 | ts.JsxElement 110 | ts.JsxOpeningElement 111 | ts.JsxSelfClosingElement 112 | ts.JsxFragment 113 | ts.JsxOpeningFragment 114 | ts.JsxClosingFragment 115 | ts.JsxAttribute 116 | ts.JsxSpreadAttribute 117 | ts.JsxClosingElement 118 | ts.JsxExpression 119 | ts.JsxText 120 | ts.NotEmittedStatement 121 | ts.CommaListExpression 122 | ts.EmptyStatement 123 | ts.DebuggerStatement 124 | ts.MissingDeclaration 125 | ts.Block 126 | ts.VariableStatement 127 | ts.ExpressionStatement 128 | ts.IfStatement 129 | ts.DoStatement 130 | ts.WhileStatement 131 | ts.ForStatement 132 | ts.ForInStatement 133 | ts.ForOfStatement 134 | ts.BreakStatement 135 | ts.ContinueStatement 136 | ts.ReturnStatement 137 | ts.WithStatement 138 | ts.SwitchStatement 139 | ts.CaseBlock 140 | ts.CaseClause 141 | ts.DefaultClause 142 | ts.LabeledStatement 143 | ts.ThrowStatement 144 | ts.TryStatement 145 | ts.CatchClause 146 // | ts.ClassLikeDeclarationBase -> ClassDeclaration | ClassExpression 147 | ts.ClassDeclaration 148 | ts.ClassExpression 149 | ts.InterfaceDeclaration 150 | ts.HeritageClause 151 | ts.TypeAliasDeclaration 152 | ts.EnumMember 153 | ts.EnumDeclaration 154 | ts.ModuleDeclaration 155 | ts.ModuleBlock 156 | ts.ImportEqualsDeclaration 157 | ts.ExternalModuleReference 158 | ts.ImportDeclaration 159 | ts.ImportClause 160 | ts.NamespaceImport 161 | ts.NamespaceExportDeclaration 162 | ts.ExportDeclaration 163 | ts.NamedImports 164 | ts.NamedExports 165 | ts.ImportSpecifier 166 | ts.ExportSpecifier 167 | ts.ExportAssignment 168 | ts.SourceFile 169 | ts.Bundle 170 | ts.InputFiles 171 | ts.UnparsedSource 172 | ts.JsonMinusNumericLiteral 173 | ts.TemplateLiteralTypeNode 174 175 // JSDoc: Unsupported 176 | ts.JSDoc 177 | ts.JSDocTypeExpression 178 | ts.JSDocUnknownTag 179 | ts.JSDocAugmentsTag 180 | ts.JSDocClassTag 181 | ts.JSDocEnumTag 182 | ts.JSDocThisTag 183 | ts.JSDocTemplateTag 184 | ts.JSDocReturnTag 185 | ts.JSDocTypeTag 186 | ts.JSDocTypedefTag 187 | ts.JSDocCallbackTag 188 | ts.JSDocSignature 189 | ts.JSDocPropertyTag 190 | ts.JSDocParameterTag 191 | ts.JSDocTypeLiteral 192 | ts.JSDocFunctionType 193 | ts.JSDocAllType 194 | ts.JSDocUnknownType 195 | ts.JSDocNullableType 196 | ts.JSDocNonNullableType 197 | ts.JSDocOptionalType 198 | ts.JSDocVariadicType 199 | ts.JSDocAuthorTag; 200