typescript 5.4.0-dev.20231214 → 5.4.0-dev.20231216

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.4";
21
- var version = `${versionMajorMinor}.0-dev.20231214`;
21
+ var version = `${versionMajorMinor}.0-dev.20231216`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6673,6 +6673,8 @@ var Diagnostics = {
6673
6673
  A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
6674
6674
  Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
6675
6675
  Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2866, 1 /* Error */, "Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866", "Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),
6676
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun: diag(2867, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),
6677
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig: diag(2868, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),
6676
6678
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
6677
6679
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
6678
6680
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -33290,6 +33292,12 @@ var Parser;
33290
33292
  if (isBracketed) {
33291
33293
  skipWhitespace();
33292
33294
  }
33295
+ const modifiers = parseModifiers(
33296
+ /*allowDecorators*/
33297
+ false,
33298
+ /*permitConstAsModifier*/
33299
+ true
33300
+ );
33293
33301
  const name = parseJSDocIdentifierName(Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
33294
33302
  let defaultType;
33295
33303
  if (isBracketed) {
@@ -33302,8 +33310,7 @@ var Parser;
33302
33310
  return void 0;
33303
33311
  }
33304
33312
  return finishNode(factory2.createTypeParameterDeclaration(
33305
- /*modifiers*/
33306
- void 0,
33313
+ modifiers,
33307
33314
  name,
33308
33315
  /*constraint*/
33309
33316
  void 0,
@@ -64999,6 +65006,8 @@ function createTypeChecker(host) {
64999
65006
  case "Buffer":
65000
65007
  case "module":
65001
65008
  return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode;
65009
+ case "Bun":
65010
+ return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun;
65002
65011
  case "Map":
65003
65012
  case "Set":
65004
65013
  case "Promise":
@@ -83367,6 +83376,7 @@ function createTypeChecker(host) {
83367
83376
  return externalHelpersModule;
83368
83377
  }
83369
83378
  function checkGrammarModifiers(node) {
83379
+ var _a;
83370
83380
  const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node);
83371
83381
  if (quickResult !== void 0) {
83372
83382
  return quickResult;
@@ -83430,15 +83440,16 @@ function createTypeChecker(host) {
83430
83440
  }
83431
83441
  }
83432
83442
  switch (modifier.kind) {
83433
- case 87 /* ConstKeyword */:
83443
+ case 87 /* ConstKeyword */: {
83434
83444
  if (node.kind !== 266 /* EnumDeclaration */ && node.kind !== 168 /* TypeParameter */) {
83435
83445
  return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(87 /* ConstKeyword */));
83436
83446
  }
83437
- const parent = node.parent;
83447
+ const parent = isJSDocTemplateTag(node.parent) && getEffectiveJSDocHost(node.parent) || node.parent;
83438
83448
  if (node.kind === 168 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent) || isClassLike(parent) || isFunctionTypeNode(parent) || isConstructorTypeNode(parent) || isCallSignatureDeclaration(parent) || isConstructSignatureDeclaration(parent) || isMethodSignature(parent))) {
83439
83449
  return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind));
83440
83450
  }
83441
83451
  break;
83452
+ }
83442
83453
  case 164 /* OverrideKeyword */:
83443
83454
  if (flags & 16 /* Override */) {
83444
83455
  return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override");
@@ -83638,10 +83649,11 @@ function createTypeChecker(host) {
83638
83649
  lastAsync = modifier;
83639
83650
  break;
83640
83651
  case 103 /* InKeyword */:
83641
- case 147 /* OutKeyword */:
83652
+ case 147 /* OutKeyword */: {
83642
83653
  const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */;
83643
83654
  const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out";
83644
- if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
83655
+ const parent = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((_a = getJSDocRoot(node.parent)) == null ? void 0 : _a.tags, isJSDocTypedefTag)) || node.parent;
83656
+ if (node.kind !== 168 /* TypeParameter */ || parent && !(isInterfaceDeclaration(parent) || isClassLike(parent) || isTypeAliasDeclaration(parent) || isJSDocTypedefTag(parent))) {
83645
83657
  return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
83646
83658
  }
83647
83659
  if (flags & inOutFlag) {
@@ -83652,6 +83664,7 @@ function createTypeChecker(host) {
83652
83664
  }
83653
83665
  flags |= inOutFlag;
83654
83666
  break;
83667
+ }
83655
83668
  }
83656
83669
  }
83657
83670
  }
package/lib/tsserver.js CHANGED
@@ -2335,7 +2335,7 @@ module.exports = __toCommonJS(server_exports);
2335
2335
 
2336
2336
  // src/compiler/corePublic.ts
