typescript 4.8.0-dev.20220508 → 4.8.0-dev.20220511

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.
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20220508";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20220511";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -8383,6 +8383,7 @@ var ts;
8383
8383
  resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, ts.DiagnosticCategory.Error, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
8384
8384
  resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, ts.DiagnosticCategory.Error, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
8385
8385
  Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1456, ts.DiagnosticCategory.Error, "Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456", "Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),
8386
+ Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk: diag(1457, ts.DiagnosticCategory.Message, "Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457", "Matched by default include pattern '**/*'"),
8386
8387
  The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
8387
8388
  Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
8388
8389
  catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
@@ -14062,6 +14063,16 @@ var ts;
14062
14063
  return node.kind === 324 /* JSDocLink */ || node.kind === 325 /* JSDocLinkCode */ || node.kind === 326 /* JSDocLinkPlain */;
14063
14064
  }
14064
14065
  ts.isJSDocLinkLike = isJSDocLinkLike;
14066
+ function hasRestParameter(s) {
14067
+ var last = ts.lastOrUndefined(s.parameters);
14068
+ return !!last && isRestParameter(last);
14069
+ }
14070
+ ts.hasRestParameter = hasRestParameter;
14071
+ function isRestParameter(node) {
14072
+ var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type;
14073
+ return node.dotDotDotToken !== undefined || !!type && type.kind === 318 /* JSDocVariadicType */;
14074
+ }
14075
+ ts.isRestParameter = isRestParameter;
14065
14076
  // #endregion
14066
14077
  })(ts || (ts = {}));
14067
14078
  /* @internal */
@@ -16832,16 +16843,6 @@ var ts;
16832
16843
  return typeParameters && ts.find(typeParameters, function (p) { return p.name.escapedText === name; });
16833
16844
  }
16834
16845
  ts.getTypeParameterFromJsDoc = getTypeParameterFromJsDoc;
16835
- function hasRestParameter(s) {
16836
- var last = ts.lastOrUndefined(s.parameters);
16837
- return !!last && isRestParameter(last);
16838
- }
16839
- ts.hasRestParameter = hasRestParameter;
16840
- function isRestParameter(node) {
16841
- var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type;
16842
- return node.dotDotDotToken !== undefined || !!type && type.kind === 318 /* JSDocVariadicType */;
16843
- }
16844
- ts.isRestParameter = isRestParameter;
16845
16846
  function hasTypeArguments(node) {
16846
16847
  return !!node.typeArguments;
16847
16848
  }
@@ -34371,6 +34372,10 @@ var ts;
34371
34372
  // isn't actually allowed, but we want to treat it as a lambda so we can provide
34372
34373
  // a good error message.
34373
34374
  if (ts.isModifierKind(second) && second !== 131 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) {
34375
+ if (nextToken() === 127 /* AsKeyword */) {
34376
+ // https://github.com/microsoft/TypeScript/issues/44466
34377
+ return 0 /* False */;
34378
+ }
34374
34379
  return 1 /* True */;
34375
34380
  }
34376
34381
  // If we had "(" followed by something that's not an identifier,
@@ -40960,7 +40965,7 @@ var ts;
40960
40965
  return undefined;
40961
40966
  if (ts.length(specs) !== 1)
40962
40967
  return specs;
40963
- if (specs[0] === "**/*")
40968
+ if (specs[0] === ts.defaultIncludeSpec)
40964
40969
  return undefined;
40965
40970
  return specs;
40966
40971
  }
@@ -41238,6 +41243,8 @@ var ts;
41238
41243
  // until consistent casing errors are reported
41239
41244
  return ts.getDirectoryPath(ts.getNormalizedAbsolutePath(fileName, basePath));
41240
41245
  }
