index.d.ts 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  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, options: 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";
  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 { ScopeManager } from "eslint-scope";
  51. import { ParseError } from "vue-eslint-parser/ast/errors";
  52. import { HasLocation } from "vue-eslint-parser/ast/locations";
  53. import { 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. exported: ESLintIdentifier;
  239. }
  240. export interface ESLintExportDefaultDeclaration extends HasLocation, HasParent {
  241. type: "ExportDefaultDeclaration";
  242. declaration: ESLintDeclaration | ESLintExpression;
  243. }
  244. export interface ESLintExportAllDeclaration extends HasLocation, HasParent {
  245. type: "ExportAllDeclaration";
  246. source: ESLintLiteral;
  247. }
  248. 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;
  249. export interface ESLintIdentifier extends HasLocation, HasParent {
  250. type: "Identifier";
  251. name: string;
  252. }
  253. export interface ESLintLiteral extends HasLocation, HasParent {
  254. type: "Literal";
  255. value: string | boolean | null | number | RegExp;
  256. regex?: {
  257. pattern: string;
  258. flags: string;
  259. };
  260. }
  261. export interface ESLintThisExpression extends HasLocation, HasParent {
  262. type: "ThisExpression";
  263. }
  264. export interface ESLintArrayExpression extends HasLocation, HasParent {
  265. type: "ArrayExpression";
  266. elements: (ESLintExpression | ESLintSpreadElement)[];
  267. }
  268. export interface ESLintObjectExpression extends HasLocation, HasParent {
  269. type: "ObjectExpression";
  270. properties: (ESLintProperty | ESLintSpreadElement | ESLintLegacySpreadProperty)[];
  271. }
  272. export interface ESLintProperty extends HasLocation, HasParent {
  273. type: "Property";
  274. kind: "init" | "get" | "set";
  275. method: boolean;
  276. shorthand: boolean;
  277. computed: boolean;
  278. key: ESLintExpression;
  279. value: ESLintExpression | ESLintPattern;
  280. }
  281. export interface ESLintFunctionExpression extends HasLocation, HasParent {
  282. type: "FunctionExpression";
  283. async: boolean;
  284. generator: boolean;
  285. id: ESLintIdentifier | null;
  286. params: ESLintPattern[];
  287. body: ESLintBlockStatement;
  288. }
  289. export interface ESLintArrowFunctionExpression extends HasLocation, HasParent {
  290. type: "ArrowFunctionExpression";
  291. async: boolean;
  292. generator: boolean;
  293. id: ESLintIdentifier | null;
  294. params: ESLintPattern[];
  295. body: ESLintBlockStatement;
  296. }
  297. export interface ESLintSequenceExpression extends HasLocation, HasParent {
  298. type: "SequenceExpression";
  299. expressions: ESLintExpression[];
  300. }
  301. export interface ESLintUnaryExpression extends HasLocation, HasParent {
  302. type: "UnaryExpression";
  303. operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
  304. prefix: boolean;
  305. argument: ESLintExpression;
  306. }
  307. export interface ESLintBinaryExpression extends HasLocation, HasParent {
  308. type: "BinaryExpression";
  309. operator: "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
  310. left: ESLintExpression;
  311. right: ESLintExpression;
  312. }
  313. export interface ESLintAssignmentExpression extends HasLocation, HasParent {
  314. type: "AssignmentExpression";
  315. operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=";
  316. left: ESLintPattern;
  317. right: ESLintExpression;
  318. }
  319. export interface ESLintUpdateExpression extends HasLocation, HasParent {
  320. type: "UpdateExpression";
  321. operator: "++" | "--";
  322. argument: ESLintExpression;
  323. prefix: boolean;
  324. }
  325. export interface ESLintLogicalExpression extends HasLocation, HasParent {
  326. type: "LogicalExpression";
  327. operator: "||" | "&&";
  328. left: ESLintExpression;
  329. right: ESLintExpression;
  330. }
  331. export interface ESLintConditionalExpression extends HasLocation, HasParent {
  332. type: "ConditionalExpression";
  333. test: ESLintExpression;
  334. alternate: ESLintExpression;
  335. consequent: ESLintExpression;
  336. }
  337. export interface ESLintCallExpression extends HasLocation, HasParent {
  338. type: "CallExpression";
  339. callee: ESLintExpression | ESLintSuper;
  340. arguments: (ESLintExpression | ESLintSpreadElement)[];
  341. }
  342. export interface ESLintSuper extends HasLocation, HasParent {
  343. type: "Super";
  344. }
  345. export interface ESLintNewExpression extends HasLocation, HasParent {
  346. type: "NewExpression";
  347. callee: ESLintExpression;
  348. arguments: (ESLintExpression | ESLintSpreadElement)[];
  349. }
  350. export interface ESLintMemberExpression extends HasLocation, HasParent {
  351. type: "MemberExpression";
  352. computed: boolean;
  353. object: ESLintExpression | ESLintSuper;
  354. property: ESLintExpression;
  355. }
  356. export interface ESLintYieldExpression extends HasLocation, HasParent {
  357. type: "YieldExpression";
  358. delegate: boolean;
  359. argument: ESLintExpression | null;
  360. }
  361. export interface ESLintAwaitExpression extends HasLocation, HasParent {
  362. type: "AwaitExpression";
  363. argument: ESLintExpression;
  364. }
  365. export interface ESLintTemplateLiteral extends HasLocation, HasParent {
  366. type: "TemplateLiteral";
  367. quasis: ESLintTemplateElement[];
  368. expressions: ESLintExpression[];
  369. }
  370. export interface ESLintTaggedTemplateExpression extends HasLocation, HasParent {
  371. type: "TaggedTemplateExpression";
  372. tag: ESLintExpression;
  373. quasi: ESLintTemplateLiteral;
  374. }
  375. export interface ESLintTemplateElement extends HasLocation, HasParent {
  376. type: "TemplateElement";
  377. tail: boolean;
  378. value: {
  379. cooked: string;
  380. raw: string;
  381. };
  382. }
  383. export interface ESLintClassExpression extends HasLocation, HasParent {
  384. type: "ClassExpression";
  385. id: ESLintIdentifier | null;
  386. superClass: ESLintExpression | null;
  387. body: ESLintClassBody;
  388. }
  389. export interface ESLintMetaProperty extends HasLocation, HasParent {
  390. type: "MetaProperty";
  391. meta: ESLintIdentifier;
  392. property: ESLintIdentifier;
  393. }
  394. export type ESLintPattern = ESLintIdentifier | ESLintObjectPattern | ESLintArrayPattern | ESLintRestElement | ESLintAssignmentPattern | ESLintMemberExpression | ESLintLegacyRestProperty;
  395. export interface ESLintObjectPattern extends HasLocation, HasParent {
  396. type: "ObjectPattern";
  397. properties: (ESLintAssignmentProperty | ESLintRestElement | ESLintLegacyRestProperty)[];
  398. }
  399. export interface ESLintAssignmentProperty extends ESLintProperty {
  400. value: ESLintPattern;
  401. kind: "init";
  402. method: false;
  403. }
  404. export interface ESLintArrayPattern extends HasLocation, HasParent {
  405. type: "ArrayPattern";
  406. elements: ESLintPattern[];
  407. }
  408. export interface ESLintRestElement extends HasLocation, HasParent {
  409. type: "RestElement";
  410. argument: ESLintPattern;
  411. }
  412. export interface ESLintSpreadElement extends HasLocation, HasParent {
  413. type: "SpreadElement";
  414. argument: ESLintExpression;
  415. }
  416. export interface ESLintAssignmentPattern extends HasLocation, HasParent {
  417. type: "AssignmentPattern";
  418. left: ESLintPattern;
  419. right: ESLintExpression;
  420. }
  421. export interface ESLintLegacyRestProperty extends HasLocation, HasParent {
  422. type: "RestProperty" | "ExperimentalRestProperty";
  423. argument: ESLintPattern;
  424. }
  425. export interface ESLintLegacySpreadProperty extends HasLocation, HasParent {
  426. type: "SpreadProperty" | "ExperimentalSpreadProperty";
  427. argument: ESLintExpression;
  428. }
  429. export const NS: Readonly<{
  430. HTML: "http://www.w3.org/1999/xhtml";
  431. MathML: "http://www.w3.org/1998/Math/MathML";
  432. SVG: "http://www.w3.org/2000/svg";
  433. XLink: "http://www.w3.org/1999/xlink";
  434. XML: "http://www.w3.org/XML/1998/namespace";
  435. XMLNS: "http://www.w3.org/2000/xmlns/";
  436. }>;
  437. export type Namespace = typeof NS.HTML | typeof NS.MathML | typeof NS.SVG | typeof NS.XLink | typeof NS.XML | typeof NS.XMLNS;
  438. export interface Variable {
  439. id: ESLintIdentifier;
  440. kind: "v-for" | "scope";
  441. references: Reference[];
  442. }
  443. export interface Reference {
  444. id: ESLintIdentifier;
  445. mode: "rw" | "r" | "w";
  446. variable: Variable | null;
  447. }
  448. export interface VForExpression extends HasLocation, HasParent {
  449. type: "VForExpression";
  450. parent: VExpressionContainer;
  451. left: ESLintPattern[];
  452. right: ESLintExpression;
  453. }
  454. export interface VOnExpression extends HasLocation, HasParent {
  455. type: "VOnExpression";
  456. parent: VExpressionContainer;
  457. body: ESLintStatement[];
  458. }
  459. export interface VSlotScopeExpression extends HasLocation, HasParent {
  460. type: "VSlotScopeExpression";
  461. parent: VExpressionContainer;
  462. params: ESLintPattern[];
  463. }
  464. export interface VFilterSequenceExpression extends HasLocation, HasParent {
  465. type: "VFilterSequenceExpression";
  466. parent: VExpressionContainer;
  467. expression: ESLintExpression;
  468. filters: VFilter[];
  469. }
  470. export interface VFilter extends HasLocation, HasParent {
  471. type: "VFilter";
  472. parent: VFilterSequenceExpression;
  473. callee: ESLintIdentifier;
  474. arguments: (ESLintExpression | ESLintSpreadElement)[];
  475. }
  476. export type VNode = VAttribute | VDirective | VDirectiveKey | VDocumentFragment | VElement | VEndTag | VExpressionContainer | VIdentifier | VLiteral | VStartTag | VText;
  477. export interface VText extends HasLocation, HasParent {
  478. type: "VText";
  479. parent: VDocumentFragment | VElement;
  480. value: string;
  481. }
  482. export interface VExpressionContainer extends HasLocation, HasParent {
  483. type: "VExpressionContainer";
  484. parent: VDocumentFragment | VElement | VDirective | VDirectiveKey;
  485. expression: ESLintExpression | VFilterSequenceExpression | VForExpression | VOnExpression | VSlotScopeExpression | null;
  486. references: Reference[];
  487. }
  488. export interface VIdentifier extends HasLocation, HasParent {
  489. type: "VIdentifier";
  490. parent: VAttribute | VDirectiveKey;
  491. name: string;
  492. rawName: string;
  493. }
  494. export interface VDirectiveKey extends HasLocation, HasParent {
  495. type: "VDirectiveKey";
  496. parent: VAttribute;
  497. name: VIdentifier;
  498. argument: VExpressionContainer | VIdentifier | null;
  499. modifiers: VIdentifier[];
  500. }
  501. export interface VLiteral extends HasLocation, HasParent {
  502. type: "VLiteral";
  503. parent: VAttribute;
  504. value: string;
  505. }
  506. export interface VAttribute extends HasLocation, HasParent {
  507. type: "VAttribute";
  508. parent: VStartTag;
  509. directive: false;
  510. key: VIdentifier;
  511. value: VLiteral | null;
  512. }
  513. export interface VDirective extends HasLocation, HasParent {
  514. type: "VAttribute";
  515. parent: VStartTag;
  516. directive: true;
  517. key: VDirectiveKey;
  518. value: VExpressionContainer | null;
  519. }
  520. export interface VStartTag extends HasLocation, HasParent {
  521. type: "VStartTag";
  522. parent: VElement;
  523. selfClosing: boolean;
  524. attributes: (VAttribute | VDirective)[];
  525. }
  526. export interface VEndTag extends HasLocation, HasParent {
  527. type: "VEndTag";
  528. parent: VElement;
  529. }
  530. export interface HasConcreteInfo {
  531. tokens: Token[];
  532. comments: Token[];
  533. errors: ParseError[];
  534. }
  535. export interface VElement extends HasLocation, HasParent {
  536. type: "VElement";
  537. parent: VDocumentFragment | VElement;
  538. namespace: Namespace;
  539. name: string;
  540. rawName: string;
  541. startTag: VStartTag;
  542. children: (VElement | VText | VExpressionContainer)[];
  543. endTag: VEndTag | null;
  544. variables: Variable[];
  545. }
  546. export interface VDocumentFragment extends HasLocation, HasParent, HasConcreteInfo {
  547. type: "VDocumentFragment";
  548. parent: null;
  549. children: (VElement | VText | VExpressionContainer)[];
  550. }
  551. }
  552. declare module 'vue-eslint-parser/ast/tokens' {
  553. import { HasLocation } from "vue-eslint-parser/ast/locations";
  554. export interface Token extends HasLocation {
  555. type: string;
  556. value: string;
  557. }
  558. }
  559. declare module 'vue-eslint-parser/ast/traverse' {
  560. import { VisitorKeys } from "eslint-visitor-keys";
  561. import { Node } from "vue-eslint-parser/ast/nodes";
  562. function getFallbackKeys(node: Node): string[];
  563. export interface Visitor {
  564. visitorKeys?: VisitorKeys;
  565. enterNode(node: Node, parent: Node | null): void;
  566. leaveNode(node: Node, parent: Node | null): void;
  567. }
  568. export function traverseNodes(node: Node, visitor: Visitor): void;
  569. export { getFallbackKeys };
  570. }