Skip to content

Commit a4a5510

Browse files
authored
Add some Parser properties to type definitions
1 parent 9899904 commit a4a5510

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

acorn/dist/acorn.d.ts

+36-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ declare namespace acorn {
1111
[Symbol.iterator](): Iterator<Token>
1212
}
1313

14+
type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'
15+
1416
interface Options {
15-
ecmaVersion: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'
17+
ecmaVersion: ecmaVersion
1618
sourceType?: 'script' | 'module'
1719
onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
1820
onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
@@ -36,8 +38,41 @@ declare namespace acorn {
3638
}
3739

3840
class Parser {
41+
// state.js
42+
lineStart: number;
43+
options: Options;
44+
curLine: number;
45+
start: number;
46+
end: number;
47+
input: string;
48+
type: TokenType;
49+
50+
// state.js
3951
constructor(options: Options, input: string, startPos?: number)
4052
parse(this: Parser): Node
53+
54+
// tokenize.js
55+
next(): void;
56+
nextToken(): void;
57+
58+
// statement.js
59+
parseTopLevel(node: Node): Node;
60+
61+
// node.js
62+
finishNode(node: Node, type: string): Node;
63+
finishNodeAt(node: Node, type: string, pos: number, loc: Position): Node;
64+
65+
// location.js
66+
raise(pos: number, message: string) : void;
67+
raiseRecoverable?(pos: number, message: string) : void;
68+
69+
// parseutils.js
70+
unexpected(pos: number) : void;
71+
72+
// index.js
73+
static acorn: typeof acorn;
74+
75+
// state.js
4176
static parse(this: typeof Parser, input: string, options: Options): Node
4277
static parseExpressionAt(this: typeof Parser, input: string, pos: number, options: Options): Node
4378
static tokenizer(this: typeof Parser, input: string, options: Options): {

0 commit comments

Comments
 (0)