41246
+ /*@internal*/
41247
+ ts.defaultIncludeSpec = "**/*";
41241
41248
  /**
41242
41249
  * Parse the contents of a config file from json or json source file (tsconfig.json).
41243
41250
  * @param json The contents of the config file to parse
@@ -41303,6 +41310,7 @@ var ts;
41303
41310
  }
41304
41311
  var includeSpecs = toPropValue(getSpecsFromRaw("include"));
41305
41312
  var excludeOfRaw = getSpecsFromRaw("exclude");
41313
+ var isDefaultIncludeSpec = false;
41306
41314
  var excludeSpecs = toPropValue(excludeOfRaw);
41307
41315
  if (excludeOfRaw === "no-prop" && raw.compilerOptions) {
41308
41316
  var outDir = raw.compilerOptions.outDir;
@@ -41312,7 +41320,8 @@ var ts;
41312
41320
  }
41313
41321
  }
41314
41322
  if (filesSpecs === undefined && includeSpecs === undefined) {
41315
- includeSpecs = ["**/*"];
41323
+ includeSpecs = [ts.defaultIncludeSpec];
41324
+ isDefaultIncludeSpec = true;
41316
41325
  }
41317
41326
  var validatedIncludeSpecs, validatedExcludeSpecs;
41318
41327
  // The exclude spec list is converted into a regular expression, which allows us to quickly
@@ -41331,7 +41340,8 @@ var ts;
41331
41340
  validatedFilesSpec: ts.filter(filesSpecs, ts.isString),
41332
41341
  validatedIncludeSpecs: validatedIncludeSpecs,
41333
41342
  validatedExcludeSpecs: validatedExcludeSpecs,
41334
- pathPatterns: undefined, // Initialized on first use
41343
+ pathPatterns: undefined,
41344
+ isDefaultIncludeSpec: isDefaultIncludeSpec,
41335
41345
  };
41336
41346
  }
41337
41347
  function getFileNames(basePath) {
@@ -65454,6 +65464,20 @@ var ts;
65454
65464
  }
65455
65465
  }
65456
65466
  }
65467
+ if (relation === comparableRelation && sourceFlags & 262144 /* TypeParameter */) {
65468
+ // This is a carve-out in comparability to essentially forbid comparing a type parameter
65469
+ // with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
65470
+ var constraint = getConstraintOfTypeParameter(source);
65471
+ if (constraint && hasNonCircularBaseConstraint(source)) {
65472
+ while (constraint && constraint.flags & 262144 /* TypeParameter */) {
65473
+ if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false)) {
65474
+ return result;
65475
+ }
65476
+ constraint = getConstraintOfTypeParameter(constraint);
65477
+ }
65478
+ }
65479
+ return 0 /* False */;
65480
+ }
65457
65481
  }
65458
65482
  else if (targetFlags & 4194304 /* Index */) {
65459
65483
  var targetType_1 = target.type;
@@ -65657,8 +65681,8 @@ var ts;
65657
65681
  if (sourceFlags & 8650752 /* TypeVariable */) {
65658
65682
  // IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
65659
65683
  if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
65660
- var constraint = getConstraintOfType(source);
65661
- if (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
65684
+ var constraint = getConstraintOfType(source) || unknownType;
65685
+ if (!getConstraintOfType(source) || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
65662
65686
  // A type variable with no constraint is not related to the non-primitive object type.
65663
65687
  if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
65664
65688
  resetErrorInfo(saveErrorInfo);
@@ -65666,12 +65690,12 @@ var ts;
65666
65690
  }
65667
65691
  }
65668
65692
  // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed
65669
- else if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
65693
+ if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
65670
65694
  resetErrorInfo(saveErrorInfo);
65671
65695
  return result;
65672
65696
  }
65673
65697
  // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
65674
- else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
65698
+ else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && constraint !== unknownType && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
65675
65699
  resetErrorInfo(saveErrorInfo);
65676
65700
  return result;
65677
65701
  }
@@ -72508,7 +72532,25 @@ var ts;
72508
72532
  }
