@@ -18,35 +18,32 @@ interface JsxTokTypes extends AcornTokTypes {
1818
1919type AcornTokTypes = typeof acorn . tokTypes ;
2020
21- declare function jsx ( options ?: jsx . Options ) : ( BaseParser : typeof acorn . Parser ) => jsx . AcornJsxParserCtor ;
21+ type TokTypes = JsxTokTypes
2222
23- declare namespace jsx {
24- type TokTypes = JsxTokTypes
25-
26- interface Options {
23+ interface Options {
2724 allowNamespacedObjects ?: boolean ;
2825 allowNamespaces ?: boolean ;
29- }
26+ }
3027
31- interface TokContexts {
28+ interface TokContexts {
3229 tc_oTag : TokContext ,
3330 tc_cTag : TokContext ,
3431 tc_expr : TokContext
35- }
32+ }
3633
37- // We pick (statics) from acorn rather than plain extending to avoid complaint
38- // about base constructors needing the same return type (i.e., we return
39- // `AcornJsxParser` here)
40- interface AcornJsxParserCtor extends Pick < typeof acorn . Parser , keyof typeof acorn . Parser > {
34+ // We pick (statics) from acorn rather than plain extending to avoid complaint
35+ // about base constructors needing the same return type (i.e., we return
36+ // `AcornJsxParser` here)
37+ interface AcornJsxParserCtor extends Pick < typeof acorn . Parser , keyof typeof acorn . Parser > {
4138 readonly acornJsx : {
42- tokTypes : TokTypes ;
43- tokContexts : TokContexts
39+ tokTypes : TokTypes ;
40+ tokContexts : TokContexts
4441 } ;
4542
4643 new ( options : acorn . Options , input : string , startPos ?: number ) : AcornJsxParser ;
47- }
44+ }
4845
49- interface AcornJsxParser extends acorn . Parser {
46+ interface AcornJsxParser extends acorn . Parser {
5047 jsx_readToken ( ) : string ;
5148 jsx_readNewLine ( normalizeCRLF : boolean ) : void ;
5249 jsx_readString ( quote : number ) : void ;
@@ -64,7 +61,6 @@ declare namespace jsx {
6461 jsx_parseElementAt ( startPos : number , startLoc ?: acorn . SourceLocation ) : acorn . Node ;
6562 jsx_parseText ( ) : acorn . Node ;
6663 jsx_parseElement ( ) : acorn . Node ;
67- }
6864}
6965
70- export = jsx ;
66+ export default function jsx ( options ?: Options ) : ( BaseParser : typeof acorn . Parser ) => AcornJsxParserCtor ;
0 commit comments