index.d.ts 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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 | ESLintModuleDeclaration | ESLintModuleSpecifier | 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. }
  133. export interface ESLintLabeledStatement extends HasLocation, HasParent {
  134. type: "LabeledStatement";
  135. label: ESLintIdentifier;
  136. body: ESLintStatement;
  137. }
  138. export interface ESLintBreakStatement extends HasLocation, HasParent {
  139. type: "BreakStatement";
  140. label: ESLintIdentifier | null;
  141. }
  142. export interface ESLintContinueStatement extends HasLocation, HasParent {
  143. type: "ContinueStatement";
  144. label: ESLintIdentifier | null;
  145. }
  146. export interface ESLintReturnStatement extends HasLocation, HasParent {
  147. type: "ReturnStatement";
  148. argument: ESLintExpression | null;
  149. }
  150. export interface ESLintThrowStatement extends HasLocation, HasParent {
  151. type: "ThrowStatement";
  152. argument: ESLintExpression;
  153. }
  154. export interface ESLintTryStatement extends HasLocation, HasParent {
  155. type: "TryStatement";
  156. block: ESLintBlockStatement;
  157. handler: ESLintCatchClause | null;
  158. finalizer: ESLintBlockStatement | null;
  159. }
  160. export interface ESLintCatchClause extends HasLocation, HasParent {
  161. type: "CatchClause";
  162. param: ESLintPattern;
  163. body: ESLintBlockStatement;
  164. }
  165. export interface ESLintWithStatement extends HasLocation, HasParent {
  166. type: "WithStatement";
  167. object: ESLintExpression;
  168. body: ESLintStatement;
  169. }
  170. export interface ESLintDebuggerStatement extends HasLocation, HasParent {
  171. type: "DebuggerStatement";
  172. }
  173. export type ESLintDeclaration = ESLintFunctionDeclaration | ESLintVariableDeclaration | ESLintClassDeclaration;
  174. export interface ESLintFunctionDeclaration extends HasLocation, HasParent {
  175. type: "FunctionDeclaration";
  176. async: boolean;
  177. generator: boolean;
  178. id: ESLintIdentifier | null;
  179. params: ESLintPattern[];
  180. body: ESLintBlockStatement;
  181. }
  182. export interface ESLintVariableDeclaration extends HasLocation, HasParent {
  183. type: "VariableDeclaration";
  184. kind: "var" | "let" | "const";
  185. declarations: ESLintVariableDeclarator[];
  186. }
  187. export interface ESLintVariableDeclarator extends HasLocation, HasParent {
  188. type: "VariableDeclarator";
  189. id: ESLintPattern;
  190. init: ESLintExpression | null;
  191. }
  192. export interface ESLintClassDeclaration extends HasLocation, HasParent {
  193. type: "ClassDeclaration";
  194. id: ESLintIdentifier | null;
  195. superClass: ESLintExpression | null;
  196. body: ESLintClassBody;
  197. }
  198. export interface ESLintClassBody extends HasLocation, HasParent {
  199. type: "ClassBody";
  200. body: ESLintMethodDefinition[];
  201. }
  202. export interface ESLintMethodDefinition extends HasLocation, HasParent {
  203. type: "MethodDefinition";
  204. kind: "constructor" | "method" | "get" | "set";
  205. computed: boolean;
  206. static: boolean;
  207. key: ESLintExpression;
  208. value: ESLintFunctionExpression;
  209. }
  210. export type ESLintModuleDeclaration = ESLintImportDeclaration | ESLintExportNamedDeclaration | ESLintExportDefaultDeclaration | ESLintExportAllDeclaration;
  211. export type ESLintModuleSpecifier = ESLintImportSpecifier | ESLintImportDefaultSpecifier | ESLintImportNamespaceSpecifier | ESLintExportSpecifier;
  212. export interface ESLintImportDeclaration extends HasLocation, HasParent {
  213. type: "ImportDeclaration";
  214. specifiers: (ESLintImportSpecifier | ESLintImportDefaultSpecifier | ESLintImportNamespaceSpecifier)[];
  215. source: ESLintLiteral;
  216. }
  217. export interface ESLintImportSpecifier extends HasLocation, HasParent {
  218. type: "ImportSpecifier";
  219. imported: ESLintIdentifier;
  220. local: ESLintIdentifier;
  221. }
  222. export interface ESLintImportDefaultSpecifier extends HasLocation, HasParent {
  223. type: "ImportDefaultSpecifier";
  224. local: ESLintIdentifier;
  225. }
  226. export interface ESLintImportNamespaceSpecifier extends HasLocation, HasParent {
  227. type: "ImportNamespaceSpecifier";
  228. local: ESLintIdentifier;
  229. }
  230. export interface ESLintExportNamedDeclaration extends HasLocation, HasParent {
  231. type: "ExportNamedDeclaration";
  232. declaration?: ESLintDeclaration | null;
  233. specifiers: ESLintExportSpecifier[];
  234. source?: ESLintLiteral | null;
  235. }
  236. export interface ESLintExportSpecifier extends HasLocation, HasParent {
  237. type: "ExportSpecifier";
  238. local: ESLintIdentifier;
  239. exported: ESLintIdentifier;
  240. }
  241. export interface ESLintExportDefaultDeclaration extends HasLocation, HasParent {
  242. type: "ExportDefaultDeclaration";
  243. declaration: ESLintDeclaration | ESLintExpression;
  244. }
  245. export interface ESLintExportAllDeclaration extends HasLocation, HasParent {
  246. type: "ExportAllDeclaration";
  247. source: ESLintLiteral;
  248. }
  249. 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;
  250. export interface ESLintIdentifier extends HasLocation, HasParent {
  251. type: "Identifier";
  252. name: string;
  253. }
  254. export interface ESLintLiteral extends HasLocation, HasParent {
  255. type: "Literal";
  256. value: string | boolean | null | number | RegExp;
  257. regex?: {
  258. pattern: string;
  259. flags: string;
  260. };
  261. }
  262. export interface ESLintThisExpression extends HasLocation, HasParent {
  263. type: "ThisExpression";
  264. }
  265. export interface ESLintArrayExpression extends HasLocation, HasParent {
  266. type: "ArrayExpression";
  267. elements: (ESLintExpression | ESLintSpreadElement)[];
  268. }
  269. export interface ESLintObjectExpression extends HasLocation, HasParent {
  270. type: "ObjectExpression";
  271. properties: (ESLintProperty | ESLintSpreadElement | ESLintLegacySpreadProperty)[];
  272. }
  273. export interface ESLintProperty extends HasLocation, HasParent {
  274. type: "Property";
  275. kind: "init" | "get" | "set";
  276. method: boolean;
  277. shorthand: boolean;
  278. computed: boolean;
  279. key: ESLintExpression;
  280. value: ESLintExpression | ESLintPattern;
  281. }
  282. export interface ESLintFunctionExpression extends HasLocation, HasParent {
  283. type: "FunctionExpression";
  284. async: boolean;
  285. generator: boolean;
  286. id: ESLintIdentifier | null;
  287. params: ESLintPattern[];
  288. body: ESLintBlockStatement;
  289. }
  290. export interface ESLintArrowFunctionExpression extends HasLocation, HasParent {
  291. type: "ArrowFunctionExpression";
  292. async: boolean;
  293. generator: boolean;
  294. id: ESLintIdentifier | null;
  295. params: ESLintPattern[];
  296. body: ESLintBlockStatement;
  297. }
  298. export interface ESLintSequenceExpression extends HasLocation, HasParent {
  299. type: "SequenceExpression";
  300. expressions: ESLintExpression[];
  301. }
  302. export interface ESLintUnaryExpression extends HasLocation, HasParent {
  303. type: "UnaryExpression";
  304. operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
  305. prefix: boolean;
  306. argument: ESLintExpression;
  307. }
  308. export interface ESLintBinaryExpression extends HasLocation, HasParent {
  309. type: "BinaryExpression";
  310. operator: "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
  311. left: ESLintExpression;
  312. right: ESLintExpression;
  313. }
  314. export interface ESLintAssignmentExpression extends HasLocation, HasParent {
  315. type: "AssignmentExpression";
  316. operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=";
  317. left: ESLintPattern;
  318. right: ESLintExpression;
  319. }
  320. export interface ESLintUpdateExpression extends HasLocation, HasParent {
  321. type: "UpdateExpression";
  322. operator: "++" | "--";
  323. argument: ESLintExpression;
  324. prefix: boolean;
  325. }
  326. export interface ESLintLogicalExpression extends HasLocation, HasParent {
  327. type: "LogicalExpression";
  328. operator: "||" | "&&";
  329. left: ESLintExpression;
  330. right: ESLintExpression;
  331. }
  332. export interface ESLintConditionalExpression extends HasLocation, HasParent {
  333. type: "ConditionalExpression";
  334. test: ESLintExpression;
  335. alternate: ESLintExpression;
  336. consequent: ESLintExpression;
  337. }
  338. export interface ESLintCallExpression extends HasLocation, HasParent {
  339. type: "CallExpression";
  340. callee: ESLintExpression | ESLintSuper;
  341. arguments: (ESLintExpression | ESLintSpreadElement)[];
  342. }
  343. export interface ESLintSuper extends HasLocation, HasParent {
  344. type: "Super";
  345. }
  346. export interface ESLintNewExpression extends HasLocation, HasParent {
  347. type: "NewExpression";
  348. callee: ESLintExpression;
  349. arguments: (ESLintExpression | ESLintSpreadElement)[];
  350. }
  351. export interface ESLintMemberExpression extends HasLocation, HasParent {
  352. type: "MemberExpression";
  353. computed: boolean;
  354. object: ESLintExpression | ESLintSuper;
  355. property: ESLintExpression;
  356. }
  357. export interface ESLintYieldExpression extends HasLocation, HasParent {
  358. type: "YieldExpression";
  359. delegate: boolean;
  360. argument: ESLintExpression | null;
  361. }
  362. export interface ESLintAwaitExpression extends HasLocation, HasParent {
  363. type: "AwaitExpression";
  364. argument: ESLintExpression;
  365. }
  366. export interface ESLintTemplateLiteral extends HasLocation, HasParent {
  367. type: "TemplateLiteral";
  368. quasis: ESLintTemplateElement[];
  369. expressions: ESLintExpression[];
  370. }
  371. export interface ESLintTaggedTemplateExpression extends HasLocation, HasParent {
  372. type: "TaggedTemplateExpression";
  373. tag: ESLintExpression;
  374. quasi: ESLintTemplateLiteral;
  375. }
  376. export interface ESLintTemplateElement extends HasLocation, HasParent {
  377. type: "TemplateElement";
  378. tail: boolean;
  379. value: {
  380. cooked: string;
  381. raw: string;
  382. };
  383. }
  384. export interface ESLintClassExpression extends HasLocation, HasParent {
  385. type: "ClassExpression";
  386. id: ESLintIdentifier | null;
  387. superClass: ESLintExpression | null;
  388. body: ESLintClassBody;
  389. }
  390. export interface ESLintMetaProperty extends HasLocation, HasParent {
  391. type: "MetaProperty";
  392. meta: ESLintIdentifier;
  393. property: ESLintIdentifier;
  394. }
  395. export type ESLintPattern = ESLintIdentifier | ESLintObjectPattern | ESLintArrayPattern | ESLintRestElement | ESLintAssignmentPattern | ESLintMemberExpression | ESLintLegacyRestProperty;
  396. export interface ESLintObjectPattern extends HasLocation, HasParent {
  397. type: "ObjectPattern";
  398. properties: (ESLintAssignmentProperty | ESLintRestElement | ESLintLegacyRestProperty)[];
  399. }
  400. export interface ESLintAssignmentProperty extends ESLintProperty {
  401. value: ESLintPattern;
  402. kind: "init";
  403. method: false;
  404. }
  405. export interface ESLintArrayPattern extends HasLocation, HasParent {
  406. type: "ArrayPattern";
  407. elements: ESLintPattern[];
  408. }
  409. export interface ESLintRestElement extends HasLocation, HasParent {
  410. type: "RestElement";
  411. argument: ESLintPattern;
  412. }
  413. export interface ESLintSpreadElement extends HasLocation, HasParent {
  414. type: "SpreadElement";
  415. argument: ESLintExpression;
  416. }
  417. export interface ESLintAssignmentPattern extends HasLocation, HasParent {
  418. type: "AssignmentPattern";
  419. left: ESLintPattern;
  420. right: ESLintExpression;
  421. }
  422. export interface ESLintLegacyRestProperty extends HasLocation, HasParent {
  423. type: "RestProperty" | "ExperimentalRestProperty";
  424. argument: ESLintPattern;
  425. }
  426. export interface ESLintLegacySpreadProperty extends HasLocation, HasParent {
  427. type: "SpreadProperty" | "ExperimentalSpreadProperty";
  428. argument: ESLintExpression;
  429. }
  430. export const NS: Readonly<{
  431. HTML: "http://www.w3.org/1999/xhtml";
  432. MathML: "http://www.w3.org/1998/Math/MathML";
  433. SVG: "http://www.w3.org/2000/svg";
  434. XLink: "http://www.w3.org/1999/xlink";
  435. XML: "http://www.w3.org/XML/1998/namespace";
  436. XMLNS: "http://www.w3.org/2000/xmlns/";
  437. }>;
  438. export type Namespace = typeof NS.HTML | typeof NS.MathML | typeof NS.SVG | typeof NS.XLink | typeof NS.XML | typeof NS.XMLNS;
  439. export interface Variable {
  440. id: ESLintIdentifier;
  441. kind: "v-for" | "scope";
  442. references: Reference[];
  443. }
  444. export interface Reference {
  445. id: ESLintIdentifier;
  446. mode: "rw" | "r" | "w";
  447. variable: Variable | null;
  448. }
  449. export interface VForExpression extends HasLocation, HasParent {
  450. type: "VForExpression";
  451. parent: VExpressionContainer;
  452. left: ESLintPattern[];
  453. right: ESLintExpression;
  454. }
  455. export interface VOnExpression extends HasLocation, HasParent {
  456. type: "VOnExpression";
  457. parent: VExpressionContainer;
  458. body: ESLintStatement[];
  459. }
  460. export interface VSlotScopeExpression extends HasLocation, HasParent {
  461. type: "VSlotScopeExpression";
  462. parent: VExpressionContainer;
  463. params: ESLintPattern[];
  464. }
  465. export interface VFilterSequenceExpression extends HasLocation, HasParent {
  466. type: "VFilterSequenceExpression";
  467. parent: VExpressionContainer;
  468. expression: ESLintExpression;
  469. filters: VFilter[];
  470. }
  471. export interface VFilter extends HasLocation, HasParent {
  472. type: "VFilter";
  473. parent: VFilterSequenceExpression;
  474. callee: ESLintIdentifier;
  475. arguments: (ESLintExpression | ESLintSpreadElement)[];
  476. }
  477. export type VNode = VAttribute | VDirective | VDirectiveKey | VDocumentFragment | VElement | VEndTag | VExpressionContainer | VIdentifier | VLiteral | VStartTag | VText;
  478. export interface VText extends HasLocation, HasParent {
  479. type: "VText";
  480. parent: VDocumentFragment | VElement;
  481. value: string;
  482. }
  483. export interface VExpressionContainer extends HasLocation, HasParent {
  484. type: "VExpressionContainer";
  485. parent: VDocumentFragment | VElement | VDirective | VDirectiveKey;
  486. expression: ESLintExpression | VFilterSequenceExpression | VForExpression | VOnExpression | VSlotScopeExpression | null;
  487. references: Reference[];
  488. }
  489. export interface VIdentifier extends HasLocation, HasParent {
  490. type: "VIdentifier";
  491. parent: VAttribute | VDirectiveKey;
  492. name: string;
  493. rawName: string;
  494. }
  495. export interface VDirectiveKey extends HasLocation, HasParent {
  496. type: "VDirectiveKey";
  497. parent: VDirective;
  498. name: VIdentifier;
  499. argument: VExpressionContainer | VIdentifier | null;
  500. modifiers: VIdentifier[];
  501. }
  502. export interface VLiteral extends HasLocation, HasParent {
  503. type: "VLiteral";
  504. parent: VAttribute;
  505. value: string;
  506. }
  507. export interface VAttribute extends HasLocation, HasParent {
  508. type: "VAttribute";
  509. parent: VStartTag;
  510. directive: false;
  511. key: VIdentifier;
  512. value: VLiteral | null;
  513. }
  514. export interface VDirective extends HasLocation, HasParent {
  515. type: "VAttribute";
  516. parent: VStartTag;
  517. directive: true;
  518. key: VDirectiveKey;
  519. value: VExpressionContainer | null;
  520. }
  521. export interface VStartTag extends HasLocation, HasParent {
  522. type: "VStartTag";
  523. parent: VElement;
  524. selfClosing: boolean;
  525. attributes: (VAttribute | VDirective)[];
  526. }
  527. export interface VEndTag extends HasLocation, HasParent {
  528. type: "VEndTag";
  529. parent: VElement;
  530. }
  531. export interface HasConcreteInfo {
  532. tokens: Token[];
  533. comments: Token[];
  534. errors: ParseError[];
  535. }
  536. export interface VElement extends HasLocation, HasParent {
  537. type: "VElement";
  538. parent: VDocumentFragment | VElement;
  539. namespace: Namespace;
  540. name: string;
  541. rawName: string;
  542. startTag: VStartTag;
  543. children: (VElement | VText | VExpressionContainer)[];
  544. endTag: VEndTag | null;
  545. variables: Variable[];
  546. }
  547. export interface VDocumentFragment extends HasLocation, HasParent, HasConcreteInfo {
  548. type: "VDocumentFragment";
  549. parent: null;
  550. children: (VElement | VText | VExpressionContainer | VStyleElement)[];
  551. }
  552. export interface VStyleElement extends VElement {
  553. type: "VElement";
  554. name: "style";
  555. style: true;
  556. children: (VText | VExpressionContainer)[];
  557. }
  558. }
  559. declare module 'vue-eslint-parser/ast/tokens' {
  560. import type { HasLocation } from "vue-eslint-parser/ast/locations";
  561. export interface Token extends HasLocation {
  562. type: string;
  563. value: string;
  564. }
  565. }
  566. declare module 'vue-eslint-parser/ast/traverse' {
  567. import type { VisitorKeys } from "eslint-visitor-keys";
  568. import type { Node } from "vue-eslint-parser/ast/nodes";
  569. export const KEYS: Readonly<{
  570. [type: string]: readonly string[] | undefined;
  571. }>;
  572. function getFallbackKeys(node: Node): string[];
  573. export interface Visitor {
  574. visitorKeys?: VisitorKeys;
  575. enterNode(node: Node, parent: Node | null): void;
  576. leaveNode(node: Node, parent: Node | null): void;
  577. }
  578. export function traverseNodes(node: Node, visitor: Visitor): void;
  579. export { getFallbackKeys };
  580. }