index.d.ts 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. // Generated by dts-bundle v0.7.3
  2. // Dependencies for this module:
  3. // ../eslint-scope
  4. // ../@typescript-eslint/utils
  5. // ../eslint-visitor-keys
  6. declare module 'vue-eslint-parser' {
  7. import * as AST from "vue-eslint-parser/ast";
  8. export function parseForESLint(code: string, parserOptions: any): AST.ESLintExtendedProgram;
  9. export function parse(code: string, options: any): AST.ESLintProgram;
  10. export { AST };
  11. export const meta: {
  12. name: string;
  13. version: string | undefined;
  14. };
  15. }
  16. declare module 'vue-eslint-parser/ast' {
  17. export * from "vue-eslint-parser/ast/errors";
  18. export * from "vue-eslint-parser/ast/locations";
  19. export * from "vue-eslint-parser/ast/nodes";
  20. export * from "vue-eslint-parser/ast/tokens";
  21. export * from "vue-eslint-parser/ast/traverse";
  22. }
  23. declare module 'vue-eslint-parser/ast/errors' {
  24. export class ParseError extends SyntaxError {
  25. code?: ErrorCode;
  26. index: number;
  27. lineNumber: number;
  28. column: number;
  29. static fromCode(code: ErrorCode, offset: number, line: number, column: number): ParseError;
  30. static normalize(x: any): ParseError | null;
  31. constructor(message: string, code: ErrorCode | undefined, offset: number, line: number, column: number);
  32. static isParseError(x: any): x is ParseError;
  33. }
  34. 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" | "x-missing-interpolation-end";
  35. }
  36. declare module 'vue-eslint-parser/ast/locations' {
  37. export interface Location {
  38. line: number;
  39. column: number;
  40. }
  41. export interface LocationRange {
  42. start: Location;
  43. end: Location;
  44. }
  45. export type Offset = number;
  46. export type OffsetRange = [Offset, Offset];
  47. export interface HasLocation {
  48. range: OffsetRange;
  49. loc: LocationRange;
  50. start?: number;
  51. end?: number;
  52. }
  53. }
  54. declare module 'vue-eslint-parser/ast/nodes' {
  55. import type { ScopeManager } from "eslint-scope";
  56. import type { ParseError } from "vue-eslint-parser/ast/errors";
  57. import type { HasLocation } from "vue-eslint-parser/ast/locations";
  58. import type { Token } from "vue-eslint-parser/ast/tokens";
  59. import type { TSESTree } from "@typescript-eslint/utils";
  60. export interface HasParent {
  61. parent?: Node | null;
  62. }
  63. export type Node = ESLintNode | VNode | VForExpression | VOnExpression | VSlotScopeExpression | VGenericExpression | VFilterSequenceExpression | VFilter;
  64. export type ESLintNode = ESLintIdentifier | ESLintLiteral | ESLintProgram | ESLintSwitchCase | ESLintCatchClause | ESLintVariableDeclarator | ESLintStatement | ESLintExpression | ESLintProperty | ESLintAssignmentProperty | ESLintSuper | ESLintTemplateElement | ESLintSpreadElement | ESLintPattern | ESLintClassBody | ESLintMethodDefinition | ESLintPropertyDefinition | ESLintStaticBlock | ESLintPrivateIdentifier | ESLintModuleDeclaration | ESLintModuleSpecifier | ESLintImportExpression | ESLintLegacyRestProperty;
  65. export interface ESLintExtendedProgram {
  66. ast: ESLintProgram;
  67. services?: {};
  68. visitorKeys?: {
  69. [type: string]: string[];
  70. };
  71. scopeManager?: ScopeManager;
  72. }
  73. export interface ESLintProgram extends HasLocation, HasParent {
  74. type: "Program";
  75. sourceType: "script" | "module";
  76. body: (ESLintStatement | ESLintModuleDeclaration)[];
  77. templateBody?: VElement & HasConcreteInfo;
  78. tokens?: Token[];
  79. comments?: Token[];
  80. errors?: ParseError[];
  81. }
  82. export type ESLintStatement = ESLintExpressionStatement | ESLintBlockStatement | ESLintEmptyStatement | ESLintDebuggerStatement | ESLintWithStatement | ESLintReturnStatement | ESLintLabeledStatement | ESLintBreakStatement | ESLintContinueStatement | ESLintIfStatement | ESLintSwitchStatement | ESLintThrowStatement | ESLintTryStatement | ESLintWhileStatement | ESLintDoWhileStatement | ESLintForStatement | ESLintForInStatement | ESLintForOfStatement | ESLintDeclaration;
  83. export interface ESLintEmptyStatement extends HasLocation, HasParent {
  84. type: "EmptyStatement";
  85. }
  86. export interface ESLintBlockStatement extends HasLocation, HasParent {
  87. type: "BlockStatement";
  88. body: ESLintStatement[];
  89. }
  90. export interface ESLintExpressionStatement extends HasLocation, HasParent {
  91. type: "ExpressionStatement";
  92. expression: ESLintExpression;
  93. }
  94. export interface ESLintIfStatement extends HasLocation, HasParent {
  95. type: "IfStatement";
  96. test: ESLintExpression;
  97. consequent: ESLintStatement;
  98. alternate: ESLintStatement | null;
  99. }
  100. export interface ESLintSwitchStatement extends HasLocation, HasParent {
  101. type: "SwitchStatement";
  102. discriminant: ESLintExpression;
  103. cases: ESLintSwitchCase[];
  104. }
  105. export interface ESLintSwitchCase extends HasLocation, HasParent {
  106. type: "SwitchCase";
  107. test: ESLintExpression | null;
  108. consequent: ESLintStatement[];
  109. }
  110. export interface ESLintWhileStatement extends HasLocation, HasParent {
  111. type: "WhileStatement";
  112. test: ESLintExpression;
  113. body: ESLintStatement;
  114. }
  115. export interface ESLintDoWhileStatement extends HasLocation, HasParent {
  116. type: "DoWhileStatement";
  117. body: ESLintStatement;
  118. test: ESLintExpression;
  119. }
  120. export interface ESLintForStatement extends HasLocation, HasParent {
  121. type: "ForStatement";
  122. init: ESLintVariableDeclaration | ESLintExpression | null;
  123. test: ESLintExpression | null;
  124. update: ESLintExpression | null;
  125. body: ESLintStatement;
  126. }
  127. export interface ESLintForInStatement extends HasLocation, HasParent {
  128. type: "ForInStatement";
  129. left: ESLintVariableDeclaration | ESLintPattern;
  130. right: ESLintExpression;
  131. body: ESLintStatement;
  132. }
  133. export interface ESLintForOfStatement extends HasLocation, HasParent {
  134. type: "ForOfStatement";
  135. left: ESLintVariableDeclaration | ESLintPattern;
  136. right: ESLintExpression;
  137. body: ESLintStatement;
  138. await: boolean;
  139. }
  140. export interface ESLintLabeledStatement extends HasLocation, HasParent {
  141. type: "LabeledStatement";
  142. label: ESLintIdentifier;
  143. body: ESLintStatement;
  144. }
  145. export interface ESLintBreakStatement extends HasLocation, HasParent {
  146. type: "BreakStatement";
  147. label: ESLintIdentifier | null;
  148. }
  149. export interface ESLintContinueStatement extends HasLocation, HasParent {
  150. type: "ContinueStatement";
  151. label: ESLintIdentifier | null;
  152. }
  153. export interface ESLintReturnStatement extends HasLocation, HasParent {
  154. type: "ReturnStatement";
  155. argument: ESLintExpression | null;
  156. }
  157. export interface ESLintThrowStatement extends HasLocation, HasParent {
  158. type: "ThrowStatement";
  159. argument: ESLintExpression;
  160. }
  161. export interface ESLintTryStatement extends HasLocation, HasParent {
  162. type: "TryStatement";
  163. block: ESLintBlockStatement;
  164. handler: ESLintCatchClause | null;
  165. finalizer: ESLintBlockStatement | null;
  166. }
  167. export interface ESLintCatchClause extends HasLocation, HasParent {
  168. type: "CatchClause";
  169. param: ESLintPattern | null;
  170. body: ESLintBlockStatement;
  171. }
  172. export interface ESLintWithStatement extends HasLocation, HasParent {
  173. type: "WithStatement";
  174. object: ESLintExpression;
  175. body: ESLintStatement;
  176. }
  177. export interface ESLintDebuggerStatement extends HasLocation, HasParent {
  178. type: "DebuggerStatement";
  179. }
  180. export type ESLintDeclaration = ESLintFunctionDeclaration | ESLintVariableDeclaration | ESLintClassDeclaration;
  181. export interface ESLintFunctionDeclaration extends HasLocation, HasParent {
  182. type: "FunctionDeclaration";
  183. async: boolean;
  184. generator: boolean;
  185. id: ESLintIdentifier | null;
  186. params: ESLintPattern[];
  187. body: ESLintBlockStatement;
  188. }
  189. export interface ESLintVariableDeclaration extends HasLocation, HasParent {
  190. type: "VariableDeclaration";
  191. kind: "var" | "let" | "const";
  192. declarations: ESLintVariableDeclarator[];
  193. }
  194. export interface ESLintVariableDeclarator extends HasLocation, HasParent {
  195. type: "VariableDeclarator";
  196. id: ESLintPattern;
  197. init: ESLintExpression | null;
  198. }
  199. export interface ESLintClassDeclaration extends HasLocation, HasParent {
  200. type: "ClassDeclaration";
  201. id: ESLintIdentifier | null;
  202. superClass: ESLintExpression | null;
  203. body: ESLintClassBody;
  204. }
  205. export interface ESLintClassBody extends HasLocation, HasParent {
  206. type: "ClassBody";
  207. body: (ESLintMethodDefinition | ESLintPropertyDefinition | ESLintStaticBlock)[];
  208. }
  209. export interface ESLintMethodDefinition extends HasLocation, HasParent {
  210. type: "MethodDefinition";
  211. kind: "constructor" | "method" | "get" | "set";
  212. computed: boolean;
  213. static: boolean;
  214. key: ESLintExpression | ESLintPrivateIdentifier;
  215. value: ESLintFunctionExpression;
  216. }
  217. export interface ESLintPropertyDefinition extends HasLocation, HasParent {
  218. type: "PropertyDefinition";
  219. computed: boolean;
  220. static: boolean;
  221. key: ESLintExpression | ESLintPrivateIdentifier;
  222. value: ESLintExpression | null;
  223. }
  224. export interface ESLintStaticBlock extends HasLocation, HasParent, Omit<ESLintBlockStatement, "type"> {
  225. type: "StaticBlock";
  226. body: ESLintStatement[];
  227. }
  228. export interface ESLintPrivateIdentifier extends HasLocation, HasParent {
  229. type: "PrivateIdentifier";
  230. name: string;
  231. }
  232. export type ESLintModuleDeclaration = ESLintImportDeclaration | ESLintExportNamedDeclaration | ESLintExportDefaultDeclaration | ESLintExportAllDeclaration;
  233. export type ESLintModuleSpecifier = ESLintImportSpecifier | ESLintImportDefaultSpecifier | ESLintImportNamespaceSpecifier | ESLintExportSpecifier;
  234. export interface ESLintImportDeclaration extends HasLocation, HasParent {
  235. type: "ImportDeclaration";
  236. specifiers: (ESLintImportSpecifier | ESLintImportDefaultSpecifier | ESLintImportNamespaceSpecifier)[];
  237. source: ESLintLiteral;
  238. }
  239. export interface ESLintImportSpecifier extends HasLocation, HasParent {
  240. type: "ImportSpecifier";
  241. imported: ESLintIdentifier | ESLintStringLiteral;
  242. local: ESLintIdentifier;
  243. }
  244. export interface ESLintImportDefaultSpecifier extends HasLocation, HasParent {
  245. type: "ImportDefaultSpecifier";
  246. local: ESLintIdentifier;
  247. }
  248. export interface ESLintImportNamespaceSpecifier extends HasLocation, HasParent {
  249. type: "ImportNamespaceSpecifier";
  250. local: ESLintIdentifier;
  251. }
  252. export interface ESLintImportExpression extends HasLocation, HasParent {
  253. type: "ImportExpression";
  254. source: ESLintExpression;
  255. }
  256. export interface ESLintExportNamedDeclaration extends HasLocation, HasParent {
  257. type: "ExportNamedDeclaration";
  258. declaration?: ESLintDeclaration | null;
  259. specifiers: ESLintExportSpecifier[];
  260. source?: ESLintLiteral | null;
  261. }
  262. export interface ESLintExportSpecifier extends HasLocation, HasParent {
  263. type: "ExportSpecifier";
  264. local: ESLintIdentifier | ESLintStringLiteral;
  265. exported: ESLintIdentifier | ESLintStringLiteral;
  266. }
  267. export interface ESLintExportDefaultDeclaration extends HasLocation, HasParent {
  268. type: "ExportDefaultDeclaration";
  269. declaration: ESLintDeclaration | ESLintExpression;
  270. }
  271. export interface ESLintExportAllDeclaration extends HasLocation, HasParent {
  272. type: "ExportAllDeclaration";
  273. exported: ESLintIdentifier | ESLintStringLiteral | null;
  274. source: ESLintLiteral;
  275. }
  276. 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 | ESLintChainExpression;
  277. export interface ESLintIdentifier extends HasLocation, HasParent {
  278. type: "Identifier";
  279. name: string;
  280. }
  281. interface ESLintLiteralBase extends HasLocation, HasParent {
  282. type: "Literal";
  283. value: string | boolean | null | number | RegExp | bigint;
  284. raw: string;
  285. regex?: {
  286. pattern: string;
  287. flags: string;
  288. };
  289. bigint?: string;
  290. }
  291. export interface ESLintStringLiteral extends ESLintLiteralBase {
  292. value: string;
  293. regex?: undefined;
  294. bigint?: undefined;
  295. }
  296. export interface ESLintBooleanLiteral extends ESLintLiteralBase {
  297. value: boolean;
  298. regex?: undefined;
  299. bigint?: undefined;
  300. }
  301. export interface ESLintNullLiteral extends ESLintLiteralBase {
  302. value: null;
  303. regex?: undefined;
  304. bigint?: undefined;
  305. }
  306. export interface ESLintNumberLiteral extends ESLintLiteralBase {
  307. value: number;
  308. regex?: undefined;
  309. bigint?: undefined;
  310. }
  311. export interface ESLintRegExpLiteral extends ESLintLiteralBase {
  312. value: null | RegExp;
  313. regex: {
  314. pattern: string;
  315. flags: string;
  316. };
  317. bigint?: undefined;
  318. }
  319. export interface ESLintBigIntLiteral extends ESLintLiteralBase {
  320. value: null | bigint;
  321. regex?: undefined;
  322. bigint: string;
  323. }
  324. export type ESLintLiteral = ESLintStringLiteral | ESLintBooleanLiteral | ESLintNullLiteral | ESLintNumberLiteral | ESLintRegExpLiteral | ESLintBigIntLiteral;
  325. export interface ESLintThisExpression extends HasLocation, HasParent {
  326. type: "ThisExpression";
  327. }
  328. export interface ESLintArrayExpression extends HasLocation, HasParent {
  329. type: "ArrayExpression";
  330. elements: (ESLintExpression | ESLintSpreadElement)[];
  331. }
  332. export interface ESLintObjectExpression extends HasLocation, HasParent {
  333. type: "ObjectExpression";
  334. properties: (ESLintProperty | ESLintSpreadElement | ESLintLegacySpreadProperty)[];
  335. }
  336. export interface ESLintProperty extends HasLocation, HasParent {
  337. type: "Property";
  338. kind: "init" | "get" | "set";
  339. method: boolean;
  340. shorthand: boolean;
  341. computed: boolean;
  342. key: ESLintExpression;
  343. value: ESLintExpression | ESLintPattern;
  344. }
  345. export interface ESLintFunctionExpression extends HasLocation, HasParent {
  346. type: "FunctionExpression";
  347. async: boolean;
  348. generator: boolean;
  349. id: ESLintIdentifier | null;
  350. params: ESLintPattern[];
  351. body: ESLintBlockStatement;
  352. }
  353. export interface ESLintArrowFunctionExpression extends HasLocation, HasParent {
  354. type: "ArrowFunctionExpression";
  355. async: boolean;
  356. generator: boolean;
  357. id: ESLintIdentifier | null;
  358. params: ESLintPattern[];
  359. body: ESLintBlockStatement | ESLintExpression;
  360. }
  361. export interface ESLintSequenceExpression extends HasLocation, HasParent {
  362. type: "SequenceExpression";
  363. expressions: ESLintExpression[];
  364. }
  365. export interface ESLintUnaryExpression extends HasLocation, HasParent {
  366. type: "UnaryExpression";
  367. operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
  368. prefix: boolean;
  369. argument: ESLintExpression;
  370. }
  371. export interface ESLintBinaryExpression extends HasLocation, HasParent {
  372. type: "BinaryExpression";
  373. operator: "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
  374. left: ESLintExpression | ESLintPrivateIdentifier;
  375. right: ESLintExpression;
  376. }
  377. export interface ESLintAssignmentExpression extends HasLocation, HasParent {
  378. type: "AssignmentExpression";
  379. operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
  380. left: ESLintPattern;
  381. right: ESLintExpression;
  382. }
  383. export interface ESLintUpdateExpression extends HasLocation, HasParent {
  384. type: "UpdateExpression";
  385. operator: "++" | "--";
  386. argument: ESLintExpression;
  387. prefix: boolean;
  388. }
  389. export interface ESLintLogicalExpression extends HasLocation, HasParent {
  390. type: "LogicalExpression";
  391. operator: "||" | "&&" | "??";
  392. left: ESLintExpression;
  393. right: ESLintExpression;
  394. }
  395. export interface ESLintConditionalExpression extends HasLocation, HasParent {
  396. type: "ConditionalExpression";
  397. test: ESLintExpression;
  398. alternate: ESLintExpression;
  399. consequent: ESLintExpression;
  400. }
  401. export interface ESLintCallExpression extends HasLocation, HasParent {
  402. type: "CallExpression";
  403. optional: boolean;
  404. callee: ESLintExpression | ESLintSuper;
  405. arguments: (ESLintExpression | ESLintSpreadElement)[];
  406. }
  407. export interface ESLintSuper extends HasLocation, HasParent {
  408. type: "Super";
  409. }
  410. export interface ESLintNewExpression extends HasLocation, HasParent {
  411. type: "NewExpression";
  412. callee: ESLintExpression;
  413. arguments: (ESLintExpression | ESLintSpreadElement)[];
  414. }
  415. export interface ESLintMemberExpression extends HasLocation, HasParent {
  416. type: "MemberExpression";
  417. optional: boolean;
  418. computed: boolean;
  419. object: ESLintExpression | ESLintSuper;
  420. property: ESLintExpression | ESLintPrivateIdentifier;
  421. }
  422. export interface ESLintYieldExpression extends HasLocation, HasParent {
  423. type: "YieldExpression";
  424. delegate: boolean;
  425. argument: ESLintExpression | null;
  426. }
  427. export interface ESLintAwaitExpression extends HasLocation, HasParent {
  428. type: "AwaitExpression";
  429. argument: ESLintExpression;
  430. }
  431. export interface ESLintTemplateLiteral extends HasLocation, HasParent {
  432. type: "TemplateLiteral";
  433. quasis: ESLintTemplateElement[];
  434. expressions: ESLintExpression[];
  435. }
  436. export interface ESLintTaggedTemplateExpression extends HasLocation, HasParent {
  437. type: "TaggedTemplateExpression";
  438. tag: ESLintExpression;
  439. quasi: ESLintTemplateLiteral;
  440. }
  441. export interface ESLintTemplateElement extends HasLocation, HasParent {
  442. type: "TemplateElement";
  443. tail: boolean;
  444. value: {
  445. cooked: string | null;
  446. raw: string;
  447. };
  448. }
  449. export interface ESLintClassExpression extends HasLocation, HasParent {
  450. type: "ClassExpression";
  451. id: ESLintIdentifier | null;
  452. superClass: ESLintExpression | null;
  453. body: ESLintClassBody;
  454. }
  455. export interface ESLintMetaProperty extends HasLocation, HasParent {
  456. type: "MetaProperty";
  457. meta: ESLintIdentifier;
  458. property: ESLintIdentifier;
  459. }
  460. export type ESLintPattern = ESLintIdentifier | ESLintObjectPattern | ESLintArrayPattern | ESLintRestElement | ESLintAssignmentPattern | ESLintMemberExpression | ESLintLegacyRestProperty;
  461. export interface ESLintObjectPattern extends HasLocation, HasParent {
  462. type: "ObjectPattern";
  463. properties: (ESLintAssignmentProperty | ESLintRestElement | ESLintLegacyRestProperty)[];
  464. }
  465. export interface ESLintAssignmentProperty extends ESLintProperty {
  466. value: ESLintPattern;
  467. kind: "init";
  468. method: false;
  469. }
  470. export interface ESLintArrayPattern extends HasLocation, HasParent {
  471. type: "ArrayPattern";
  472. elements: ESLintPattern[];
  473. }
  474. export interface ESLintRestElement extends HasLocation, HasParent {
  475. type: "RestElement";
  476. argument: ESLintPattern;
  477. }
  478. export interface ESLintSpreadElement extends HasLocation, HasParent {
  479. type: "SpreadElement";
  480. argument: ESLintExpression;
  481. }
  482. export interface ESLintAssignmentPattern extends HasLocation, HasParent {
  483. type: "AssignmentPattern";
  484. left: ESLintPattern;
  485. right: ESLintExpression;
  486. }
  487. export type ESLintChainElement = ESLintCallExpression | ESLintMemberExpression;
  488. export interface ESLintChainExpression extends HasLocation, HasParent {
  489. type: "ChainExpression";
  490. expression: ESLintChainElement;
  491. }
  492. export interface ESLintLegacyRestProperty extends HasLocation, HasParent {
  493. type: "RestProperty" | "ExperimentalRestProperty";
  494. argument: ESLintPattern;
  495. }
  496. export interface ESLintLegacySpreadProperty extends HasLocation, HasParent {
  497. type: "SpreadProperty" | "ExperimentalSpreadProperty";
  498. argument: ESLintExpression;
  499. }
  500. export const NS: Readonly<{
  501. HTML: "http://www.w3.org/1999/xhtml";
  502. MathML: "http://www.w3.org/1998/Math/MathML";
  503. SVG: "http://www.w3.org/2000/svg";
  504. XLink: "http://www.w3.org/1999/xlink";
  505. XML: "http://www.w3.org/XML/1998/namespace";
  506. XMLNS: "http://www.w3.org/2000/xmlns/";
  507. }>;
  508. export type Namespace = typeof NS.HTML | typeof NS.MathML | typeof NS.SVG | typeof NS.XLink | typeof NS.XML | typeof NS.XMLNS;
  509. export interface Variable {
  510. id: ESLintIdentifier;
  511. kind: "v-for" | "scope" | "generic";
  512. references: Reference[];
  513. }
  514. export interface Reference {
  515. id: ESLintIdentifier;
  516. mode: "rw" | "r" | "w";
  517. variable: Variable | null;
  518. isValueReference?: boolean;
  519. isTypeReference?: boolean;
  520. }
  521. export interface VForExpression extends HasLocation, HasParent {
  522. type: "VForExpression";
  523. parent: VExpressionContainer;
  524. left: ESLintPattern[];
  525. right: ESLintExpression;
  526. }
  527. export interface VOnExpression extends HasLocation, HasParent {
  528. type: "VOnExpression";
  529. parent: VExpressionContainer;
  530. body: ESLintStatement[];
  531. }
  532. export interface VSlotScopeExpression extends HasLocation, HasParent {
  533. type: "VSlotScopeExpression";
  534. parent: VExpressionContainer;
  535. params: ESLintPattern[];
  536. }
  537. export interface VGenericExpression extends HasLocation, HasParent {
  538. type: "VGenericExpression";
  539. parent: VExpressionContainer;
  540. params: TSESTree.TSTypeParameterDeclaration["params"];
  541. rawParams: string[];
  542. }
  543. export interface VFilterSequenceExpression extends HasLocation, HasParent {
  544. type: "VFilterSequenceExpression";
  545. parent: VExpressionContainer;
  546. expression: ESLintExpression;
  547. filters: VFilter[];
  548. }
  549. export interface VFilter extends HasLocation, HasParent {
  550. type: "VFilter";
  551. parent: VFilterSequenceExpression;
  552. callee: ESLintIdentifier;
  553. arguments: (ESLintExpression | ESLintSpreadElement)[];
  554. }
  555. export type VNode = VAttribute | VDirective | VDirectiveKey | VDocumentFragment | VElement | VEndTag | VExpressionContainer | VIdentifier | VLiteral | VStartTag | VText;
  556. export interface VText extends HasLocation, HasParent {
  557. type: "VText";
  558. parent: VDocumentFragment | VElement;
  559. value: string;
  560. }
  561. export interface VExpressionContainer extends HasLocation, HasParent {
  562. type: "VExpressionContainer";
  563. parent: VDocumentFragment | VElement | VDirective | VDirectiveKey;
  564. expression: ESLintExpression | VFilterSequenceExpression | VForExpression | VOnExpression | VSlotScopeExpression | VGenericExpression | null;
  565. references: Reference[];
  566. }
  567. export interface VIdentifier extends HasLocation, HasParent {
  568. type: "VIdentifier";
  569. parent: VAttribute | VDirectiveKey;
  570. name: string;
  571. rawName: string;
  572. }
  573. export interface VDirectiveKey extends HasLocation, HasParent {
  574. type: "VDirectiveKey";
  575. parent: VDirective;
  576. name: VIdentifier;
  577. argument: VExpressionContainer | VIdentifier | null;
  578. modifiers: VIdentifier[];
  579. }
  580. export interface VLiteral extends HasLocation, HasParent {
  581. type: "VLiteral";
  582. parent: VAttribute;
  583. value: string;
  584. }
  585. export interface VAttribute extends HasLocation, HasParent {
  586. type: "VAttribute";
  587. parent: VStartTag;
  588. directive: false;
  589. key: VIdentifier;
  590. value: VLiteral | null;
  591. }
  592. export interface VDirective extends HasLocation, HasParent {
  593. type: "VAttribute";
  594. parent: VStartTag;
  595. directive: true;
  596. key: VDirectiveKey;
  597. value: VExpressionContainer | null;
  598. }
  599. export interface VStartTag extends HasLocation, HasParent {
  600. type: "VStartTag";
  601. parent: VElement;
  602. selfClosing: boolean;
  603. attributes: (VAttribute | VDirective)[];
  604. }
  605. export interface VEndTag extends HasLocation, HasParent {
  606. type: "VEndTag";
  607. parent: VElement;
  608. }
  609. export interface HasConcreteInfo {
  610. tokens: Token[];
  611. comments: Token[];
  612. errors: ParseError[];
  613. }
  614. export interface VElement extends HasLocation, HasParent {
  615. type: "VElement";
  616. parent: VDocumentFragment | VElement;
  617. namespace: Namespace;
  618. name: string;
  619. rawName: string;
  620. startTag: VStartTag;
  621. children: (VElement | VText | VExpressionContainer)[];
  622. endTag: VEndTag | null;
  623. variables: Variable[];
  624. }
  625. export interface VDocumentFragment extends HasLocation, HasParent, HasConcreteInfo {
  626. type: "VDocumentFragment";
  627. parent: null;
  628. children: (VElement | VText | VExpressionContainer | VStyleElement)[];
  629. }
  630. export interface VStyleElement extends VElement {
  631. type: "VElement";
  632. name: "style";
  633. style: true;
  634. children: (VText | VExpressionContainer)[];
  635. }
  636. export {};
  637. }
  638. declare module 'vue-eslint-parser/ast/tokens' {
  639. import type { HasLocation } from "vue-eslint-parser/ast/locations";
  640. export interface Token extends HasLocation {
  641. type: string;
  642. value: string;
  643. }
  644. }
  645. declare module 'vue-eslint-parser/ast/traverse' {
  646. import type { VisitorKeys } from "eslint-visitor-keys";
  647. import type { Node } from "vue-eslint-parser/ast/nodes";
  648. export const KEYS: Readonly<{
  649. [type: string]: readonly string[] | undefined;
  650. }>;
  651. function getFallbackKeys(node: Node): string[];
  652. export interface Visitor {
  653. visitorKeys?: VisitorKeys;
  654. enterNode(node: Node, parent: Node | null): void;
  655. leaveNode(node: Node, parent: Node | null): void;
  656. }
  657. export function traverseNodes(node: Node, visitor: Visitor): void;
  658. export { getFallbackKeys };
  659. }