72509
72533
  function getTypeOfPropertyOfContextualType(type, name, nameType) {
72510
72534
  return mapType(type, function (t) {
72511
- var _a;
72535
+ if (t.flags & 2097152 /* Intersection */) {
72536
+ var intersection = t;
72537
+ var newTypes = ts.mapDefined(intersection.types, getTypeOfConcretePropertyOfContextualType);
72538
+ if (newTypes.length > 0) {
72539
+ return getIntersectionType(newTypes);
72540
+ }
72541
+ newTypes = ts.mapDefined(intersection.types, getTypeOfApplicableIndexInfoOfContextualType);
72542
+ if (newTypes.length > 0) {
72543
+ return getIntersectionType(newTypes);
72544
+ }
72545
+ return undefined;
72546
+ }
72547
+ var concretePropertyType = getTypeOfConcretePropertyOfContextualType(t);
72548
+ if (concretePropertyType) {
72549
+ return concretePropertyType;
72550
+ }
72551
+ return getTypeOfApplicableIndexInfoOfContextualType(t);
72552
+ }, /*noReductions*/ true);
72553
+ function getTypeOfConcretePropertyOfContextualType(t) {
72512
72554
  if (isGenericMappedType(t) && !t.declaration.nameType) {
72513
72555
  var constraint = getConstraintTypeFromMappedType(t);
72514
72556
  var constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
@@ -72516,8 +72558,9 @@ var ts;
72516
72558
  if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
72517
72559
  return substituteIndexedMappedType(t, propertyNameType);
72518
72560
  }
72561
+ return undefined;
72519
72562
  }
72520
- else if (t.flags & 3670016 /* StructuredType */) {
72563
+ if (t.flags & 3670016 /* StructuredType */) {
72521
72564
  var prop = getPropertyOfType(t, name);
72522
72565
  if (prop) {
72523
72566
  return isCircularMappedProperty(prop) ? undefined : getTypeOfSymbol(prop);
@@ -72528,10 +72571,16 @@ var ts;
72528
72571
  return restType;
72529
72572
  }
72530
72573
  }
72531
- return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(ts.unescapeLeadingUnderscores(name)))) === null || _a === void 0 ? void 0 : _a.type;
72532
72574
  }
72533
72575
  return undefined;
72534
- }, /*noReductions*/ true);
72576
+ }
72577
+ function getTypeOfApplicableIndexInfoOfContextualType(t) {
72578
+ var _a;
72579
+ if (!(t.flags & 3670016 /* StructuredType */)) {
72580
+ return undefined;
72581
+ }
72582
+ return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(ts.unescapeLeadingUnderscores(name)))) === null || _a === void 0 ? void 0 : _a.type;
72583
+ }
72535
72584
  }
72536
72585
  // In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of
72537
72586
  // the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one
@@ -81005,7 +81054,7 @@ var ts;
81005
81054
  * @param type The type of the promise.
81006
81055
  * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback.
81007
81056
  */
81008
- function getPromisedTypeOfPromise(type, errorNode) {
81057
+ function getPromisedTypeOfPromise(type, errorNode, thisTypeForErrorOut) {
81009
81058
  //
81010
81059
  // { // type
81011
81060
  // then( // thenFunction
@@ -81040,7 +81089,29 @@ var ts;
81040
81089
  }
81041
81090
  return undefined;
81042
81091
  }
81043
- var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 2097152 /* NEUndefinedOrNull */);
81092
+ var thisTypeForError;
81093
+ var candidates;
81094
+ for (var _i = 0, thenSignatures_1 = thenSignatures; _i < thenSignatures_1.length; _i++) {
81095
+ var thenSignature = thenSignatures_1[_i];
81096
+ var thisType = getThisTypeOfSignature(thenSignature);
81097
+ if (thisType && thisType !== voidType && !isTypeRelatedTo(type, thisType, subtypeRelation)) {
81098
+ thisTypeForError = thisType;
81099
+ }
81100
+ else {
81101
+ candidates = ts.append(candidates, thenSignature);
81102
+ }
81103
+ }
81104
+ if (!candidates) {
81105
+ ts.Debug.assertIsDefined(thisTypeForError);
81106
+ if (thisTypeForErrorOut) {
81107
+ thisTypeForErrorOut.value = thisTypeForError;
81108
+ }
81109
+ if (errorNode) {
81110
+ error(errorNode, ts.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForError));
81111
+ }
81112
+ return undefined;
81113
+ }
81114
+ var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(candidates, getTypeOfFirstParameterOfSignature)), 2097152 /* NEUndefinedOrNull */);
81044
81115
  if (isTypeAny(onfulfilledParameterType)) {
81045
81116
  return undefined;
81046
81117
  }
