index.d.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // Generated by typings
  2. // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/esprima/esprima.d.ts
  3. // Type definitions for Esprima v2.1.0
  4. // Project: http://esprima.org
  5. // Definitions by: teppeis <https://github.com/teppeis>, RReverser <https://github.com/RReverser>
  6. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
  7. declare namespace esprima {
  8. const version: string;
  9. function parse(code: string, options?: Options): ESTree.Program;
  10. function tokenize(code: string, options?: Options): Array<Token>;
  11. interface Token {
  12. type: string;
  13. value: string;
  14. }
  15. interface Comment extends ESTree.Node {
  16. value: string;
  17. }
  18. interface Options {
  19. loc?: boolean;
  20. range?: boolean;
  21. raw?: boolean;
  22. tokens?: boolean;
  23. comment?: boolean;
  24. attachComment?: boolean;
  25. tolerant?: boolean;
  26. source?: boolean;
  27. }
  28. const Syntax: {
  29. AssignmentExpression: string,
  30. AssignmentPattern: string,
  31. ArrayExpression: string,
  32. ArrayPattern: string,
  33. ArrowFunctionExpression: string,
  34. BlockStatement: string,
  35. BinaryExpression: string,
  36. BreakStatement: string,
  37. CallExpression: string,
  38. CatchClause: string,
  39. ClassBody: string,
  40. ClassDeclaration: string,
  41. ClassExpression: string,
  42. ConditionalExpression: string,
  43. ContinueStatement: string,
  44. DoWhileStatement: string,
  45. DebuggerStatement: string,
  46. EmptyStatement: string,
  47. ExportAllDeclaration: string,
  48. ExportDefaultDeclaration: string,
  49. ExportNamedDeclaration: string,
  50. ExportSpecifier: string,
  51. ExpressionStatement: string,
  52. ForStatement: string,
  53. ForOfStatement: string,
  54. ForInStatement: string,
  55. FunctionDeclaration: string,
  56. FunctionExpression: string,
  57. Identifier: string,
  58. IfStatement: string,
  59. ImportDeclaration: string,
  60. ImportDefaultSpecifier: string,
  61. ImportNamespaceSpecifier: string,
  62. ImportSpecifier: string,
  63. Literal: string,
  64. LabeledStatement: string,
  65. LogicalExpression: string,
  66. MemberExpression: string,
  67. MethodDefinition: string,
  68. NewExpression: string,
  69. ObjectExpression: string,
  70. ObjectPattern: string,
  71. Program: string,
  72. Property: string,
  73. RestElement: string,
  74. ReturnStatement: string,
  75. SequenceExpression: string,
  76. SpreadElement: string,
  77. Super: string,
  78. SwitchCase: string,
  79. SwitchStatement: string,
  80. TaggedTemplateExpression: string,
  81. TemplateElement: string,
  82. TemplateLiteral: string,
  83. ThisExpression: string,
  84. ThrowStatement: string,
  85. TryStatement: string,
  86. UnaryExpression: string,
  87. UpdateExpression: string,
  88. VariableDeclaration: string,
  89. VariableDeclarator: string,
  90. WhileStatement: string,
  91. WithStatement: string,
  92. YieldExpression: string
  93. };
  94. }
  95. declare module "esprima" {
  96. export = esprima
  97. }