Skip to content

Commit

Permalink
feat: Support ESM declaration imports; add an AcornJsxParser class
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Feb 10, 2022
1 parent f5c107b commit 41f88a4
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { Parser } from 'acorn'
import acorn from 'acorn';

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

declare namespace jsx {
interface Options {
allowNamespacedObjects?: boolean;
allowNamespaces?: boolean;
}
export interface Options {
allowNamespacedObjects?: boolean;
allowNamespaces?: boolean;
}

export = jsx;
export class AcornJsxParser extends acorn.Parser {
static readonly acornJsx: {
tokTypes: typeof acorn.tokTypes
};

jsx_readString(quote: number): void;
}

export as namespace jsx;
export default jsx;

0 comments on commit 41f88a4

Please sign in to comment.