@@ -81164,7 +81235,8 @@ var ts;
81164
81235
  var mapper = errorNode ? function (constituentType) { return getAwaitedTypeNoAlias(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeNoAlias;
81165
81236
  return typeAsAwaitable.awaitedTypeOfType = mapType(type, mapper);
81166
81237
  }
81167
- var promisedType = getPromisedTypeOfPromise(type);
81238
+ var thisTypeForErrorOut = { value: undefined };
81239
+ var promisedType = getPromisedTypeOfPromise(type, /*errorNode*/ undefined, thisTypeForErrorOut);
81168
81240
  if (promisedType) {
81169
81241
  if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) {
81170
81242
  // Verify that we don't have a bad actor in the form of a promise whose
@@ -81233,7 +81305,12 @@ var ts;
81233
81305
  if (isThenableType(type)) {
81234
81306
  if (errorNode) {
81235
81307
  ts.Debug.assertIsDefined(diagnosticMessage);
81236
- error(errorNode, diagnosticMessage, arg0);
81308
+ var chain = void 0;
81309
+ if (thisTypeForErrorOut.value) {
81310
+ chain = ts.chainDiagnosticMessages(chain, ts.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForErrorOut.value));
81311
+ }
81312
+ chain = ts.chainDiagnosticMessages(chain, diagnosticMessage, arg0);
81313
+ diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, chain));
81237
81314
  }
81238
81315
  return undefined;
81239
81316
  }
@@ -118751,7 +118828,7 @@ var ts;
118751
118828
  }
118752
118829
  var matchedByInclude = ts.getMatchedIncludeSpec(program, fileName);
118753
118830
  // Could be additional files specified as roots
118754
- if (!matchedByInclude)
118831
+ if (!matchedByInclude || !ts.isString(matchedByInclude))
118755
118832
  return undefined;
118756
118833
  configFileNode = ts.getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
118757
118834
  message = ts.Diagnostics.File_is_matched_by_include_pattern_specified_here;
@@ -122349,6 +122426,8 @@ var ts;
122349
122426
  if (ts.fileExtensionIsOneOf(fileName, [".json" /* Json */, ".mjs" /* Mjs */, ".cjs" /* Cjs */]))
122350
122427
  return fileName;
122351
122428
  var noExtension = ts.removeFileExtension(fileName);
122429
+ if (fileName === noExtension)
122430
+ return fileName;
122352
122431
  if (ts.fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */]))
122353
122432
  return noExtension + getJSExtensionForFile(fileName, options);
122354
122433
  switch (ending) {
@@ -122637,6 +122716,9 @@ var ts;
122637
122716
  var configFile = program.getCompilerOptions().configFile;
122638
122717
  if (!((_a = configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) === null || _a === void 0 ? void 0 : _a.validatedIncludeSpecs))
122639
122718
  return undefined;
122719
+ // Return true if its default include spec
122720
+ if (configFile.configFileSpecs.isDefaultIncludeSpec)
122721
+ return true;
122640
122722
  var isJsonFile = ts.fileExtensionIs(fileName, ".json" /* Json */);
122641
122723
  var basePath = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
122642
122724
  var useCaseSensitiveFileNames = program.useCaseSensitiveFileNames();
@@ -122702,11 +122784,13 @@ var ts;
122702
122784
  if (matchedByFiles)
122703
122785
  return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Part_of_files_list_in_tsconfig_json);
122704
122786
  var matchedByInclude = getMatchedIncludeSpec(program, fileName);
122705
- return matchedByInclude ?
122787
+ return ts.isString(matchedByInclude) ?
122706
122788
  ts.chainDiagnosticMessages(
122707
122789
  /*details*/ undefined, ts.Diagnostics.Matched_by_include_pattern_0_in_1, matchedByInclude, toFileName(options.configFile, fileNameConvertor)) :
122708
- // Could be additional files specified as roots
122709
- ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Root_file_specified_for_compilation);
122790
+ // Could be additional files specified as roots or matched by default include
122791
+ ts.chainDiagnosticMessages(/*details*/ undefined, matchedByInclude ?
122792
+ ts.Diagnostics.Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk :
122793
+ ts.Diagnostics.Root_file_specified_for_compilation);
122710
122794
  case ts.FileIncludeKind.SourceFromProjectReference:
