Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / @typescript-eslint / typescript-estree / dist / ts-estree / estree-to-ts-node-types.d.ts
1 import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types';
2 import * as ts from 'typescript';
3 import { TSNode } from './ts-nodes';
4 export interface EstreeToTsNodeTypes {
5     [AST_NODE_TYPES.ArrayExpression]: ts.ArrayLiteralExpression;
6     [AST_NODE_TYPES.ArrayPattern]: ts.ArrayLiteralExpression | ts.ArrayBindingPattern;
7     [AST_NODE_TYPES.ArrowFunctionExpression]: ts.ArrowFunction;
8     [AST_NODE_TYPES.AssignmentExpression]: ts.BinaryExpression;
9     [AST_NODE_TYPES.AssignmentPattern]: ts.ShorthandPropertyAssignment | ts.BindingElement | ts.BinaryExpression | ts.ParameterDeclaration;
10     [AST_NODE_TYPES.AwaitExpression]: ts.AwaitExpression;
11     [AST_NODE_TYPES.BinaryExpression]: ts.BinaryExpression;
12     [AST_NODE_TYPES.BlockStatement]: ts.Block;
13     [AST_NODE_TYPES.BreakStatement]: ts.BreakStatement;
14     [AST_NODE_TYPES.CallExpression]: ts.CallExpression;
15     [AST_NODE_TYPES.CatchClause]: ts.CatchClause;
16     [AST_NODE_TYPES.ClassBody]: ts.ClassDeclaration | ts.ClassExpression;
17     [AST_NODE_TYPES.ClassDeclaration]: ts.ClassDeclaration;
18     [AST_NODE_TYPES.ClassExpression]: ts.ClassExpression;
19     [AST_NODE_TYPES.ClassProperty]: ts.PropertyDeclaration;
20     [AST_NODE_TYPES.ConditionalExpression]: ts.ConditionalExpression;
21     [AST_NODE_TYPES.ContinueStatement]: ts.ContinueStatement;
22     [AST_NODE_TYPES.DebuggerStatement]: ts.DebuggerStatement;
23     [AST_NODE_TYPES.Decorator]: ts.Decorator;
24     [AST_NODE_TYPES.DoWhileStatement]: ts.DoStatement;
25     [AST_NODE_TYPES.EmptyStatement]: ts.EmptyStatement;
26     [AST_NODE_TYPES.ExportAllDeclaration]: ts.ExportDeclaration;
27     [AST_NODE_TYPES.ExportDefaultDeclaration]: ts.ExportAssignment | ts.FunctionDeclaration | ts.VariableStatement | ts.ClassDeclaration | ts.ClassExpression | ts.TypeAliasDeclaration | ts.InterfaceDeclaration | ts.EnumDeclaration | ts.ModuleDeclaration;
28     [AST_NODE_TYPES.ExportNamedDeclaration]: ts.ExportDeclaration | ts.FunctionDeclaration | ts.VariableStatement | ts.ClassDeclaration | ts.ClassExpression | ts.TypeAliasDeclaration | ts.InterfaceDeclaration | ts.EnumDeclaration | ts.ModuleDeclaration;
29     [AST_NODE_TYPES.ExportSpecifier]: ts.ExportSpecifier;
30     [AST_NODE_TYPES.ExpressionStatement]: ts.ExpressionStatement;
31     [AST_NODE_TYPES.ForInStatement]: ts.ForInStatement;
32     [AST_NODE_TYPES.ForOfStatement]: ts.ForOfStatement;
33     [AST_NODE_TYPES.ForStatement]: ts.ForStatement;
34     [AST_NODE_TYPES.FunctionDeclaration]: ts.FunctionDeclaration;
35     [AST_NODE_TYPES.FunctionExpression]: ts.FunctionExpression | ts.ConstructorDeclaration | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration;
36     [AST_NODE_TYPES.Identifier]: ts.Identifier | ts.ConstructorDeclaration | ts.Token<ts.SyntaxKind.NewKeyword | ts.SyntaxKind.ImportKeyword>;
37     [AST_NODE_TYPES.IfStatement]: ts.IfStatement;
38     [AST_NODE_TYPES.ImportDeclaration]: ts.ImportDeclaration;
39     [AST_NODE_TYPES.ImportDefaultSpecifier]: ts.ImportClause;
40     [AST_NODE_TYPES.ImportExpression]: ts.CallExpression;
41     [AST_NODE_TYPES.ImportNamespaceSpecifier]: ts.NamespaceImport;
42     [AST_NODE_TYPES.ImportSpecifier]: ts.ImportSpecifier;
43     [AST_NODE_TYPES.JSXAttribute]: ts.JsxAttribute;
44     [AST_NODE_TYPES.JSXClosingElement]: ts.JsxClosingElement;
45     [AST_NODE_TYPES.JSXClosingFragment]: ts.JsxClosingFragment;
46     [AST_NODE_TYPES.JSXElement]: ts.JsxElement | ts.JsxSelfClosingElement;
47     [AST_NODE_TYPES.JSXEmptyExpression]: ts.JsxExpression;
48     [AST_NODE_TYPES.JSXExpressionContainer]: ts.JsxExpression;
49     [AST_NODE_TYPES.JSXFragment]: ts.JsxFragment;
50     [AST_NODE_TYPES.JSXIdentifier]: ts.Identifier | ts.ThisExpression;
51     [AST_NODE_TYPES.JSXOpeningElement]: ts.JsxOpeningElement | ts.JsxSelfClosingElement;
52     [AST_NODE_TYPES.JSXOpeningFragment]: ts.JsxOpeningFragment;
53     [AST_NODE_TYPES.JSXSpreadAttribute]: ts.JsxSpreadAttribute;
54     [AST_NODE_TYPES.JSXSpreadChild]: ts.JsxExpression;
55     [AST_NODE_TYPES.JSXMemberExpression]: ts.PropertyAccessExpression;
56     [AST_NODE_TYPES.JSXText]: ts.JsxText;
57     [AST_NODE_TYPES.LabeledStatement]: ts.LabeledStatement;
58     [AST_NODE_TYPES.Literal]: ts.StringLiteral | ts.NumericLiteral | ts.RegularExpressionLiteral | ts.JsxText | ts.NullLiteral | ts.BooleanLiteral | ts.BigIntLiteral;
59     [AST_NODE_TYPES.LogicalExpression]: ts.BinaryExpression;
60     [AST_NODE_TYPES.MemberExpression]: ts.PropertyAccessExpression | ts.ElementAccessExpression;
61     [AST_NODE_TYPES.MetaProperty]: ts.MetaProperty;
62     [AST_NODE_TYPES.MethodDefinition]: ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration | ts.ConstructorDeclaration;
63     [AST_NODE_TYPES.NewExpression]: ts.NewExpression;
64     [AST_NODE_TYPES.ObjectExpression]: ts.ObjectLiteralExpression;
65     [AST_NODE_TYPES.ObjectPattern]: ts.ObjectLiteralExpression | ts.ObjectBindingPattern;
66     [AST_NODE_TYPES.OptionalCallExpression]: ts.CallExpression;
67     [AST_NODE_TYPES.OptionalMemberExpression]: ts.PropertyAccessExpression | ts.ElementAccessExpression;
68     [AST_NODE_TYPES.Program]: ts.SourceFile;
69     [AST_NODE_TYPES.Property]: ts.PropertyAssignment | ts.ShorthandPropertyAssignment | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration | ts.BindingElement;
70     [AST_NODE_TYPES.RestElement]: ts.BindingElement | ts.SpreadAssignment | ts.SpreadElement | ts.ParameterDeclaration;
71     [AST_NODE_TYPES.ReturnStatement]: ts.ReturnStatement;
72     [AST_NODE_TYPES.SequenceExpression]: ts.BinaryExpression;
73     [AST_NODE_TYPES.SpreadElement]: ts.SpreadElement | ts.SpreadAssignment;
74     [AST_NODE_TYPES.Super]: ts.SuperExpression;
75     [AST_NODE_TYPES.SwitchCase]: ts.CaseClause | ts.DefaultClause;
76     [AST_NODE_TYPES.SwitchStatement]: ts.SwitchStatement;
77     [AST_NODE_TYPES.TaggedTemplateExpression]: ts.TaggedTemplateExpression;
78     [AST_NODE_TYPES.TemplateElement]: ts.NoSubstitutionTemplateLiteral | ts.TemplateHead | ts.TemplateMiddle | ts.TemplateTail;
79     [AST_NODE_TYPES.TemplateLiteral]: ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression;
80     [AST_NODE_TYPES.ThisExpression]: ts.ThisExpression | ts.KeywordTypeNode;
81     [AST_NODE_TYPES.ThrowStatement]: ts.ThrowStatement;
82     [AST_NODE_TYPES.TryStatement]: ts.TryStatement;
83     [AST_NODE_TYPES.TSAbstractClassProperty]: ts.PropertyDeclaration;
84     [AST_NODE_TYPES.TSAbstractMethodDefinition]: ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration | ts.ConstructorDeclaration;
85     [AST_NODE_TYPES.TSArrayType]: ts.ArrayTypeNode;
86     [AST_NODE_TYPES.TSAsExpression]: ts.AsExpression;
87     [AST_NODE_TYPES.TSCallSignatureDeclaration]: ts.PropertySignature;
88     [AST_NODE_TYPES.TSClassImplements]: ts.ExpressionWithTypeArguments;
89     [AST_NODE_TYPES.TSConditionalType]: ts.ConditionalTypeNode;
90     [AST_NODE_TYPES.TSConstructorType]: ts.ConstructorTypeNode;
91     [AST_NODE_TYPES.TSConstructSignatureDeclaration]: ts.ConstructorTypeNode | ts.FunctionTypeNode | ts.ConstructSignatureDeclaration | ts.CallSignatureDeclaration;
92     [AST_NODE_TYPES.TSDeclareFunction]: ts.FunctionDeclaration;
93     [AST_NODE_TYPES.TSEnumDeclaration]: ts.EnumDeclaration;
94     [AST_NODE_TYPES.TSEnumMember]: ts.EnumMember;
95     [AST_NODE_TYPES.TSExportAssignment]: ts.ExportAssignment;
96     [AST_NODE_TYPES.TSExternalModuleReference]: ts.ExternalModuleReference;
97     [AST_NODE_TYPES.TSFunctionType]: ts.FunctionTypeNode;
98     [AST_NODE_TYPES.TSImportEqualsDeclaration]: ts.ImportEqualsDeclaration;
99     [AST_NODE_TYPES.TSImportType]: ts.ImportTypeNode;
100     [AST_NODE_TYPES.TSIndexedAccessType]: ts.IndexedAccessTypeNode;
101     [AST_NODE_TYPES.TSIndexSignature]: ts.IndexSignatureDeclaration;
102     [AST_NODE_TYPES.TSInferType]: ts.InferTypeNode;
103     [AST_NODE_TYPES.TSInterfaceDeclaration]: ts.InterfaceDeclaration;
104     [AST_NODE_TYPES.TSInterfaceBody]: ts.InterfaceDeclaration;
105     [AST_NODE_TYPES.TSInterfaceHeritage]: ts.ExpressionWithTypeArguments;
106     [AST_NODE_TYPES.TSIntersectionType]: ts.IntersectionTypeNode;
107     [AST_NODE_TYPES.TSLiteralType]: ts.LiteralTypeNode;
108     [AST_NODE_TYPES.TSMappedType]: ts.MappedTypeNode;
109     [AST_NODE_TYPES.TSMethodSignature]: ts.MethodSignature;
110     [AST_NODE_TYPES.TSModuleBlock]: ts.ModuleBlock;
111     [AST_NODE_TYPES.TSModuleDeclaration]: ts.ModuleDeclaration;
112     [AST_NODE_TYPES.TSNamedTupleMember]: ts.NamedTupleMember;
113     [AST_NODE_TYPES.TSNamespaceExportDeclaration]: ts.NamespaceExportDeclaration;
114     [AST_NODE_TYPES.TSNonNullExpression]: ts.NonNullExpression;
115     [AST_NODE_TYPES.TSOptionalType]: ts.OptionalTypeNode;
116     [AST_NODE_TYPES.TSParameterProperty]: ts.ParameterDeclaration;
117     [AST_NODE_TYPES.TSParenthesizedType]: ts.ParenthesizedTypeNode;
118     [AST_NODE_TYPES.TSPropertySignature]: ts.PropertySignature;
119     [AST_NODE_TYPES.TSQualifiedName]: ts.QualifiedName;
120     [AST_NODE_TYPES.TSRestType]: ts.RestTypeNode | ts.NamedTupleMember;
121     [AST_NODE_TYPES.TSThisType]: ts.ThisTypeNode;
122     [AST_NODE_TYPES.TSTupleType]: ts.TupleTypeNode;
123     [AST_NODE_TYPES.TSTypeAliasDeclaration]: ts.TypeAliasDeclaration;
124     [AST_NODE_TYPES.TSTypeAnnotation]: undefined;
125     [AST_NODE_TYPES.TSTypeAssertion]: ts.TypeAssertion;
126     [AST_NODE_TYPES.TSTypeLiteral]: ts.TypeLiteralNode;
127     [AST_NODE_TYPES.TSTypeOperator]: ts.TypeOperatorNode;
128     [AST_NODE_TYPES.TSTypeParameter]: ts.TypeParameterDeclaration;
129     [AST_NODE_TYPES.TSTypeParameterDeclaration]: undefined;
130     [AST_NODE_TYPES.TSTypeParameterInstantiation]: ts.TaggedTemplateExpression | ts.ImportTypeNode | ts.ExpressionWithTypeArguments | ts.TypeReferenceNode | ts.JsxOpeningElement | ts.JsxSelfClosingElement | ts.NewExpression | ts.CallExpression;
131     [AST_NODE_TYPES.TSTypePredicate]: ts.TypePredicateNode;
132     [AST_NODE_TYPES.TSTypeQuery]: ts.TypeQueryNode;
133     [AST_NODE_TYPES.TSTypeReference]: ts.TypeReferenceNode;
134     [AST_NODE_TYPES.TSUnionType]: ts.UnionTypeNode;
135     [AST_NODE_TYPES.UpdateExpression]: ts.PrefixUnaryExpression | ts.PostfixUnaryExpression;
136     [AST_NODE_TYPES.UnaryExpression]: ts.PrefixUnaryExpression | ts.PostfixUnaryExpression | ts.DeleteExpression | ts.VoidExpression | ts.TypeOfExpression;
137     [AST_NODE_TYPES.VariableDeclaration]: ts.VariableDeclarationList | ts.VariableStatement;
138     [AST_NODE_TYPES.VariableDeclarator]: ts.VariableDeclaration;
139     [AST_NODE_TYPES.WhileStatement]: ts.WhileStatement;
140     [AST_NODE_TYPES.WithStatement]: ts.WithStatement;
141     [AST_NODE_TYPES.YieldExpression]: ts.YieldExpression;
142     [AST_NODE_TYPES.TSEmptyBodyFunctionExpression]: ts.FunctionExpression | ts.ConstructorDeclaration | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration;
143     [AST_NODE_TYPES.TSAbstractKeyword]: ts.Token<ts.SyntaxKind.AbstractKeyword>;
144     [AST_NODE_TYPES.TSNullKeyword]: ts.NullLiteral | ts.KeywordTypeNode;
145     [AST_NODE_TYPES.TSAnyKeyword]: ts.KeywordTypeNode;
146     [AST_NODE_TYPES.TSBigIntKeyword]: ts.KeywordTypeNode;
147     [AST_NODE_TYPES.TSBooleanKeyword]: ts.KeywordTypeNode;
148     [AST_NODE_TYPES.TSNeverKeyword]: ts.KeywordTypeNode;
149     [AST_NODE_TYPES.TSNumberKeyword]: ts.KeywordTypeNode;
150     [AST_NODE_TYPES.TSObjectKeyword]: ts.KeywordTypeNode;
151     [AST_NODE_TYPES.TSStringKeyword]: ts.KeywordTypeNode;
152     [AST_NODE_TYPES.TSSymbolKeyword]: ts.KeywordTypeNode;
153     [AST_NODE_TYPES.TSUnknownKeyword]: ts.KeywordTypeNode;
154     [AST_NODE_TYPES.TSVoidKeyword]: ts.KeywordTypeNode;
155     [AST_NODE_TYPES.TSUndefinedKeyword]: ts.KeywordTypeNode;
156     [AST_NODE_TYPES.TSAsyncKeyword]: ts.Token<ts.SyntaxKind.AsyncKeyword>;
157     [AST_NODE_TYPES.TSDeclareKeyword]: ts.Token<ts.SyntaxKind.DeclareKeyword>;
158     [AST_NODE_TYPES.TSExportKeyword]: ts.Token<ts.SyntaxKind.ExportKeyword>;
159     [AST_NODE_TYPES.TSStaticKeyword]: ts.Token<ts.SyntaxKind.StaticKeyword>;
160     [AST_NODE_TYPES.TSPublicKeyword]: ts.Token<ts.SyntaxKind.PublicKeyword>;
161     [AST_NODE_TYPES.TSPrivateKeyword]: ts.Token<ts.SyntaxKind.PrivateKeyword>;
162     [AST_NODE_TYPES.TSProtectedKeyword]: ts.Token<ts.SyntaxKind.ProtectedKeyword>;
163     [AST_NODE_TYPES.TSReadonlyKeyword]: ts.Token<ts.SyntaxKind.ReadonlyKeyword>;
164 }
165 /**
166  * Maps TSESTree AST Node type to the expected TypeScript AST Node type(s).
167  * This mapping is based on the internal logic of the parser.
168  */
169 export declare type TSESTreeToTSNode<T extends TSESTree.Node = TSESTree.Node> = Extract<TSNode | ts.Token<ts.SyntaxKind.NewKeyword | ts.SyntaxKind.ImportKeyword>, EstreeToTsNodeTypes[T['type']]>;
170 //# sourceMappingURL=estree-to-ts-node-types.d.ts.map