houdini 1.1.7 → 1.2.0-next.1

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.
Files changed (88) hide show
  1. package/README.md +1 -1
  2. package/build/cmd-cjs/index.js +1739 -1256
  3. package/build/cmd-esm/index.js +1739 -1256
  4. package/build/codegen/generators/artifacts/selection.d.ts +2 -1
  5. package/build/codegen/generators/typescript/inlineType.d.ts +5 -2
  6. package/build/codegen/generators/typescript/loadingState.d.ts +8 -0
  7. package/build/codegen-cjs/index.js +1701 -1241
  8. package/build/codegen-esm/index.js +1701 -1241
  9. package/build/lib/config.d.ts +5 -0
  10. package/build/lib/graphql.d.ts +5 -1
  11. package/build/lib/parse.d.ts +11 -1
  12. package/build/lib/types.d.ts +4 -1
  13. package/build/lib-cjs/index.js +611 -493
  14. package/build/lib-esm/index.js +608 -493
  15. package/build/runtime/cache/cache.d.ts +7 -8
  16. package/build/runtime/cache/stuff.d.ts +1 -4
  17. package/build/runtime/client/documentStore.d.ts +6 -3
  18. package/build/runtime/client/index.d.ts +9 -8
  19. package/build/runtime/client/plugins/cache.d.ts +1 -1
  20. package/build/runtime/client/plugins/fetch.d.ts +1 -0
  21. package/build/runtime/client/plugins/subscription.d.ts +1 -0
  22. package/build/runtime/client/plugins/throwOnError.d.ts +2 -1
  23. package/build/runtime/lib/pageInfo.d.ts +7 -0
  24. package/build/runtime/lib/pagination.d.ts +27 -0
  25. package/build/runtime/lib/selection.d.ts +1 -1
  26. package/build/runtime/lib/types.d.ts +79 -4
  27. package/build/runtime-cjs/cache/cache.d.ts +7 -8
  28. package/build/runtime-cjs/cache/cache.js +78 -36
  29. package/build/runtime-cjs/cache/stuff.d.ts +1 -4
  30. package/build/runtime-cjs/cache/stuff.js +2 -2
  31. package/build/runtime-cjs/cache/subscription.js +5 -5
  32. package/build/runtime-cjs/client/documentStore.d.ts +6 -3
  33. package/build/runtime-cjs/client/documentStore.js +20 -7
  34. package/build/runtime-cjs/client/index.d.ts +9 -8
  35. package/build/runtime-cjs/client/index.js +12 -4
  36. package/build/runtime-cjs/client/plugins/cache.d.ts +1 -1
  37. package/build/runtime-cjs/client/plugins/cache.js +12 -2
  38. package/build/runtime-cjs/client/plugins/fetch.d.ts +1 -0
  39. package/build/runtime-cjs/client/plugins/fetch.js +3 -2
  40. package/build/runtime-cjs/client/plugins/fragment.js +8 -1
  41. package/build/runtime-cjs/client/plugins/query.js +2 -1
  42. package/build/runtime-cjs/client/plugins/subscription.d.ts +1 -0
  43. package/build/runtime-cjs/client/plugins/subscription.js +1 -0
  44. package/build/runtime-cjs/client/plugins/throwOnError.d.ts +2 -1
  45. package/build/runtime-cjs/lib/config.js +2 -1
  46. package/build/runtime-cjs/lib/pageInfo.d.ts +7 -0
  47. package/build/runtime-cjs/lib/pageInfo.js +79 -0
  48. package/build/runtime-cjs/lib/pagination.d.ts +27 -0
  49. package/build/runtime-cjs/lib/pagination.js +219 -0
  50. package/build/runtime-cjs/lib/scalars.js +1 -1
  51. package/build/runtime-cjs/lib/selection.d.ts +1 -1
  52. package/build/runtime-cjs/lib/selection.js +28 -1
  53. package/build/runtime-cjs/lib/types.d.ts +79 -4
  54. package/build/runtime-cjs/lib/types.js +3 -0
  55. package/build/runtime-esm/cache/cache.d.ts +7 -8
  56. package/build/runtime-esm/cache/cache.js +79 -37
  57. package/build/runtime-esm/cache/stuff.d.ts +1 -4
  58. package/build/runtime-esm/cache/stuff.js +2 -2
  59. package/build/runtime-esm/cache/subscription.js +5 -5
  60. package/build/runtime-esm/client/documentStore.d.ts +6 -3
  61. package/build/runtime-esm/client/documentStore.js +20 -7
  62. package/build/runtime-esm/client/index.d.ts +9 -8
  63. package/build/runtime-esm/client/index.js +15 -7
  64. package/build/runtime-esm/client/plugins/cache.d.ts +1 -1
  65. package/build/runtime-esm/client/plugins/cache.js +12 -2
  66. package/build/runtime-esm/client/plugins/fetch.d.ts +1 -0
  67. package/build/runtime-esm/client/plugins/fetch.js +3 -2
  68. package/build/runtime-esm/client/plugins/fragment.js +8 -1
  69. package/build/runtime-esm/client/plugins/query.js +2 -1
  70. package/build/runtime-esm/client/plugins/subscription.d.ts +1 -0
  71. package/build/runtime-esm/client/plugins/subscription.js +1 -0
  72. package/build/runtime-esm/client/plugins/throwOnError.d.ts +2 -1
  73. package/build/runtime-esm/lib/config.js +2 -1
  74. package/build/runtime-esm/lib/pageInfo.d.ts +7 -0
  75. package/build/runtime-esm/lib/pageInfo.js +52 -0
  76. package/build/runtime-esm/lib/pagination.d.ts +27 -0
  77. package/build/runtime-esm/lib/pagination.js +194 -0
  78. package/build/runtime-esm/lib/scalars.js +1 -1
  79. package/build/runtime-esm/lib/selection.d.ts +1 -1
  80. package/build/runtime-esm/lib/selection.js +28 -1
  81. package/build/runtime-esm/lib/types.d.ts +79 -4
  82. package/build/runtime-esm/lib/types.js +2 -0
  83. package/build/test/index.d.ts +15 -0
  84. package/build/test-cjs/index.js +1706 -1223
  85. package/build/test-esm/index.js +1706 -1223
  86. package/build/vite-cjs/index.js +1757 -1274
  87. package/build/vite-esm/index.js +1757 -1274
  88. package/package.json +5 -1