122711
122795
  case ts.FileIncludeKind.OutputFromProjectReference:
122712
122796
  var isOutput = reason.kind === ts.FileIncludeKind.OutputFromProjectReference;
@@ -575,9 +575,9 @@
575
575
  "Duplicate_label_0_1114": "標籤 '{0}' 重複。",
576
576
  "Duplicate_property_0_2718": "屬性 '{0}' 重複。",
577
577
  "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "動態匯入的指定名稱必須屬於類型 'string',但這裡的類型為 '{0}'。",
578
- "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "只有在 '--module' 旗標設定為 'es2020'、'es2022'、'esnext'、'commonjs'、'amd'、'system'、'umd'、'node12' 或 'nodenext',才支援動態匯入。",
578
+ "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": "只有在 '--module' 旗標設定為 'es2020'、'es2022'、'esnext'、'commonjs'、'amd'、'system'、'umd'、'node16' 或 'nodenext',才支援動態匯入。",
579
579
  "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450": "動態匯入只能接受模組指定名稱和選擇性判斷提示來做為引數",
580
- "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_or_nodenext_1324": "當 '--module' 選項設定為 'esnext' 時,動態匯入只支援第二個引數。",
580
+ "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324": "當 '--module' 選項設定為 'esnext'、'node16' 或 'nodenext' 時,動態匯入只支援第二個引數。",
581
581
  "Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762": "等位型別 '{0}' 的每個成員都有建構簽章,但這些簽章都互不相容。",
582
582
  "Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758": "等位型別 '{0}' 的每個成員都有簽章,但這些簽章都互不相容。",
583
583
  "Editor_Support_6249": "編輯器支援",
@@ -856,7 +856,6 @@
856
856
  "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "JSDoc '@typedef' 標記應具有類型註解,或者其後接著 '@property' 或 '@member' 標記。",
857
857
  "JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "JSDoc 類型只能在文件註解中使用。",
858
858
  "JSDoc_types_may_be_moved_to_TypeScript_types_80004": "JSDoc 類型可移為 TypeScript 類型。",
859
- "JSON_imports_are_experimental_in_ES_module_mode_imports_7062": "JSON 匯入在 ES 模組模式匯入中為實驗性。",
860
859
  "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000": "只能將非空白的 'expression' 指派給 JSX 屬性。",
861
860
  "JSX_element_0_has_no_corresponding_closing_tag_17008": "JSX 元素 '{0}' 沒有對應的結尾標記。",
862
861
  "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607": "因為 JSX 項目類別沒有 '{0}' 屬性 (property),所以不支援屬性 (attribute)。",
@@ -1160,8 +1159,8 @@
1160
1159
  "Referenced_project_0_may_not_disable_emit_6310": "參考的專案 '{0}' 不得停用發出。",
1161
1160
  "Referenced_project_0_must_have_setting_composite_Colon_true_6306": "參考的專案 '{0}' 之設定 \"composite\" 必須為 true。",
1162
1161
  "Referenced_via_0_from_file_1_1400": "透過 '{0}' 從檔案 '{1}' 參考",
1163
- "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834": "當 '--moduleResolution' 為 'node12' 或 'nodenext' 時,相對匯入路徑在 EcmaScript 匯入中需要明確的副檔名。請考慮將延伸模組新增到匯入路徑。",
1164
- "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835": "當 '--moduleResolution' 為 'node12' 或 'nodenext' 時,相對匯入路徑在 EcmaScript 匯入中需要明確的副檔名。您是 指 '{0}' 嗎?",
1162
+ "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834": "當 '--moduleResolution' 為 'node16' 或 'nodenext' 時,相對匯入路徑在 EcmaScript 匯入中需要明確的副檔名。請考慮將副檔名新增到匯入路徑。",
1163
+ "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835": "當 '--moduleResolution' 為 'node16' 或 'nodenext' 時,相對匯入路徑在 EcmaScript 匯入中需要明確的副檔名。您是 指 '{0}' 嗎?",
1165
1164
  "Remove_a_list_of_directories_from_the_watch_process_6628": "從監看處理序移除目錄清單。",