2337
2337
  var versionMajorMinor = "5.4";
2338
- var version = `${versionMajorMinor}.0-dev.20231214`;
2338
+ var version = `${versionMajorMinor}.0-dev.20231216`;
2339
2339
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2340
2340
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2341
2341
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10228,6 +10228,8 @@ var Diagnostics = {
10228
10228
  A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
10229
10229
  Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
10230
10230
  Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2866, 1 /* Error */, "Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866", "Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),
10231
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun: diag(2867, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),
10232
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig: diag(2868, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),
10231
10233
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
10232
10234
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
10233
10235
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -37705,6 +37707,12 @@ var Parser;
37705
37707
  if (isBracketed) {
37706
37708
  skipWhitespace();
37707
37709
  }
37710
+ const modifiers = parseModifiers(
37711
+ /*allowDecorators*/
37712
+ false,
37713
+ /*permitConstAsModifier*/
37714
+ true
37715
+ );
37708
37716
  const name = parseJSDocIdentifierName(Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
37709
37717
  let defaultType;
37710
37718
  if (isBracketed) {
@@ -37717,8 +37725,7 @@ var Parser;
37717
37725
  return void 0;
37718
37726
  }
37719
37727
  return finishNode(factory2.createTypeParameterDeclaration(
37720
- /*modifiers*/
37721
- void 0,
37728
+ modifiers,
37722
37729
  name,
37723
37730
  /*constraint*/
37724
37731
  void 0,
@@ -69714,6 +69721,8 @@ function createTypeChecker(host) {
69714
69721
  case "Buffer":
69715
69722
  case "module":
69716
69723
  return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode;
69724
+ case "Bun":
69725
+ return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun;
69717
69726
  case "Map":
69718
69727
  case "Set":
69719
69728
  case "Promise":
@@ -88082,6 +88091,7 @@ function createTypeChecker(host) {
88082
88091
  return externalHelpersModule;
88083
88092
  }
88084
88093
  function checkGrammarModifiers(node) {
88094
+ var _a;
88085
88095
  const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node);
88086
88096
  if (quickResult !== void 0) {
88087
88097
  return quickResult;
@@ -88145,15 +88155,16 @@ function createTypeChecker(host) {
88145
88155
  }
88146
88156
  }
88147
88157
  switch (modifier.kind) {
88148
- case 87 /* ConstKeyword */:
88158
+ case 87 /* ConstKeyword */: {
88149
88159
  if (node.kind !== 266 /* EnumDeclaration */ && node.kind !== 168 /* TypeParameter */) {
88150
88160
  return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(87 /* ConstKeyword */));
88151
88161
  }
88152
- const parent2 = node.parent;
88162
+ const parent2 = isJSDocTemplateTag(node.parent) && getEffectiveJSDocHost(node.parent) || node.parent;
88153
88163
  if (node.kind === 168 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) {
88154
88164
  return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind));
88155
88165
  }
88156
88166
  break;
88167
+ }
88157
88168
  case 164 /* OverrideKeyword */:
88158
88169
  if (flags & 16 /* Override */) {
88159
88170
  return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override");
@@ -88353,10 +88364,11 @@ function createTypeChecker(host) {
88353
88364
  lastAsync = modifier;
88354
88365
  break;
88355
88366
  case 103 /* InKeyword */:
88356
- case 147 /* OutKeyword */:
88367
+ case 147 /* OutKeyword */: {
88357
88368
  const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */;
88358
88369
  const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out";
88359
- if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
88370
+ const parent2 = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((_a = getJSDocRoot(node.parent)) == null ? void 0 : _a.tags, isJSDocTypedefTag)) || node.parent;
88371
+ if (node.kind !== 168 /* TypeParameter */ || parent2 && !(isInterfaceDeclaration(parent2) || isClassLike(parent2) || isTypeAliasDeclaration(parent2) || isJSDocTypedefTag(parent2))) {
88360
88372
  return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
88361
88373
  }
88362
88374
  if (flags & inOutFlag) {
@@ -88367,6 +88379,7 @@ function createTypeChecker(host) {
88367
88379
  }
88368
88380
  flags |= inOutFlag;
88369
88381
  break;
88382
+ }
88370
88383
  }
88371
88384
  }
88372
88385
  }
@@ -139115,7 +139128,7 @@ function getFunctionOrClassName(node) {
139115
139128
  if (name.length > maxLength) {
139116
139129
  return `${name} callback`;
139117
139130
  }
139118
- const args = cleanText(mapDefined(parent2.arguments, (a) => isStringLiteralLike(a) ? a.getText(curSourceFile) : void 0).join(", "));
139131
+ const args = cleanText(mapDefined(parent2.arguments, (a) => isStringLiteralLike(a) || isTemplateLiteral(a) ? a.getText(curSourceFile) : void 0).join(", "));
139119
139132
  return `${name}(${args}) callback`;
139120
139133
  }
139121
139134
  }
@@ -171238,7 +171251,7 @@ function getAllRules() {
171238
171251
  const comments = [2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */];
171239
171252
  const typeNames = [80 /* Identifier */, ...typeKeywords];
171240
171253
  const functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments;
171241
- const typeScriptOpenBraceLeftTokenRange = tokenRangeFrom([80 /* Identifier */, 3 /* MultiLineCommentTrivia */, 86 /* ClassKeyword */, 95 /* ExportKeyword */, 102 /* ImportKeyword */]);
171254
+ const typeScriptOpenBraceLeftTokenRange = tokenRangeFrom([80 /* Identifier */, 32 /* GreaterThanToken */, 3 /* MultiLineCommentTrivia */, 86 /* ClassKeyword */, 95 /* ExportKeyword */, 102 /* ImportKeyword */]);
171242
171255
  const controlOpenBraceLeftTokenRange = tokenRangeFrom([22 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 92 /* DoKeyword */, 113 /* TryKeyword */, 98 /* FinallyKeyword */, 93 /* ElseKeyword */, 85 /* CatchKeyword */]);
171243
171256
  const highPriorityCommonRules = [
171244
171257
  // Leave comments alone
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.4";
38
- version = `${versionMajorMinor}.0-dev.20231214`;
38
+ version = `${versionMajorMinor}.0-dev.20231216`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8003,6 +8003,8 @@ ${lanes.join("\n")}
8003
8003
  A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
8004
8004
  Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
8005
8005
  Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2866, 1 /* Error */, "Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866", "Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),
8006
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun: diag(2867, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),
8007
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig: diag(2868, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),
8006
8008
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
8007
8009
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
8008
8010
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -35770,6 +35772,12 @@ ${lanes.join("\n")}
35770
35772
  if (isBracketed) {
35771
35773
  skipWhitespace();
35772
35774
  }
35775
+ const modifiers = parseModifiers(
35776
+ /*allowDecorators*/
35777
+ false,
35778
+ /*permitConstAsModifier*/
35779
+ true
35780
+ );
35773
35781
  const name = parseJSDocIdentifierName(Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
35774
35782
  let defaultType;
35775
35783
  if (isBracketed) {
@@ -35782,8 +35790,7 @@ ${lanes.join("\n")}
35782
35790
  return void 0;
35783
35791
  }
35784
35792
  return finishNode(factory2.createTypeParameterDeclaration(
35785
- /*modifiers*/
35786
- void 0,
35793
+ modifiers,
35787
35794
  name,
35788
35795
  /*constraint*/
35789
35796
  void 0,
@@ -67474,6 +67481,8 @@ ${lanes.join("\n")}
67474
67481
  case "Buffer":
67475
67482
  case "module":
67476
67483
  return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode;
67484
+ case "Bun":
67485
+ return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun;
67477
67486
  case "Map":
67478
67487
  case "Set":
67479
67488
  case "Promise":
@@ -85842,6 +85851,7 @@ ${lanes.join("\n")}
85842
85851
  return externalHelpersModule;
85843
85852
  }
85844
85853
  function checkGrammarModifiers(node) {
85854
+ var _a;
85845
85855
  const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node);
85846
85856
  if (quickResult !== void 0) {
85847
85857
  return quickResult;
@@ -85905,15 +85915,16 @@ ${lanes.join("\n")}
85905
85915
  }
85906
85916
  }
85907
85917
  switch (modifier.kind) {
85908
- case 87 /* ConstKeyword */:
85918
+ case 87 /* ConstKeyword */: {
85909
85919
  if (node.kind !== 266 /* EnumDeclaration */ && node.kind !== 168 /* TypeParameter */) {
85910
85920
  return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(87 /* ConstKeyword */));
85911
85921
  }
85912
- const parent2 = node.parent;
85922
+ const parent2 = isJSDocTemplateTag(node.parent) && getEffectiveJSDocHost(node.parent) || node.parent;
85913
85923
  if (node.kind === 168 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) {
85914
85924
  return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind));
85915
85925
  }
85916
85926
  break;
85927
+ }
85917
85928
  case 164 /* OverrideKeyword */:
85918
85929
  if (flags & 16 /* Override */) {
85919
85930
  return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override");
@@ -86113,10 +86124,11 @@ ${lanes.join("\n")}
86113
86124
  lastAsync = modifier;
86114
86125
  break;
86115
86126
  case 103 /* InKeyword */:
86116
- case 147 /* OutKeyword */:
86127
+ case 147 /* OutKeyword */: {
86117
86128
  const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */;
86118
86129
  const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out";
86119
- if (node.kind !== 168 /* TypeParameter */ || !(isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent))) {
86130
+ const parent2 = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find((_a = getJSDocRoot(node.parent)) == null ? void 0 : _a.tags, isJSDocTypedefTag)) || node.parent;
86131
+ if (node.kind !== 168 /* TypeParameter */ || parent2 && !(isInterfaceDeclaration(parent2) || isClassLike(parent2) || isTypeAliasDeclaration(parent2) || isJSDocTypedefTag(parent2))) {
86120
86132
  return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
86121
86133
  }
86122
86134
  if (flags & inOutFlag) {
@@ -86127,6 +86139,7 @@ ${lanes.join("\n")}
86127
86139
  }
86128
86140
  flags |= inOutFlag;
86129
86141
  break;
86142
+ }
86130
86143
  }
86131
86144
  }
