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