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