86132
86145
  }
@@ -137472,7 +137485,7 @@ ${lanes.join("\n")}
137472
137485
  if (name.length > maxLength) {
137473
137486
  return `${name} callback`;
137474
137487
  }
137475
- const args = cleanText(mapDefined(parent2.arguments, (a) => isStringLiteralLike(a) ? a.getText(curSourceFile) : void 0).join(", "));
137488
+ const args = cleanText(mapDefined(parent2.arguments, (a) => isStringLiteralLike(a) || isTemplateLiteral(a) ? a.getText(curSourceFile) : void 0).join(", "));
137476
137489
  return `${name}(${args}) callback`;
137477
137490
  }
137478
137491
  }
@@ -170696,7 +170709,7 @@ ${options.prefix}` : "\n" : options.prefix
170696
170709
  const comments = [2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */];
170697
170710
  const typeNames = [80 /* Identifier */, ...typeKeywords];
170698
170711
  const functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments;
170699
- const typeScriptOpenBraceLeftTokenRange = tokenRangeFrom([80 /* Identifier */, 3 /* MultiLineCommentTrivia */, 86 /* ClassKeyword */, 95 /* ExportKeyword */, 102 /* ImportKeyword */]);
170712
+ const typeScriptOpenBraceLeftTokenRange = tokenRangeFrom([80 /* Identifier */, 32 /* GreaterThanToken */, 3 /* MultiLineCommentTrivia */, 86 /* ClassKeyword */, 95 /* ExportKeyword */, 102 /* ImportKeyword */]);
170700
170713
  const controlOpenBraceLeftTokenRange = tokenRangeFrom([22 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 92 /* DoKeyword */, 113 /* TryKeyword */, 98 /* FinallyKeyword */, 93 /* ElseKeyword */, 85 /* CatchKeyword */]);
170701
170714
  const highPriorityCommonRules = [
170702
170715
  // Leave comments alone
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.4";
57
- var version = `${versionMajorMinor}.0-dev.20231214`;
57
+ var version = `${versionMajorMinor}.0-dev.20231216`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -6050,6 +6050,8 @@ var Diagnostics = {
6050
6050
  A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
6051
6051
  Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
6052
6052
  Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2866, 1 /* Error */, "Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866", "Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),
6053
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun: diag(2867, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),
6054
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig: diag(2868, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),
6053
6055
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
6054
6056
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
6055
6057
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -25158,6 +25160,12 @@ var Parser;
25158
25160
  if (isBracketed) {
25159
25161
  skipWhitespace();
25160
25162
  }
25163
+ const modifiers = parseModifiers(
25164
+ /*allowDecorators*/
25165
+ false,
25166
+ /*permitConstAsModifier*/
25167
+ true
25168
+ );
25161
25169
  const name = parseJSDocIdentifierName(Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
25162
25170
  let defaultType;
25163
25171
  if (isBracketed) {
@@ -25170,8 +25178,7 @@ var Parser;
25170
25178
  return void 0;
25171
25179
  }
25172
25180
  return finishNode(factory2.createTypeParameterDeclaration(
25173
- /*modifiers*/
25174
- void 0,
25181
+ modifiers,
25175
25182
  name,
25176
25183
  /*constraint*/
25177
25184
  void 0,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.4.0-dev.20231214",
5
+ "version": "5.4.0-dev.20231216",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "20.1.0",
114
114
  "npm": "8.19.4"
115
115
  },
116
- "gitHead": "2c7162143bbbf567ccecc64105010699fa7a2128"
116
+ "gitHead": "4d5ba0316a43ea31c41c50e4d62756659ddffbaa"
117
117
  }