index.d.ts 27 KB

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