1166
1165
  "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629": "從監視模式的處理移除檔案清單。",
1167
1166
  "Remove_all_unnecessary_override_modifiers_95163": "移除所有不必要的 'override' 修飾元",
@@ -1200,7 +1199,7 @@
1200
1199
  "Required_type_parameters_may_not_follow_optional_type_parameters_2706": "必要型別參數可能未遵循選擇性型別參數。",
1201
1200
  "Resolution_for_module_0_was_found_in_cache_from_location_1_6147": "從位置 '{1}' 的快取中找到模組 '{0}' 的解析。",
1202
1201
  "Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241": "從位置 '{0}' 的快取記憶體找到類型參照指示詞 '{1}'。",
1203
- "Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452": "只有當 'moduleResolution' 為 'node12' 或 'nodenext' 時,才支援解析模式。",
1202
+ "Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452": "只有當 'moduleResolution' 為 'node16' 或 'nodenext' 時,才支援解析模式。",
1204
1203
  "Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195": "只將 'keyof' 解析為字串值的屬性名稱 (無任何數字或符號)。",
1205
1204
  "Resolving_module_0_from_1_6086": "======== 正在從 '{1}' 解析模組 '{0}'。========",
1206
1205
  "Resolving_module_name_0_relative_to_base_url_1_2_6094": "正在解析與基底 URL '{1}' 相對的模組名稱 '{0}' - '{2}'。",
@@ -1370,6 +1369,7 @@
1370
1369
  "The_character_set_of_the_input_files_6163": "輸入檔的字元集。",
1371
1370
  "The_containing_arrow_function_captures_the_global_value_of_this_7041": "包含的箭號函式會擷取 'this' 的全域值。",
1372
1371
  "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "內含的函式或模組主體對控制流程分析而言過大。",
1372
+ "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309": "目前的檔案是 CommonJS 模組,無法在最上層使用 'await'。",
1373
1373
  "The_current_host_does_not_support_the_0_option_5001": "目前的主機不支援 '{0}' 選項。",
1374
1374
  "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018": "您可能要使用的 '{0}' 宣告定義於此處",
1375
1375
  "The_declaration_was_marked_as_deprecated_here_2798": "該宣告在這裡標示為已淘汰。",
@@ -1384,7 +1384,7 @@
1384
1384
  "The_global_type_JSX_0_may_not_have_more_than_one_property_2608": "全域類型 'JSX.{0}' 的屬性不得超過一個。",
1385
1385
  "The_implementation_signature_is_declared_here_2750": "實作簽章宣告於此處。",
1386
1386
  "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470": "將會組建至 CommonJS 輸出的檔案中不允許 'import.meta' 中繼屬性。",
1387
- "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343": "只有當 '--module' 選項為 'es2020'、'es2022'、'esnext'、'system'、, 'node12' 或 'nodenext' 時,才允許 'import.meta' 中繼屬性。",
1387
+ "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343": "只有當 '--module' 選項為 'es2020'、'es2022'、'esnext'、'system'、, 'node16' 或 'nodenext' 時,才允許 'import.meta' 中繼屬性。",
1388
1388
  "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "'{0}' 的推斷類型無法在沒有 '{1}' 參考的情況下命名。其可能非可攜式。必須有型別註解。",
1389
1389
  "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "'{0}' 的推斷型別參考了具有迴圈結構且不是可完整序列化的型別。必須有型別註解。",
1390
1390
  "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "'{0}' 的推斷型別參考了無法存取的 '{1}' 型別。必須有型別註解。",
@@ -1418,6 +1418,8 @@
1418
1418
  "The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777": "遞增或遞減運算子的運算元不可為選擇性屬性存取。",
1419
1419
  "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357": "遞增或遞減運算子的運算元必須是變數或屬性存取。",
1420
1420
  "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007": "剖析器需要找到 '{1}',以對應此處的 '{0}' 權杖。",
