Skip to content

Commit 41f88a4

Browse files
committed
feat: Support ESM declaration imports; add an AcornJsxParser class
1 parent f5c107b commit 41f88a4

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

index.d.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
import { Parser } from 'acorn'
1+
import acorn from 'acorn';
22

3-
declare const jsx: (options?: jsx.Options) => (BaseParser: typeof Parser) => typeof Parser;
3+
export const jsx: (options?: jsx.Options) => (BaseParser: typeof acorn.Parser) => typeof acorn.Parser;
44

5-
declare namespace jsx {
6-
interface Options {
7-
allowNamespacedObjects?: boolean;
8-
allowNamespaces?: boolean;
9-
}
5+
export interface Options {
6+
allowNamespacedObjects?: boolean;
7+
allowNamespaces?: boolean;
108
}
119

12-
export = jsx;
10+
export class AcornJsxParser extends acorn.Parser {
11+
static readonly acornJsx: {
12+
tokTypes: typeof acorn.tokTypes
13+
};
14+
15+
jsx_readString(quote: number): void;
16+
}
17+
18+
export as namespace jsx;
19+
export default jsx;

0 commit comments

Comments
 (0)