@danielx/civet 0.6.71 → 0.6.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -3389,7 +3389,7 @@ function reorderBindingRestProperty(props) {
3389
3389
  }
3390
3390
  ];
3391
3391
  }
3392
- if (rest.delim?.at(-1)?.token === ",") {
3392
+ if (Array.isArray(rest.delim) && rest.delim.at(-1)?.token === ",") {
3393
3393
  rest.delim.pop();
3394
3394
  }
3395
3395
  const children = [...props, ...after, rest];
@@ -4568,6 +4568,7 @@ var require_parser = __commonJS({
4568
4568
  If,
4569
4569
  Import,
4570
4570
  In,
4571
+ Infer,
4571
4572
  LetOrConst,
4572
4573
  Const,
4573
4574
  Is,
@@ -4666,6 +4667,9 @@ var require_parser = __commonJS({
4666
4667
  UsingJSModeError,
4667
4668
  TypeDeclaration,
4668
4669
  TypeDeclarationRest,
4670
+ TypeAliasDeclaration,
4671
+ InterfaceDeclaration,
4672
+ NamespaceDeclaration,
4669
4673
  OptionalEquals,
4670
4674
  TypeLexicalDeclaration,
4671
4675
  TypeDeclarationBinding,
@@ -4693,7 +4697,7 @@ var require_parser = __commonJS({
4693
4697
  EnumDeclaration,
4694
4698
  EnumBlock,
4695
4699
  NestedEnumProperties,
4696
- NestedEnumProperty,
4700
+ NestedEnumPropertyLine,
4697
4701
  EnumProperty,
4698
4702
  TypeProperty,
4699
4703
  TypeIndexSignature,
@@ -4952,66 +4956,66 @@ var require_parser = __commonJS({
4952
4956
  var $L150 = $L("#");
4953
4957
  var $L151 = $L("if");
4954
4958
  var $L152 = $L("in");
4955
- var $L153 = $L("let");
4956
- var $L154 = $L("const");
4957
- var $L155 = $L("is");
4958
- var $L156 = $L("loop");
4959
- var $L157 = $L("new");
4960
- var $L158 = $L("not");
4961
- var $L159 = $L("of");
4962
- var $L160 = $L("[");
4963
- var $L161 = $L("operator");
4964
- var $L162 = $L("own");
4965
- var $L163 = $L("public");
4966
- var $L164 = $L("private");
4967
- var $L165 = $L("protected");
4968
- var $L166 = $L("||>");
4969
- var $L167 = $L("|\u25B7");
4970
- var $L168 = $L("|>=");
4971
- var $L169 = $L("\u25B7=");
4972
- var $L170 = $L("|>");
4973
- var $L171 = $L("\u25B7");
4974
- var $L172 = $L("readonly");
4975
- var $L173 = $L("return");
4976
- var $L174 = $L("satisfies");
4977
- var $L175 = $L("'");
4978
- var $L176 = $L("static");
4979
- var $L177 = $L("${");
4980
- var $L178 = $L("super");
4981
- var $L179 = $L("switch");
4982
- var $L180 = $L("target");
4983
- var $L181 = $L("then");
4984
- var $L182 = $L("this");
4985
- var $L183 = $L("throw");
4986
- var $L184 = $L('"""');
4987
- var $L185 = $L("'''");
4988
- var $L186 = $L("///");
4989
- var $L187 = $L("```");
4990
- var $L188 = $L("try");
4991
- var $L189 = $L("typeof");
4992
- var $L190 = $L("unless");
4993
- var $L191 = $L("until");
4994
- var $L192 = $L("using");
4995
- var $L193 = $L("var");
4996
- var $L194 = $L("void");
4997
- var $L195 = $L("when");
4998
- var $L196 = $L("while");
4999
- var $L197 = $L("yield");
5000
- var $L198 = $L("/>");
5001
- var $L199 = $L("</");
5002
- var $L200 = $L("<>");
5003
- var $L201 = $L("</>");
5004
- var $L202 = $L("<!--");
5005
- var $L203 = $L("-->");
5006
- var $L204 = $L("type");
5007
- var $L205 = $L("enum");
5008
- var $L206 = $L("interface");
5009
- var $L207 = $L("global");
5010
- var $L208 = $L("module");
5011
- var $L209 = $L("namespace");
5012
- var $L210 = $L("asserts");
5013
- var $L211 = $L("keyof");
5014
- var $L212 = $L("infer");
4959
+ var $L153 = $L("infer");
4960
+ var $L154 = $L("let");
4961
+ var $L155 = $L("const");
4962
+ var $L156 = $L("is");
4963
+ var $L157 = $L("loop");
4964
+ var $L158 = $L("new");
4965
+ var $L159 = $L("not");
4966
+ var $L160 = $L("of");
4967
+ var $L161 = $L("[");
4968
+ var $L162 = $L("operator");
4969
+ var $L163 = $L("own");
4970
+ var $L164 = $L("public");
4971
+ var $L165 = $L("private");
4972
+ var $L166 = $L("protected");
4973
+ var $L167 = $L("||>");
4974
+ var $L168 = $L("|\u25B7");
4975
+ var $L169 = $L("|>=");
4976
+ var $L170 = $L("\u25B7=");
4977
+ var $L171 = $L("|>");
4978
+ var $L172 = $L("\u25B7");
4979
+ var $L173 = $L("readonly");
4980
+ var $L174 = $L("return");
4981
+ var $L175 = $L("satisfies");
4982
+ var $L176 = $L("'");
4983
+ var $L177 = $L("static");
4984
+ var $L178 = $L("${");
4985
+ var $L179 = $L("super");
4986
+ var $L180 = $L("switch");
4987
+ var $L181 = $L("target");
4988
+ var $L182 = $L("then");
4989
+ var $L183 = $L("this");
4990
+ var $L184 = $L("throw");
4991
+ var $L185 = $L('"""');
4992
+ var $L186 = $L("'''");
4993
+ var $L187 = $L("///");
4994
+ var $L188 = $L("```");
4995
+ var $L189 = $L("try");
4996
+ var $L190 = $L("typeof");
4997
+ var $L191 = $L("unless");
4998
+ var $L192 = $L("until");
4999
+ var $L193 = $L("using");
5000
+ var $L194 = $L("var");
5001
+ var $L195 = $L("void");
5002
+ var $L196 = $L("when");
5003
+ var $L197 = $L("while");
5004
+ var $L198 = $L("yield");
5005
+ var $L199 = $L("/>");
5006
+ var $L200 = $L("</");
5007
+ var $L201 = $L("<>");
5008
+ var $L202 = $L("</>");
5009
+ var $L203 = $L("<!--");
5010
+ var $L204 = $L("-->");
5011
+ var $L205 = $L("type");
5012
+ var $L206 = $L("enum");
5013
+ var $L207 = $L("interface");
5014
+ var $L208 = $L("global");
5015
+ var $L209 = $L("module");
5016
+ var $L210 = $L("namespace");
5017
+ var $L211 = $L("asserts");
5018
+ var $L212 = $L("keyof");
5015
5019
  var $L213 = $L("???");
5016
5020
  var $L214 = $L("[]");
5017
5021
  var $L215 = $L("civet");
@@ -5883,7 +5887,7 @@ var require_parser = __commonJS({
5883
5887
  return $EVENT(ctx, state, "ParenthesizedExpression", ParenthesizedExpression$0);
5884
5888
  }
5885
5889
  var ClassDeclaration$0 = $TS($S(ClassExpression), function($skip, $loc, $0, $1) {
5886
- if ($1.binding)
5890
+ if ($1.id)
5887
5891
  return $1;
5888
5892
  return makeLeftHandSideExpression($1);
5889
5893
  });
@@ -5900,6 +5904,7 @@ var require_parser = __commonJS({
5900
5904
  decorators,
5901
5905
  abstract,
5902
5906
  binding,
5907
+ id: binding?.[0],
5903
5908
  heritage,
5904
5909
  body,
5905
5910
  children: $0
@@ -6217,7 +6222,8 @@ var require_parser = __commonJS({
6217
6222
  name: id.name,
6218
6223
  children: [".", id]
6219
6224
  }],
6220
- privateShorthand: true
6225
+ privateShorthand: true,
6226
+ privateId: id
6221
6227
  };
6222
6228
  });
6223
6229
  var PrivateThis$$ = [PrivateThis$0, PrivateThis$1];
@@ -7403,7 +7409,10 @@ var require_parser = __commonJS({
7403
7409
  var w = $2;
7404
7410
  var decl = $3;
7405
7411
  decl.names.forEach((name) => module2.operators.add(name));
7406
- return [insertTrimmingSpace(w, ""), decl];
7412
+ return {
7413
+ ...decl,
7414
+ children: [insertTrimmingSpace(w, ""), ...decl.children]
7415
+ };
7407
7416
  });
7408
7417
  var OperatorDeclaration$1 = $TS($S(OperatorSignature, BracedBlock), function($skip, $loc, $0, $1, $2) {
7409
7418
  var signature = $1;
@@ -7425,7 +7434,10 @@ var require_parser = __commonJS({
7425
7434
  var ids = $4;
7426
7435
  module2.operators.add(id.name);
7427
7436
  ids.forEach(([, , id2]) => module2.operators.add(id2.name));
7428
- return [];
7437
+ return {
7438
+ id,
7439
+ children: []
7440
+ };
7429
7441
  });
7430
7442
  var OperatorDeclaration$$ = [OperatorDeclaration$0, OperatorDeclaration$1, OperatorDeclaration$2];
7431
7443
  function OperatorDeclaration(ctx, state) {
@@ -8717,7 +8729,12 @@ var require_parser = __commonJS({
8717
8729
  v = insertTrimmingSpace(p, "");
8718
8730
  break;
8719
8731
  case "Property":
8720
- v = insertTrimmingSpace(p.value, "");
8732
+ const { value: value2 } = p;
8733
+ if (value2.privateShorthand) {
8734
+ v = value2.privateId;
8735
+ } else {
8736
+ v = insertTrimmingSpace(value2, "");
8737
+ }
8721
8738
  break;
8722
8739
  }
8723
8740
  const exp = processCallMemberExpression({
@@ -10796,18 +10813,45 @@ var require_parser = __commonJS({
10796
10813
  children: [exp, $0.slice(1)]
10797
10814
  };
10798
10815
  });
10799
- var ExportDeclaration$1 = $TS($S($E(Decorators), Export, __, Default, __, $C(HoistableDeclaration, ClassDeclaration, ExtendedExpression)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
10816
+ var ExportDeclaration$1 = $TS($S($E(Decorators), Export, __, Default, __, $N(FunctionDeclaration), $C(LexicalDeclaration, VariableStatement, TypeAliasDeclaration, NamespaceDeclaration, EnumDeclaration, OperatorDeclaration)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
10817
+ var declaration = $7;
10818
+ let id, error;
10819
+ if (declaration.id) {
10820
+ id = declaration.id;
10821
+ } else if (declaration.names) {
10822
+ if (declaration.names.length !== 1) {
10823
+ error = {
10824
+ type: "Error",
10825
+ message: `export default with ${declaration.names.length} variable declaration (should be 1)`
10826
+ };
10827
+ }
10828
+ id = declaration.names[0];
10829
+ } else {
10830
+ throw new Error("Could not find name of declaration in export default");
10831
+ }
10832
+ return [
10833
+ declaration,
10834
+ { children: [";"], ts: declaration.ts },
10835
+ error ?? {
10836
+ type: "ExportDeclaration",
10837
+ declaration: id,
10838
+ ts: declaration.ts,
10839
+ children: [...$0.slice(0, -2), id]
10840
+ }
10841
+ ];
10842
+ });
10843
+ var ExportDeclaration$2 = $TS($S($E(Decorators), Export, __, Default, __, $C(HoistableDeclaration, ClassDeclaration, InterfaceDeclaration, ExtendedExpression)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
10800
10844
  var declaration = $6;
10801
- return { type: "ExportDeclaration", declaration, children: $0 };
10845
+ return { type: "ExportDeclaration", declaration, ts: declaration.ts, children: $0 };
10802
10846
  });
10803
- var ExportDeclaration$2 = $TS($S(Export, __, ExportFromClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
10847
+ var ExportDeclaration$3 = $TS($S(Export, __, ExportFromClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
10804
10848
  return { type: "ExportDeclaration", ts: $3.ts, children: $0 };
10805
10849
  });
10806
- var ExportDeclaration$3 = $TS($S($E(Decorators), Export, __, $C(Declaration, VariableStatement, TypeAndNamedExports, ExportVarDec)), function($skip, $loc, $0, $1, $2, $3, $4) {
10850
+ var ExportDeclaration$4 = $TS($S($E(Decorators), Export, __, $C(Declaration, VariableStatement, TypeAndNamedExports, ExportVarDec)), function($skip, $loc, $0, $1, $2, $3, $4) {
10807
10851
  var declaration = $4;
10808
10852
  return { type: "ExportDeclaration", declaration, ts: declaration.ts, children: $0 };
10809
10853
  });
10810
- var ExportDeclaration$$ = [ExportDeclaration$0, ExportDeclaration$1, ExportDeclaration$2, ExportDeclaration$3];
10854
+ var ExportDeclaration$$ = [ExportDeclaration$0, ExportDeclaration$1, ExportDeclaration$2, ExportDeclaration$3, ExportDeclaration$4];
10811
10855
  function ExportDeclaration(ctx, state) {
10812
10856
  return $EVENT_C(ctx, state, "ExportDeclaration", ExportDeclaration$$);
10813
10857
  }
@@ -10971,6 +11015,7 @@ var require_parser = __commonJS({
10971
11015
  var VariableStatement$0 = $TS($S(Var, __, VariableDeclarationList), function($skip, $loc, $0, $1, $2, $3) {
10972
11016
  return {
10973
11017
  ...$3,
11018
+ names: $3.names,
10974
11019
  children: [$1, ...$2, ...$3.children]
10975
11020
  };
10976
11021
  });
@@ -11731,19 +11776,25 @@ var require_parser = __commonJS({
11731
11776
  function In(ctx, state) {
11732
11777
  return $EVENT(ctx, state, "In", In$0);
11733
11778
  }
11734
- var LetOrConst$0 = $TS($S($C($EXPECT($L153, 'LetOrConst "let"'), $EXPECT($L154, 'LetOrConst "const"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11779
+ var Infer$0 = $TS($S($EXPECT($L153, 'Infer "infer"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11780
+ return { $loc, token: $1 };
11781
+ });
11782
+ function Infer(ctx, state) {
11783
+ return $EVENT(ctx, state, "Infer", Infer$0);
11784
+ }
11785
+ var LetOrConst$0 = $TS($S($C($EXPECT($L154, 'LetOrConst "let"'), $EXPECT($L155, 'LetOrConst "const"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11735
11786
  return { $loc, token: $1 };
11736
11787
  });
11737
11788
  function LetOrConst(ctx, state) {
11738
11789
  return $EVENT(ctx, state, "LetOrConst", LetOrConst$0);
11739
11790
  }
11740
- var Const$0 = $TS($S($EXPECT($L154, 'Const "const"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11791
+ var Const$0 = $TS($S($EXPECT($L155, 'Const "const"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11741
11792
  return { $loc, token: $1 };
11742
11793
  });
11743
11794
  function Const(ctx, state) {
11744
11795
  return $EVENT(ctx, state, "Const", Const$0);
11745
11796
  }
11746
- var Is$0 = $TS($S($EXPECT($L155, 'Is "is"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11797
+ var Is$0 = $TS($S($EXPECT($L156, 'Is "is"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11747
11798
  return { $loc, token: $1 };
11748
11799
  });
11749
11800
  function Is(ctx, state) {
@@ -11755,25 +11806,25 @@ var require_parser = __commonJS({
11755
11806
  function LetOrConstOrVar(ctx, state) {
11756
11807
  return $EVENT_C(ctx, state, "LetOrConstOrVar", LetOrConstOrVar$$);
11757
11808
  }
11758
- var Loop$0 = $TS($S($EXPECT($L156, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11809
+ var Loop$0 = $TS($S($EXPECT($L157, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11759
11810
  return { $loc, token: "while(true)" };
11760
11811
  });
11761
11812
  function Loop(ctx, state) {
11762
11813
  return $EVENT(ctx, state, "Loop", Loop$0);
11763
11814
  }
11764
- var New$0 = $TS($S($EXPECT($L157, 'New "new"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11815
+ var New$0 = $TS($S($EXPECT($L158, 'New "new"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11765
11816
  return { $loc, token: $1 };
11766
11817
  });
11767
11818
  function New(ctx, state) {
11768
11819
  return $EVENT(ctx, state, "New", New$0);
11769
11820
  }
11770
- var Not$0 = $TS($S($EXPECT($L158, 'Not "not"'), NonIdContinue, $N($S($E(_), $EXPECT($L14, 'Not ":"')))), function($skip, $loc, $0, $1, $2, $3) {
11821
+ var Not$0 = $TS($S($EXPECT($L159, 'Not "not"'), NonIdContinue, $N($S($E(_), $EXPECT($L14, 'Not ":"')))), function($skip, $loc, $0, $1, $2, $3) {
11771
11822
  return { $loc, token: "!" };
11772
11823
  });
11773
11824
  function Not(ctx, state) {
11774
11825
  return $EVENT(ctx, state, "Not", Not$0);
11775
11826
  }
11776
- var Of$0 = $TS($S($EXPECT($L159, 'Of "of"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11827
+ var Of$0 = $TS($S($EXPECT($L160, 'Of "of"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11777
11828
  return { $loc, token: $1 };
11778
11829
  });
11779
11830
  function Of(ctx, state) {
@@ -11791,7 +11842,7 @@ var require_parser = __commonJS({
11791
11842
  function OpenBrace(ctx, state) {
11792
11843
  return $EVENT(ctx, state, "OpenBrace", OpenBrace$0);
11793
11844
  }
11794
- var OpenBracket$0 = $TV($EXPECT($L160, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
11845
+ var OpenBracket$0 = $TV($EXPECT($L161, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
11795
11846
  return { $loc, token: $1 };
11796
11847
  });
11797
11848
  function OpenBracket(ctx, state) {
@@ -11803,43 +11854,43 @@ var require_parser = __commonJS({
11803
11854
  function OpenParen(ctx, state) {
11804
11855
  return $EVENT(ctx, state, "OpenParen", OpenParen$0);
11805
11856
  }
11806
- var Operator$0 = $TS($S($EXPECT($L161, 'Operator "operator"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11857
+ var Operator$0 = $TS($S($EXPECT($L162, 'Operator "operator"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11807
11858
  return { $loc, token: $1 };
11808
11859
  });
11809
11860
  function Operator(ctx, state) {
11810
11861
  return $EVENT(ctx, state, "Operator", Operator$0);
11811
11862
  }
11812
- var Own$0 = $TS($S($EXPECT($L162, 'Own "own"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11863
+ var Own$0 = $TS($S($EXPECT($L163, 'Own "own"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11813
11864
  return { $loc, token: $1 };
11814
11865
  });
11815
11866
  function Own(ctx, state) {
11816
11867
  return $EVENT(ctx, state, "Own", Own$0);
11817
11868
  }
11818
- var Public$0 = $TS($S($EXPECT($L163, 'Public "public"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11869
+ var Public$0 = $TS($S($EXPECT($L164, 'Public "public"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11819
11870
  return { $loc, token: $1 };
11820
11871
  });
11821
11872
  function Public(ctx, state) {
11822
11873
  return $EVENT(ctx, state, "Public", Public$0);
11823
11874
  }
11824
- var Private$0 = $TS($S($EXPECT($L164, 'Private "private"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11875
+ var Private$0 = $TS($S($EXPECT($L165, 'Private "private"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11825
11876
  return { $loc, token: $1 };
11826
11877
  });
11827
11878
  function Private(ctx, state) {
11828
11879
  return $EVENT(ctx, state, "Private", Private$0);
11829
11880
  }
11830
- var Protected$0 = $TS($S($EXPECT($L165, 'Protected "protected"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11881
+ var Protected$0 = $TS($S($EXPECT($L166, 'Protected "protected"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11831
11882
  return { $loc, token: $1 };
11832
11883
  });
11833
11884
  function Protected(ctx, state) {
11834
11885
  return $EVENT(ctx, state, "Protected", Protected$0);
11835
11886
  }
11836
- var Pipe$0 = $TV($C($EXPECT($L166, 'Pipe "||>"'), $EXPECT($L167, 'Pipe "|\u25B7"')), function($skip, $loc, $0, $1) {
11887
+ var Pipe$0 = $TV($C($EXPECT($L167, 'Pipe "||>"'), $EXPECT($L168, 'Pipe "|\u25B7"')), function($skip, $loc, $0, $1) {
11837
11888
  return { $loc, token: "||>" };
11838
11889
  });
11839
- var Pipe$1 = $TV($C($EXPECT($L168, 'Pipe "|>="'), $EXPECT($L169, 'Pipe "\u25B7="')), function($skip, $loc, $0, $1) {
11890
+ var Pipe$1 = $TV($C($EXPECT($L169, 'Pipe "|>="'), $EXPECT($L170, 'Pipe "\u25B7="')), function($skip, $loc, $0, $1) {
11840
11891
  return { $loc, token: "|>=" };
11841
11892
  });
11842
- var Pipe$2 = $TV($C($EXPECT($L170, 'Pipe "|>"'), $EXPECT($L171, 'Pipe "\u25B7"')), function($skip, $loc, $0, $1) {
11893
+ var Pipe$2 = $TV($C($EXPECT($L171, 'Pipe "|>"'), $EXPECT($L172, 'Pipe "\u25B7"')), function($skip, $loc, $0, $1) {
11843
11894
  return { $loc, token: "|>" };
11844
11895
  });
11845
11896
  var Pipe$$ = [Pipe$0, Pipe$1, Pipe$2];
@@ -11852,19 +11903,19 @@ var require_parser = __commonJS({
11852
11903
  function QuestionMark(ctx, state) {
11853
11904
  return $EVENT(ctx, state, "QuestionMark", QuestionMark$0);
11854
11905
  }
11855
- var Readonly$0 = $TS($S($EXPECT($L172, 'Readonly "readonly"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11906
+ var Readonly$0 = $TS($S($EXPECT($L173, 'Readonly "readonly"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11856
11907
  return { $loc, token: $1, ts: true };
11857
11908
  });
11858
11909
  function Readonly(ctx, state) {
11859
11910
  return $EVENT(ctx, state, "Readonly", Readonly$0);
11860
11911
  }
11861
- var Return$0 = $TS($S($EXPECT($L173, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11912
+ var Return$0 = $TS($S($EXPECT($L174, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11862
11913
  return { $loc, token: $1 };
11863
11914
  });
11864
11915
  function Return(ctx, state) {
11865
11916
  return $EVENT(ctx, state, "Return", Return$0);
11866
11917
  }
11867
- var Satisfies$0 = $TS($S($EXPECT($L174, 'Satisfies "satisfies"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11918
+ var Satisfies$0 = $TS($S($EXPECT($L175, 'Satisfies "satisfies"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11868
11919
  return { $loc, token: $1 };
11869
11920
  });
11870
11921
  function Satisfies(ctx, state) {
@@ -11876,7 +11927,7 @@ var require_parser = __commonJS({
11876
11927
  function Semicolon(ctx, state) {
11877
11928
  return $EVENT(ctx, state, "Semicolon", Semicolon$0);
11878
11929
  }
11879
- var SingleQuote$0 = $TV($EXPECT($L175, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
11930
+ var SingleQuote$0 = $TV($EXPECT($L176, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
11880
11931
  return { $loc, token: $1 };
11881
11932
  });
11882
11933
  function SingleQuote(ctx, state) {
@@ -11888,7 +11939,7 @@ var require_parser = __commonJS({
11888
11939
  function Star(ctx, state) {
11889
11940
  return $EVENT(ctx, state, "Star", Star$0);
11890
11941
  }
11891
- var Static$0 = $TS($S($EXPECT($L176, 'Static "static"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11942
+ var Static$0 = $TS($S($EXPECT($L177, 'Static "static"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11892
11943
  return { $loc, token: $1 };
11893
11944
  });
11894
11945
  var Static$1 = $TS($S($EXPECT($L120, 'Static "@"'), $N($C($EXPECT($L4, 'Static "("'), $EXPECT($L120, 'Static "@"')))), function($skip, $loc, $0, $1, $2) {
@@ -11898,127 +11949,127 @@ var require_parser = __commonJS({
11898
11949
  function Static(ctx, state) {
11899
11950
  return $EVENT_C(ctx, state, "Static", Static$$);
11900
11951
  }
11901
- var SubstitutionStart$0 = $TV($EXPECT($L177, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
11952
+ var SubstitutionStart$0 = $TV($EXPECT($L178, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
11902
11953
  return { $loc, token: $1 };
11903
11954
  });
11904
11955
  function SubstitutionStart(ctx, state) {
11905
11956
  return $EVENT(ctx, state, "SubstitutionStart", SubstitutionStart$0);
11906
11957
  }
11907
- var Super$0 = $TS($S($EXPECT($L178, 'Super "super"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11958
+ var Super$0 = $TS($S($EXPECT($L179, 'Super "super"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11908
11959
  return { $loc, token: $1 };
11909
11960
  });
11910
11961
  function Super(ctx, state) {
11911
11962
  return $EVENT(ctx, state, "Super", Super$0);
11912
11963
  }
11913
- var Switch$0 = $TS($S($EXPECT($L179, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11964
+ var Switch$0 = $TS($S($EXPECT($L180, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11914
11965
  return { $loc, token: $1 };
11915
11966
  });
11916
11967
  function Switch(ctx, state) {
11917
11968
  return $EVENT(ctx, state, "Switch", Switch$0);
11918
11969
  }
11919
- var Target$0 = $TS($S($EXPECT($L180, 'Target "target"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11970
+ var Target$0 = $TS($S($EXPECT($L181, 'Target "target"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11920
11971
  return { $loc, token: $1 };
11921
11972
  });
11922
11973
  function Target(ctx, state) {
11923
11974
  return $EVENT(ctx, state, "Target", Target$0);
11924
11975
  }
11925
- var Then$0 = $TS($S(__, $EXPECT($L181, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
11976
+ var Then$0 = $TS($S(__, $EXPECT($L182, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
11926
11977
  return { $loc, token: "" };
11927
11978
  });
11928
11979
  function Then(ctx, state) {
11929
11980
  return $EVENT(ctx, state, "Then", Then$0);
11930
11981
  }
11931
- var This$0 = $TS($S($EXPECT($L182, 'This "this"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11982
+ var This$0 = $TS($S($EXPECT($L183, 'This "this"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11932
11983
  return { $loc, token: $1 };
11933
11984
  });
11934
11985
  function This(ctx, state) {
11935
11986
  return $EVENT(ctx, state, "This", This$0);
11936
11987
  }
11937
- var Throw$0 = $TS($S($EXPECT($L183, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11988
+ var Throw$0 = $TS($S($EXPECT($L184, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11938
11989
  return { $loc, token: $1 };
11939
11990
  });
11940
11991
  function Throw(ctx, state) {
11941
11992
  return $EVENT(ctx, state, "Throw", Throw$0);
11942
11993
  }
11943
- var TripleDoubleQuote$0 = $TV($EXPECT($L184, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
11994
+ var TripleDoubleQuote$0 = $TV($EXPECT($L185, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
11944
11995
  return { $loc, token: "`" };
11945
11996
  });
11946
11997
  function TripleDoubleQuote(ctx, state) {
11947
11998
  return $EVENT(ctx, state, "TripleDoubleQuote", TripleDoubleQuote$0);
11948
11999
  }
11949
- var TripleSingleQuote$0 = $TV($EXPECT($L185, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
12000
+ var TripleSingleQuote$0 = $TV($EXPECT($L186, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
11950
12001
  return { $loc, token: "`" };
11951
12002
  });
11952
12003
  function TripleSingleQuote(ctx, state) {
11953
12004
  return $EVENT(ctx, state, "TripleSingleQuote", TripleSingleQuote$0);
11954
12005
  }
11955
- var TripleSlash$0 = $TV($EXPECT($L186, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
12006
+ var TripleSlash$0 = $TV($EXPECT($L187, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
11956
12007
  return { $loc, token: "/" };
11957
12008
  });
11958
12009
  function TripleSlash(ctx, state) {
11959
12010
  return $EVENT(ctx, state, "TripleSlash", TripleSlash$0);
11960
12011
  }
11961
- var TripleTick$0 = $TV($EXPECT($L187, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
12012
+ var TripleTick$0 = $TV($EXPECT($L188, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
11962
12013
  return { $loc, token: "`" };
11963
12014
  });
11964
12015
  function TripleTick(ctx, state) {
11965
12016
  return $EVENT(ctx, state, "TripleTick", TripleTick$0);
11966
12017
  }
11967
- var Try$0 = $TS($S($EXPECT($L188, 'Try "try"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12018
+ var Try$0 = $TS($S($EXPECT($L189, 'Try "try"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11968
12019
  return { $loc, token: $1 };
11969
12020
  });
11970
12021
  function Try(ctx, state) {
11971
12022
  return $EVENT(ctx, state, "Try", Try$0);
11972
12023
  }
11973
- var Typeof$0 = $TS($S($EXPECT($L189, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12024
+ var Typeof$0 = $TS($S($EXPECT($L190, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11974
12025
  return { $loc, token: $1 };
11975
12026
  });
11976
12027
  function Typeof(ctx, state) {
11977
12028
  return $EVENT(ctx, state, "Typeof", Typeof$0);
11978
12029
  }
11979
- var Unless$0 = $TS($S($EXPECT($L190, 'Unless "unless"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12030
+ var Unless$0 = $TS($S($EXPECT($L191, 'Unless "unless"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11980
12031
  return { $loc, token: $1, negated: true };
11981
12032
  });
11982
12033
  function Unless(ctx, state) {
11983
12034
  return $EVENT(ctx, state, "Unless", Unless$0);
11984
12035
  }
11985
- var Until$0 = $TS($S($EXPECT($L191, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12036
+ var Until$0 = $TS($S($EXPECT($L192, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11986
12037
  return { $loc, token: $1 };
11987
12038
  });
11988
12039
  function Until(ctx, state) {
11989
12040
  return $EVENT(ctx, state, "Until", Until$0);
11990
12041
  }
11991
- var Using$0 = $TS($S($EXPECT($L192, 'Using "using"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12042
+ var Using$0 = $TS($S($EXPECT($L193, 'Using "using"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11992
12043
  return { $loc, token: $1 };
11993
12044
  });
11994
12045
  function Using(ctx, state) {
11995
12046
  return $EVENT(ctx, state, "Using", Using$0);
11996
12047
  }
11997
- var Var$0 = $TS($S($EXPECT($L193, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12048
+ var Var$0 = $TS($S($EXPECT($L194, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11998
12049
  return { $loc, token: $1 };
11999
12050
  });
12000
12051
  function Var(ctx, state) {
12001
12052
  return $EVENT(ctx, state, "Var", Var$0);
12002
12053
  }
12003
- var Void$0 = $TS($S($EXPECT($L194, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12054
+ var Void$0 = $TS($S($EXPECT($L195, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12004
12055
  return { $loc, token: $1 };
12005
12056
  });
12006
12057
  function Void(ctx, state) {
12007
12058
  return $EVENT(ctx, state, "Void", Void$0);
12008
12059
  }
12009
- var When$0 = $TS($S($EXPECT($L195, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12060
+ var When$0 = $TS($S($EXPECT($L196, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12010
12061
  return { $loc, token: "case" };
12011
12062
  });
12012
12063
  function When(ctx, state) {
12013
12064
  return $EVENT(ctx, state, "When", When$0);
12014
12065
  }
12015
- var While$0 = $TS($S($EXPECT($L196, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12066
+ var While$0 = $TS($S($EXPECT($L197, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12016
12067
  return { $loc, token: $1 };
12017
12068
  });
12018
12069
  function While(ctx, state) {
12019
12070
  return $EVENT(ctx, state, "While", While$0);
12020
12071
  }
12021
- var Yield$0 = $TS($S($EXPECT($L197, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12072
+ var Yield$0 = $TS($S($EXPECT($L198, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12022
12073
  return { $loc, token: $1, type: "Yield" };
12023
12074
  });
12024
12075
  function Yield(ctx, state) {
@@ -12097,7 +12148,7 @@ var require_parser = __commonJS({
12097
12148
  function JSXElement(ctx, state) {
12098
12149
  return $EVENT_C(ctx, state, "JSXElement", JSXElement$$);
12099
12150
  }
12100
- var JSXSelfClosingElement$0 = $TS($S($EXPECT($L16, 'JSXSelfClosingElement "<"'), JSXElementName, $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($L198, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
12151
+ var JSXSelfClosingElement$0 = $TS($S($EXPECT($L16, 'JSXSelfClosingElement "<"'), JSXElementName, $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($L199, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
12101
12152
  return { type: "JSXElement", children: $0, tag: $2 };
12102
12153
  });
12103
12154
  function JSXSelfClosingElement(ctx, state) {
@@ -12131,7 +12182,7 @@ var require_parser = __commonJS({
12131
12182
  function JSXOptionalClosingElement(ctx, state) {
12132
12183
  return $EVENT_C(ctx, state, "JSXOptionalClosingElement", JSXOptionalClosingElement$$);
12133
12184
  }
12134
- var JSXClosingElement$0 = $S($EXPECT($L199, 'JSXClosingElement "</"'), $E(Whitespace), JSXElementName, $E(Whitespace), $EXPECT($L37, 'JSXClosingElement ">"'));
12185
+ var JSXClosingElement$0 = $S($EXPECT($L200, 'JSXClosingElement "</"'), $E(Whitespace), JSXElementName, $E(Whitespace), $EXPECT($L37, 'JSXClosingElement ">"'));
12135
12186
  function JSXClosingElement(ctx, state) {
12136
12187
  return $EVENT(ctx, state, "JSXClosingElement", JSXClosingElement$0);
12137
12188
  }
@@ -12152,7 +12203,7 @@ var require_parser = __commonJS({
12152
12203
  ];
12153
12204
  return { type: "JSXFragment", children: parts, jsxChildren: children.jsxChildren };
12154
12205
  });
12155
- var JSXFragment$1 = $TS($S(CoffeeJSXEnabled, $EXPECT($L200, 'JSXFragment "<>"'), $E(JSXChildren), $E(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12206
+ var JSXFragment$1 = $TS($S(CoffeeJSXEnabled, $EXPECT($L201, 'JSXFragment "<>"'), $E(JSXChildren), $E(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12156
12207
  var children = $3;
12157
12208
  $0 = $0.slice(1);
12158
12209
  return {
@@ -12165,7 +12216,7 @@ var require_parser = __commonJS({
12165
12216
  function JSXFragment(ctx, state) {
12166
12217
  return $EVENT_C(ctx, state, "JSXFragment", JSXFragment$$);
12167
12218
  }
12168
- var PushJSXOpeningFragment$0 = $TV($EXPECT($L200, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
12219
+ var PushJSXOpeningFragment$0 = $TV($EXPECT($L201, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
12169
12220
  module2.JSXTagStack.push("");
12170
12221
  return $1;
12171
12222
  });
@@ -12182,7 +12233,7 @@ var require_parser = __commonJS({
12182
12233
  function JSXOptionalClosingFragment(ctx, state) {
12183
12234
  return $EVENT_C(ctx, state, "JSXOptionalClosingFragment", JSXOptionalClosingFragment$$);
12184
12235
  }
12185
- var JSXClosingFragment$0 = $EXPECT($L201, 'JSXClosingFragment "</>"');
12236
+ var JSXClosingFragment$0 = $EXPECT($L202, 'JSXClosingFragment "</>"');
12186
12237
  function JSXClosingFragment(ctx, state) {
12187
12238
  return $EVENT(ctx, state, "JSXClosingFragment", JSXClosingFragment$0);
12188
12239
  }
@@ -12656,7 +12707,7 @@ var require_parser = __commonJS({
12656
12707
  function JSXChild(ctx, state) {
12657
12708
  return $EVENT_C(ctx, state, "JSXChild", JSXChild$$);
12658
12709
  }
12659
- var JSXComment$0 = $TS($S($EXPECT($L202, 'JSXComment "<!--"'), JSXCommentContent, $EXPECT($L203, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
12710
+ var JSXComment$0 = $TS($S($EXPECT($L203, 'JSXComment "<!--"'), JSXCommentContent, $EXPECT($L204, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
12660
12711
  return ["{/*", $2, "*/}"];
12661
12712
  });
12662
12713
  function JSXComment(ctx, state) {
@@ -12743,21 +12794,66 @@ var require_parser = __commonJS({
12743
12794
  var TypeDeclaration$0 = $T($S($E($S(Export, $E(_))), $S(Declare, $E(_)), TypeLexicalDeclaration), function(value) {
12744
12795
  return { "ts": true, "children": value };
12745
12796
  });
12746
- var TypeDeclaration$1 = $T($S($E($S(Export, $E(_))), $E($S(Declare, $E(_))), TypeDeclarationRest), function(value) {
12747
- return { "ts": true, "children": value };
12797
+ var TypeDeclaration$1 = $TS($S($E($S(Export, $E(_))), $E($S(Declare, $E(_))), TypeDeclarationRest), function($skip, $loc, $0, $1, $2, $3) {
12798
+ var export_ = $1;
12799
+ var declare = $2;
12800
+ var t = $3;
12801
+ return {
12802
+ ...t,
12803
+ ts: true,
12804
+ export: export_,
12805
+ declare,
12806
+ children: [export_, declare, ...t.children]
12807
+ };
12748
12808
  });
12749
12809
  var TypeDeclaration$$ = [TypeDeclaration$0, TypeDeclaration$1];
12750
12810
  function TypeDeclaration(ctx, state) {
12751
12811
  return $EVENT_C(ctx, state, "TypeDeclaration", TypeDeclaration$$);
12752
12812
  }
12753
- var TypeDeclarationRest$0 = $S(TypeKeyword, $E(_), IdentifierName, $E(TypeParameters), OptionalEquals, $C($S($E(_), Type), $S(__, Type)));
12754
- var TypeDeclarationRest$1 = $S(Interface, $E(_), IdentifierName, $E(TypeParameters), $E(InterfaceExtendsClause), InterfaceBlock);
12755
- var TypeDeclarationRest$2 = $S(Namespace, $E(_), IdentifierName, ModuleBlock);
12813
+ var TypeDeclarationRest$0 = TypeAliasDeclaration;
12814
+ var TypeDeclarationRest$1 = InterfaceDeclaration;
12815
+ var TypeDeclarationRest$2 = NamespaceDeclaration;
12756
12816
  var TypeDeclarationRest$3 = FunctionSignature;
12757
12817
  var TypeDeclarationRest$$ = [TypeDeclarationRest$0, TypeDeclarationRest$1, TypeDeclarationRest$2, TypeDeclarationRest$3];
12758
12818
  function TypeDeclarationRest(ctx, state) {
12759
12819
  return $EVENT_C(ctx, state, "TypeDeclarationRest", TypeDeclarationRest$$);
12760
12820
  }
12821
+ var TypeAliasDeclaration$0 = $TS($S(TypeKeyword, $E(_), IdentifierName, $E(TypeParameters), OptionalEquals, $C($S($E(_), Type), $S(__, Type))), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
12822
+ var id = $3;
12823
+ return {
12824
+ type: "TypeDeclaration",
12825
+ id,
12826
+ children: $0,
12827
+ ts: true
12828
+ };
12829
+ });
12830
+ function TypeAliasDeclaration(ctx, state) {
12831
+ return $EVENT(ctx, state, "TypeAliasDeclaration", TypeAliasDeclaration$0);
12832
+ }
12833
+ var InterfaceDeclaration$0 = $TS($S(Interface, $E(_), IdentifierName, $E(TypeParameters), $E(InterfaceExtendsClause), InterfaceBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
12834
+ var id = $3;
12835
+ return {
12836
+ type: "InterfaceDeclaration",
12837
+ id,
12838
+ children: $0,
12839
+ ts: true
12840
+ };
12841
+ });
12842
+ function InterfaceDeclaration(ctx, state) {
12843
+ return $EVENT(ctx, state, "InterfaceDeclaration", InterfaceDeclaration$0);
12844
+ }
12845
+ var NamespaceDeclaration$0 = $TS($S(Namespace, $E(_), IdentifierName, ModuleBlock), function($skip, $loc, $0, $1, $2, $3, $4) {
12846
+ var id = $3;
12847
+ return {
12848
+ type: "NamespaceDeclaration",
12849
+ id,
12850
+ children: $0,
12851
+ ts: true
12852
+ };
12853
+ });
12854
+ function NamespaceDeclaration(ctx, state) {
12855
+ return $EVENT(ctx, state, "NamespaceDeclaration", NamespaceDeclaration$0);
12856
+ }
12761
12857
  var OptionalEquals$0 = $S(__, Equals);
12762
12858
  var OptionalEquals$1 = $T($S($Y(IndentedFurther), InsertSpaceEquals), function(value) {
12763
12859
  return value[1];
@@ -12788,37 +12884,37 @@ var require_parser = __commonJS({
12788
12884
  function InterfaceExtendsTarget(ctx, state) {
12789
12885
  return $EVENT(ctx, state, "InterfaceExtendsTarget", InterfaceExtendsTarget$0);
12790
12886
  }
12791
- var TypeKeyword$0 = $TS($S($EXPECT($L204, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12887
+ var TypeKeyword$0 = $TS($S($EXPECT($L205, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12792
12888
  return { $loc, token: $1 };
12793
12889
  });
12794
12890
  function TypeKeyword(ctx, state) {
12795
12891
  return $EVENT(ctx, state, "TypeKeyword", TypeKeyword$0);
12796
12892
  }
12797
- var Enum$0 = $TS($S($EXPECT($L205, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12893
+ var Enum$0 = $TS($S($EXPECT($L206, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12798
12894
  return { $loc, token: $1 };
12799
12895
  });
12800
12896
  function Enum(ctx, state) {
12801
12897
  return $EVENT(ctx, state, "Enum", Enum$0);
12802
12898
  }
12803
- var Interface$0 = $TS($S($EXPECT($L206, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12899
+ var Interface$0 = $TS($S($EXPECT($L207, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12804
12900
  return { $loc, token: $1 };
12805
12901
  });
12806
12902
  function Interface(ctx, state) {
12807
12903
  return $EVENT(ctx, state, "Interface", Interface$0);
12808
12904
  }
12809
- var Global$0 = $TS($S($EXPECT($L207, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12905
+ var Global$0 = $TS($S($EXPECT($L208, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12810
12906
  return { $loc, token: $1 };
12811
12907
  });
12812
12908
  function Global(ctx, state) {
12813
12909
  return $EVENT(ctx, state, "Global", Global$0);
12814
12910
  }
12815
- var Module$0 = $TS($S($EXPECT($L208, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12911
+ var Module$0 = $TS($S($EXPECT($L209, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12816
12912
  return { $loc, token: $1 };
12817
12913
  });
12818
12914
  function Module(ctx, state) {
12819
12915
  return $EVENT(ctx, state, "Module", Module$0);
12820
12916
  }
12821
- var Namespace$0 = $TS($S($EXPECT($L209, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12917
+ var Namespace$0 = $TS($S($EXPECT($L210, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
12822
12918
  return { $loc, token: $1 };
12823
12919
  });
12824
12920
  function Namespace(ctx, state) {
@@ -12920,9 +13016,10 @@ var require_parser = __commonJS({
12920
13016
  children: $0
12921
13017
  };
12922
13018
  const names = new Set(block.properties.map((p) => p.name.name));
12923
- return [
12924
- ts,
12925
- {
13019
+ return {
13020
+ type: "EnumDeclaration",
13021
+ id,
13022
+ children: [ts, {
12926
13023
  js: true,
12927
13024
  children: [
12928
13025
  ["let ", id, " = {};\n"],
@@ -12964,8 +13061,8 @@ var require_parser = __commonJS({
12964
13061
  }
12965
13062
  })
12966
13063
  ]
12967
- }
12968
- ];
13064
+ }]
13065
+ };
12969
13066
  });
12970
13067
  function EnumDeclaration(ctx, state) {
12971
13068
  return $EVENT(ctx, state, "EnumDeclaration", EnumDeclaration$0);
@@ -12995,26 +13092,26 @@ var require_parser = __commonJS({
12995
13092
  function EnumBlock(ctx, state) {
12996
13093
  return $EVENT_C(ctx, state, "EnumBlock", EnumBlock$$);
12997
13094
  }
12998
- var NestedEnumProperties$0 = $TS($S(PushIndent, $Q(NestedEnumProperty), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
13095
+ var NestedEnumProperties$0 = $TS($S(PushIndent, $Q(NestedEnumPropertyLine), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
12999
13096
  var props = $2;
13000
13097
  if (!props.length)
13001
13098
  return $skip;
13002
13099
  return {
13003
- properties: props.map((p) => p.property),
13100
+ properties: props.flat().map((p) => p.property),
13004
13101
  children: $0
13005
13102
  };
13006
13103
  });
13007
13104
  function NestedEnumProperties(ctx, state) {
13008
13105
  return $EVENT(ctx, state, "NestedEnumProperties", NestedEnumProperties$0);
13009
13106
  }
13010
- var NestedEnumProperty$0 = $TS($S(Nested, EnumProperty), function($skip, $loc, $0, $1, $2) {
13011
- return {
13012
- property: $2,
13013
- children: $0
13014
- };
13107
+ var NestedEnumPropertyLine$0 = $TS($S($S(Nested, EnumProperty), $Q($S($E(_), EnumProperty))), function($skip, $loc, $0, $1, $2) {
13108
+ return [$1, ...$2].map((pair) => ({
13109
+ property: pair[1],
13110
+ children: pair
13111
+ }));
13015
13112
  });
13016
- function NestedEnumProperty(ctx, state) {
13017
- return $EVENT(ctx, state, "NestedEnumProperty", NestedEnumProperty$0);
13113
+ function NestedEnumPropertyLine(ctx, state) {
13114
+ return $EVENT(ctx, state, "NestedEnumPropertyLine", NestedEnumPropertyLine$0);
13018
13115
  }
13019
13116
  var EnumProperty$0 = $TS($S(Identifier, $E($S(__, Equals, ExtendedExpression)), ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
13020
13117
  var name = $1;
@@ -13091,7 +13188,7 @@ var require_parser = __commonJS({
13091
13188
  function ReturnTypeSuffix(ctx, state) {
13092
13189
  return $EVENT(ctx, state, "ReturnTypeSuffix", ReturnTypeSuffix$0);
13093
13190
  }
13094
- var ReturnType$0 = $TS($S($E($S(__, $EXPECT($L210, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
13191
+ var ReturnType$0 = $TS($S($E($S(__, $EXPECT($L211, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
13095
13192
  var asserts = $1;
13096
13193
  var t = $2;
13097
13194
  if (asserts) {
@@ -13112,7 +13209,7 @@ var require_parser = __commonJS({
13112
13209
  function ReturnType(ctx, state) {
13113
13210
  return $EVENT(ctx, state, "ReturnType", ReturnType$0);
13114
13211
  }
13115
- var TypePredicate$0 = $TS($S(Type, $E($S(__, $EXPECT($L155, 'TypePredicate "is"'), NonIdContinue, Type))), function($skip, $loc, $0, $1, $2) {
13212
+ var TypePredicate$0 = $TS($S(Type, $E($S(__, $EXPECT($L156, 'TypePredicate "is"'), NonIdContinue, Type))), function($skip, $loc, $0, $1, $2) {
13116
13213
  var lhs = $1;
13117
13214
  var rhs = $2;
13118
13215
  if (!rhs)
@@ -13146,7 +13243,7 @@ var require_parser = __commonJS({
13146
13243
  function TypeBinary(ctx, state) {
13147
13244
  return $EVENT(ctx, state, "TypeBinary", TypeBinary$0);
13148
13245
  }
13149
- var TypeUnary$0 = $TS($S($Q($S(__, TypeUnaryOp, NonIdContinue)), TypePrimary, $Q(TypeUnarySuffix)), function($skip, $loc, $0, $1, $2, $3) {
13246
+ var TypeUnary$0 = $TS($S($Q($S(__, TypeUnaryOp)), TypePrimary, $Q(TypeUnarySuffix)), function($skip, $loc, $0, $1, $2, $3) {
13150
13247
  var prefix = $1;
13151
13248
  var t = $2;
13152
13249
  var suffix = $3;
@@ -13170,10 +13267,9 @@ var require_parser = __commonJS({
13170
13267
  function TypeUnarySuffix(ctx, state) {
13171
13268
  return $EVENT_C(ctx, state, "TypeUnarySuffix", TypeUnarySuffix$$);
13172
13269
  }
13173
- var TypeUnaryOp$0 = $S($EXPECT($L211, 'TypeUnaryOp "keyof"'), NonIdContinue);
13174
- var TypeUnaryOp$1 = $S($EXPECT($L212, 'TypeUnaryOp "infer"'), NonIdContinue);
13175
- var TypeUnaryOp$2 = $S($EXPECT($L172, 'TypeUnaryOp "readonly"'), NonIdContinue);
13176
- var TypeUnaryOp$$ = [TypeUnaryOp$0, TypeUnaryOp$1, TypeUnaryOp$2];
13270
+ var TypeUnaryOp$0 = $S($EXPECT($L212, 'TypeUnaryOp "keyof"'), NonIdContinue);
13271
+ var TypeUnaryOp$1 = $S($EXPECT($L173, 'TypeUnaryOp "readonly"'), NonIdContinue);
13272
+ var TypeUnaryOp$$ = [TypeUnaryOp$0, TypeUnaryOp$1];
13177
13273
  function TypeUnaryOp(ctx, state) {
13178
13274
  return $EVENT_C(ctx, state, "TypeUnaryOp", TypeUnaryOp$$);
13179
13275
  }
@@ -13208,19 +13304,20 @@ var require_parser = __commonJS({
13208
13304
  function UnknownAlias(ctx, state) {
13209
13305
  return $EVENT(ctx, state, "UnknownAlias", UnknownAlias$0);
13210
13306
  }
13211
- var TypePrimary$0 = $TS($S($E(_), Typeof, $E(_), ConditionalExpression), function($skip, $loc, $0, $1, $2, $3, $4) {
13307
+ var TypePrimary$0 = $S($E(_), Infer, $E(_), IdentifierName, $E($S(NotDedented, ExtendsToken, Type)));
13308
+ var TypePrimary$1 = $TS($S($E(_), Typeof, $E(_), UnaryExpression), function($skip, $loc, $0, $1, $2, $3, $4) {
13212
13309
  return {
13213
13310
  type: "TypeofType",
13214
13311
  children: $0
13215
13312
  };
13216
13313
  });
13217
- var TypePrimary$1 = $TS($S($E(_), TypeTuple), function($skip, $loc, $0, $1, $2) {
13314
+ var TypePrimary$2 = $TS($S($E(_), TypeTuple), function($skip, $loc, $0, $1, $2) {
13218
13315
  return { ...$2, children: [$1, ...$2.children] };
13219
13316
  });
13220
- var TypePrimary$2 = InterfaceBlock;
13221
- var TypePrimary$3 = $S($E(_), FunctionType);
13222
- var TypePrimary$4 = $S($E(_), InlineInterfaceLiteral);
13223
- var TypePrimary$5 = $TS($S($E(_), ImportType), function($skip, $loc, $0, $1, $2) {
13317
+ var TypePrimary$3 = InterfaceBlock;
13318
+ var TypePrimary$4 = $S($E(_), FunctionType);
13319
+ var TypePrimary$5 = $S($E(_), InlineInterfaceLiteral);
13320
+ var TypePrimary$6 = $TS($S($E(_), ImportType), function($skip, $loc, $0, $1, $2) {
13224
13321
  var t = $2;
13225
13322
  return {
13226
13323
  type: "ImportType",
@@ -13228,7 +13325,7 @@ var require_parser = __commonJS({
13228
13325
  children: $0
13229
13326
  };
13230
13327
  });
13231
- var TypePrimary$6 = $TS($S($E(_), TypeLiteral), function($skip, $loc, $0, $1, $2) {
13328
+ var TypePrimary$7 = $TS($S($E(_), TypeLiteral), function($skip, $loc, $0, $1, $2) {
13232
13329
  var t = $2;
13233
13330
  return {
13234
13331
  type: "LiteralType",
@@ -13236,7 +13333,7 @@ var require_parser = __commonJS({
13236
13333
  children: $0
13237
13334
  };
13238
13335
  });
13239
- var TypePrimary$7 = $TS($S($E(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
13336
+ var TypePrimary$8 = $TS($S($E(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
13240
13337
  return {
13241
13338
  type: "IdentifierType",
13242
13339
  children: $0,
@@ -13244,7 +13341,7 @@ var require_parser = __commonJS({
13244
13341
  args: void 0
13245
13342
  };
13246
13343
  });
13247
- var TypePrimary$8 = $TS($S($E(_), IdentifierName, $Q($S(Dot, IdentifierName)), $E(TypeArguments)), function($skip, $loc, $0, $1, $2, $3, $4) {
13344
+ var TypePrimary$9 = $TS($S($E(_), IdentifierName, $Q($S(Dot, IdentifierName)), $E(TypeArguments)), function($skip, $loc, $0, $1, $2, $3, $4) {
13248
13345
  var args = $4;
13249
13346
  return {
13250
13347
  type: "IdentifierType",
@@ -13253,13 +13350,13 @@ var require_parser = __commonJS({
13253
13350
  args
13254
13351
  };
13255
13352
  });
13256
- var TypePrimary$9 = $TS($S($E(_), OpenParen, $C(Type, $S(EOS, Type)), __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
13353
+ var TypePrimary$10 = $TS($S($E(_), OpenParen, $C(Type, $S(EOS, Type)), __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
13257
13354
  return {
13258
13355
  type: "ParenthesizedType",
13259
13356
  children: $0
13260
13357
  };
13261
13358
  });
13262
- var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9];
13359
+ var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9, TypePrimary$10];
13263
13360
  function TypePrimary(ctx, state) {
13264
13361
  return $EVENT_C(ctx, state, "TypePrimary", TypePrimary$$);
13265
13362
  }
@@ -13335,11 +13432,7 @@ var require_parser = __commonJS({
13335
13432
  return [$1, $2, $3, $7, $5, $6, $4];
13336
13433
  return $0;
13337
13434
  });
13338
- var TypeConditional$2 = $TS($S(TypeBinary, $E($S($E(IndentedFurther), ExtendsToken, Type))), function($skip, $loc, $0, $1, $2) {
13339
- if (!$2)
13340
- return $1;
13341
- return $0;
13342
- });
13435
+ var TypeConditional$2 = TypeBinary;
13343
13436
  var TypeConditional$$ = [TypeConditional$0, TypeConditional$1, TypeConditional$2];
13344
13437
  function TypeConditional(ctx, state) {
13345
13438
  return $EVENT_C(ctx, state, "TypeConditional", TypeConditional$$);
@@ -13411,7 +13504,7 @@ var require_parser = __commonJS({
13411
13504
  }
13412
13505
  var TypeLiteral$0 = TypeTemplateLiteral;
13413
13506
  var TypeLiteral$1 = Literal;
13414
- var TypeLiteral$2 = $TS($S($EXPECT($L194, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
13507
+ var TypeLiteral$2 = $TS($S($EXPECT($L195, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
13415
13508
  return { type: "VoidType", $loc, token: $1 };
13416
13509
  });
13417
13510
  var TypeLiteral$3 = $TV($EXPECT($L214, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
@@ -13497,7 +13590,7 @@ var require_parser = __commonJS({
13497
13590
  function TypeParameters(ctx, state) {
13498
13591
  return $EVENT(ctx, state, "TypeParameters", TypeParameters$0);
13499
13592
  }
13500
- var TypeParameter$0 = $S(__, $E($S($EXPECT($L154, 'TypeParameter "const"'), $E(_))), Identifier, $E(TypeConstraint), $E(TypeInitializer), TypeParameterDelimiter);
13593
+ var TypeParameter$0 = $S(__, $E($S($EXPECT($L155, 'TypeParameter "const"'), $E(_))), Identifier, $E(TypeConstraint), $E(TypeInitializer), TypeParameterDelimiter);
13501
13594
  function TypeParameter(ctx, state) {
13502
13595
  return $EVENT(ctx, state, "TypeParameter", TypeParameter$0);
13503
13596
  }
@@ -14742,6 +14835,7 @@ var require_parser = __commonJS({
14742
14835
  exports2.If = If;
14743
14836
  exports2.Import = Import;
14744
14837
  exports2.In = In;
14838
+ exports2.Infer = Infer;
14745
14839
  exports2.LetOrConst = LetOrConst;
14746
14840
  exports2.Const = Const;
14747
14841
  exports2.Is = Is;
@@ -14840,6 +14934,9 @@ var require_parser = __commonJS({
14840
14934
  exports2.UsingJSModeError = UsingJSModeError;
14841
14935
  exports2.TypeDeclaration = TypeDeclaration;
14842
14936
  exports2.TypeDeclarationRest = TypeDeclarationRest;
14937
+ exports2.TypeAliasDeclaration = TypeAliasDeclaration;
14938
+ exports2.InterfaceDeclaration = InterfaceDeclaration;
14939
+ exports2.NamespaceDeclaration = NamespaceDeclaration;
14843
14940
  exports2.OptionalEquals = OptionalEquals;
14844
14941
  exports2.TypeLexicalDeclaration = TypeLexicalDeclaration;
14845
14942
  exports2.TypeDeclarationBinding = TypeDeclarationBinding;
@@ -14867,7 +14964,7 @@ var require_parser = __commonJS({
14867
14964
  exports2.EnumDeclaration = EnumDeclaration;
14868
14965
  exports2.EnumBlock = EnumBlock;
14869
14966
  exports2.NestedEnumProperties = NestedEnumProperties;
14870
- exports2.NestedEnumProperty = NestedEnumProperty;
14967
+ exports2.NestedEnumPropertyLine = NestedEnumPropertyLine;
14871
14968
  exports2.EnumProperty = EnumProperty;
14872
14969
  exports2.TypeProperty = TypeProperty;
14873
14970
  exports2.TypeIndexSignature = TypeIndexSignature;