1 // Generated by dts-bundle v0.7.3
2 // Dependencies for this module:
4 // ../eslint-visitor-keys
6 declare module 'vue-eslint-parser' {
7 import * as AST from "vue-eslint-parser/ast";
8 export function parseForESLint(code: string, options: any): AST.ESLintExtendedProgram;
9 export function parse(code: string, options: any): AST.ESLintProgram;
13 declare module 'vue-eslint-parser/ast' {
14 export * from "vue-eslint-parser/ast/errors";
15 export * from "vue-eslint-parser/ast/locations";
16 export * from "vue-eslint-parser/ast/nodes";
17 export * from "vue-eslint-parser/ast/tokens";
18 export * from "vue-eslint-parser/ast/traverse";
21 declare module 'vue-eslint-parser/ast/errors' {
22 export class ParseError extends SyntaxError {
27 static fromCode(code: ErrorCode, offset: number, line: number, column: number): ParseError;
28 static normalize(x: any): ParseError | null;
29 constructor(message: string, code: ErrorCode | undefined, offset: number, line: number, column: number);
30 static isParseError(x: any): x is ParseError;
32 export type ErrorCode = "abrupt-closing-of-empty-comment" | "absence-of-digits-in-numeric-character-reference" | "cdata-in-html-content" | "character-reference-outside-unicode-range" | "control-character-in-input-stream" | "control-character-reference" | "eof-before-tag-name" | "eof-in-cdata" | "eof-in-comment" | "eof-in-tag" | "incorrectly-closed-comment" | "incorrectly-opened-comment" | "invalid-first-character-of-tag-name" | "missing-attribute-value" | "missing-end-tag-name" | "missing-semicolon-after-character-reference" | "missing-whitespace-between-attributes" | "nested-comment" | "noncharacter-character-reference" | "noncharacter-in-input-stream" | "null-character-reference" | "surrogate-character-reference" | "surrogate-in-input-stream" | "unexpected-character-in-attribute-name" | "unexpected-character-in-unquoted-attribute-value" | "unexpected-equals-sign-before-attribute-name" | "unexpected-null-character" | "unexpected-question-mark-instead-of-tag-name" | "unexpected-solidus-in-tag" | "unknown-named-character-reference" | "end-tag-with-attributes" | "duplicate-attribute" | "end-tag-with-trailing-solidus" | "non-void-html-element-start-tag-with-trailing-solidus" | "x-invalid-end-tag" | "x-invalid-namespace";
35 declare module 'vue-eslint-parser/ast/locations' {
36 export interface Location {
40 export interface LocationRange {
44 export type Offset = number;
45 export type OffsetRange = [Offset, Offset];
46 export interface HasLocation {
54 declare module 'vue-eslint-parser/ast/nodes' {
55 import { ScopeManager } from "eslint-scope";
56 import { ParseError } from "vue-eslint-parser/ast/errors";
57 import { HasLocation } from "vue-eslint-parser/ast/locations";
58 import { Token } from "vue-eslint-parser/ast/tokens";
59 export interface HasParent {
62 export type Node = ESLintNode | VNode | VForExpression | VOnExpression | VSlotScopeExpression | VFilterSequenceExpression | VFilter;
63 export type ESLintNode = ESLintIdentifier | ESLintLiteral | ESLintProgram | ESLintSwitchCase | ESLintCatchClause | ESLintVariableDeclarator | ESLintStatement | ESLintExpression | ESLintProperty | ESLintAssignmentProperty | ESLintSuper | ESLintTemplateElement | ESLintSpreadElement | ESLintPattern | ESLintClassBody | ESLintMethodDefinition | ESLintModuleDeclaration | ESLintModuleSpecifier | ESLintLegacyRestProperty;
64 export interface ESLintExtendedProgram {
68 [type: string]: string[];
70 scopeManager?: ScopeManager;
72 export interface ESLintProgram extends HasLocation, HasParent {
74 sourceType: "script" | "module";
75 body: (ESLintStatement | ESLintModuleDeclaration)[];
76 templateBody?: VElement & HasConcreteInfo;
79 errors?: ParseError[];
81 export type ESLintStatement = ESLintExpressionStatement | ESLintBlockStatement | ESLintEmptyStatement | ESLintDebuggerStatement | ESLintWithStatement | ESLintReturnStatement | ESLintLabeledStatement | ESLintBreakStatement | ESLintContinueStatement | ESLintIfStatement | ESLintSwitchStatement | ESLintThrowStatement | ESLintTryStatement | ESLintWhileStatement | ESLintDoWhileStatement | ESLintForStatement | ESLintForInStatement | ESLintForOfStatement | ESLintDeclaration;
82 export interface ESLintEmptyStatement extends HasLocation, HasParent {
83 type: "EmptyStatement";
85 export interface ESLintBlockStatement extends HasLocation, HasParent {
86 type: "BlockStatement";
87 body: ESLintStatement[];
89 export interface ESLintExpressionStatement extends HasLocation, HasParent {
90 type: "ExpressionStatement";
91 expression: ESLintExpression;
93 export interface ESLintIfStatement extends HasLocation, HasParent {
95 test: ESLintExpression;
96 consequent: ESLintStatement;
97 alternate: ESLintStatement | null;
99 export interface ESLintSwitchStatement extends HasLocation, HasParent {
100 type: "SwitchStatement";
101 discriminant: ESLintExpression;
102 cases: ESLintSwitchCase[];
104 export interface ESLintSwitchCase extends HasLocation, HasParent {
106 test: ESLintExpression | null;
107 consequent: ESLintStatement[];
109 export interface ESLintWhileStatement extends HasLocation, HasParent {
110 type: "WhileStatement";
111 test: ESLintExpression;
112 body: ESLintStatement;
114 export interface ESLintDoWhileStatement extends HasLocation, HasParent {
115 type: "DoWhileStatement";
116 body: ESLintStatement;
117 test: ESLintExpression;
119 export interface ESLintForStatement extends HasLocation, HasParent {
120 type: "ForStatement";
121 init: ESLintVariableDeclaration | ESLintExpression | null;
122 test: ESLintExpression | null;
123 update: ESLintExpression | null;
124 body: ESLintStatement;
126 export interface ESLintForInStatement extends HasLocation, HasParent {
127 type: "ForInStatement";
128 left: ESLintVariableDeclaration | ESLintPattern;
129 right: ESLintExpression;
130 body: ESLintStatement;
132 export interface ESLintForOfStatement extends HasLocation, HasParent {
133 type: "ForOfStatement";
134 left: ESLintVariableDeclaration | ESLintPattern;
135 right: ESLintExpression;
136 body: ESLintStatement;
138 export interface ESLintLabeledStatement extends HasLocation, HasParent {
139 type: "LabeledStatement";
140 label: ESLintIdentifier;
141 body: ESLintStatement;
143 export interface ESLintBreakStatement extends HasLocation, HasParent {
144 type: "BreakStatement";
145 label: ESLintIdentifier | null;
147 export interface ESLintContinueStatement extends HasLocation, HasParent {
148 type: "ContinueStatement";
149 label: ESLintIdentifier | null;
151 export interface ESLintReturnStatement extends HasLocation, HasParent {
152 type: "ReturnStatement";
153 argument: ESLintExpression | null;
155 export interface ESLintThrowStatement extends HasLocation, HasParent {
156 type: "ThrowStatement";
157 argument: ESLintExpression;
159 export interface ESLintTryStatement extends HasLocation, HasParent {
160 type: "TryStatement";
161 block: ESLintBlockStatement;
162 handler: ESLintCatchClause | null;
163 finalizer: ESLintBlockStatement | null;
165 export interface ESLintCatchClause extends HasLocation, HasParent {
167 param: ESLintPattern;
168 body: ESLintBlockStatement;
170 export interface ESLintWithStatement extends HasLocation, HasParent {
171 type: "WithStatement";
172 object: ESLintExpression;
173 body: ESLintStatement;
175 export interface ESLintDebuggerStatement extends HasLocation, HasParent {
176 type: "DebuggerStatement";
178 export type ESLintDeclaration = ESLintFunctionDeclaration | ESLintVariableDeclaration | ESLintClassDeclaration;
179 export interface ESLintFunctionDeclaration extends HasLocation, HasParent {
180 type: "FunctionDeclaration";
183 id: ESLintIdentifier | null;
184 params: ESLintPattern[];
185 body: ESLintBlockStatement;
187 export interface ESLintVariableDeclaration extends HasLocation, HasParent {
188 type: "VariableDeclaration";
189 kind: "var" | "let" | "const";
190 declarations: ESLintVariableDeclarator[];
192 export interface ESLintVariableDeclarator extends HasLocation, HasParent {
193 type: "VariableDeclarator";
195 init: ESLintExpression | null;
197 export interface ESLintClassDeclaration extends HasLocation, HasParent {
198 type: "ClassDeclaration";
199 id: ESLintIdentifier | null;
200 superClass: ESLintExpression | null;
201 body: ESLintClassBody;
203 export interface ESLintClassBody extends HasLocation, HasParent {
205 body: ESLintMethodDefinition[];
207 export interface ESLintMethodDefinition extends HasLocation, HasParent {
208 type: "MethodDefinition";
209 kind: "constructor" | "method" | "get" | "set";
212 key: ESLintExpression;
213 value: ESLintFunctionExpression;
215 export type ESLintModuleDeclaration = ESLintImportDeclaration | ESLintExportNamedDeclaration | ESLintExportDefaultDeclaration | ESLintExportAllDeclaration;
216 export type ESLintModuleSpecifier = ESLintImportSpecifier | ESLintImportDefaultSpecifier | ESLintImportNamespaceSpecifier | ESLintExportSpecifier;
217 export interface ESLintImportDeclaration extends HasLocation, HasParent {
218 type: "ImportDeclaration";
219 specifiers: (ESLintImportSpecifier | ESLintImportDefaultSpecifier | ESLintImportNamespaceSpecifier)[];
220 source: ESLintLiteral;
222 export interface ESLintImportSpecifier extends HasLocation, HasParent {
223 type: "ImportSpecifier";
224 imported: ESLintIdentifier;
225 local: ESLintIdentifier;
227 export interface ESLintImportDefaultSpecifier extends HasLocation, HasParent {
228 type: "ImportDefaultSpecifier";
229 local: ESLintIdentifier;
231 export interface ESLintImportNamespaceSpecifier extends HasLocation, HasParent {
232 type: "ImportNamespaceSpecifier";
233 local: ESLintIdentifier;
235 export interface ESLintExportNamedDeclaration extends HasLocation, HasParent {
236 type: "ExportNamedDeclaration";
237 declaration?: ESLintDeclaration | null;
238 specifiers: ESLintExportSpecifier[];
239 source?: ESLintLiteral | null;
241 export interface ESLintExportSpecifier extends HasLocation, HasParent {
242 type: "ExportSpecifier";
243 exported: ESLintIdentifier;
245 export interface ESLintExportDefaultDeclaration extends HasLocation, HasParent {
246 type: "ExportDefaultDeclaration";
247 declaration: ESLintDeclaration | ESLintExpression;
249 export interface ESLintExportAllDeclaration extends HasLocation, HasParent {
250 type: "ExportAllDeclaration";
251 source: ESLintLiteral;
253 export type ESLintExpression = ESLintThisExpression | ESLintArrayExpression | ESLintObjectExpression | ESLintFunctionExpression | ESLintArrowFunctionExpression | ESLintYieldExpression | ESLintLiteral | ESLintUnaryExpression | ESLintUpdateExpression | ESLintBinaryExpression | ESLintAssignmentExpression | ESLintLogicalExpression | ESLintMemberExpression | ESLintConditionalExpression | ESLintCallExpression | ESLintNewExpression | ESLintSequenceExpression | ESLintTemplateLiteral | ESLintTaggedTemplateExpression | ESLintClassExpression | ESLintMetaProperty | ESLintIdentifier | ESLintAwaitExpression;
254 export interface ESLintIdentifier extends HasLocation, HasParent {
258 export interface ESLintLiteral extends HasLocation, HasParent {
260 value: string | boolean | null | number | RegExp;
266 export interface ESLintThisExpression extends HasLocation, HasParent {
267 type: "ThisExpression";
269 export interface ESLintArrayExpression extends HasLocation, HasParent {
270 type: "ArrayExpression";
271 elements: (ESLintExpression | ESLintSpreadElement)[];
273 export interface ESLintObjectExpression extends HasLocation, HasParent {
274 type: "ObjectExpression";
275 properties: (ESLintProperty | ESLintSpreadElement | ESLintLegacySpreadProperty)[];
277 export interface ESLintProperty extends HasLocation, HasParent {
279 kind: "init" | "get" | "set";
283 key: ESLintExpression;
284 value: ESLintExpression | ESLintPattern;
286 export interface ESLintFunctionExpression extends HasLocation, HasParent {
287 type: "FunctionExpression";
290 id: ESLintIdentifier | null;
291 params: ESLintPattern[];
292 body: ESLintBlockStatement;
294 export interface ESLintArrowFunctionExpression extends HasLocation, HasParent {
295 type: "ArrowFunctionExpression";
298 id: ESLintIdentifier | null;
299 params: ESLintPattern[];
300 body: ESLintBlockStatement;
302 export interface ESLintSequenceExpression extends HasLocation, HasParent {
303 type: "SequenceExpression";
304 expressions: ESLintExpression[];
306 export interface ESLintUnaryExpression extends HasLocation, HasParent {
307 type: "UnaryExpression";
308 operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
310 argument: ESLintExpression;
312 export interface ESLintBinaryExpression extends HasLocation, HasParent {
313 type: "BinaryExpression";
314 operator: "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
315 left: ESLintExpression;
316 right: ESLintExpression;
318 export interface ESLintAssignmentExpression extends HasLocation, HasParent {
319 type: "AssignmentExpression";
320 operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=";
322 right: ESLintExpression;
324 export interface ESLintUpdateExpression extends HasLocation, HasParent {
325 type: "UpdateExpression";
326 operator: "++" | "--";
327 argument: ESLintExpression;
330 export interface ESLintLogicalExpression extends HasLocation, HasParent {
331 type: "LogicalExpression";
332 operator: "||" | "&&";
333 left: ESLintExpression;
334 right: ESLintExpression;
336 export interface ESLintConditionalExpression extends HasLocation, HasParent {
337 type: "ConditionalExpression";
338 test: ESLintExpression;
339 alternate: ESLintExpression;
340 consequent: ESLintExpression;
342 export interface ESLintCallExpression extends HasLocation, HasParent {
343 type: "CallExpression";
344 callee: ESLintExpression | ESLintSuper;
345 arguments: (ESLintExpression | ESLintSpreadElement)[];
347 export interface ESLintSuper extends HasLocation, HasParent {
350 export interface ESLintNewExpression extends HasLocation, HasParent {
351 type: "NewExpression";
352 callee: ESLintExpression;
353 arguments: (ESLintExpression | ESLintSpreadElement)[];
355 export interface ESLintMemberExpression extends HasLocation, HasParent {
356 type: "MemberExpression";
358 object: ESLintExpression | ESLintSuper;
359 property: ESLintExpression;
361 export interface ESLintYieldExpression extends HasLocation, HasParent {
362 type: "YieldExpression";
364 argument: ESLintExpression | null;
366 export interface ESLintAwaitExpression extends HasLocation, HasParent {
367 type: "AwaitExpression";
368 argument: ESLintExpression;
370 export interface ESLintTemplateLiteral extends HasLocation, HasParent {
371 type: "TemplateLiteral";
372 quasis: ESLintTemplateElement[];
373 expressions: ESLintExpression[];
375 export interface ESLintTaggedTemplateExpression extends HasLocation, HasParent {
376 type: "TaggedTemplateExpression";
377 tag: ESLintExpression;
378 quasi: ESLintTemplateLiteral;
380 export interface ESLintTemplateElement extends HasLocation, HasParent {
381 type: "TemplateElement";
388 export interface ESLintClassExpression extends HasLocation, HasParent {
389 type: "ClassExpression";
390 id: ESLintIdentifier | null;
391 superClass: ESLintExpression | null;
392 body: ESLintClassBody;
394 export interface ESLintMetaProperty extends HasLocation, HasParent {
395 type: "MetaProperty";
396 meta: ESLintIdentifier;
397 property: ESLintIdentifier;
399 export type ESLintPattern = ESLintIdentifier | ESLintObjectPattern | ESLintArrayPattern | ESLintRestElement | ESLintAssignmentPattern | ESLintMemberExpression | ESLintLegacyRestProperty;
400 export interface ESLintObjectPattern extends HasLocation, HasParent {
401 type: "ObjectPattern";
402 properties: (ESLintAssignmentProperty | ESLintRestElement | ESLintLegacyRestProperty)[];
404 export interface ESLintAssignmentProperty extends ESLintProperty {
405 value: ESLintPattern;
409 export interface ESLintArrayPattern extends HasLocation, HasParent {
410 type: "ArrayPattern";
411 elements: ESLintPattern[];
413 export interface ESLintRestElement extends HasLocation, HasParent {
415 argument: ESLintPattern;
417 export interface ESLintSpreadElement extends HasLocation, HasParent {
418 type: "SpreadElement";
419 argument: ESLintExpression;
421 export interface ESLintAssignmentPattern extends HasLocation, HasParent {
422 type: "AssignmentPattern";
424 right: ESLintExpression;
426 export interface ESLintLegacyRestProperty extends HasLocation, HasParent {
427 type: "RestProperty" | "ExperimentalRestProperty";
428 argument: ESLintPattern;
430 export interface ESLintLegacySpreadProperty extends HasLocation, HasParent {
431 type: "SpreadProperty" | "ExperimentalSpreadProperty";
432 argument: ESLintExpression;
434 export const NS: Readonly<{
435 HTML: "http://www.w3.org/1999/xhtml";
436 MathML: "http://www.w3.org/1998/Math/MathML";
437 SVG: "http://www.w3.org/2000/svg";
438 XLink: "http://www.w3.org/1999/xlink";
439 XML: "http://www.w3.org/XML/1998/namespace";
440 XMLNS: "http://www.w3.org/2000/xmlns/";
442 export type Namespace = typeof NS.HTML | typeof NS.MathML | typeof NS.SVG | typeof NS.XLink | typeof NS.XML | typeof NS.XMLNS;
443 export interface Variable {
444 id: ESLintIdentifier;
445 kind: "v-for" | "scope";
446 references: Reference[];
448 export interface Reference {
449 id: ESLintIdentifier;
450 mode: "rw" | "r" | "w";
451 variable: Variable | null;
453 export interface VForExpression extends HasLocation, HasParent {
454 type: "VForExpression";
455 parent: VExpressionContainer;
456 left: ESLintPattern[];
457 right: ESLintExpression;
459 export interface VOnExpression extends HasLocation, HasParent {
460 type: "VOnExpression";
461 parent: VExpressionContainer;
462 body: ESLintStatement[];
464 export interface VSlotScopeExpression extends HasLocation, HasParent {
465 type: "VSlotScopeExpression";
466 parent: VExpressionContainer;
467 params: ESLintPattern[];
469 export interface VFilterSequenceExpression extends HasLocation, HasParent {
470 type: "VFilterSequenceExpression";
471 parent: VExpressionContainer;
472 expression: ESLintExpression;
475 export interface VFilter extends HasLocation, HasParent {
477 parent: VFilterSequenceExpression;
478 callee: ESLintIdentifier;
479 arguments: (ESLintExpression | ESLintSpreadElement)[];
481 export type VNode = VAttribute | VDirective | VDirectiveKey | VDocumentFragment | VElement | VEndTag | VExpressionContainer | VIdentifier | VLiteral | VStartTag | VText;
482 export interface VText extends HasLocation, HasParent {
484 parent: VDocumentFragment | VElement;
487 export interface VExpressionContainer extends HasLocation, HasParent {
488 type: "VExpressionContainer";
489 parent: VDocumentFragment | VElement | VDirective | VDirectiveKey;
490 expression: ESLintExpression | VFilterSequenceExpression | VForExpression | VOnExpression | VSlotScopeExpression | null;
491 references: Reference[];
493 export interface VIdentifier extends HasLocation, HasParent {
495 parent: VAttribute | VDirectiveKey;
499 export interface VDirectiveKey extends HasLocation, HasParent {
500 type: "VDirectiveKey";
503 argument: VExpressionContainer | VIdentifier | null;
504 modifiers: VIdentifier[];
506 export interface VLiteral extends HasLocation, HasParent {
511 export interface VAttribute extends HasLocation, HasParent {
516 value: VLiteral | null;
518 export interface VDirective extends HasLocation, HasParent {
523 value: VExpressionContainer | null;
525 export interface VStartTag extends HasLocation, HasParent {
528 selfClosing: boolean;
529 attributes: (VAttribute | VDirective)[];
531 export interface VEndTag extends HasLocation, HasParent {
535 export interface HasConcreteInfo {
538 errors: ParseError[];
540 export interface VElement extends HasLocation, HasParent {
542 parent: VDocumentFragment | VElement;
543 namespace: Namespace;
547 children: (VElement | VText | VExpressionContainer)[];
548 endTag: VEndTag | null;
549 variables: Variable[];
551 export interface VDocumentFragment extends HasLocation, HasParent, HasConcreteInfo {
552 type: "VDocumentFragment";
554 children: (VElement | VText | VExpressionContainer)[];
558 declare module 'vue-eslint-parser/ast/tokens' {
559 import { HasLocation } from "vue-eslint-parser/ast/locations";
560 export interface Token extends HasLocation {
566 declare module 'vue-eslint-parser/ast/traverse' {
567 import { VisitorKeys } from "eslint-visitor-keys";
568 import { Node } from "vue-eslint-parser/ast/nodes";
569 function getFallbackKeys(node: Node): string[];
570 export interface Visitor {
571 visitorKeys?: VisitorKeys;
572 enterNode(node: Node, parent: Node | null): void;
573 leaveNode(node: Node, parent: Node | null): void;
575 export function traverseNodes(node: Node, visitor: Visitor): void;
576 export { getFallbackKeys };