index.d.ts 2.9 KB

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