@@ -2406,7 +2406,7 @@ var require_visitor = __commonJS({
2406
2406
  Object.defineProperty(exports, "__esModule", {
2407
2407
  value: true
2408
2408
  });
2409
- exports.visit = visit2;
2409
+ exports.visit = visit3;
2410
2410
  exports.visitInParallel = visitInParallel;
2411
2411
  exports.getVisitFn = getVisitFn;
2412
2412
  exports.BREAK = exports.QueryDocumentKeys = void 0;
@@ -2469,7 +2469,7 @@ var require_visitor = __commonJS({
2469
2469
  exports.QueryDocumentKeys = QueryDocumentKeys;
2470
2470
  var BREAK = Object.freeze({});
2471
2471
  exports.BREAK = BREAK;
2472
- function visit2(root, visitor) {
2472
+ function visit3(root, visitor) {
2473
2473
  var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
2474
2474
  var stack = void 0;
2475
2475
  var inArray = Array.isArray(root);
@@ -3074,10 +3074,10 @@ var require_printer = __commonJS({
3074
3074
  Object.defineProperty(exports, "__esModule", {
3075
3075
  value: true
3076
3076
  });
3077
- exports.print = print4;
3077
+ exports.print = print5;
3078
3078
  var _visitor = require_visitor();
3079
3079
  var _blockString = require_blockString();
3080
- function print4(ast) {
3080
+ function print5(ast) {
3081
3081
  return (0, _visitor.visit)(ast, {
3082
3082
  leave: printDocASTReducer2
3083
3083
  });
@@ -44293,7 +44293,7 @@ var require_path_visitor = __commonJS({
44293
44293
  }
44294
44294
  return target;
44295
44295
  }
44296
- PathVisitor.visit = function visit2(node, methods) {
44296
+ PathVisitor.visit = function visit3(node, methods) {
44297
44297
  return PathVisitor.fromMethodsObject(methods).visit(node);
44298
44298
  };
44299
44299
  var PVp = PathVisitor.prototype;
@@ -44484,7 +44484,7 @@ var require_path_visitor = __commonJS({
44484
44484
  this.needToCallTraverse = false;
44485
44485
  return visitChildren(path2, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
44486
44486
  };
44487
- sharedContextProtoMethods.visit = function visit2(path2, newVisitor) {
44487
+ sharedContextProtoMethods.visit = function visit3(path2, newVisitor) {
44488
44488
  if (!(this instanceof this.Context)) {
44489
44489
  throw new Error("");
44490
44490
  }
@@ -45877,7 +45877,7 @@ var require_main = __commonJS({
45877
45877
  var someField = _a.someField;
45878
45878
  var Type = _a.Type;
45879
45879
  var use = _a.use;
45880
- var visit2 = _a.visit;
45880
+ var visit3 = _a.visit;
45881
45881
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
45882
45882
  exports.builders = builders;
45883
45883
  exports.builtInTypes = builtInTypes;
@@ -45894,7 +45894,7 @@ var require_main = __commonJS({
45894
45894
  exports.someField = someField;
45895
45895
  exports.Type = Type;
45896
45896
  exports.use = use;
45897
- exports.visit = visit2;
45897
+ exports.visit = visit3;
45898
45898
  Object.assign(namedTypes_1.namedTypes, n);
45899
45899
  }
45900
45900
  });
@@ -55143,12 +55143,12 @@ var require_comments = __commonJS({
55143
55143
  comment.trailing = true;
55144
55144
  addCommentHelper(node, comment);
55145
55145
  }
55146
- function printLeadingComment(commentPath, print4) {
55146
+ function printLeadingComment(commentPath, print5) {
55147
55147
  var comment = commentPath.getValue();
55148
55148
  n.Comment.assert(comment);
55149
55149
  var loc = comment.loc;
55150
55150
  var lines = loc && loc.lines;
55151
- var parts = [print4(commentPath)];
55151
+ var parts = [print5(commentPath)];
55152
55152
  if (comment.trailing) {
55153
55153
  parts.push("\n");
55154
55154
  } else if (lines instanceof lines_1.Lines) {
@@ -55163,7 +55163,7 @@ var require_comments = __commonJS({
55163
55163
  }
55164
55164
  return (0, lines_1.concat)(parts);
55165
55165
  }
55166
- function printTrailingComment(commentPath, print4) {
55166
+ function printTrailingComment(commentPath, print5) {
55167
55167
  var comment = commentPath.getValue(commentPath);
55168
55168
  n.Comment.assert(comment);
55169
55169
  var loc = comment.loc;
@@ -55178,12 +55178,12 @@ var require_comments = __commonJS({
55178
55178
  parts.push(new Array(leadingSpace.length).join("\n"));
55179
55179
  }
55180
55180
  }
55181
- parts.push(print4(commentPath));
55181
+ parts.push(print5(commentPath));
55182
55182
  return (0, lines_1.concat)(parts);
55183
55183
  }
55184
- function printComments(path2, print4) {
55184
+ function printComments(path2, print5) {
55185
55185
  var value = path2.getValue();
55186
- var innerLines = print4(path2);
55186
+ var innerLines = print5(path2);
55187
55187
  var comments = n.Node.check(value) && types4.getFieldValue(value, "comments");
55188
55188
  if (!comments || comments.length === 0) {
55189
55189
  return innerLines;
@@ -55195,9 +55195,9 @@ var require_comments = __commonJS({
55195
55195
  var leading = types4.getFieldValue(comment, "leading");
55196
55196
  var trailing = types4.getFieldValue(comment, "trailing");
55197
55197
  if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
55198
- leadingParts.push(printLeadingComment(commentPath, print4));
55198
+ leadingParts.push(printLeadingComment(commentPath, print5));
55199
55199
  } else if (trailing) {
55200
- trailingParts.push(printTrailingComment(commentPath, print4));
55200
+ trailingParts.push(printTrailingComment(commentPath, print5));
55201
55201
  }
55202
55202
  }, "comments");
55203
55203
  leadingParts.push.apply(leadingParts, trailingParts);
@@ -55888,7 +55888,7 @@ var require_patcher = __commonJS({
55888
55888
  };
55889
55889
  exports.Patcher = Patcher;
55890
55890
  var Pp = Patcher.prototype;
55891
- Pp.tryToReprintComments = function(newNode, oldNode, print4) {
55891
+ Pp.tryToReprintComments = function(newNode, oldNode, print5) {
55892
55892
  var patcher = this;
55893
55893
  if (!newNode.comments && !oldNode.comments) {
55894
55894
  return true;
@@ -55905,7 +55905,7 @@ var require_patcher = __commonJS({
55905
55905
  assert_1.default.ok(oldComment.leading || oldComment.trailing);
55906
55906
  patcher.replace(
55907
55907
  oldComment.loc,
55908
- print4(reprint.newPath).indentTail(oldComment.loc.indent)
55908
+ print5(reprint.newPath).indentTail(oldComment.loc.indent)
55909
55909
  );
55910
55910
  });
55911
55911
  }
@@ -55952,17 +55952,17 @@ var require_patcher = __commonJS({
55952
55952
  var reprints = [];
55953
55953
  if (!lines || !findReprints(path2, reprints))
55954
55954
  return;
55955
- return function(print4) {
55955
+ return function(print5) {
55956
55956
  var patcher = new Patcher(lines);
55957
55957
  reprints.forEach(function(reprint) {
55958
55958
  var newNode = reprint.newPath.getValue();
55959
55959
  var oldNode = reprint.oldPath.getValue();
55960
55960
  SourceLocation.assert(oldNode.loc, true);
55961
- var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print4);
55961
+ var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print5);
55962
55962
  if (needToPrintNewPathWithComments) {
55963
55963
  patcher.deleteComments(oldNode);
55964
55964
  }
55965
- var newLines = print4(reprint.newPath, {
55965
+ var newLines = print5(reprint.newPath, {
55966
55966
  includeComments: needToPrintNewPathWithComments,
55967
55967
  avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens()
55968
55968
  }).indentTail(oldNode.loc.indent);
@@ -56179,10 +56179,10 @@ var require_printer2 = __commonJS({
56179
56179
  function makePrintFunctionWith(options, overrides) {
56180
56180
  options = Object.assign({}, options, overrides);
56181
56181
  return function(path2) {
56182
- return print4(path2, options);
56182
+ return print5(path2, options);
56183
56183
  };
56184
56184
  }
56185
- function print4(path2, options) {
56185
+ function print5(path2, options) {
56186
56186
  assert_1.default.ok(path2 instanceof fast_path_1.default);
56187
56187
  options = options || {};
56188
56188
  if (options.includeComments) {
@@ -56198,7 +56198,7 @@ var require_printer2 = __commonJS({
56198
56198
  }
56199
56199
  }
56200
56200
  var reprinter = (0, patcher_1.getReprinter)(path2);
56201
- var lines = reprinter ? reprinter(print4) : genericPrint(path2, config, options, makePrintFunctionWith(options, {
56201
+ var lines = reprinter ? reprinter(print5) : genericPrint(path2, config, options, makePrintFunctionWith(options, {
56202
56202
  includeComments: true,
56203
56203
  avoidRootParens: false
56204
56204
  }));
@@ -56209,7 +56209,7 @@ var require_printer2 = __commonJS({
56209
56209
  if (!ast) {
56210
56210
  return emptyPrintResult;
56211
56211
  }
56212
- var lines = print4(fast_path_1.default.from(ast), {
56212
+ var lines = print5(fast_path_1.default.from(ast), {
56213
56213
  includeComments: true,
56214
56214
  avoidRootParens: false
56215
56215
  });
@@ -56262,7 +56262,7 @@ var require_printer2 = __commonJS({
56262
56262
  }
56263
56263
  return (0, lines_1.concat)(parts);
56264
56264
  }
56265
- function genericPrintNoParens(path2, options, print4) {
56265
+ function genericPrintNoParens(path2, options, print5) {
56266
56266
  var n = path2.getValue();
56267
56267
  if (!n) {
56268
56268
  return (0, lines_1.fromString)("");
@@ -56274,45 +56274,45 @@ var require_printer2 = __commonJS({
56274
56274
  var parts = [];
56275
56275
  switch (n.type) {
56276
56276
  case "File":
56277
- return path2.call(print4, "program");
56277
+ return path2.call(print5, "program");
56278
56278
  case "Program":
56279
56279
  if (n.directives) {
56280
56280
  path2.each(function(childPath) {
56281
- parts.push(print4(childPath), ";\n");
56281
+ parts.push(print5(childPath), ";\n");
56282
56282
  }, "directives");
56283
56283
  }
56284
56284
  if (n.interpreter) {
56285
- parts.push(path2.call(print4, "interpreter"));
56285
+ parts.push(path2.call(print5, "interpreter"));
56286
56286
  }
56287
56287
  parts.push(path2.call(function(bodyPath) {
56288
- return printStatementSequence(bodyPath, options, print4);
56288
+ return printStatementSequence(bodyPath, options, print5);
56289
56289
  }, "body"));
56290
56290
  return (0, lines_1.concat)(parts);
56291
56291
  case "Noop":
56292
56292
  case "EmptyStatement":
56293
56293
  return (0, lines_1.fromString)("");
56294
56294
  case "ExpressionStatement":
56295
- return (0, lines_1.concat)([path2.call(print4, "expression"), ";"]);
56295
+ return (0, lines_1.concat)([path2.call(print5, "expression"), ";"]);
56296
56296
  case "ParenthesizedExpression":
56297
- return (0, lines_1.concat)(["(", path2.call(print4, "expression"), ")"]);
56297
+ return (0, lines_1.concat)(["(", path2.call(print5, "expression"), ")"]);
56298
56298
  case "BinaryExpression":
56299
56299
  case "LogicalExpression":
56300
56300
  case "AssignmentExpression":
56301
56301
  return (0, lines_1.fromString)(" ").join([
56302
- path2.call(print4, "left"),
56302
+ path2.call(print5, "left"),
56303
56303
  n.operator,
56304
- path2.call(print4, "right")
56304
+ path2.call(print5, "right")
56305
56305
  ]);
56306
56306
  case "AssignmentPattern":
56307
56307
  return (0, lines_1.concat)([
56308
- path2.call(print4, "left"),
56308
+ path2.call(print5, "left"),
56309
56309
  " = ",
56310
- path2.call(print4, "right")
56310
+ path2.call(print5, "right")
56311
56311
  ]);
56312
56312
  case "MemberExpression":
56313
56313
  case "OptionalMemberExpression": {
56314
- parts.push(path2.call(print4, "object"));
56315
- var property = path2.call(print4, "property");
56314
+ parts.push(path2.call(print5, "object"));
56315
+ var property = path2.call(print5, "property");
56316
56316
  var optional = types4.getFieldValue(n, "optional");
56317
56317
  if (n.computed) {
56318
56318
  parts.push(optional ? "?.[" : "[", property, "]");
@@ -56322,18 +56322,18 @@ var require_printer2 = __commonJS({
56322
56322
  return (0, lines_1.concat)(parts);
56323
56323
  }
56324
56324
  case "ChainExpression":
56325
- return path2.call(print4, "expression");
56325
+ return path2.call(print5, "expression");
56326
56326
  case "MetaProperty":
56327
56327
  return (0, lines_1.concat)([
56328
- path2.call(print4, "meta"),
56328
+ path2.call(print5, "meta"),
56329
56329
  ".",
56330
- path2.call(print4, "property")
56330
+ path2.call(print5, "property")
56331
56331
  ]);
56332
56332
  case "BindExpression":
56333
56333
  if (n.object) {
56334
- parts.push(path2.call(print4, "object"));
56334
+ parts.push(path2.call(print5, "object"));
56335
56335
  }
56336
- parts.push("::", path2.call(print4, "callee"));
56336
+ parts.push("::", path2.call(print5, "callee"));
56337
56337
  return (0, lines_1.concat)(parts);
56338
56338
  case "Path":
56339
56339
  return (0, lines_1.fromString)(".").join(n.body);
@@ -56341,7 +56341,7 @@ var require_printer2 = __commonJS({
56341
56341
  return (0, lines_1.concat)([
56342
56342
  (0, lines_1.fromString)(n.name, options),
56343
56343
  n.optional ? "?" : "",
56344
- path2.call(print4, "typeAnnotation")
56344
+ path2.call(print5, "typeAnnotation")
56345
56345
  ]);
56346
56346
  case "SpreadElement":
56347
56347
  case "SpreadElementPattern":
@@ -56352,8 +56352,8 @@ var require_printer2 = __commonJS({
56352
56352
  case "RestElement":
56353
56353
  return (0, lines_1.concat)([
56354
56354
  "...",
56355
- path2.call(print4, "argument"),
56356
- path2.call(print4, "typeAnnotation")
56355
+ path2.call(print5, "argument"),
56356
+ path2.call(print5, "typeAnnotation")
56357
56357
  ]);
56358
56358
  case "FunctionDeclaration":
56359
56359
  case "FunctionExpression":
@@ -56368,15 +56368,15 @@ var require_printer2 = __commonJS({
56368
56368
  if (n.generator)
56369
56369
  parts.push("*");
56370
56370
  if (n.id) {
56371
- parts.push(" ", path2.call(print4, "id"), path2.call(print4, "typeParameters"));
56371
+ parts.push(" ", path2.call(print5, "id"), path2.call(print5, "typeParameters"));
56372
56372
  } else {
56373
56373
  if (n.typeParameters) {
56374
- parts.push(path2.call(print4, "typeParameters"));
56374
+ parts.push(path2.call(print5, "typeParameters"));
56375
56375
  }
56376
56376
  }
56377
- parts.push("(", printFunctionParams(path2, options, print4), ")", path2.call(print4, "returnType"));
56377
+ parts.push("(", printFunctionParams(path2, options, print5), ")", path2.call(print5, "returnType"));
56378
56378
  if (n.body) {
56379
- parts.push(" ", path2.call(print4, "body"));
56379
+ parts.push(" ", path2.call(print5, "body"));
56380
56380
  }
56381
56381
  return (0, lines_1.concat)(parts);
56382
56382
  case "ArrowFunctionExpression":
@@ -56384,44 +56384,44 @@ var require_printer2 = __commonJS({
56384
56384
  parts.push("async ");
56385
56385
  }
56386
56386
  if (n.typeParameters) {
56387
- parts.push(path2.call(print4, "typeParameters"));
56387
+ parts.push(path2.call(print5, "typeParameters"));
56388
56388
  }
56389
56389
  if (!options.arrowParensAlways && n.params.length === 1 && !n.rest && n.params[0].type === "Identifier" && !n.params[0].typeAnnotation && !n.returnType) {
56390
- parts.push(path2.call(print4, "params", 0));
56390
+ parts.push(path2.call(print5, "params", 0));
56391
56391
  } else {
56392
- parts.push("(", printFunctionParams(path2, options, print4), ")", path2.call(print4, "returnType"));
56392
+ parts.push("(", printFunctionParams(path2, options, print5), ")", path2.call(print5, "returnType"));
56393
56393
  }
56394
- parts.push(" => ", path2.call(print4, "body"));
56394
+ parts.push(" => ", path2.call(print5, "body"));
56395
56395
  return (0, lines_1.concat)(parts);
56396
56396
  case "MethodDefinition":
56397
- return printMethod(path2, options, print4);
56397
+ return printMethod(path2, options, print5);
56398
56398
  case "YieldExpression":
56399
56399
  parts.push("yield");
56400
56400
  if (n.delegate)
56401
56401
  parts.push("*");
56402
56402
  if (n.argument)
56403
- parts.push(" ", path2.call(print4, "argument"));
56403
+ parts.push(" ", path2.call(print5, "argument"));
56404
56404
  return (0, lines_1.concat)(parts);
56405
56405
  case "AwaitExpression":
56406
56406
  parts.push("await");
56407
56407
  if (n.all)
56408
56408
  parts.push("*");
56409
56409
  if (n.argument)
56410
- parts.push(" ", path2.call(print4, "argument"));
56410
+ parts.push(" ", path2.call(print5, "argument"));
56411
56411
  return (0, lines_1.concat)(parts);
56412
56412
  case "ModuleExpression":
56413
56413
  return (0, lines_1.concat)([
56414
56414
  "module {\n",
56415
- path2.call(print4, "body").indent(options.tabWidth),
56415
+ path2.call(print5, "body").indent(options.tabWidth),
56416
56416
  "\n}"
56417
56417
  ]);
56418
56418
  case "ModuleDeclaration":
56419
- parts.push("module", path2.call(print4, "id"));
56419
+ parts.push("module", path2.call(print5, "id"));
56420
56420
  if (n.source) {
56421
56421
  assert_1.default.ok(!n.body);
56422
- parts.push("from", path2.call(print4, "source"));
56422
+ parts.push("from", path2.call(print5, "source"));
56423
56423
  } else {
56424
- parts.push(path2.call(print4, "body"));
56424
+ parts.push(path2.call(print5, "body"));
56425
56425
  }
56426
56426
  return (0, lines_1.fromString)(" ").join(parts);
56427
56427
  case "ImportSpecifier":
@@ -56429,27 +56429,27 @@ var require_printer2 = __commonJS({
56429
56429
  parts.push(n.importKind + " ");
56430
56430
  }
56431
56431
  if (n.imported) {
56432
- parts.push(path2.call(print4, "imported"));
56432
+ parts.push(path2.call(print5, "imported"));
56433
56433
  if (n.local && n.local.name !== n.imported.name) {
56434
- parts.push(" as ", path2.call(print4, "local"));
56434
+ parts.push(" as ", path2.call(print5, "local"));
56435
56435
  }
56436
56436
  } else if (n.id) {
56437
- parts.push(path2.call(print4, "id"));
56437
+ parts.push(path2.call(print5, "id"));
56438
56438
  if (n.name) {
56439
- parts.push(" as ", path2.call(print4, "name"));
56439
+ parts.push(" as ", path2.call(print5, "name"));
56440
56440
  }
56441
56441
  }
56442
56442
  return (0, lines_1.concat)(parts);
56443
56443
  case "ExportSpecifier":
56444
56444
  if (n.local) {
56445
- parts.push(path2.call(print4, "local"));
56445
+ parts.push(path2.call(print5, "local"));
56446
56446
  if (n.exported && n.exported.name !== n.local.name) {
56447
- parts.push(" as ", path2.call(print4, "exported"));
56447
+ parts.push(" as ", path2.call(print5, "exported"));
56448
56448
  }
56449
56449
  } else if (n.id) {
56450
- parts.push(path2.call(print4, "id"));
56450
+ parts.push(path2.call(print5, "id"));
56451
56451
  if (n.name) {
56452
- parts.push(" as ", path2.call(print4, "name"));
56452
+ parts.push(" as ", path2.call(print5, "name"));
56453
56453
  }
56454
56454
  }
56455
56455
  return (0, lines_1.concat)(parts);
@@ -56458,40 +56458,40 @@ var require_printer2 = __commonJS({
56458
56458
  case "ImportNamespaceSpecifier":
56459
56459
  parts.push("* as ");
56460
56460
  if (n.local) {
56461
- parts.push(path2.call(print4, "local"));
56461
+ parts.push(path2.call(print5, "local"));
56462
56462
  } else if (n.id) {
56463
- parts.push(path2.call(print4, "id"));
56463
+ parts.push(path2.call(print5, "id"));
56464
56464
  }
56465
56465
  return (0, lines_1.concat)(parts);
56466
56466
  case "ImportDefaultSpecifier":
56467
56467
  if (n.local) {
56468
- return path2.call(print4, "local");
56468
+ return path2.call(print5, "local");
56469
56469
  }
56470
- return path2.call(print4, "id");
56470
+ return path2.call(print5, "id");
56471
56471
  case "TSExportAssignment":
56472
- return (0, lines_1.concat)(["export = ", path2.call(print4, "expression")]);
56472
+ return (0, lines_1.concat)(["export = ", path2.call(print5, "expression")]);
56473
56473
  case "ExportDeclaration":
56474
56474
  case "ExportDefaultDeclaration":
56475
56475
  case "ExportNamedDeclaration":
56476
- return printExportDeclaration(path2, options, print4);
56476
+ return printExportDeclaration(path2, options, print5);
56477
56477
  case "ExportAllDeclaration":
56478
56478
  parts.push("export *");
56479
56479
  if (n.exported) {
56480
- parts.push(" as ", path2.call(print4, "exported"));
56480
+ parts.push(" as ", path2.call(print5, "exported"));
56481
56481
  }
56482
- parts.push(" from ", path2.call(print4, "source"), ";");
56482
+ parts.push(" from ", path2.call(print5, "source"), ";");
56483
56483
  return (0, lines_1.concat)(parts);
56484
56484
  case "TSNamespaceExportDeclaration":
56485
- parts.push("export as namespace ", path2.call(print4, "id"));
56485
+ parts.push("export as namespace ", path2.call(print5, "id"));
56486
56486
  return maybeAddSemicolon((0, lines_1.concat)(parts));
56487
56487
  case "ExportNamespaceSpecifier":
56488
- return (0, lines_1.concat)(["* as ", path2.call(print4, "exported")]);
56488
+ return (0, lines_1.concat)(["* as ", path2.call(print5, "exported")]);
56489
56489
  case "ExportDefaultSpecifier":
56490
- return path2.call(print4, "exported");
56490
+ return path2.call(print5, "exported");
56491
56491
  case "Import":
56492
56492
  return (0, lines_1.fromString)("import", options);
56493
56493
  case "ImportExpression":
56494
- return (0, lines_1.concat)(["import(", path2.call(print4, "source"), ")"]);
56494
+ return (0, lines_1.concat)(["import(", path2.call(print5, "source"), ")"]);
56495
56495
  case "ImportDeclaration": {
56496
56496
  parts.push("import ");
56497
56497
  if (n.importKind && n.importKind !== "value") {
@@ -56503,9 +56503,9 @@ var require_printer2 = __commonJS({
56503
56503
  path2.each(function(specifierPath) {
56504
56504
  var spec = specifierPath.getValue();
56505
56505
  if (spec.type === "ImportSpecifier") {
56506
- bracedSpecifiers_1.push(print4(specifierPath));
56506
+ bracedSpecifiers_1.push(print5(specifierPath));
56507
56507
  } else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") {
56508
- unbracedSpecifiers_1.push(print4(specifierPath));
56508
+ unbracedSpecifiers_1.push(print5(specifierPath));
56509
56509
  }
56510
56510
  }, "specifiers");
56511
56511
  unbracedSpecifiers_1.forEach(function(lines2, i2) {
@@ -56535,16 +56535,16 @@ var require_printer2 = __commonJS({
56535
56535
  }
56536
56536
  parts.push(" from ");
56537
56537
  }
56538
- parts.push(path2.call(print4, "source"), maybePrintImportAssertions(path2, options, print4), ";");
56538
+ parts.push(path2.call(print5, "source"), maybePrintImportAssertions(path2, options, print5), ";");
56539
56539
  return (0, lines_1.concat)(parts);
56540
56540
  }
56541
56541
  case "ImportAttribute":
56542
- return (0, lines_1.concat)([path2.call(print4, "key"), ": ", path2.call(print4, "value")]);
56542
+ return (0, lines_1.concat)([path2.call(print5, "key"), ": ", path2.call(print5, "value")]);
56543
56543
  case "StaticBlock":
56544
56544
  parts.push("static ");
56545
56545
  case "BlockStatement": {
56546
56546
  var naked_1 = path2.call(function(bodyPath) {
56547
- return printStatementSequence(bodyPath, options, print4);
56547
+ return printStatementSequence(bodyPath, options, print5);
56548
56548
  }, "body");
56549
56549
  if (naked_1.isEmpty()) {
56550
56550
  if (!n.directives || n.directives.length === 0) {
@@ -56555,7 +56555,7 @@ var require_printer2 = __commonJS({
56555
56555
  parts.push("{\n");
56556
56556
  if (n.directives) {
56557
56557
  path2.each(function(childPath) {
56558
- parts.push(maybeAddSemicolon(print4(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
56558
+ parts.push(maybeAddSemicolon(print5(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
56559
56559
  }, "directives");
56560
56560
  }
56561
56561
  parts.push(naked_1.indent(options.tabWidth));
@@ -56565,7 +56565,7 @@ var require_printer2 = __commonJS({
56565
56565
  case "ReturnStatement": {
56566
56566
  parts.push("return");
56567
56567
  if (n.argument) {
56568
- var argLines = path2.call(print4, "argument");
56568
+ var argLines = path2.call(print5, "argument");
56569
56569
  if (argLines.startsWithComment() || argLines.length > 1 && namedTypes.JSXElement && namedTypes.JSXElement.check(n.argument)) {
56570
56570
  parts.push(" (\n", argLines.indent(options.tabWidth), "\n)");
56571
56571
  } else {
@@ -56577,17 +56577,17 @@ var require_printer2 = __commonJS({
56577
56577
  }
56578
56578
  case "CallExpression":
56579
56579
  case "OptionalCallExpression":
56580
- parts.push(path2.call(print4, "callee"));
56580
+ parts.push(path2.call(print5, "callee"));
56581
56581
  if (n.typeParameters) {
56582
- parts.push(path2.call(print4, "typeParameters"));
56582
+ parts.push(path2.call(print5, "typeParameters"));
56583
56583
  }
56584
56584
  if (n.typeArguments) {
56585
- parts.push(path2.call(print4, "typeArguments"));
56585
+ parts.push(path2.call(print5, "typeArguments"));
56586
56586
  }
56587
56587
  if (types4.getFieldValue(n, "optional")) {
56588
56588
  parts.push("?.");
56589
56589
  }
56590
- parts.push(printArgumentsList(path2, options, print4));
56590
+ parts.push(printArgumentsList(path2, options, print5));
56591
56591
  return (0, lines_1.concat)(parts);
56592
56592
  case "RecordExpression":
56593
56593
  parts.push("#");
@@ -56617,7 +56617,7 @@ var require_printer2 = __commonJS({
56617
56617
  var i_1 = 0;
56618
56618
  fields.forEach(function(field) {
56619
56619
  path2.each(function(childPath) {
56620
- var lines2 = print4(childPath);
56620
+ var lines2 = print5(childPath);
56621
56621
  if (!oneLine_1) {
56622
56622
  lines2 = lines2.indent(options.tabWidth);
56623
56623
  }
@@ -56654,32 +56654,32 @@ var require_printer2 = __commonJS({
56654
56654
  parts[parts.length - 1] = " " + rightBrace;
56655
56655
  }
56656
56656
  if (n.typeAnnotation) {
56657
- parts.push(path2.call(print4, "typeAnnotation"));
56657
+ parts.push(path2.call(print5, "typeAnnotation"));
56658
56658
  }
56659
56659
  return (0, lines_1.concat)(parts);
56660
56660
  }
56661
56661
  case "PropertyPattern":
56662
56662
  return (0, lines_1.concat)([
56663
- path2.call(print4, "key"),
56663
+ path2.call(print5, "key"),
56664
56664
  ": ",
56665
- path2.call(print4, "pattern")
56665
+ path2.call(print5, "pattern")
56666
56666
  ]);
56667
56667
  case "ObjectProperty":
56668
56668
  case "Property": {
56669
56669
  if (n.method || n.kind === "get" || n.kind === "set") {
56670
- return printMethod(path2, options, print4);
56670
+ return printMethod(path2, options, print5);
56671
56671
  }
56672
56672
  if (n.shorthand && n.value.type === "AssignmentPattern") {
56673
- return path2.call(print4, "value");
56673
+ return path2.call(print5, "value");
56674
56674
  }
56675
- var key = path2.call(print4, "key");
56675
+ var key = path2.call(print5, "key");
56676
56676
  if (n.computed) {
56677
56677
  parts.push("[", key, "]");
56678
56678
  } else {
56679
56679
  parts.push(key);
56680
56680
  }
56681
56681
  if (!n.shorthand || n.key.name !== n.value.name) {
56682
- parts.push(": ", path2.call(print4, "value"));
56682
+ parts.push(": ", path2.call(print5, "value"));
56683
56683
  }
56684
56684
  return (0, lines_1.concat)(parts);
56685
56685
  }
@@ -56687,18 +56687,18 @@ var require_printer2 = __commonJS({
56687
56687
  case "ObjectMethod":
56688
56688
  case "ClassPrivateMethod":
56689
56689
  case "TSDeclareMethod":
56690
- return printMethod(path2, options, print4);
56690
+ return printMethod(path2, options, print5);
56691
56691
  case "PrivateName":
56692
- return (0, lines_1.concat)(["#", path2.call(print4, "id")]);
56692
+ return (0, lines_1.concat)(["#", path2.call(print5, "id")]);
56693
56693
  case "Decorator":
56694
- return (0, lines_1.concat)(["@", path2.call(print4, "expression")]);
56694
+ return (0, lines_1.concat)(["@", path2.call(print5, "expression")]);
56695
56695
  case "TupleExpression":
56696
56696
  parts.push("#");
56697
56697
  case "ArrayExpression":
56698
56698
  case "ArrayPattern": {
56699
56699
  var elems = n.elements;
56700
56700
  var len_2 = elems.length;
56701
- var printed_1 = path2.map(print4, "elements");
56701
+ var printed_1 = path2.map(print5, "elements");
56702
56702
  var joined = (0, lines_1.fromString)(", ").join(printed_1);
56703
56703
  var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn;
56704
56704
  if (oneLine_2) {
@@ -56736,12 +56736,12 @@ var require_printer2 = __commonJS({
56736
56736
  parts.push("]");
56737
56737
  }
56738
56738
  if (n.typeAnnotation) {
56739
- parts.push(path2.call(print4, "typeAnnotation"));
56739
+ parts.push(path2.call(print5, "typeAnnotation"));
56740
56740
  }
56741
56741
  return (0, lines_1.concat)(parts);
56742
56742
  }
56743
56743
  case "SequenceExpression":
56744
- return (0, lines_1.fromString)(", ").join(path2.map(print4, "expressions"));
56744
+ return (0, lines_1.fromString)(", ").join(path2.map(print5, "expressions"));
56745
56745
  case "ThisExpression":
56746
56746
  return (0, lines_1.fromString)("this");
56747
56747
  case "Super":
@@ -56762,7 +56762,7 @@ var require_printer2 = __commonJS({
56762
56762
  case "Literal":
56763
56763
  return (0, lines_1.fromString)(getPossibleRaw(n) || (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options);
56764
56764
  case "Directive":
56765
- return path2.call(print4, "value");
56765
+ return path2.call(print5, "value");
56766
56766
  case "DirectiveLiteral":
56767
56767
  return (0, lines_1.fromString)(getPossibleRaw(n) || nodeStr(n.value, options), options);
56768
56768
  case "InterpreterDirective":
@@ -56776,32 +56776,32 @@ var require_printer2 = __commonJS({
56776
56776
  parts.push(n.operator);
56777
56777
  if (/[a-z]$/.test(n.operator))
56778
56778
  parts.push(" ");
56779
- parts.push(path2.call(print4, "argument"));
56779
+ parts.push(path2.call(print5, "argument"));
56780
56780
  return (0, lines_1.concat)(parts);
56781
56781
  case "UpdateExpression":
56782
- parts.push(path2.call(print4, "argument"), n.operator);
56782
+ parts.push(path2.call(print5, "argument"), n.operator);
56783
56783
  if (n.prefix)
56784
56784
  parts.reverse();
56785
56785
  return (0, lines_1.concat)(parts);
56786
56786
  case "ConditionalExpression":
56787
56787
  return (0, lines_1.concat)([
56788
- path2.call(print4, "test"),
56788
+ path2.call(print5, "test"),
56789
56789
  " ? ",
56790
- path2.call(print4, "consequent"),
56790
+ path2.call(print5, "consequent"),
56791
56791
  " : ",
56792
- path2.call(print4, "alternate")
56792
+ path2.call(print5, "alternate")
56793
56793
  ]);
56794
56794
  case "NewExpression": {
56795
- parts.push("new ", path2.call(print4, "callee"));
56795
+ parts.push("new ", path2.call(print5, "callee"));
56796
56796
  if (n.typeParameters) {
56797
- parts.push(path2.call(print4, "typeParameters"));
56797
+ parts.push(path2.call(print5, "typeParameters"));
56798
56798
  }
56799
56799
  if (n.typeArguments) {
56800
- parts.push(path2.call(print4, "typeArguments"));
56800
+ parts.push(path2.call(print5, "typeArguments"));
56801
56801
  }
56802
56802
  var args = n.arguments;
56803
56803
  if (args) {
56804
- parts.push(printArgumentsList(path2, options, print4));
56804
+ parts.push(printArgumentsList(path2, options, print5));
56805
56805
  }
56806
56806
  return (0, lines_1.concat)(parts);
56807
56807
  }
@@ -56812,7 +56812,7 @@ var require_printer2 = __commonJS({
56812
56812
  parts.push(n.kind, " ");
56813
56813
  var maxLen_1 = 0;
56814
56814
  var printed = path2.map(function(childPath) {
56815
- var lines2 = print4(childPath);
56815
+ var lines2 = print5(childPath);
56816
56816
  maxLen_1 = Math.max(lines2.length, maxLen_1);
56817
56817
  return lines2;
56818
56818
  }, "declarations");
@@ -56831,30 +56831,30 @@ var require_printer2 = __commonJS({
56831
56831
  }
56832
56832
  case "VariableDeclarator":
56833
56833
  return n.init ? (0, lines_1.fromString)(" = ").join([
56834
- path2.call(print4, "id"),
56835
- path2.call(print4, "init")
56836
- ]) : path2.call(print4, "id");
56834
+ path2.call(print5, "id"),
56835
+ path2.call(print5, "init")
56836
+ ]) : path2.call(print5, "id");
56837
56837
  case "WithStatement":
56838
56838
  return (0, lines_1.concat)([
56839
56839
  "with (",
56840
- path2.call(print4, "object"),
56840
+ path2.call(print5, "object"),
56841
56841
  ") ",
56842
- path2.call(print4, "body")
56842
+ path2.call(print5, "body")
56843
56843
  ]);
56844
56844
  case "IfStatement": {
56845
- var con = adjustClause(path2.call(print4, "consequent"), options);
56846
- parts.push("if (", path2.call(print4, "test"), ")", con);
56845
+ var con = adjustClause(path2.call(print5, "consequent"), options);
56846
+ parts.push("if (", path2.call(print5, "test"), ")", con);
56847
56847
  if (n.alternate)
56848
- parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(print4, "alternate"), options));
56848
+ parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(print5, "alternate"), options));
56849
56849
  return (0, lines_1.concat)(parts);
56850
56850
  }
56851
56851
  case "ForStatement": {
56852
- var init = path2.call(print4, "init");
56852
+ var init = path2.call(print5, "init");
56853
56853
  var sep2 = init.length > 1 ? ";\n" : "; ";
56854
56854
  var forParen = "for (";
56855
- var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(print4, "test"), path2.call(print4, "update")]).indentTail(forParen.length);
56855
+ var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(print5, "test"), path2.call(print5, "update")]).indentTail(forParen.length);
56856
56856
  var head = (0, lines_1.concat)([forParen, indented, ")"]);
56857
- var clause = adjustClause(path2.call(print4, "body"), options);
56857
+ var clause = adjustClause(path2.call(print5, "body"), options);
56858
56858
  parts.push(head);
56859
56859
  if (head.length > 1) {
56860
56860
  parts.push("\n");
@@ -56866,18 +56866,18 @@ var require_printer2 = __commonJS({
56866
56866
  case "WhileStatement":
56867
56867
  return (0, lines_1.concat)([
56868
56868
  "while (",
56869
- path2.call(print4, "test"),
56869
+ path2.call(print5, "test"),
56870
56870
  ")",
56871
- adjustClause(path2.call(print4, "body"), options)
56871
+ adjustClause(path2.call(print5, "body"), options)
56872
56872
  ]);
56873
56873
  case "ForInStatement":
56874
56874
  return (0, lines_1.concat)([
56875
56875
  n.each ? "for each (" : "for (",
56876
- path2.call(print4, "left"),
56876
+ path2.call(print5, "left"),
56877
56877
  " in ",
56878
- path2.call(print4, "right"),
56878
+ path2.call(print5, "right"),
56879
56879
  ")",
56880
- adjustClause(path2.call(print4, "body"), options)
56880
+ adjustClause(path2.call(print5, "body"), options)
56881
56881
  ]);
56882
56882
  case "ForOfStatement":
56883
56883
  case "ForAwaitStatement":
@@ -56885,122 +56885,122 @@ var require_printer2 = __commonJS({
56885
56885
  if (n.await || n.type === "ForAwaitStatement") {
56886
56886
  parts.push("await ");
56887
56887
  }
56888
- parts.push("(", path2.call(print4, "left"), " of ", path2.call(print4, "right"), ")", adjustClause(path2.call(print4, "body"), options));
56888
+ parts.push("(", path2.call(print5, "left"), " of ", path2.call(print5, "right"), ")", adjustClause(path2.call(print5, "body"), options));
56889
56889
  return (0, lines_1.concat)(parts);
56890
56890
  case "DoWhileStatement": {
56891
56891
  var doBody = (0, lines_1.concat)([
56892
56892
  "do",
56893
- adjustClause(path2.call(print4, "body"), options)
56893
+ adjustClause(path2.call(print5, "body"), options)
56894
56894
  ]);
56895
56895
  parts.push(doBody);
56896
56896
  if (endsWithBrace(doBody))
56897
56897
  parts.push(" while");
56898
56898
  else
56899
56899
  parts.push("\nwhile");
56900
- parts.push(" (", path2.call(print4, "test"), ");");
56900
+ parts.push(" (", path2.call(print5, "test"), ");");
56901
56901
  return (0, lines_1.concat)(parts);
56902
56902
  }
56903
56903
  case "DoExpression": {
56904
56904
  var statements = path2.call(function(bodyPath) {
56905
- return printStatementSequence(bodyPath, options, print4);
56905
+ return printStatementSequence(bodyPath, options, print5);
56906
56906
  }, "body");
56907
56907
  return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]);
56908
56908
  }
56909
56909
  case "BreakStatement":
56910
56910
  parts.push("break");
56911
56911
  if (n.label)
56912
- parts.push(" ", path2.call(print4, "label"));
56912
+ parts.push(" ", path2.call(print5, "label"));
56913
56913
  parts.push(";");
56914
56914
  return (0, lines_1.concat)(parts);
56915
56915
  case "ContinueStatement":
56916
56916
  parts.push("continue");
56917
56917
  if (n.label)
56918
- parts.push(" ", path2.call(print4, "label"));
56918
+ parts.push(" ", path2.call(print5, "label"));
56919
56919
  parts.push(";");
56920
56920
  return (0, lines_1.concat)(parts);
56921
56921
  case "LabeledStatement":
56922
56922
  return (0, lines_1.concat)([
56923
- path2.call(print4, "label"),
56923
+ path2.call(print5, "label"),
56924
56924
  ":\n",
56925
- path2.call(print4, "body")
56925
+ path2.call(print5, "body")
56926
56926
  ]);
56927
56927
  case "TryStatement":
56928
- parts.push("try ", path2.call(print4, "block"));
56928
+ parts.push("try ", path2.call(print5, "block"));
56929
56929
  if (n.handler) {
56930
- parts.push(" ", path2.call(print4, "handler"));
56930
+ parts.push(" ", path2.call(print5, "handler"));
56931
56931
  } else if (n.handlers) {
56932
56932
  path2.each(function(handlerPath) {
56933
- parts.push(" ", print4(handlerPath));
56933
+ parts.push(" ", print5(handlerPath));
56934
56934
  }, "handlers");
56935
56935
  }
56936
56936
  if (n.finalizer) {
56937
- parts.push(" finally ", path2.call(print4, "finalizer"));
56937
+ parts.push(" finally ", path2.call(print5, "finalizer"));
56938
56938
  }
56939
56939
  return (0, lines_1.concat)(parts);
56940
56940
  case "CatchClause":
56941
56941
  parts.push("catch ");
56942
56942
  if (n.param) {
56943
- parts.push("(", path2.call(print4, "param"));
56943
+ parts.push("(", path2.call(print5, "param"));
56944
56944
  }
56945
56945
  if (n.guard) {
56946
- parts.push(" if ", path2.call(print4, "guard"));
56946
+ parts.push(" if ", path2.call(print5, "guard"));
56947
56947
  }
56948
56948
  if (n.param) {
56949
56949
  parts.push(") ");
56950
56950
  }
56951
- parts.push(path2.call(print4, "body"));
56951
+ parts.push(path2.call(print5, "body"));
56952
56952
  return (0, lines_1.concat)(parts);
56953
56953
  case "ThrowStatement":
56954
- return (0, lines_1.concat)(["throw ", path2.call(print4, "argument"), ";"]);
56954
+ return (0, lines_1.concat)(["throw ", path2.call(print5, "argument"), ";"]);
56955
56955
  case "SwitchStatement":
56956
56956
  return (0, lines_1.concat)([
56957
56957
  "switch (",
56958
- path2.call(print4, "discriminant"),
56958
+ path2.call(print5, "discriminant"),
56959
56959
  ") {\n",
56960
- (0, lines_1.fromString)("\n").join(path2.map(print4, "cases")),
56960
+ (0, lines_1.fromString)("\n").join(path2.map(print5, "cases")),
56961
56961
  "\n}"
56962
56962
  ]);
56963
56963
  case "SwitchCase":
56964
56964
  if (n.test)
56965
- parts.push("case ", path2.call(print4, "test"), ":");
56965
+ parts.push("case ", path2.call(print5, "test"), ":");
56966
56966
  else
56967
56967
  parts.push("default:");
56968
56968
  if (n.consequent.length > 0) {
56969
56969
  parts.push("\n", path2.call(function(consequentPath) {
56970
- return printStatementSequence(consequentPath, options, print4);
56970
+ return printStatementSequence(consequentPath, options, print5);
56971
56971
  }, "consequent").indent(options.tabWidth));
56972
56972
  }
56973
56973
  return (0, lines_1.concat)(parts);
56974
56974
  case "DebuggerStatement":
56975
56975
  return (0, lines_1.fromString)("debugger;");
56976
56976
  case "JSXAttribute":
56977
- parts.push(path2.call(print4, "name"));
56977
+ parts.push(path2.call(print5, "name"));
56978
56978
  if (n.value)
56979
- parts.push("=", path2.call(print4, "value"));
56979
+ parts.push("=", path2.call(print5, "value"));
56980
56980
  return (0, lines_1.concat)(parts);
56981
56981
  case "JSXIdentifier":
56982
56982
  return (0, lines_1.fromString)(n.name, options);
56983
56983
  case "JSXNamespacedName":
56984
56984
  return (0, lines_1.fromString)(":").join([
56985
- path2.call(print4, "namespace"),
56986
- path2.call(print4, "name")
56985
+ path2.call(print5, "namespace"),
56986
+ path2.call(print5, "name")
56987
56987
  ]);
56988
56988
  case "JSXMemberExpression":
56989
56989
  return (0, lines_1.fromString)(".").join([
56990
- path2.call(print4, "object"),
56991
- path2.call(print4, "property")
56990
+ path2.call(print5, "object"),
56991
+ path2.call(print5, "property")
56992
56992
  ]);
56993
56993
  case "JSXSpreadAttribute":
56994
- return (0, lines_1.concat)(["{...", path2.call(print4, "argument"), "}"]);
56994
+ return (0, lines_1.concat)(["{...", path2.call(print5, "argument"), "}"]);
56995
56995
  case "JSXSpreadChild":
56996
- return (0, lines_1.concat)(["{...", path2.call(print4, "expression"), "}"]);
56996
+ return (0, lines_1.concat)(["{...", path2.call(print5, "expression"), "}"]);
56997
56997
  case "JSXExpressionContainer":
56998
- return (0, lines_1.concat)(["{", path2.call(print4, "expression"), "}"]);
56998
+ return (0, lines_1.concat)(["{", path2.call(print5, "expression"), "}"]);
56999
56999
  case "JSXElement":
57000
57000
  case "JSXFragment": {
57001
57001
  var openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment");
57002
57002
  var closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment");
57003
- var openingLines = path2.call(print4, openingPropName);
57003
+ var openingLines = path2.call(print5, openingPropName);
57004
57004
  if (n[openingPropName].selfClosing) {
57005
57005
  assert_1.default.ok(!n[closingPropName], "unexpected " + closingPropName + " element in self-closing " + n.type);
57006
57006
  return openingLines;
@@ -57014,16 +57014,16 @@ var require_printer2 = __commonJS({
57014
57014
  return "\n";
57015
57015
  }
57016
57016
  }
57017
- return print4(childPath);
57017
+ return print5(childPath);
57018
57018
  }, "children")).indentTail(options.tabWidth);
57019
- var closingLines = path2.call(print4, closingPropName);
57019
+ var closingLines = path2.call(print5, closingPropName);
57020
57020
  return (0, lines_1.concat)([openingLines, childLines, closingLines]);
57021
57021
  }
57022
57022
  case "JSXOpeningElement": {
57023
- parts.push("<", path2.call(print4, "name"));
57023
+ parts.push("<", path2.call(print5, "name"));
57024
57024
  var attrParts_1 = [];
57025
57025
  path2.each(function(attrPath) {
57026
- attrParts_1.push(" ", print4(attrPath));
57026
+ attrParts_1.push(" ", print5(attrPath));
57027
57027
  }, "attributes");
57028
57028
  var attrLines = (0, lines_1.concat)(attrParts_1);
57029
57029
  var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn;
@@ -57040,7 +57040,7 @@ var require_printer2 = __commonJS({
57040
57040
  return (0, lines_1.concat)(parts);
57041
57041
  }
57042
57042
  case "JSXClosingElement":
57043
- return (0, lines_1.concat)(["</", path2.call(print4, "name"), ">"]);
57043
+ return (0, lines_1.concat)(["</", path2.call(print5, "name"), ">"]);
57044
57044
  case "JSXOpeningFragment":
57045
57045
  return (0, lines_1.fromString)("<>");
57046
57046
  case "JSXClosingFragment":
@@ -57051,9 +57051,9 @@ var require_printer2 = __commonJS({
57051
57051
  return (0, lines_1.fromString)("");
57052
57052
  case "TypeAnnotatedIdentifier":
57053
57053
  return (0, lines_1.concat)([
57054
- path2.call(print4, "annotation"),
57054
+ path2.call(print5, "annotation"),
57055
57055
  " ",
57056
- path2.call(print4, "identifier")
57056
+ path2.call(print5, "identifier")
57057
57057
  ]);
57058
57058
  case "ClassBody":
57059
57059
  if (n.body.length === 0) {
@@ -57062,12 +57062,12 @@ var require_printer2 = __commonJS({
57062
57062
  return (0, lines_1.concat)([
57063
57063
  "{\n",
57064
57064
  path2.call(function(bodyPath) {
57065
- return printStatementSequence(bodyPath, options, print4);
57065
+ return printStatementSequence(bodyPath, options, print5);
57066
57066
  }, "body").indent(options.tabWidth),
57067
57067
  "\n}"
57068
57068
  ]);
57069
57069
  case "ClassPropertyDefinition":
57070
- parts.push("static ", path2.call(print4, "definition"));
57070
+ parts.push("static ", path2.call(print5, "definition"));
57071
57071
  if (!namedTypes.MethodDefinition.check(n.definition))
57072
57072
  parts.push(";");
57073
57073
  return (0, lines_1.concat)(parts);
@@ -57088,12 +57088,12 @@ var require_printer2 = __commonJS({
57088
57088
  if (n.readonly) {
57089
57089
  parts.push("readonly ");
57090
57090
  }
57091
- var key = path2.call(print4, "key");
57091
+ var key = path2.call(print5, "key");
57092
57092
  if (n.computed) {
57093
57093
  key = (0, lines_1.concat)(["[", key, "]"]);
57094
57094
  }
57095
57095
  if (n.variance) {
57096
- key = (0, lines_1.concat)([printVariance(path2, print4), key]);
57096
+ key = (0, lines_1.concat)([printVariance(path2, print5), key]);
57097
57097
  }
57098
57098
  parts.push(key);
57099
57099
  if (n.optional) {
@@ -57103,10 +57103,10 @@ var require_printer2 = __commonJS({
57103
57103
  parts.push("!");
57104
57104
  }
57105
57105
  if (n.typeAnnotation) {
57106
- parts.push(path2.call(print4, "typeAnnotation"));
57106
+ parts.push(path2.call(print5, "typeAnnotation"));
57107
57107
  }
57108
57108
  if (n.value) {
57109
- parts.push(" = ", path2.call(print4, "value"));
57109
+ parts.push(" = ", path2.call(print5, "value"));
57110
57110
  }
57111
57111
  parts.push(";");
57112
57112
  return (0, lines_1.concat)(parts);
@@ -57115,21 +57115,21 @@ var require_printer2 = __commonJS({
57115
57115
  if (n.static) {
57116
57116
  parts.push("static ");
57117
57117
  }
57118
- parts.push(path2.call(print4, "key"));
57118
+ parts.push(path2.call(print5, "key"));
57119
57119
  if (n.typeAnnotation) {
57120
- parts.push(path2.call(print4, "typeAnnotation"));
57120
+ parts.push(path2.call(print5, "typeAnnotation"));
57121
57121
  }
57122
57122
  if (n.value) {
57123
- parts.push(" = ", path2.call(print4, "value"));
57123
+ parts.push(" = ", path2.call(print5, "value"));
57124
57124
  }
57125
57125
  parts.push(";");
57126
57126
  return (0, lines_1.concat)(parts);
57127
57127
  case "ClassAccessorProperty": {
57128
57128
  parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n), false), ["accessor "], false));
57129
57129
  if (n.computed) {
57130
- parts.push("[", path2.call(print4, "key"), "]");
57130
+ parts.push("[", path2.call(print5, "key"), "]");
57131
57131
  } else {
57132
- parts.push(path2.call(print4, "key"));
57132
+ parts.push(path2.call(print5, "key"));
57133
57133
  }
57134
57134
  if (n.optional) {
57135
57135
  parts.push("?");
@@ -57138,10 +57138,10 @@ var require_printer2 = __commonJS({
57138
57138
  parts.push("!");
57139
57139
  }
57140
57140
  if (n.typeAnnotation) {
57141
- parts.push(path2.call(print4, "typeAnnotation"));
57141
+ parts.push(path2.call(print5, "typeAnnotation"));
57142
57142
  }
57143
57143
  if (n.value) {
57144
- parts.push(" = ", path2.call(print4, "value"));
57144
+ parts.push(" = ", path2.call(print5, "value"));
57145
57145
  }
57146
57146
  parts.push(";");
57147
57147
  return (0, lines_1.concat)(parts);
@@ -57157,21 +57157,21 @@ var require_printer2 = __commonJS({
57157
57157
  }
57158
57158
  parts.push("class");
57159
57159
  if (n.id) {
57160
- parts.push(" ", path2.call(print4, "id"));
57160
+ parts.push(" ", path2.call(print5, "id"));
57161
57161
  }
57162
57162
  if (n.typeParameters) {
57163
- parts.push(path2.call(print4, "typeParameters"));
57163
+ parts.push(path2.call(print5, "typeParameters"));
57164
57164
  }
57165
57165
  if (n.superClass) {
57166
- parts.push(" extends ", path2.call(print4, "superClass"), path2.call(print4, "superTypeParameters"));
57166
+ parts.push(" extends ", path2.call(print5, "superClass"), path2.call(print5, "superTypeParameters"));
57167
57167
  }
57168
57168
  if (n.extends && n.extends.length > 0) {
57169
- parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print4, "extends")));
57169
+ parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print5, "extends")));
57170
57170
  }
57171
57171
  if (n["implements"] && n["implements"].length > 0) {
57172
- parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(print4, "implements")));
57172
+ parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(print5, "implements")));
57173
57173
  }
57174
- parts.push(" ", path2.call(print4, "body"));
57174
+ parts.push(" ", path2.call(print5, "body"));
57175
57175
  if (n.type === "DeclareClass") {
57176
57176
  return printFlowDeclaration(path2, parts);
57177
57177
  } else {
@@ -57180,11 +57180,11 @@ var require_printer2 = __commonJS({
57180
57180
  case "TemplateElement":
57181
57181
  return (0, lines_1.fromString)(n.value.raw, options).lockIndentTail();
57182
57182
  case "TemplateLiteral": {
57183
- var expressions_1 = path2.map(print4, "expressions");
57183
+ var expressions_1 = path2.map(print5, "expressions");
57184
57184
  parts.push("`");
57185
57185
  path2.each(function(childPath) {
57186
57186
  var i2 = childPath.getName();
57187
- parts.push(print4(childPath));
57187
+ parts.push(print5(childPath));
57188
57188
  if (i2 < expressions_1.length) {
57189
57189
  parts.push("${", expressions_1[i2], "}");
57190
57190
  }
@@ -57193,7 +57193,7 @@ var require_printer2 = __commonJS({
57193
57193
  return (0, lines_1.concat)(parts).lockIndentTail();
57194
57194
  }
57195
57195
  case "TaggedTemplateExpression":
57196
- return (0, lines_1.concat)([path2.call(print4, "tag"), path2.call(print4, "quasi")]);
57196
+ return (0, lines_1.concat)([path2.call(print5, "tag"), path2.call(print5, "quasi")]);
57197
57197
  case "Node":
57198
57198
  case "Printable":
57199
57199
  case "SourceLocation":
@@ -57227,7 +57227,7 @@ var require_printer2 = __commonJS({
57227
57227
  if (n.typeAnnotation.type !== "FunctionTypeAnnotation") {
57228
57228
  parts.push(": ");
57229
57229
  }
57230
- parts.push(path2.call(print4, "typeAnnotation"));
57230
+ parts.push(path2.call(print5, "typeAnnotation"));
57231
57231
  return (0, lines_1.concat)(parts);
57232
57232
  }
57233
57233
  return (0, lines_1.fromString)("");
@@ -57241,9 +57241,9 @@ var require_printer2 = __commonJS({
57241
57241
  case "MixedTypeAnnotation":
57242
57242
  return (0, lines_1.fromString)("mixed", options);
57243
57243
  case "ArrayTypeAnnotation":
57244
- return (0, lines_1.concat)([path2.call(print4, "elementType"), "[]"]);
57244
+ return (0, lines_1.concat)([path2.call(print5, "elementType"), "[]"]);
57245
57245
  case "TupleTypeAnnotation": {
57246
- var printed_2 = path2.map(print4, "types");
57246
+ var printed_2 = path2.map(print5, "types");
57247
57247
  var joined = (0, lines_1.fromString)(", ").join(printed_2);
57248
57248
  var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn;
57249
57249
  if (oneLine_3) {
@@ -57290,38 +57290,38 @@ var require_printer2 = __commonJS({
57290
57290
  case "InterfaceTypeAnnotation":
57291
57291
  parts.push("interface");
57292
57292
  if (n.extends && n.extends.length > 0) {
57293
- parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print4, "extends")));
57293
+ parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print5, "extends")));
57294
57294
  }
57295
- parts.push(" ", path2.call(print4, "body"));
57295
+ parts.push(" ", path2.call(print5, "body"));
57296
57296
  return (0, lines_1.concat)(parts);
57297
57297
  case "DeclareFunction":
57298
57298
  return printFlowDeclaration(path2, [
57299
57299
  "function ",
57300
- path2.call(print4, "id"),
57300
+ path2.call(print5, "id"),
57301
57301
  ";"
57302
57302
  ]);
57303
57303
  case "DeclareModule":
57304
57304
  return printFlowDeclaration(path2, [
57305
57305
  "module ",
57306
- path2.call(print4, "id"),
57306
+ path2.call(print5, "id"),
57307
57307
  " ",
57308
- path2.call(print4, "body")
57308
+ path2.call(print5, "body")
57309
57309
  ]);
57310
57310
  case "DeclareModuleExports":
57311
57311
  return printFlowDeclaration(path2, [
57312
57312
  "module.exports",
57313
- path2.call(print4, "typeAnnotation")
57313
+ path2.call(print5, "typeAnnotation")
57314
57314
  ]);
57315
57315
  case "DeclareVariable":
57316
- return printFlowDeclaration(path2, ["var ", path2.call(print4, "id"), ";"]);
57316
+ return printFlowDeclaration(path2, ["var ", path2.call(print5, "id"), ";"]);
57317
57317
  case "DeclareExportDeclaration":
57318
57318
  case "DeclareExportAllDeclaration":
57319
- return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options, print4)]);
57319
+ return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options, print5)]);
57320
57320
  case "EnumDeclaration":
57321
57321
  return (0, lines_1.concat)([
57322
57322
  "enum ",
57323
- path2.call(print4, "id"),
57324
- path2.call(print4, "body")
57323
+ path2.call(print5, "id"),
57324
+ path2.call(print5, "body")
57325
57325
  ]);
57326
57326
  case "EnumBooleanBody":
57327
57327
  case "EnumNumberBody":
@@ -57333,24 +57333,24 @@ var require_printer2 = __commonJS({
57333
57333
  n.type.slice(4, -4).toLowerCase()
57334
57334
  );
57335
57335
  }
57336
- parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(print4, "members")).indent(options.tabWidth), "\n}");
57336
+ parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(print5, "members")).indent(options.tabWidth), "\n}");
57337
57337
  return (0, lines_1.concat)(parts);
57338
57338
  }
57339
57339
  case "EnumDefaultedMember":
57340
- return (0, lines_1.concat)([path2.call(print4, "id"), ","]);
57340
+ return (0, lines_1.concat)([path2.call(print5, "id"), ","]);
57341
57341
  case "EnumBooleanMember":
57342
57342
  case "EnumNumberMember":
57343
57343
  case "EnumStringMember":
57344
57344
  return (0, lines_1.concat)([
57345
- path2.call(print4, "id"),
57345
+ path2.call(print5, "id"),
57346
57346
  " = ",
57347
- path2.call(print4, "init"),
57347
+ path2.call(print5, "init"),
57348
57348
  ","
57349
57349
  ]);
57350
57350
  case "InferredPredicate":
57351
57351
  return (0, lines_1.fromString)("%checks", options);
57352
57352
  case "DeclaredPredicate":
57353
- return (0, lines_1.concat)(["%checks(", path2.call(print4, "value"), ")"]);
57353
+ return (0, lines_1.concat)(["%checks(", path2.call(print5, "value"), ")"]);
57354
57354
  case "FunctionTypeAnnotation": {
57355
57355
  var parent = path2.getParentNode(0);
57356
57356
  var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path2.getParentNode(2)));
@@ -57360,14 +57360,14 @@ var require_printer2 = __commonJS({
57360
57360
  }
57361
57361
  var hasTypeParameters = !!n.typeParameters;
57362
57362
  var needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name;
57363
- parts.push(hasTypeParameters ? path2.call(print4, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path2, options, print4), needsParens ? ")" : "");
57363
+ parts.push(hasTypeParameters ? path2.call(print5, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path2, options, print5), needsParens ? ")" : "");
57364
57364
  if (n.returnType) {
57365
- parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(print4, "returnType"));
57365
+ parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(print5, "returnType"));
57366
57366
  }
57367
57367
  return (0, lines_1.concat)(parts);
57368
57368
  }
57369
57369
  case "FunctionTypeParam": {
57370
- var name = path2.call(print4, "name");
57370
+ var name = path2.call(print5, "name");
57371
57371
  parts.push(name);
57372
57372
  if (n.optional) {
57373
57373
  parts.push("?");
@@ -57375,13 +57375,13 @@ var require_printer2 = __commonJS({
57375
57375
  if (name.infos[0].line) {
57376
57376
  parts.push(": ");
57377
57377
  }
57378
- parts.push(path2.call(print4, "typeAnnotation"));
57378
+ parts.push(path2.call(print5, "typeAnnotation"));
57379
57379
  return (0, lines_1.concat)(parts);
57380
57380
  }
57381
57381
  case "GenericTypeAnnotation":
57382
57382
  return (0, lines_1.concat)([
57383
- path2.call(print4, "id"),
57384
- path2.call(print4, "typeParameters")
57383
+ path2.call(print5, "id"),
57384
+ path2.call(print5, "typeParameters")
57385
57385
  ]);
57386
57386
  case "DeclareInterface":
57387
57387
  parts.push("declare ");
@@ -57390,24 +57390,24 @@ var require_printer2 = __commonJS({
57390
57390
  if (n.declare) {
57391
57391
  parts.push("declare ");
57392
57392
  }
57393
- parts.push("interface ", path2.call(print4, "id"), path2.call(print4, "typeParameters"), " ");
57393
+ parts.push("interface ", path2.call(print5, "id"), path2.call(print5, "typeParameters"), " ");
57394
57394
  if (n["extends"] && n["extends"].length > 0) {
57395
- parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(print4, "extends")), " ");
57395
+ parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(print5, "extends")), " ");
57396
57396
  }
57397
57397
  if (n.body) {
57398
- parts.push(path2.call(print4, "body"));
57398
+ parts.push(path2.call(print5, "body"));
57399
57399
  }
57400
57400
  return (0, lines_1.concat)(parts);
57401
57401
  case "ClassImplements":
57402
57402
  case "InterfaceExtends":
57403
57403
  return (0, lines_1.concat)([
57404
- path2.call(print4, "id"),
57405
- path2.call(print4, "typeParameters")
57404
+ path2.call(print5, "id"),
57405
+ path2.call(print5, "typeParameters")
57406
57406
  ]);
57407
57407
  case "IntersectionTypeAnnotation":
57408
- return (0, lines_1.fromString)(" & ").join(path2.map(print4, "types"));
57408
+ return (0, lines_1.fromString)(" & ").join(path2.map(print5, "types"));
57409
57409
  case "NullableTypeAnnotation":
57410
- return (0, lines_1.concat)(["?", path2.call(print4, "typeAnnotation")]);
57410
+ return (0, lines_1.concat)(["?", path2.call(print5, "typeAnnotation")]);
57411
57411
  case "NullLiteralTypeAnnotation":
57412
57412
  return (0, lines_1.fromString)("null", options);
57413
57413
  case "ThisTypeAnnotation":
@@ -57415,40 +57415,40 @@ var require_printer2 = __commonJS({
57415
57415
  case "NumberTypeAnnotation":
57416
57416
  return (0, lines_1.fromString)("number", options);
57417
57417
  case "ObjectTypeCallProperty":
57418
- return path2.call(print4, "value");
57418
+ return path2.call(print5, "value");
57419
57419
  case "ObjectTypeIndexer":
57420
57420
  if (n.static) {
57421
57421
  parts.push("static ");
57422
57422
  }
57423
- parts.push(printVariance(path2, print4), "[");
57423
+ parts.push(printVariance(path2, print5), "[");
57424
57424
  if (n.id) {
57425
- parts.push(path2.call(print4, "id"), ": ");
57425
+ parts.push(path2.call(print5, "id"), ": ");
57426
57426
  }
57427
- parts.push(path2.call(print4, "key"), "]: ", path2.call(print4, "value"));
57427
+ parts.push(path2.call(print5, "key"), "]: ", path2.call(print5, "value"));
57428
57428
  return (0, lines_1.concat)(parts);
57429
57429
  case "ObjectTypeProperty":
57430
57430
  return (0, lines_1.concat)([
57431
- printVariance(path2, print4),
57432
- path2.call(print4, "key"),
57431
+ printVariance(path2, print5),
57432
+ path2.call(print5, "key"),
57433
57433
  n.optional ? "?" : "",
57434
57434
  ": ",
57435
- path2.call(print4, "value")
57435
+ path2.call(print5, "value")
57436
57436
  ]);
57437
57437
  case "ObjectTypeInternalSlot":
57438
57438
  return (0, lines_1.concat)([
57439
57439
  n.static ? "static " : "",
57440
57440
  "[[",
57441
- path2.call(print4, "id"),
57441
+ path2.call(print5, "id"),
57442
57442
  "]]",
57443
57443
  n.optional ? "?" : "",
57444
57444
  n.value.type !== "FunctionTypeAnnotation" ? ": " : "",
57445
- path2.call(print4, "value")
57445
+ path2.call(print5, "value")
57446
57446
  ]);
57447
57447
  case "QualifiedTypeIdentifier":
57448
57448
  return (0, lines_1.concat)([
57449
- path2.call(print4, "qualification"),
57449
+ path2.call(print5, "qualification"),
57450
57450
  ".",
57451
- path2.call(print4, "id")
57451
+ path2.call(print5, "id")
57452
57452
  ]);
57453
57453
  case "StringLiteralTypeAnnotation":
57454
57454
  return (0, lines_1.fromString)(nodeStr(n.value, options), options);
@@ -57465,36 +57465,36 @@ var require_printer2 = __commonJS({
57465
57465
  case "TypeAlias":
57466
57466
  return (0, lines_1.concat)([
57467
57467
  "type ",
57468
- path2.call(print4, "id"),
57469
- path2.call(print4, "typeParameters"),
57468
+ path2.call(print5, "id"),
57469
+ path2.call(print5, "typeParameters"),
57470
57470
  " = ",
57471
- path2.call(print4, "right"),
57471
+ path2.call(print5, "right"),
57472
57472
  ";"
57473
57473
  ]);
57474
57474
  case "DeclareOpaqueType":
57475
57475
  parts.push("declare ");
57476
57476
  case "OpaqueType":
57477
- parts.push("opaque type ", path2.call(print4, "id"), path2.call(print4, "typeParameters"));
57477
+ parts.push("opaque type ", path2.call(print5, "id"), path2.call(print5, "typeParameters"));
57478
57478
  if (n["supertype"]) {
57479
- parts.push(": ", path2.call(print4, "supertype"));
57479
+ parts.push(": ", path2.call(print5, "supertype"));
57480
57480
  }
57481
57481
  if (n["impltype"]) {
57482
- parts.push(" = ", path2.call(print4, "impltype"));
57482
+ parts.push(" = ", path2.call(print5, "impltype"));
57483
57483
  }
57484
57484
  parts.push(";");
57485
57485
  return (0, lines_1.concat)(parts);
57486
57486
  case "TypeCastExpression":
57487
57487
  return (0, lines_1.concat)([
57488
57488
  "(",
57489
- path2.call(print4, "expression"),
57490
- path2.call(print4, "typeAnnotation"),
57489
+ path2.call(print5, "expression"),
57490
+ path2.call(print5, "typeAnnotation"),
57491
57491
  ")"
57492
57492
  ]);
57493
57493
  case "TypeParameterDeclaration":
57494
57494
  case "TypeParameterInstantiation":
57495
57495
  return (0, lines_1.concat)([
57496
57496
  "<",
57497
- (0, lines_1.fromString)(", ").join(path2.map(print4, "params")),
57497
+ (0, lines_1.fromString)(", ").join(path2.map(print5, "params")),
57498
57498
  ">"
57499
57499
  ]);
57500
57500
  case "Variance":
@@ -57507,32 +57507,32 @@ var require_printer2 = __commonJS({
57507
57507
  return (0, lines_1.fromString)("");
57508
57508
  case "TypeParameter":
57509
57509
  if (n.variance) {
57510
- parts.push(printVariance(path2, print4));
57510
+ parts.push(printVariance(path2, print5));
57511
57511
  }
57512
- parts.push(path2.call(print4, "name"));
57512
+ parts.push(path2.call(print5, "name"));
57513
57513
  if (n.bound) {
57514
- parts.push(path2.call(print4, "bound"));
57514
+ parts.push(path2.call(print5, "bound"));
57515
57515
  }
57516
57516
  if (n["default"]) {
57517
- parts.push("=", path2.call(print4, "default"));
57517
+ parts.push("=", path2.call(print5, "default"));
57518
57518
  }
57519
57519
  return (0, lines_1.concat)(parts);
57520
57520
  case "TypeofTypeAnnotation":
57521
57521
  return (0, lines_1.concat)([
57522
57522
  (0, lines_1.fromString)("typeof ", options),
57523
- path2.call(print4, "argument")
57523
+ path2.call(print5, "argument")
57524
57524
  ]);
57525
57525
  case "IndexedAccessType":
57526
57526
  case "OptionalIndexedAccessType":
57527
57527
  return (0, lines_1.concat)([
57528
- path2.call(print4, "objectType"),
57528
+ path2.call(print5, "objectType"),
57529
57529
  n.optional ? "?." : "",
57530
57530
  "[",
57531
- path2.call(print4, "indexType"),
57531
+ path2.call(print5, "indexType"),
57532
57532
  "]"
57533
57533
  ]);
57534
57534
  case "UnionTypeAnnotation":
57535
- return (0, lines_1.fromString)(" | ").join(path2.map(print4, "types"));
57535
+ return (0, lines_1.fromString)(" | ").join(path2.map(print5, "types"));
57536
57536
  case "VoidTypeAnnotation":
57537
57537
  return (0, lines_1.fromString)("void", options);
57538
57538
  case "NullTypeAnnotation":
@@ -57572,77 +57572,77 @@ var require_printer2 = __commonJS({
57572
57572
  case "TSNeverKeyword":
57573
57573
  return (0, lines_1.fromString)("never", options);
57574
57574
  case "TSArrayType":
57575
- return (0, lines_1.concat)([path2.call(print4, "elementType"), "[]"]);
57575
+ return (0, lines_1.concat)([path2.call(print5, "elementType"), "[]"]);
57576
57576
  case "TSLiteralType":
57577
- return path2.call(print4, "literal");
57577
+ return path2.call(print5, "literal");
57578
57578
  case "TSUnionType":
57579
- return (0, lines_1.fromString)(" | ").join(path2.map(print4, "types"));
57579
+ return (0, lines_1.fromString)(" | ").join(path2.map(print5, "types"));
57580
57580
  case "TSIntersectionType":
57581
- return (0, lines_1.fromString)(" & ").join(path2.map(print4, "types"));
57581
+ return (0, lines_1.fromString)(" & ").join(path2.map(print5, "types"));
57582
57582
  case "TSConditionalType":
57583
- parts.push(path2.call(print4, "checkType"), " extends ", path2.call(print4, "extendsType"), " ? ", path2.call(print4, "trueType"), " : ", path2.call(print4, "falseType"));
57583
+ parts.push(path2.call(print5, "checkType"), " extends ", path2.call(print5, "extendsType"), " ? ", path2.call(print5, "trueType"), " : ", path2.call(print5, "falseType"));
57584
57584
  return (0, lines_1.concat)(parts);
57585
57585
  case "TSInferType":
57586
- parts.push("infer ", path2.call(print4, "typeParameter"));
57586
+ parts.push("infer ", path2.call(print5, "typeParameter"));
57587
57587
  return (0, lines_1.concat)(parts);
57588
57588
  case "TSParenthesizedType":
57589
- return (0, lines_1.concat)(["(", path2.call(print4, "typeAnnotation"), ")"]);
57589
+ return (0, lines_1.concat)(["(", path2.call(print5, "typeAnnotation"), ")"]);
57590
57590
  case "TSFunctionType":
57591
57591
  return (0, lines_1.concat)([
57592
- path2.call(print4, "typeParameters"),
57592
+ path2.call(print5, "typeParameters"),
57593
57593
  "(",
57594
- printFunctionParams(path2, options, print4),
57594
+ printFunctionParams(path2, options, print5),
57595
57595
  ") => ",
57596
- path2.call(print4, "typeAnnotation", "typeAnnotation")
57596
+ path2.call(print5, "typeAnnotation", "typeAnnotation")
57597
57597
  ]);
57598
57598
  case "TSConstructorType":
57599
57599
  return (0, lines_1.concat)([
57600
57600
  "new ",
57601
- path2.call(print4, "typeParameters"),
57601
+ path2.call(print5, "typeParameters"),
57602
57602
  "(",
57603
- printFunctionParams(path2, options, print4),
57603
+ printFunctionParams(path2, options, print5),
57604
57604
  ") => ",
57605
- path2.call(print4, "typeAnnotation", "typeAnnotation")
57605
+ path2.call(print5, "typeAnnotation", "typeAnnotation")
57606
57606
  ]);
57607
57607
  case "TSMappedType": {
57608
- parts.push(n.readonly ? "readonly " : "", "[", path2.call(print4, "typeParameter"), "]", n.optional ? "?" : "");
57608
+ parts.push(n.readonly ? "readonly " : "", "[", path2.call(print5, "typeParameter"), "]", n.optional ? "?" : "");
57609
57609
  if (n.typeAnnotation) {
57610
- parts.push(": ", path2.call(print4, "typeAnnotation"), ";");
57610
+ parts.push(": ", path2.call(print5, "typeAnnotation"), ";");
57611
57611
  }
57612
57612
  return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]);
57613
57613
  }
57614
57614
  case "TSTupleType":
57615
57615
  return (0, lines_1.concat)([
57616
57616
  "[",
57617
- (0, lines_1.fromString)(", ").join(path2.map(print4, "elementTypes")),
57617
+ (0, lines_1.fromString)(", ").join(path2.map(print5, "elementTypes")),
57618
57618
  "]"
57619
57619
  ]);
57620
57620
  case "TSNamedTupleMember":
57621
- parts.push(path2.call(print4, "label"));
57621
+ parts.push(path2.call(print5, "label"));
57622
57622
  if (n.optional) {
57623
57623
  parts.push("?");
57624
57624
  }
57625
- parts.push(": ", path2.call(print4, "elementType"));
57625
+ parts.push(": ", path2.call(print5, "elementType"));
57626
57626
  return (0, lines_1.concat)(parts);
57627
57627
  case "TSRestType":
57628
- return (0, lines_1.concat)(["...", path2.call(print4, "typeAnnotation")]);
57628
+ return (0, lines_1.concat)(["...", path2.call(print5, "typeAnnotation")]);
57629
57629
  case "TSOptionalType":
57630
- return (0, lines_1.concat)([path2.call(print4, "typeAnnotation"), "?"]);
57630
+ return (0, lines_1.concat)([path2.call(print5, "typeAnnotation"), "?"]);
57631
57631
  case "TSIndexedAccessType":
57632
57632
  return (0, lines_1.concat)([
57633
- path2.call(print4, "objectType"),
57633
+ path2.call(print5, "objectType"),
57634
57634
  "[",
57635
- path2.call(print4, "indexType"),
57635
+ path2.call(print5, "indexType"),
57636
57636
  "]"
57637
57637
  ]);
57638
57638
  case "TSTypeOperator":
57639
57639
  return (0, lines_1.concat)([
57640
- path2.call(print4, "operator"),
57640
+ path2.call(print5, "operator"),
57641
57641
  " ",
57642
- path2.call(print4, "typeAnnotation")
57642
+ path2.call(print5, "typeAnnotation")
57643
57643
  ]);
57644
57644
  case "TSTypeLiteral": {
57645
- var members = (0, lines_1.fromString)("\n").join(path2.map(print4, "members").map(function(member) {
57645
+ var members = (0, lines_1.fromString)("\n").join(path2.map(print5, "members").map(function(member) {
57646
57646
  if (lastNonSpaceCharacter(member) !== ";") {
57647
57647
  return member.concat(";");
57648
57648
  }
@@ -57655,13 +57655,13 @@ var require_printer2 = __commonJS({
57655
57655
  return (0, lines_1.concat)(parts);
57656
57656
  }
57657
57657
  case "TSEnumMember":
57658
- parts.push(path2.call(print4, "id"));
57658
+ parts.push(path2.call(print5, "id"));
57659
57659
  if (n.initializer) {
57660
- parts.push(" = ", path2.call(print4, "initializer"));
57660
+ parts.push(" = ", path2.call(print5, "initializer"));
57661
57661
  }
57662
57662
  return (0, lines_1.concat)(parts);
57663
57663
  case "TSTypeQuery":
57664
- return (0, lines_1.concat)(["typeof ", path2.call(print4, "exprName")]);
57664
+ return (0, lines_1.concat)(["typeof ", path2.call(print5, "exprName")]);
57665
57665
  case "TSParameterProperty":
57666
57666
  if (n.accessibility) {
57667
57667
  parts.push(n.accessibility, " ");
@@ -57675,119 +57675,119 @@ var require_printer2 = __commonJS({
57675
57675
  if (n.readonly) {
57676
57676
  parts.push("readonly ");
57677
57677
  }
57678
- parts.push(path2.call(print4, "parameter"));
57678
+ parts.push(path2.call(print5, "parameter"));
57679
57679
  return (0, lines_1.concat)(parts);
57680
57680
  case "TSTypeReference":
57681
57681
  return (0, lines_1.concat)([
57682
- path2.call(print4, "typeName"),
57683
- path2.call(print4, "typeParameters")
57682
+ path2.call(print5, "typeName"),
57683
+ path2.call(print5, "typeParameters")
57684
57684
  ]);
57685
57685
  case "TSQualifiedName":
57686
- return (0, lines_1.concat)([path2.call(print4, "left"), ".", path2.call(print4, "right")]);
57686
+ return (0, lines_1.concat)([path2.call(print5, "left"), ".", path2.call(print5, "right")]);
57687
57687
  case "TSAsExpression":
57688
57688
  case "TSSatisfiesExpression": {
57689
- var expression = path2.call(print4, "expression");
57690
- parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(print4, "typeAnnotation"));
57689
+ var expression = path2.call(print5, "expression");
57690
+ parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(print5, "typeAnnotation"));
57691
57691
  return (0, lines_1.concat)(parts);
57692
57692
  }
57693
57693
  case "TSTypeCastExpression":
57694
57694
  return (0, lines_1.concat)([
57695
- path2.call(print4, "expression"),
57696
- path2.call(print4, "typeAnnotation")
57695
+ path2.call(print5, "expression"),
57696
+ path2.call(print5, "typeAnnotation")
57697
57697
  ]);
57698
57698
  case "TSNonNullExpression":
57699
- return (0, lines_1.concat)([path2.call(print4, "expression"), "!"]);
57699
+ return (0, lines_1.concat)([path2.call(print5, "expression"), "!"]);
57700
57700
  case "TSTypeAnnotation":
57701
- return (0, lines_1.concat)([": ", path2.call(print4, "typeAnnotation")]);
57701
+ return (0, lines_1.concat)([": ", path2.call(print5, "typeAnnotation")]);
57702
57702
  case "TSIndexSignature":
57703
57703
  return (0, lines_1.concat)([
57704
57704
  n.readonly ? "readonly " : "",
57705
57705
  "[",
57706
- path2.map(print4, "parameters"),
57706
+ path2.map(print5, "parameters"),
57707
57707
  "]",
57708
- path2.call(print4, "typeAnnotation")
57708
+ path2.call(print5, "typeAnnotation")
57709
57709
  ]);
57710
57710
  case "TSPropertySignature":
57711
- parts.push(printVariance(path2, print4), n.readonly ? "readonly " : "");
57711
+ parts.push(printVariance(path2, print5), n.readonly ? "readonly " : "");
57712
57712
  if (n.computed) {
57713
- parts.push("[", path2.call(print4, "key"), "]");
57713
+ parts.push("[", path2.call(print5, "key"), "]");
57714
57714
  } else {
57715
- parts.push(path2.call(print4, "key"));
57715
+ parts.push(path2.call(print5, "key"));
57716
57716
  }
57717
- parts.push(n.optional ? "?" : "", path2.call(print4, "typeAnnotation"));
57717
+ parts.push(n.optional ? "?" : "", path2.call(print5, "typeAnnotation"));
57718
57718
  return (0, lines_1.concat)(parts);
57719
57719
  case "TSMethodSignature":
57720
57720
  if (n.computed) {
57721
- parts.push("[", path2.call(print4, "key"), "]");
57721
+ parts.push("[", path2.call(print5, "key"), "]");
57722
57722
  } else {
57723
- parts.push(path2.call(print4, "key"));
57723
+ parts.push(path2.call(print5, "key"));
57724
57724
  }
57725
57725
  if (n.optional) {
57726
57726
  parts.push("?");
57727
57727
  }
57728
- parts.push(path2.call(print4, "typeParameters"), "(", printFunctionParams(path2, options, print4), ")", path2.call(print4, "typeAnnotation"));
57728
+ parts.push(path2.call(print5, "typeParameters"), "(", printFunctionParams(path2, options, print5), ")", path2.call(print5, "typeAnnotation"));
57729
57729
  return (0, lines_1.concat)(parts);
57730
57730
  case "TSTypePredicate":
57731
57731
  if (n.asserts) {
57732
57732
  parts.push("asserts ");
57733
57733
  }
57734
- parts.push(path2.call(print4, "parameterName"));
57734
+ parts.push(path2.call(print5, "parameterName"));
57735
57735
  if (n.typeAnnotation) {
57736
- parts.push(" is ", path2.call(print4, "typeAnnotation", "typeAnnotation"));
57736
+ parts.push(" is ", path2.call(print5, "typeAnnotation", "typeAnnotation"));
57737
57737
  }
57738
57738
  return (0, lines_1.concat)(parts);
57739
57739
  case "TSCallSignatureDeclaration":
57740
57740
  return (0, lines_1.concat)([
57741
- path2.call(print4, "typeParameters"),
57741
+ path2.call(print5, "typeParameters"),
57742
57742
  "(",
57743
- printFunctionParams(path2, options, print4),
57743
+ printFunctionParams(path2, options, print5),
57744
57744
  ")",
57745
- path2.call(print4, "typeAnnotation")
57745
+ path2.call(print5, "typeAnnotation")
57746
57746
  ]);
57747
57747
  case "TSConstructSignatureDeclaration":
57748
57748
  if (n.typeParameters) {
57749
- parts.push("new", path2.call(print4, "typeParameters"));
57749
+ parts.push("new", path2.call(print5, "typeParameters"));
57750
57750
  } else {
57751
57751
  parts.push("new ");
57752
57752
  }
57753
- parts.push("(", printFunctionParams(path2, options, print4), ")", path2.call(print4, "typeAnnotation"));
57753
+ parts.push("(", printFunctionParams(path2, options, print5), ")", path2.call(print5, "typeAnnotation"));
57754
57754
  return (0, lines_1.concat)(parts);
57755
57755
  case "TSTypeAliasDeclaration":
57756
57756
  return (0, lines_1.concat)([
57757
57757
  n.declare ? "declare " : "",
57758
57758
  "type ",
57759
- path2.call(print4, "id"),
57760
- path2.call(print4, "typeParameters"),
57759
+ path2.call(print5, "id"),
57760
+ path2.call(print5, "typeParameters"),
57761
57761
  " = ",
57762
- path2.call(print4, "typeAnnotation"),
57762
+ path2.call(print5, "typeAnnotation"),
57763
57763
  ";"
57764
57764
  ]);
57765
57765
  case "TSTypeParameter": {
57766
- parts.push(path2.call(print4, "name"));
57766
+ parts.push(path2.call(print5, "name"));
57767
57767
  var parent = path2.getParentNode(0);
57768
57768
  var isInMappedType = namedTypes.TSMappedType.check(parent);
57769
57769
  if (n.constraint) {
57770
- parts.push(isInMappedType ? " in " : " extends ", path2.call(print4, "constraint"));
57770
+ parts.push(isInMappedType ? " in " : " extends ", path2.call(print5, "constraint"));
57771
57771
  }
57772
57772
  if (n["default"]) {
57773
- parts.push(" = ", path2.call(print4, "default"));
57773
+ parts.push(" = ", path2.call(print5, "default"));
57774
57774
  }
57775
57775
  return (0, lines_1.concat)(parts);
57776
57776
  }
57777
57777
  case "TSTypeAssertion": {
57778
- parts.push("<", path2.call(print4, "typeAnnotation"), "> ", path2.call(print4, "expression"));
57778
+ parts.push("<", path2.call(print5, "typeAnnotation"), "> ", path2.call(print5, "expression"));
57779
57779
  return (0, lines_1.concat)(parts);
57780
57780
  }
57781
57781
  case "TSTypeParameterDeclaration":
57782
57782
  case "TSTypeParameterInstantiation":
57783
57783
  return (0, lines_1.concat)([
57784
57784
  "<",
57785
- (0, lines_1.fromString)(", ").join(path2.map(print4, "params")),
57785
+ (0, lines_1.fromString)(", ").join(path2.map(print5, "params")),
57786
57786
  ">"
57787
57787
  ]);
57788
57788
  case "TSEnumDeclaration": {
57789
- parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(print4, "id"));
57790
- var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(print4, "members"));
57789
+ parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(print5, "id"));
57790
+ var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(print5, "members"));
57791
57791
  if (memberLines.isEmpty()) {
57792
57792
  parts.push(" {}");
57793
57793
  } else {
@@ -57797,11 +57797,11 @@ var require_printer2 = __commonJS({
57797
57797
  }
57798
57798
  case "TSExpressionWithTypeArguments":
57799
57799
  return (0, lines_1.concat)([
57800
- path2.call(print4, "expression"),
57801
- path2.call(print4, "typeParameters")
57800
+ path2.call(print5, "expression"),
57801
+ path2.call(print5, "typeParameters")
57802
57802
  ]);
57803
57803
  case "TSInterfaceBody": {
57804
- var lines = (0, lines_1.fromString)("\n").join(path2.map(print4, "body").map(function(element) {
57804
+ var lines = (0, lines_1.fromString)("\n").join(path2.map(print5, "body").map(function(element) {
57805
57805
  if (lastNonSpaceCharacter(element) !== ";") {
57806
57806
  return element.concat(";");
57807
57807
  }
@@ -57813,22 +57813,22 @@ var require_printer2 = __commonJS({
57813
57813
  return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]);
57814
57814
  }
57815
57815
  case "TSImportType":
57816
- parts.push("import(", path2.call(print4, "argument"), ")");
57816
+ parts.push("import(", path2.call(print5, "argument"), ")");
57817
57817
  if (n.qualifier) {
57818
- parts.push(".", path2.call(print4, "qualifier"));
57818
+ parts.push(".", path2.call(print5, "qualifier"));
57819
57819
  }
57820
57820
  if (n.typeParameters) {
57821
- parts.push(path2.call(print4, "typeParameters"));
57821
+ parts.push(path2.call(print5, "typeParameters"));
57822
57822
  }
57823
57823
  return (0, lines_1.concat)(parts);
57824
57824
  case "TSImportEqualsDeclaration":
57825
57825
  if (n.isExport) {
57826
57826
  parts.push("export ");
57827
57827
  }
57828
- parts.push("import ", path2.call(print4, "id"), " = ", path2.call(print4, "moduleReference"));
57828
+ parts.push("import ", path2.call(print5, "id"), " = ", path2.call(print5, "moduleReference"));
57829
57829
  return maybeAddSemicolon((0, lines_1.concat)(parts));
57830
57830
  case "TSExternalModuleReference":
57831
- return (0, lines_1.concat)(["require(", path2.call(print4, "expression"), ")"]);
57831
+ return (0, lines_1.concat)(["require(", path2.call(print5, "expression"), ")"]);
57832
57832
  case "TSModuleDeclaration": {
57833
57833
  var parent = path2.getParentNode();
57834
57834
  if (parent.type === "TSModuleDeclaration") {
@@ -57853,16 +57853,16 @@ var require_printer2 = __commonJS({
57853
57853
  }
57854
57854
  }
57855
57855
  }
57856
- parts.push(path2.call(print4, "id"));
57856
+ parts.push(path2.call(print5, "id"));
57857
57857
  if (n.body) {
57858
57858
  parts.push(" ");
57859
- parts.push(path2.call(print4, "body"));
57859
+ parts.push(path2.call(print5, "body"));
57860
57860
  }
57861
57861
  return (0, lines_1.concat)(parts);
57862
57862
  }
57863
57863
  case "TSModuleBlock": {
57864
57864
  var naked = path2.call(function(bodyPath) {
57865
- return printStatementSequence(bodyPath, options, print4);
57865
+ return printStatementSequence(bodyPath, options, print5);
57866
57866
  }, "body");
57867
57867
  if (naked.isEmpty()) {
57868
57868
  parts.push("{}");
@@ -57872,11 +57872,11 @@ var require_printer2 = __commonJS({
57872
57872
  return (0, lines_1.concat)(parts);
57873
57873
  }
57874
57874
  case "TSInstantiationExpression": {
57875
- parts.push(path2.call(print4, "expression"), path2.call(print4, "typeParameters"));
57875
+ parts.push(path2.call(print5, "expression"), path2.call(print5, "typeParameters"));
57876
57876
  return (0, lines_1.concat)(parts);
57877
57877
  }
57878
57878
  case "V8IntrinsicIdentifier":
57879
- return (0, lines_1.concat)(["%", path2.call(print4, "name")]);
57879
+ return (0, lines_1.concat)(["%", path2.call(print5, "name")]);
57880
57880
  case "TopicReference":
57881
57881
  return (0, lines_1.fromString)("#");
57882
57882
  case "ClassHeritage":
@@ -57926,7 +57926,7 @@ var require_printer2 = __commonJS({
57926
57926
  }
57927
57927
  return (0, lines_1.concat)(parts);
57928
57928
  }
57929
- function printStatementSequence(path2, options, print4) {
57929
+ function printStatementSequence(path2, options, print5) {
57930
57930
  var filtered = [];
57931
57931
  var sawComment = false;
57932
57932
  var sawStatement = false;
@@ -57947,7 +57947,7 @@ var require_printer2 = __commonJS({
57947
57947
  }
57948
57948
  filtered.push({
57949
57949
  node: stmt,
57950
- printed: print4(stmtPath)
57950
+ printed: print5(stmtPath)
57951
57951
  });
57952
57952
  });
57953
57953
  if (sawComment) {
@@ -58039,7 +58039,7 @@ var require_printer2 = __commonJS({
58039
58039
  }
58040
58040
  return parts;
58041
58041
  }
58042
- function printMethod(path2, options, print4) {
58042
+ function printMethod(path2, options, print5) {
58043
58043
  var node = path2.getNode();
58044
58044
  var kind = node.kind;
58045
58045
  var parts = [];
@@ -58057,7 +58057,7 @@ var require_printer2 = __commonJS({
58057
58057
  if (kind === "get" || kind === "set") {
58058
58058
  parts.push(kind, " ");
58059
58059
  }
58060
- var key = path2.call(print4, "key");
58060
+ var key = path2.call(print5, "key");
58061
58061
  if (node.computed) {
58062
58062
  key = (0, lines_1.concat)(["[", key, "]"]);
58063
58063
  }
@@ -58066,26 +58066,26 @@ var require_printer2 = __commonJS({
58066
58066
  parts.push("?");
58067
58067
  }
58068
58068
  if (node === nodeValue) {
58069
- parts.push(path2.call(print4, "typeParameters"), "(", printFunctionParams(path2, options, print4), ")", path2.call(print4, "returnType"));
58069
+ parts.push(path2.call(print5, "typeParameters"), "(", printFunctionParams(path2, options, print5), ")", path2.call(print5, "returnType"));
58070
58070
  if (node.body) {
58071
- parts.push(" ", path2.call(print4, "body"));
58071
+ parts.push(" ", path2.call(print5, "body"));
58072
58072
  } else {
58073
58073
  parts.push(";");
58074
58074
  }
58075
58075
  } else {
58076
- parts.push(path2.call(print4, "value", "typeParameters"), "(", path2.call(function(valuePath) {
58077
- return printFunctionParams(valuePath, options, print4);
58078
- }, "value"), ")", path2.call(print4, "value", "returnType"));
58076
+ parts.push(path2.call(print5, "value", "typeParameters"), "(", path2.call(function(valuePath) {
58077
+ return printFunctionParams(valuePath, options, print5);
58078
+ }, "value"), ")", path2.call(print5, "value", "returnType"));
58079
58079
  if (nodeValue.body) {
58080
- parts.push(" ", path2.call(print4, "value", "body"));
58080
+ parts.push(" ", path2.call(print5, "value", "body"));
58081
58081
  } else {
58082
58082
  parts.push(";");
58083
58083
  }
58084
58084
  }
58085
58085
  return (0, lines_1.concat)(parts);
58086
58086
  }
58087
- function printArgumentsList(path2, options, print4) {
58088
- var printed = path2.map(print4, "arguments");
58087
+ function printArgumentsList(path2, options, print5) {
58088
+ var printed = path2.map(print5, "arguments");
58089
58089
  var trailingComma = util.isTrailingCommaEnabled(options, "parameters");
58090
58090
  var joined = (0, lines_1.fromString)(", ").join(printed);
58091
58091
  if (joined.getLineLength(1) > options.wrapColumn) {
@@ -58098,28 +58098,28 @@ var require_printer2 = __commonJS({
58098
58098
  }
58099
58099
  return (0, lines_1.concat)(["(", joined, ")"]);
58100
58100
  }
58101
- function printFunctionParams(path2, options, print4) {
58101
+ function printFunctionParams(path2, options, print5) {
58102
58102
  var fun = path2.getValue();
58103
58103
  var params;
58104
58104
  var printed = [];
58105
58105
  if (fun.params) {
58106
58106
  params = fun.params;
58107
- printed = path2.map(print4, "params");
58107
+ printed = path2.map(print5, "params");
58108
58108
  } else if (fun.parameters) {
58109
58109
  params = fun.parameters;
58110
- printed = path2.map(print4, "parameters");
58110
+ printed = path2.map(print5, "parameters");
58111
58111
  }
58112
58112
  if (fun.defaults) {
58113
58113
  path2.each(function(defExprPath) {
58114
58114
  var i2 = defExprPath.getName();
58115
58115
  var p = printed[i2];
58116
58116
  if (p && defExprPath.getValue()) {
58117
- printed[i2] = (0, lines_1.concat)([p, " = ", print4(defExprPath)]);
58117
+ printed[i2] = (0, lines_1.concat)([p, " = ", print5(defExprPath)]);
58118
58118
  }
58119
58119
  }, "defaults");
58120
58120
  }
58121
58121
  if (fun.rest) {
58122
- printed.push((0, lines_1.concat)(["...", path2.call(print4, "rest")]));
58122
+ printed.push((0, lines_1.concat)(["...", path2.call(print5, "rest")]));
58123
58123
  }
58124
58124
  var joined = (0, lines_1.fromString)(", ").join(printed);
58125
58125
  if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) {
@@ -58133,11 +58133,11 @@ var require_printer2 = __commonJS({
58133
58133
  }
58134
58134
  return joined;
58135
58135
  }
58136
- function maybePrintImportAssertions(path2, options, print4) {
58136
+ function maybePrintImportAssertions(path2, options, print5) {
58137
58137
  var n = path2.getValue();
58138
58138
  if (n.assertions && n.assertions.length > 0) {
58139
58139
  var parts = [" assert {"];
58140
- var printed = path2.map(print4, "assertions");
58140
+ var printed = path2.map(print5, "assertions");
58141
58141
  var flat = (0, lines_1.fromString)(", ").join(printed);
58142
58142
  if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) {
58143
58143
  parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}");
@@ -58148,7 +58148,7 @@ var require_printer2 = __commonJS({
58148
58148
  }
58149
58149
  return (0, lines_1.fromString)("");
58150
58150
  }
58151
- function printExportDeclaration(path2, options, print4) {
58151
+ function printExportDeclaration(path2, options, print5) {
58152
58152
  var decl = path2.getValue();
58153
58153
  var parts = ["export "];
58154
58154
  if (decl.exportKind && decl.exportKind === "type") {
@@ -58162,7 +58162,7 @@ var require_printer2 = __commonJS({
58162
58162
  parts.push("default ");
58163
58163
  }
58164
58164
  if (decl.declaration) {
58165
- parts.push(path2.call(print4, "declaration"));
58165
+ parts.push(path2.call(print5, "declaration"));
58166
58166
  } else if (decl.specifiers) {
58167
58167
  if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") {
58168
58168
  parts.push("*");
@@ -58174,9 +58174,9 @@ var require_printer2 = __commonJS({
58174
58174
  path2.each(function(specifierPath) {
58175
58175
  var spec = specifierPath.getValue();
58176
58176
  if (spec.type === "ExportDefaultSpecifier") {
58177
- unbracedSpecifiers_2.push(print4(specifierPath));
58177
+ unbracedSpecifiers_2.push(print5(specifierPath));
58178
58178
  } else {
58179
- bracedSpecifiers_2.push(print4(specifierPath));
58179
+ bracedSpecifiers_2.push(print5(specifierPath));
58180
58180
  }
58181
58181
  }, "specifiers");
58182
58182
  unbracedSpecifiers_2.forEach(function(lines2, i2) {
@@ -58205,10 +58205,10 @@ var require_printer2 = __commonJS({
58205
58205
  }
58206
58206
  }
58207
58207
  } else {
58208
- parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(print4, "specifiers")), shouldPrintSpaces ? " }" : "}");
58208
+ parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(print5, "specifiers")), shouldPrintSpaces ? " }" : "}");
58209
58209
  }
58210
58210
  if (decl.source) {
58211
- parts.push(" from ", path2.call(print4, "source"), maybePrintImportAssertions(path2, options, print4));
58211
+ parts.push(" from ", path2.call(print5, "source"), maybePrintImportAssertions(path2, options, print5));
58212
58212
  }
58213
58213
  }
58214
58214
  var lines = (0, lines_1.concat)(parts);
@@ -58226,7 +58226,7 @@ var require_printer2 = __commonJS({
58226
58226
  }
58227
58227
  return (0, lines_1.concat)(parts);
58228
58228
  }
58229
- function printVariance(path2, print4) {
58229
+ function printVariance(path2, print5) {
58230
58230
  return path2.call(function(variancePath) {
58231
58231
  var value = variancePath.getValue();
58232
58232
  if (value) {
@@ -58236,7 +58236,7 @@ var require_printer2 = __commonJS({
58236
58236
  if (value === "minus") {
58237
58237
  return (0, lines_1.fromString)("-");
58238
58238
  }
58239
- return print4(variancePath);
58239
+ return print5(variancePath);
58240
58240
  }
58241
58241
  return (0, lines_1.fromString)("");
58242
58242
  }, "variance");
@@ -58323,14 +58323,14 @@ var require_main2 = __commonJS({
58323
58323
  Object.defineProperty(exports, "visit", { enumerable: true, get: function() {
58324
58324
  return ast_types_1.visit;
58325
58325
  } });
58326
- function print4(node, options) {
58326
+ function print5(node, options) {
58327
58327
  return new printer_1.Printer(options).print(node);
58328
58328
  }
58329
- exports.print = print4;
58330
- function prettyPrint(node, options) {
58329
+ exports.print = print5;
58330
+ function prettyPrint2(node, options) {
58331
58331
  return new printer_1.Printer(options).printGenerically(node);
58332
58332
  }
58333
- exports.prettyPrint = prettyPrint;
58333
+ exports.prettyPrint = prettyPrint2;
58334
58334
  function run(transformer, options) {
58335
58335
  return runFile(process.argv[2], transformer, options);
58336
58336
  }
@@ -58350,7 +58350,7 @@ var require_main2 = __commonJS({
58350
58350
  function runString(code, transformer, options) {
58351
58351
  var writeback = options && options.writeback || defaultWriteback;
58352
58352
  transformer((0, parser_1.parse)(code, options), function(node) {
58353
- writeback(print4(node, options).code);
58353
+ writeback(print5(node, options).code);
58354
58354
  });
58355
58355
  }
58356
58356
  }
@@ -61619,7 +61619,8 @@ function defaultConfigValues(file) {
61619
61619
  };
61620
61620
  }
61621
61621
  function keyFieldsForType(configFile, type) {
61622
- return configFile.types?.[type]?.keys || configFile.defaultKeys;
61622
+ const withDefault = defaultConfigValues(configFile);
61623
+ return withDefault.types?.[type]?.keys || withDefault.defaultKeys;
61623
61624
  }
61624
61625
  function computeID(configFile, type, data) {
61625
61626
  const fields = keyFieldsForType(configFile, type);
@@ -61676,7 +61677,15 @@ function deepEquals(objA, objB, map = /* @__PURE__ */ new WeakMap()) {
61676
61677
  }
61677
61678
 
61678
61679
  // src/runtime/lib/selection.ts
61679
- function getFieldsForType(selection, __typename) {
61680
+ function getFieldsForType(selection, __typename, loading) {
61681
+ if (loading) {
61682
+ if (selection.loadingTypes && selection.loadingTypes.length > 0) {
61683
+ return deepMerge(
61684
+ ...selection.loadingTypes.map((type) => selection.abstractFields?.fields[type])
61685
+ );
61686
+ }
61687
+ return selection.fields ?? {};
61688
+ }
61680
61689
  let targetSelection = selection.fields || {};
61681
61690
  if (selection.abstractFields && __typename) {
61682
61691
  const mappedType = selection.abstractFields.typeMap[__typename];
@@ -61688,6 +61697,25 @@ function getFieldsForType(selection, __typename) {
61688
61697
  }
61689
61698
  return targetSelection;
61690
61699
  }
61700
+ function deepMerge(...objects) {
61701
+ const mergedObj = {};
61702
+ for (let obj of objects) {
61703
+ if (!obj) {
61704
+ continue;
61705
+ }
61706
+ for (let prop in obj) {
61707
+ if (prop in obj) {
61708
+ const val = obj[prop];
61709
+ if (typeof val === "object" && val !== null && !Array.isArray(val)) {
61710
+ mergedObj[prop] = deepMerge(mergedObj[prop] || {}, val);
61711
+ } else {
61712
+ mergedObj[prop] = val;
61713
+ }
61714
+ }
61715
+ }
61716
+ }
61717
+ return mergedObj;
61718
+ }
61691
61719
 
61692
61720
  // src/runtime/lib/scalars.ts
61693
61721
  async function marshalSelection({
@@ -61701,7 +61729,7 @@ async function marshalSelection({
61701
61729
  if (Array.isArray(data)) {
61702
61730
  return await Promise.all(data.map((val) => marshalSelection({ selection, data: val })));
61703
61731
  }
61704
- const targetSelection = getFieldsForType(selection, data["__typename"]);
61732
+ const targetSelection = getFieldsForType(selection, data["__typename"], false);
61705
61733
  return Object.fromEntries(
61706
61734
  await Promise.all(
61707
61735
  Object.entries(data).map(async ([fieldName, value]) => {
@@ -61801,6 +61829,7 @@ var DataSource = {
61801
61829
  Ssr: "ssr"
61802
61830
  };
61803
61831
  var fragmentKey = " $fragments";
61832
+ var PendingValue = Symbol("houdini_loading");
61804
61833
 
61805
61834
  // src/runtime/lib/store.ts
61806
61835
  var subscriber_queue = [];
@@ -63460,6 +63489,7 @@ var fetch2 = (target) => {
63460
63489
  }
63461
63490
  const fetch3 = ctx.fetch ?? globalThis.fetch;
63462
63491
  const fetchParams2 = {
63492
+ name: ctx.artifact.name,
63463
63493
  text: ctx.text,
63464
63494
  hash: ctx.hash,
63465
63495
  variables: marshalVariables2(ctx)
@@ -63500,10 +63530,10 @@ var defaultFetch = (url, params) => {
63500
63530
  "Could not find configured client url. Please specify one in your HoudiniClient constructor."
63501
63531
  );
63502
63532
  }
63503
- return async ({ fetch: fetch3, text, variables }) => {
63533
+ return async ({ fetch: fetch3, name, text, variables }) => {
63504
63534
  const result = await fetch3(url, {
63505
63535
  method: "POST",
63506
- body: JSON.stringify({ query: text, variables }),
63536
+ body: JSON.stringify({ operationName: name, query: text, variables }),
63507
63537
  ...params,
63508
63538
  headers: {
63509
63539
  Accept: "application/graphql+json, application/json",
@@ -64033,46 +64063,6 @@ var ListCollection = class {
64033
64063
  }
64034
64064
  };
64035
64065
 
64036
- // src/runtime/cache/schema.ts
64037
- var SchemaManager = class {
64038
- cache;
64039
- fieldTypes = {};
64040
- constructor(cache) {
64041
- this.cache = cache;
64042
- }
64043
- setFieldType({
64044
- parent,
64045
- key,
64046
- type,
64047
- nullable = false,
64048
- link
64049
- }) {
64050
- let parensIndex = key.indexOf("(");
64051
- if (parensIndex !== -1) {
64052
- key = key.substring(0, parensIndex);
64053
- }
64054
- if (parent === rootID) {
64055
- parent = "Query";
64056
- } else if (parent.includes(":")) {
64057
- parent = parent.substring(0, parent.indexOf(":"));
64058
- }
64059
- if (!this.fieldTypes[parent]) {
64060
- this.fieldTypes[parent] = {};
64061
- }
64062
- this.fieldTypes[parent][key] = {
64063
- type,
64064
- nullable,
64065
- link: !!link
64066
- };
64067
- }
64068
- fieldType(type, field) {
64069
- return this.fieldTypes[type]?.[field] || null;
64070
- }
64071
- get config() {
64072
- return this.cache._internal_unstable.config;
64073
- }
64074
- };
64075
-
64076
64066
  // src/runtime/cache/staleManager.ts
64077
64067
  var StaleManager = class {
64078
64068
  cache;
@@ -64505,7 +64495,7 @@ var OperationKind = {
64505
64495
  };
64506
64496
 
64507
64497
  // src/runtime/cache/stuff.ts
64508
- function evaluateKey(key, variables = {}) {
64498
+ function evaluateKey(key, variables = null) {
64509
64499
  let evaluated = "";
64510
64500
  let varName = "";
64511
64501
  let inString = false;
@@ -64515,7 +64505,7 @@ function evaluateKey(key, variables = {}) {
64515
64505
  varName += char;
64516
64506
  continue;
64517
64507
  }
64518
- const value = variables[varName.slice(1)];
64508
+ const value = variables?.[varName.slice(1)];
64519
64509
  evaluated += typeof value !== "undefined" ? JSON.stringify(value) : "undefined";
64520
64510
  varName = "";
64521
64511
  }
@@ -64549,7 +64539,7 @@ var InMemorySubscriptions = class {
64549
64539
  parentType
64550
64540
  }) {
64551
64541
  const __typename = this.cache._internal_unstable.storage.get(parent, "__typename").value;
64552
- let targetSelection = getFieldsForType(selection, __typename);
64542
+ let targetSelection = getFieldsForType(selection, __typename, false);
64553
64543
  for (const fieldSelection of Object.values(targetSelection || {})) {
64554
64544
  const {
64555
64545
  keyRaw,
@@ -64566,7 +64556,7 @@ var InMemorySubscriptions = class {
64566
64556
  let targetSelection2;
64567
64557
  if (innerSelection) {
64568
64558
  const __typename2 = this.cache._internal_unstable.storage.get(parent, "__typename").value;
64569
- targetSelection2 = getFieldsForType(innerSelection, __typename2);
64559
+ targetSelection2 = getFieldsForType(innerSelection, __typename2, false);
64570
64560
  }
64571
64561
  this.addFieldSubscription({
64572
64562
  id: parent,
@@ -64677,7 +64667,7 @@ var InMemorySubscriptions = class {
64677
64667
  filters
64678
64668
  } = selection;
64679
64669
  const key = evaluateKey(keyRaw, variables);
64680
- const fieldSelection = innerSelection ? getFieldsForType(innerSelection, parentType) : void 0;
64670
+ const fieldSelection = innerSelection ? getFieldsForType(innerSelection, parentType, false) : void 0;
64681
64671
  this.addFieldSubscription({
64682
64672
  id: parent,
64683
64673
  key,
@@ -64707,7 +64697,7 @@ var InMemorySubscriptions = class {
64707
64697
  linkedRecord,
64708
64698
  "__typename"
64709
64699
  ).value;
64710
- let targetSelection2 = getFieldsForType(childSelection, __typename);
64700
+ let targetSelection2 = getFieldsForType(childSelection, __typename, false);
64711
64701
  this.addMany({
64712
64702
  parent: linkedRecord,
64713
64703
  variables,
@@ -64726,7 +64716,7 @@ var InMemorySubscriptions = class {
64726
64716
  visited.push(id);
64727
64717
  const linkedIDs = [];
64728
64718
  const __typename = this.cache._internal_unstable.storage.get(id, "__typename").value;
64729
- let targetSelection = getFieldsForType(selection, __typename);
64719
+ let targetSelection = getFieldsForType(selection, __typename, false);
64730
64720
  for (const fieldSelection of Object.values(targetSelection || {})) {
64731
64721
  const key = evaluateKey(fieldSelection.keyRaw, variables);
64732
64722
  this.removeSubscribers(id, key, targets);
@@ -64796,7 +64786,6 @@ var Cache = class {
64796
64786
  lists: new ListManager(this, rootID),
64797
64787
  lifetimes: new GarbageCollector(this),
64798
64788
  staleManager: new StaleManager(this),
64799
- schema: new SchemaManager(this),
64800
64789
  disabled: disabled ?? typeof globalThis.window === "undefined"
64801
64790
  });
64802
64791
  if (Object.keys(config).length > 0) {
@@ -64907,7 +64896,6 @@ var CacheInternal = class {
64907
64896
  cache;
64908
64897
  lifetimes;
64909
64898
  staleManager;
64910
- schema;
64911
64899
  constructor({
64912
64900
  storage,
64913
64901
  subscriptions,
@@ -64915,7 +64903,6 @@ var CacheInternal = class {
64915
64903
  cache,
64916
64904
  lifetimes,
64917
64905
  staleManager,
64918
- schema,
64919
64906
  disabled,
64920
64907
  config
64921
64908
  }) {
@@ -64925,7 +64912,6 @@ var CacheInternal = class {
64925
64912
  this.cache = cache;
64926
64913
  this.lifetimes = lifetimes;
64927
64914
  this.staleManager = staleManager;
64928
- this.schema = schema;
64929
64915
  this._config = config;
64930
64916
  this._disabled = disabled;
64931
64917
  try {
@@ -64955,7 +64941,11 @@ var CacheInternal = class {
64955
64941
  if (this._disabled) {
64956
64942
  return [];
64957
64943
  }
64958
- let targetSelection = getFieldsForType(selection, data["__typename"]);
64944
+ let targetSelection = getFieldsForType(
64945
+ selection,
64946
+ data["__typename"],
64947
+ false
64948
+ );
64959
64949
  for (const [field, value] of Object.entries(data)) {
64960
64950
  if (!selection || !targetSelection[field]) {
64961
64951
  continue;
@@ -64966,17 +64956,9 @@ var CacheInternal = class {
64966
64956
  selection: fieldSelection,
64967
64957
  operations,
64968
64958
  abstract: isAbstract,
64969
- updates,
64970
- nullable
64959
+ updates
64971
64960
  } = targetSelection[field];
64972
64961
  const key = evaluateKey(keyRaw, variables);
64973
- this.schema.setFieldType({
64974
- parent,
64975
- key: keyRaw,
64976
- type: linkedType,
64977
- nullable,
64978
- link: !!fieldSelection
64979
- });
64980
64962
  if (value && typeof value === "object" && "__typename" in value && value["__typename"]) {
64981
64963
  linkedType = value["__typename"];
64982
64964
  }
@@ -65222,32 +65204,49 @@ var CacheInternal = class {
65222
65204
  variables,
65223
65205
  stepsFromConnection = null,
65224
65206
  ignoreMasking,
65225
- fullCheck = false
65207
+ fullCheck = false,
65208
+ loading: generateLoading
65226
65209
  }) {
65227
65210
  if (parent === null) {
65228
65211
  return { data: null, partial: false, stale: false, hasData: true };
65229
65212
  }
65230
65213
  const target = {};
65231
65214
  if (selection.fragments) {
65232
- target[fragmentKey] = Object.fromEntries(
65233
- Object.entries(selection.fragments).map(([key, value]) => [
65234
- key,
65235
- {
65236
- parent,
65237
- variables: evaluateFragmentVariables(value, variables ?? {})
65238
- }
65239
- ])
65240
- );
65215
+ target[fragmentKey] = {
65216
+ loading: Boolean(generateLoading),
65217
+ values: Object.fromEntries(
65218
+ Object.entries(selection.fragments).filter(([, value]) => !generateLoading || value.loading).map(([key, value]) => [
65219
+ key,
65220
+ {
65221
+ parent,
65222
+ variables: evaluateFragmentVariables(
65223
+ value.arguments,
65224
+ variables ?? {}
65225
+ )
65226
+ }
65227
+ ])
65228
+ )
65229
+ };
65241
65230
  }
65242
65231
  let hasData = !!selection.fragments;
65243
65232
  let partial = false;
65244
65233
  let cascadeNull = false;
65245
65234
  let stale = false;
65246
65235
  const typename = this.storage.get(parent, "__typename").value;
65247
- let targetSelection = getFieldsForType(selection, typename);
65236
+ let targetSelection = getFieldsForType(selection, typename, !!generateLoading);
65248
65237
  for (const [
65249
65238
  attributeName,
65250
- { type, keyRaw, selection: fieldSelection, nullable, list, visible, directives }
65239
+ {
65240
+ type,
65241
+ keyRaw,
65242
+ selection: fieldSelection,
65243
+ nullable,
65244
+ list,
65245
+ visible,
65246
+ directives,
65247
+ loading: fieldLoading,
65248
+ abstractHasRequired
65249
+ }
65251
65250
  ] of Object.entries(targetSelection)) {
65252
65251
  if (!visible && !ignoreMasking && !fullCheck) {
65253
65252
  continue;
@@ -65270,11 +65269,17 @@ var CacheInternal = class {
65270
65269
  }
65271
65270
  const fieldTarget = visible || ignoreMasking ? target : {};
65272
65271
  const key = evaluateKey(keyRaw, variables);
65273
- const { value } = this.storage.get(parent, key);
65272
+ if (generateLoading && !fieldLoading) {
65273
+ continue;
65274
+ }
65275
+ let { value } = this.storage.get(parent, key);
65274
65276
  const dt_field = this.staleManager.getFieldTime(parent, key);
65275
65277
  if (dt_field === null) {
65276
65278
  stale = true;
65277
65279
  }
65280
+ if (generateLoading) {
65281
+ value = void 0;
65282
+ }
65278
65283
  let nextStep = stepsFromConnection;
65279
65284
  if (nextStep !== null) {
65280
65285
  if (nextStep >= 2) {
@@ -65290,7 +65295,10 @@ var CacheInternal = class {
65290
65295
  if (typeof value === "undefined" && !embeddedCursor) {
65291
65296
  partial = true;
65292
65297
  }
65293
- if (typeof value === "undefined" || value === null) {
65298
+ if (generateLoading && fieldLoading?.kind === "value") {
65299
+ fieldTarget[attributeName] = PendingValue;
65300
+ hasData = true;
65301
+ } else if (!generateLoading && typeof value === "undefined" || value === null) {
65294
65302
  fieldTarget[attributeName] = null;
65295
65303
  if (typeof value !== "undefined") {
65296
65304
  hasData = true;
@@ -65310,7 +65318,8 @@ var CacheInternal = class {
65310
65318
  linkedList: value,
65311
65319
  stepsFromConnection: nextStep,
65312
65320
  ignoreMasking: !!ignoreMasking,
65313
- fullCheck
65321
+ fullCheck,
65322
+ loading: generateLoading
65314
65323
  });
65315
65324
  fieldTarget[attributeName] = listValue.data;
65316
65325
  if (listValue.partial) {
@@ -65329,7 +65338,8 @@ var CacheInternal = class {
65329
65338
  variables,
65330
65339
  stepsFromConnection: nextStep,
65331
65340
  ignoreMasking,
65332
- fullCheck
65341
+ fullCheck,
65342
+ loading: generateLoading
65333
65343
  });
65334
65344
  fieldTarget[attributeName] = objectFields.data;
65335
65345
  if (objectFields.partial) {
@@ -65342,13 +65352,27 @@ var CacheInternal = class {
65342
65352
  hasData = true;
65343
65353
  }
65344
65354
  }
65355
+ if (generateLoading && fieldLoading?.list) {
65356
+ fieldTarget[attributeName] = wrapInLists(
65357
+ Array.from({ length: fieldLoading.list.count }).fill(
65358
+ fieldTarget[attributeName]
65359
+ ),
65360
+ fieldLoading.list.depth - 1
65361
+ );
65362
+ }
65345
65363
  if (fieldTarget[attributeName] === null && !nullable && !embeddedCursor) {
65346
- cascadeNull = true;
65364
+ if (abstractHasRequired) {
65365
+ target[attributeName] = {
65366
+ __typename: "@required field missing; don't match this"
65367
+ };
65368
+ } else {
65369
+ cascadeNull = true;
65370
+ }
65347
65371
  }
65348
65372
  }
65349
65373
  return {
65350
65374
  data: cascadeNull ? null : target,
65351
- partial: hasData && partial,
65375
+ partial: !generateLoading && hasData && partial,
65352
65376
  stale: hasData && stale,
65353
65377
  hasData
65354
65378
  };
@@ -65375,7 +65399,8 @@ var CacheInternal = class {
65375
65399
  linkedList,
65376
65400
  stepsFromConnection,
65377
65401
  ignoreMasking,
65378
- fullCheck
65402
+ fullCheck,
65403
+ loading
65379
65404
  }) {
65380
65405
  const result = [];
65381
65406
  let partialData = false;
@@ -65389,7 +65414,8 @@ var CacheInternal = class {
65389
65414
  linkedList: entry,
65390
65415
  stepsFromConnection,
65391
65416
  ignoreMasking,
65392
- fullCheck
65417
+ fullCheck,
65418
+ loading
65393
65419
  });
65394
65420
  result.push(nestedValue.data);
65395
65421
  if (nestedValue.partial) {
@@ -65412,7 +65438,8 @@ var CacheInternal = class {
65412
65438
  variables,
65413
65439
  stepsFromConnection,
65414
65440
  ignoreMasking,
65415
- fullCheck
65441
+ fullCheck,
65442
+ loading
65416
65443
  });
65417
65444
  result.push(data);
65418
65445
  if (partial) {
@@ -65519,6 +65546,12 @@ function evaluateFragmentVariables(variables, args) {
65519
65546
  Object.entries(variables).map(([key, value]) => [key, fragmentVariableValue(value, args)])
65520
65547
  );
65521
65548
  }
65549
+ function wrapInLists(target, count = 0) {
65550
+ if (count === 0) {
65551
+ return target;
65552
+ }
65553
+ return wrapInLists([target], count - 1);
65554
+ }
65522
65555
  function fragmentVariableValue(value, args) {
65523
65556
  if (value.kind === "StringValue") {
65524
65557
  return value.value;
@@ -65571,7 +65604,7 @@ var cachePolicy = ({
65571
65604
  network(ctx, { initialValue, next, resolve: resolve2, marshalVariables: marshalVariables2 }) {
65572
65605
  const { policy, artifact } = ctx;
65573
65606
  let useCache = false;
65574
- if (enabled && artifact.kind === ArtifactKind.Query && !ctx.cacheParams?.disableRead) {
65607
+ if (enabled && (artifact.kind === ArtifactKind.Query || artifact.kind === ArtifactKind.Fragment) && !ctx.cacheParams?.disableRead) {
65575
65608
  if (policy !== CachePolicy.NetworkOnly) {
65576
65609
  const value = localCache.read({
65577
65610
  selection: artifact.selection,
@@ -65612,7 +65645,17 @@ var cachePolicy = ({
65612
65645
  localCache._internal_unstable.collectGarbage();
65613
65646
  }, 0);
65614
65647
  }
65615
- setFetching(!useCache);
65648
+ if (!ctx.stuff?.silenceLoading) {
65649
+ let fetchingState = null;
65650
+ if (!useCache && "enableLoadingState" in artifact && artifact.enableLoadingState) {
65651
+ fetchingState = localCache.read({
65652
+ selection: artifact.selection,
65653
+ variables: marshalVariables2(ctx),
65654
+ loading: true
65655
+ }).data;
65656
+ }
65657
+ setFetching(!useCache, fetchingState);
65658
+ }
65616
65659
  return next(ctx);
65617
65660
  },
65618
65661
  afterNetwork(ctx, { resolve: resolve2, value, marshalVariables: marshalVariables2 }) {
@@ -65692,10 +65735,11 @@ var query = documentPlugin(ArtifactKind.Query, function() {
65692
65735
  cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
65693
65736
  }
65694
65737
  lastVariables = { ...marshalVariables2(ctx) };
65738
+ const variables = lastVariables;
65695
65739
  subscriptionSpec = {
65696
65740
  rootType: ctx.artifact.rootType,
65697
65741
  selection: ctx.artifact.selection,
65698
- variables: () => lastVariables,
65742
+ variables: () => variables,
65699
65743
  set: (newValue) => {
65700
65744
  resolve2(ctx, {
65701
65745
  data: newValue,
@@ -65724,12 +65768,17 @@ var query = documentPlugin(ArtifactKind.Query, function() {
65724
65768
  // src/runtime/client/plugins/fragment.ts
65725
65769
  var fragment = documentPlugin(ArtifactKind.Fragment, function() {
65726
65770
  let subscriptionSpec = null;
65771
+ let lastReference = null;
65727
65772
  return {
65728
65773
  start(ctx, { next, resolve: resolve2, variablesChanged: variablesChanged2, marshalVariables: marshalVariables2 }) {
65729
65774
  if (!ctx.stuff.parentID) {
65730
65775
  return next(ctx);
65731
65776
  }
65732
- if (variablesChanged2(ctx) && !ctx.cacheParams?.disableSubscriptions) {
65777
+ const currentReference = {
65778
+ parent: ctx.stuff.parentID,
65779
+ variables: marshalVariables2(ctx)
65780
+ };
65781
+ if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged2(ctx))) {
65733
65782
  if (subscriptionSpec) {
65734
65783
  cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
65735
65784
  }
@@ -65752,6 +65801,7 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
65752
65801
  }
65753
65802
  };
65754
65803
  cache_default.subscribe(subscriptionSpec, variables);
65804
+ lastReference = currentReference;
65755
65805
  }
65756
65806
  next(ctx);
65757
65807
  },
@@ -65846,6 +65896,7 @@ function subscription(factory) {
65846
65896
  clearSubscription?.();
65847
65897
  clearSubscription = client.subscribe(
65848
65898
  {
65899
+ operationName: ctx.artifact.name,
65849
65900
  query: ctx.artifact.raw,
65850
65901
  variables: marshalVariables2(ctx)
65851
65902
  },
@@ -65952,6 +66003,7 @@ var DocumentStore = class extends Writable {
65952
66003
  #plugins;
65953
66004
  #lastVariables;
65954
66005
  #lastContext = null;
66006
+ pendingPromise = null;
65955
66007
  constructor({
65956
66008
  artifact,
65957
66009
  plugins: plugins2,
@@ -65984,7 +66036,15 @@ var DocumentStore = class extends Writable {
65984
66036
  this.#plugins = pipeline2 ?? [
65985
66037
  cachePolicy({
65986
66038
  enabled: cache,
65987
- setFetching: (fetching2) => this.update((state) => ({ ...state, fetching: fetching2 }))
66039
+ setFetching: (fetching2, data) => {
66040
+ this.update((state) => {
66041
+ const newState = { ...state, fetching: fetching2 };
66042
+ if (fetching2 && data) {
66043
+ newState.data = data;
66044
+ }
66045
+ return newState;
66046
+ });
66047
+ }
65988
66048
  })(),
65989
66049
  ...plugins2 ?? []
65990
66050
  ];
@@ -66024,7 +66084,7 @@ var DocumentStore = class extends Writable {
66024
66084
  const draft = context.draft();
66025
66085
  draft.variables = variables ?? null;
66026
66086
  context = context.apply(draft, false);
66027
- return await new Promise((resolve2, reject) => {
66087
+ const promise = new Promise((resolve2, reject) => {
66028
66088
  const state = {
66029
66089
  setup,
66030
66090
  currentStep: 0,
@@ -66033,12 +66093,17 @@ var DocumentStore = class extends Writable {
66033
66093
  promise: {
66034
66094
  resolved: false,
66035
66095
  resolve: resolve2,
66036
- reject
66096
+ reject,
66097
+ then: (...args) => promise.then(...args)
66037
66098
  },
66038
66099
  context
66039
66100
  };
66101
+ if (this.pendingPromise === null) {
66102
+ this.pendingPromise = state.promise;
66103
+ }
66040
66104
  this.#step("forward", state);
66041
66105
  });
66106
+ return await promise;
66042
66107
  }
66043
66108
  async cleanup() {
66044
66109
  for (const plugin2 of this.#plugins) {
@@ -66157,16 +66222,15 @@ var DocumentStore = class extends Writable {
66157
66222
  value
66158
66223
  );
66159
66224
  }
66225
+ if (!ctx.silenceEcho || value.data !== this.state.data) {
66226
+ this.set(value);
66227
+ }
66160
66228
  if (!ctx.promise.resolved) {
66161
66229
  ctx.promise.resolve(value);
66162
66230
  ctx.promise.resolved = true;
66163
66231
  }
66164
66232
  this.#lastContext = ctx.context.draft();
66165
66233
  this.#lastVariables = this.#lastContext.stuff.inputs.marshaled;
66166
- if (ctx.silenceEcho && value.data === this.state.data) {
66167
- return;
66168
- }
66169
- this.set(value);
66170
66234
  }
66171
66235
  };
66172
66236
  var ClientPluginContextWrapper = class {
@@ -66274,14 +66338,22 @@ var injectedPlugins_default = plugins;
66274
66338
  // src/runtime/client/index.ts
66275
66339
  var HoudiniClient = class {
66276
66340
  url;
66277
- #plugins;
66278
- constructor({ url, fetchParams: fetchParams2, plugins: plugins2, pipeline: pipeline2, throwOnError: throwOnError2 }) {
66341
+ plugins;
66342
+ throwOnError_operations;
66343
+ constructor({
66344
+ url,
66345
+ fetchParams: fetchParams2,
66346
+ plugins: plugins2,
66347
+ pipeline: pipeline2,
66348
+ throwOnError: throwOnError2
66349
+ }) {
66279
66350
  if (plugins2 && pipeline2) {
66280
66351
  throw new Error(
66281
66352
  "A client cannot be given a pipeline and a list of plugins at the same time."
66282
66353
  );
66283
66354
  }
66284
- this.#plugins = flatten(
66355
+ this.throwOnError_operations = throwOnError2?.operations ?? [];
66356
+ this.plugins = flatten(
66285
66357
  [].concat(
66286
66358
  throwOnError2 ? [throwOnError(throwOnError2)] : [],
66287
66359
  fetchParams(fetchParams2),
@@ -66307,7 +66379,7 @@ var HoudiniClient = class {
66307
66379
  return new DocumentStore({
66308
66380
  client: this,
66309
66381
  artifact,
66310
- plugins: createPluginHooks(this.#plugins),
66382
+ plugins: createPluginHooks(this.plugins),
66311
66383
  cache,
66312
66384
  initialValue,
66313
66385
  fetching
@@ -66703,6 +66775,12 @@ var Config = class {
66703
66775
  get listParentDirective() {
66704
66776
  return "parentID";
66705
66777
  }
66778
+ get blockingDirective() {
66779
+ return "blocking";
66780
+ }
66781
+ get blockingDisableDirective() {
66782
+ return "blocking_disable";
66783
+ }
66706
66784
  get deprecatedlistDirectiveParentIDArg() {
66707
66785
  return "parentID";
66708
66786
  }
@@ -66724,6 +66802,9 @@ var Config = class {
66724
66802
  get deleteDirectiveSuffix() {
66725
66803
  return `_delete`;
66726
66804
  }
66805
+ get loadingDirective() {
66806
+ return `loading`;
66807
+ }
66727
66808
  get whenDirective() {
66728
66809
  return "when";
66729
66810
  }
@@ -66754,6 +66835,9 @@ var Config = class {
66754
66835
  get cachePolicyArg() {
66755
66836
  return "policy";
66756
66837
  }
66838
+ get requiredDirective() {
66839
+ return "required";
66840
+ }
66757
66841
  paginationQueryName(documentName) {
66758
66842
  return documentName + "_Pagination_Query";
66759
66843
  }
@@ -66793,6 +66877,17 @@ var Config = class {
66793
66877
  }, []) ?? [];
66794
66878
  return !defaultDirectives.includes(name) && (internalDirectives.includes(name) || this.isDeleteDirective(name));
66795
66879
  }
66880
+ needsRefetchArtifact(document) {
66881
+ let needsArtifact = false;
66882
+ graphql2.visit(document, {
66883
+ Directive: (node) => {
66884
+ if ([this.paginateDirective].includes(node.name.value)) {
66885
+ needsArtifact = true;
66886
+ }
66887
+ }
66888
+ });
66889
+ return needsArtifact;
66890
+ }
66796
66891
  #fragmentVariableMaps;
66797
66892
  registerFragmentVariablesHash({
66798
66893
  hash,
@@ -67139,6 +67234,16 @@ function hashDocument({
67139
67234
  const docString = typeof document === "string" ? document : document.originalString;
67140
67235
  return crypto.createHash("sha256").update(docString ?? "").digest("hex");
67141
67236
  }
67237
+ function parentField(ancestors) {
67238
+ return walkParentField([...ancestors].sort(() => -1));
67239
+ }
67240
+ function walkParentField(ancestors) {
67241
+ let head = ancestors.shift();
67242
+ if (Array.isArray(head) || head.kind === "SelectionSet") {
67243
+ return walkParentField(ancestors);
67244
+ }
67245
+ return head;
67246
+ }
67142
67247
  function parentTypeFromAncestors(schema, filepath, ancestors) {
67143
67248
  const parents = [...ancestors];
67144
67249
  parents.reverse();
@@ -67209,7 +67314,7 @@ function definitionFromAncestors(ancestors) {
67209
67314
  while (Array.isArray(definition) && definition) {
67210
67315
  definition = parents.shift();
67211
67316
  }
67212
- return definition;
67317
+ return { parents, definition };
67213
67318
  }
67214
67319
  function formatErrors(e2, afterError) {
67215
67320
  const errors = Array.isArray(e2) ? e2 : [e2];
@@ -67293,20 +67398,48 @@ var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
67293
67398
 
67294
67399
  // src/lib/parse.ts
67295
67400
  var import_parser = __toESM(require_lib3(), 1);
67296
- async function parseJS(str) {
67297
- return {
67298
- start: 0,
67299
- script: (0, import_parser.parse)(str || "", {
67300
- plugins: ["typescript"],
67301
- sourceType: "module"
67302
- }).program,
67303
- end: str.length
67401
+ var import_recast = __toESM(require_main2(), 1);
67402
+
67403
+ // src/lib/deepMerge.ts
67404
+ var import_deepmerge = __toESM(require_cjs(), 1);
67405
+ function deepMerge2(filepath, ...targets) {
67406
+ try {
67407
+ if (targets.length === 1) {
67408
+ return targets[0];
67409
+ } else if (targets.length === 2) {
67410
+ return (0, import_deepmerge.default)(targets[0], targets[1], {
67411
+ arrayMerge: (source, update) => [...new Set(source.concat(update))]
67412
+ });
67413
+ }
67414
+ return deepMerge2(filepath, targets[0], deepMerge2(filepath, ...targets.slice(1)));
67415
+ } catch (e2) {
67416
+ throw new HoudiniError({
67417
+ filepath,
67418
+ message: "could not merge: " + JSON.stringify(targets, null, 4),
67419
+ description: e2.message
67420
+ });
67421
+ }
67422
+ }
67423
+
67424
+ // src/lib/parse.ts
67425
+ async function parseJS(str, config) {
67426
+ const defaultConfig = {
67427
+ plugins: ["typescript", "importAssertions"],
67428
+ sourceType: "module"
67304
67429
  };
67430
+ return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
67305
67431
  }
67306
67432
  function parseJSON(str) {
67307
67433
  str = str.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (m2, g) => g ? "" : m2);
67308
67434
  return JSON.parse(str);
67309
67435
  }
67436
+ async function printJS(script, options) {
67437
+ if (options?.pretty) {
67438
+ return (0, import_recast.prettyPrint)(script, options);
67439
+ } else {
67440
+ return (0, import_recast.print)(script, options);
67441
+ }
67442
+ }
67310
67443
 
67311
67444
  // src/lib/imports.ts
67312
67445
  var recast = __toESM(require_main2(), 1);
@@ -67367,27 +67500,6 @@ async function cleanupFiles(pathFolder, listOfObj) {
67367
67500
  return allFilesNotInList;
67368
67501
  }
67369
67502
 
67370
- // src/lib/deepMerge.ts
67371
- var import_deepmerge = __toESM(require_cjs(), 1);
67372
- function deepMerge(filepath, ...targets) {
67373
- try {
67374
- if (targets.length === 1) {
67375
- return targets[0];
67376
- } else if (targets.length === 2) {
67377
- return (0, import_deepmerge.default)(targets[0], targets[1], {
67378
- arrayMerge: (source, update) => [...new Set(source.concat(update))]
67379
- });
67380
- }
67381
- return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
67382
- } catch (e2) {
67383
- throw new HoudiniError({
67384
- filepath,
67385
- message: "could not merge: " + targets,
67386
- description: e2.message
67387
- });
67388
- }
67389
- }
67390
-
67391
67503
  // src/lib/detectTools.ts
67392
67504
  async function detectFromPackageJSON(cwd) {
67393
67505
  try {
@@ -67636,12 +67748,13 @@ export {
67636
67748
  HoudiniError,
67637
67749
  LogLevel,
67638
67750
  PaginateMode,
67751
+ PendingValue,
67639
67752
  RefetchUpdateMode,
67640
67753
  TypeWrapper,
67641
67754
  cleanupFiles,
67642
67755
  computeID,
67643
67756
  createPluginHooks,
67644
- deepMerge,
67757
+ deepMerge2 as deepMerge,
67645
67758
  defaultConfigValues,
67646
67759
  definitionFromAncestors,
67647
67760
  detectFromPackageJSON,
@@ -67663,11 +67776,13 @@ export {
67663
67776
  mutation,
67664
67777
  operation_requires_variables,
67665
67778
  orderedPlugins,
67779
+ parentField,
67666
67780
  parentTypeFromAncestors,
67667
67781
  parseJS,
67668
67782
  parseJSON,
67669
67783
  path_exports as path,
67670
67784
  plugin,
67785
+ printJS,
67671
67786
  pullSchema,
67672
67787
  query,
67673
67788
  readConfigFile,