1421
+ "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209": "專案根目錄模棱兩可,但需要用以解決檔案 '{1}' 中的匯出對應項目 '{0}'。請提供 'rootDir' 編譯器選項來釐清。",
1422
+ "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210": "專案根目錄模稜兩可,但需要在檔案 '{1}' 中解析匯入對應項目 '{0}'。請提供 'rootDir' 編譯器選項來釐清。",
1421
1423
  "The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014": "無法在此類別內的類型 '{1}' 上存取屬性 '{0}',原因是另一個拼字相同的私人識別碼已將其陰影。",
1422
1424
  "The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type_2380": "'get' 存取子的傳回型別必須可指派給其 'set' 存取子類型",
1423
1425
  "The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237": "參數裝飾項目函式的傳回型別必須是 'void' 或 'any'。",
@@ -1483,11 +1485,10 @@
1483
1485
  "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "此語法需要已匯入的協助程式,但找不到模組 '{0}'。",
1484
1486
  "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "此語法需要名為 '{1}' 的已匯入協助程式,但其不存在於 '{0}' 中。請考慮升級您的 '{0}' 版本。",
1485
1487
  "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "此語法需要名為 '{1}' 且具有 {2} 參數的匯入協助程式,其與 '{0}' 中的參數不相容。請考慮升級 '{0}' 的版本。",
1486
- "This_type_parameter_probably_needs_an_extends_object_constraint_2208": "此類型參數可能需要 'extends object' 限制式。",
1487
1488
  "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": "此 'import' 的使用方式無效。'import()' 呼叫可以寫入,但必須有括弧,而且不能有類型引數。",
1488
- "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "只有在 'module' 選項設定為 'es2022'、'esnext'、'system' 或 'nodenext',而且 'target' 選項設定為 'es2017' 或更高版本時,才允許最上層的 'await' 運算式。",
1489
+ "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378": "只有在 'module' 選項設定為 'es2022'、'esnext'、'system'、'node16' 或 'nodenext',而且 'target' 選項設定為 'es2017' 或更高版本時,才允許最上層的 'await' 運算式。",
1489
1490
  "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts 檔案中的最上層宣告必須以 'declare' 或 'export' 修飾元開頭。",
1490
- "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "只有在 'module' 選項設為 'es2022'、'esnext'、'system' 或 'nodenext',而且 'target' 選項設為 'es2017' 或更高版本時,才允許最上層的 'for await' 迴圈。",
1491
+ "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432": "只有在 'module' 選項設為 'es2022'、'esnext'、'system'、'node16' 或 'nodenext',而且 'target' 選項設為 'es2017' 或更高版本時,才允許最上層的 'for await' 迴圈。",
1491
1492
  "Trailing_comma_not_allowed_1009": "尾端不得為逗號。",
1492
1493
  "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "以個別模組的形式轉換每個檔案的語言 (類似於 'ts.transpileModule')。",
1493
1494
  "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "如有 `npm i --save-dev @types/{1}`,請嘗試使用,或新增包含 `declare module '{0}';` 的宣告 (.d.ts) 檔案",
@@ -1727,7 +1728,7 @@
1727
1728
  "abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": "'abstract' 修飾元只能出現在類別宣告、方法宣告或屬性宣告。",
1728
1729
  "and_here_6204": "及此處。",
1729
1730
  "arguments_cannot_be_referenced_in_property_initializers_2815": "屬性初始設定式中不得參考 'arguments'。",
1730
- "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": 處理具有 imports、exports、import.meta, jsx (具有 jsx: react-jsx) 或 esm 格式 (具有 module: node12+) 的檔案作為模組。",
1731
+ "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": "\"auto\": 處理具有 imports、exports、import.meta, jsx (具有 jsx: react-jsx) 的檔案,或以 esm 格式 (具有 module: node16+) 作為模組。",
1731
1732
  "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": "當檔案為模組時,只允許 'await' 運算式位於檔案的最上層,但是此檔案沒有匯入或匯出。請考慮新增空白的 'export {}',使這個檔案成為模組。",
1732
1733
  "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308": "只允許在非同步函式中與模組的最上層使用 'await' 運算式。",
1733
1734
  "await_expressions_cannot_be_used_in_a_parameter_initializer_2524": "'await' 運算式不得用於參數初始設定式。",
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": "4.8.0-dev.20220508",
5
+ "version": "4.8.0-dev.20220511",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [