typescript 5.4.0-dev.20240102 → 5.4.0-dev.20240104

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.
@@ -0,0 +1,28 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+ /// <reference no-default-lib="true"/>
18
+
19
+ /////////////////////////////
20
+ /// Window Async Iterable APIs
21
+ /////////////////////////////
22
+
23
+ interface FileSystemDirectoryHandle {
24
+ [Symbol.asyncIterator](): AsyncIterableIterator<[string, FileSystemHandle]>;
25
+ entries(): AsyncIterableIterator<[string, FileSystemHandle]>;
26
+ keys(): AsyncIterableIterator<string>;
27
+ values(): AsyncIterableIterator<FileSystemHandle>;
28
+ }
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -0,0 +1,28 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+ /// <reference no-default-lib="true"/>
18
+
19
+ /////////////////////////////
20
+ /// Worker Async Iterable APIs
21
+ /////////////////////////////
22
+
23
+ interface FileSystemDirectoryHandle {
24
+ [Symbol.asyncIterator](): AsyncIterableIterator<[string, FileSystemHandle]>;
25
+ entries(): AsyncIterableIterator<[string, FileSystemHandle]>;
26
+ keys(): AsyncIterableIterator<string>;
27
+ values(): AsyncIterableIterator<FileSystemHandle>;
28
+ }
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.20240102`;
21
+ var version = `${versionMajorMinor}.0-dev.20240104`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -33755,7 +33755,25 @@ var IncrementalParser;
33755
33755
  })(InvalidPosition || (InvalidPosition = {}));
33756
33756
  })(IncrementalParser || (IncrementalParser = {}));
33757
33757
  function isDeclarationFileName(fileName) {
33758
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
33758
+ return getDeclarationFileExtension(fileName) !== void 0;
33759
+ }
33760
+ function getDeclarationFileExtension(fileName) {
33761
+ const standardExtension = getAnyExtensionFromPath(
33762
+ fileName,
33763
+ supportedDeclarationExtensions,
33764
+ /*ignoreCase*/
33765
+ false
33766
+ );
33767
+ if (standardExtension) {
33768
+ return standardExtension;
33769
+ }
33770
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
33771
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
33772
+ if (index >= 0) {
33773
+ return fileName.substring(index);
33774
+ }
33775
+ }
33776
+ return void 0;
33759
33777
  }
33760
33778
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
33761
33779
  if (!mode) {
@@ -34003,9 +34021,11 @@ var libEntries = [
34003
34021
  // Host only
34004
34022
  ["dom", "lib.dom.d.ts"],
34005
34023
  ["dom.iterable", "lib.dom.iterable.d.ts"],
34024
+ ["dom.asynciterable", "lib.dom.asynciterable.d.ts"],
34006
34025
  ["webworker", "lib.webworker.d.ts"],
34007
34026
  ["webworker.importscripts", "lib.webworker.importscripts.d.ts"],
34008
34027
  ["webworker.iterable", "lib.webworker.iterable.d.ts"],
34028
+ ["webworker.asynciterable", "lib.webworker.asynciterable.d.ts"],
34009
34029
  ["scripthost", "lib.scripthost.d.ts"],
34010
34030
  // ES2015 Or ESNext By-feature options
34011
34031
  ["es2015.core", "lib.es2015.core.d.ts"],
@@ -50959,7 +50979,7 @@ function createTypeChecker(host) {
50959
50979
  });
50960
50980
  }
50961
50981
  function serializeAsAlias(symbol, localName, modifierFlags) {
50962
- var _a2, _b, _c, _d, _e;
50982
+ var _a2, _b, _c, _d, _e, _f;
50963
50983
  const node = getDeclarationOfAliasSymbol(symbol);
50964
50984
  if (!node)
50965
50985
  return Debug.fail();
@@ -51157,6 +51177,9 @@ function createTypeChecker(host) {
51157
51177
  }
51158
51178
  case 281 /* ExportSpecifier */:
51159
51179
  const specifier = node.parent.parent.moduleSpecifier;
51180
+ if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
51181
+ verbatimTargetName = "default" /* Default */;
51182
+ }
51160
51183
  serializeExportSpecifier(
51161
51184
  unescapeLeadingUnderscores(symbol.escapedName),
51162
51185
  specifier ? verbatimTargetName : targetName,
@@ -59053,6 +59076,12 @@ function createTypeChecker(host) {
59053
59076
  return type;
59054
59077
  }
59055
59078
  function getESSymbolLikeTypeForNode(node) {
59079
+ if (isInJSFile(node) && isJSDocTypeExpression(node)) {
59080
+ const host2 = getJSDocHost(node);
59081
+ if (host2) {
59082
+ node = getSingleVariableOfVariableStatement(host2) || host2;
59083
+ }
59084
+ }
59056
59085
  if (isValidESSymbolDeclaration(node)) {
59057
59086
  const symbol = isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node);
59058
59087
  if (symbol) {
@@ -61997,7 +62026,7 @@ function createTypeChecker(host) {
61997
62026
  }
61998
62027
  if (relation === comparableRelation && sourceFlags & 262144 /* TypeParameter */) {
61999
62028
  let constraint = getConstraintOfTypeParameter(source2);
62000
- if (constraint && hasNonCircularBaseConstraint(source2)) {
62029
+ if (constraint) {
62001
62030
  while (constraint && someType(constraint, (c) => !!(c.flags & 262144 /* TypeParameter */))) {
62002
62031
  if (result2 = isRelatedTo(
62003
62032
  constraint,
@@ -64626,6 +64655,9 @@ function createTypeChecker(host) {
64626
64655
  inferToTemplateLiteralType(source, target);
64627
64656
  } else {
64628
64657
  source = getReducedType(source);
64658
+ if (isGenericMappedType(source) && isGenericMappedType(target)) {
64659
+ invokeOnce(source, target, inferFromGenericMappedTypes);
64660
+ }
64629
64661
  if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
64630
64662
  const apparentSource = getApparentType(source);
64631
64663
  if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
@@ -64889,6 +64921,14 @@ function createTypeChecker(host) {
64889
64921
  }
64890
64922
  }
64891
64923
  }
64924
+ function inferFromGenericMappedTypes(source, target) {
64925
+ inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
64926
+ inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
64927
+ const sourceNameType = getNameTypeFromMappedType(source);
64928
+ const targetNameType = getNameTypeFromMappedType(target);
64929
+ if (sourceNameType && targetNameType)
64930
+ inferFromTypes(sourceNameType, targetNameType);
64931
+ }
64892
64932
  function inferFromObjectTypes(source, target) {
64893
64933
  var _a, _b;
64894
64934
  if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
@@ -64896,12 +64936,7 @@ function createTypeChecker(host) {
64896
64936
  return;
64897
64937
  }
64898
64938
  if (isGenericMappedType(source) && isGenericMappedType(target)) {
64899
- inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
64900
- inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
64901
- const sourceNameType = getNameTypeFromMappedType(source);
64902
- const targetNameType = getNameTypeFromMappedType(target);
64903
- if (sourceNameType && targetNameType)
64904
- inferFromTypes(sourceNameType, targetNameType);
64939
+ inferFromGenericMappedTypes(source, target);
64905
64940
  }
64906
64941
  if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {
64907
64942
  const constraintType = getConstraintTypeFromMappedType(target);
package/lib/tsserver.js CHANGED
@@ -269,6 +269,7 @@ __export(server_exports, {
269
269
  changeAnyExtension: () => changeAnyExtension,
270
270
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
271
271
  changeExtension: () => changeExtension,
272
+ changeFullExtension: () => changeFullExtension,
272
273
  changesAffectModuleResolution: () => changesAffectModuleResolution,
273
274
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
274
275
  childIsDecorated: () => childIsDecorated,
@@ -708,6 +709,7 @@ __export(server_exports, {
708
709
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
709
710
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
710
711
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
712
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
711
713
  getDeclarationFromName: () => getDeclarationFromName,
712
714
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
713
715
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -2339,7 +2341,7 @@ module.exports = __toCommonJS(server_exports);
2339
2341
 
2340
2342
  // src/compiler/corePublic.ts
2341
2343
  var versionMajorMinor = "5.4";
2342
- var version = `${versionMajorMinor}.0-dev.20240102`;
2344
+ var version = `${versionMajorMinor}.0-dev.20240104`;
2343
2345
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2344
2346
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2345
2347
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9107,6 +9109,13 @@ function changeAnyExtension(path, ext, extensions, ignoreCase) {
9107
9109
  const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);
9108
9110
  return pathext ? path.slice(0, path.length - pathext.length) + (startsWith(ext, ".") ? ext : "." + ext) : path;
9109
9111
  }
9112
+ function changeFullExtension(path, newExtension) {
9113
+ const declarationExtension = getDeclarationFileExtension(path);
9114
+ if (declarationExtension) {
9115
+ return path.slice(0, path.length - declarationExtension.length) + (startsWith(newExtension, ".") ? newExtension : "." + newExtension);
9116
+ }
9117
+ return changeAnyExtension(path, newExtension);
9118
+ }
9110
9119
  var relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;
9111
9120
  function comparePathsWorker(a, b, componentComparer) {
9112
9121
  if (a === b)
@@ -38174,7 +38183,25 @@ var IncrementalParser;
38174
38183
  })(InvalidPosition || (InvalidPosition = {}));
38175
38184
  })(IncrementalParser || (IncrementalParser = {}));
38176
38185
  function isDeclarationFileName(fileName) {
38177
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
38186
+ return getDeclarationFileExtension(fileName) !== void 0;
38187
+ }
38188
+ function getDeclarationFileExtension(fileName) {
38189
+ const standardExtension = getAnyExtensionFromPath(
38190
+ fileName,
38191
+ supportedDeclarationExtensions,
38192
+ /*ignoreCase*/
38193
+ false
38194
+ );
38195
+ if (standardExtension) {
38196
+ return standardExtension;
38197
+ }
38198
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
38199
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
38200
+ if (index >= 0) {
38201
+ return fileName.substring(index);
38202
+ }
38203
+ }
38204
+ return void 0;
38178
38205
  }
38179
38206
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
38180
38207
  if (!mode) {
@@ -38422,9 +38449,11 @@ var libEntries = [
38422
38449
  // Host only
38423
38450
  ["dom", "lib.dom.d.ts"],
38424
38451
  ["dom.iterable", "lib.dom.iterable.d.ts"],
38452
+ ["dom.asynciterable", "lib.dom.asynciterable.d.ts"],
38425
38453
  ["webworker", "lib.webworker.d.ts"],
38426
38454
  ["webworker.importscripts", "lib.webworker.importscripts.d.ts"],
38427
38455
  ["webworker.iterable", "lib.webworker.iterable.d.ts"],
38456
+ ["webworker.asynciterable", "lib.webworker.asynciterable.d.ts"],
38428
38457
  ["scripthost", "lib.scripthost.d.ts"],
38429
38458
  // ES2015 Or ESNext By-feature options
38430
38459
  ["es2015.core", "lib.es2015.core.d.ts"],
@@ -43171,7 +43200,7 @@ function loadEntrypointsFromExportMap(scope, exports2, state, extensions) {
43171
43200
  /*excludes*/
43172
43201
  void 0,
43173
43202
  [
43174
- isDeclarationFileName(target) ? replaceFirstStar(target, "**/*") : changeAnyExtension(replaceFirstStar(target, "**/*"), getDeclarationEmitExtensionForPath(target))
43203
+ changeFullExtension(replaceFirstStar(target, "**/*"), ".*")
43175
43204
  ]
43176
43205
  ).forEach((entry) => {
43177
43206
  entrypoints = appendIfUnique(entrypoints, {
@@ -55678,7 +55707,7 @@ function createTypeChecker(host) {
55678
55707
  });
55679
55708
  }
55680
55709
  function serializeAsAlias(symbol, localName, modifierFlags) {
55681
- var _a2, _b, _c, _d, _e;
55710
+ var _a2, _b, _c, _d, _e, _f;
55682
55711
  const node = getDeclarationOfAliasSymbol(symbol);
55683
55712
  if (!node)
55684
55713
  return Debug.fail();
@@ -55876,6 +55905,9 @@ function createTypeChecker(host) {
55876
55905
  }
55877
55906
  case 281 /* ExportSpecifier */:
55878
55907
  const specifier = node.parent.parent.moduleSpecifier;
55908
+ if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
55909
+ verbatimTargetName = "default" /* Default */;
55910
+ }
55879
55911
  serializeExportSpecifier(
55880
55912
  unescapeLeadingUnderscores(symbol.escapedName),
55881
55913
  specifier ? verbatimTargetName : targetName,
@@ -63772,6 +63804,12 @@ function createTypeChecker(host) {
63772
63804
  return type;
63773
63805
  }
63774
63806
  function getESSymbolLikeTypeForNode(node) {
63807
+ if (isInJSFile(node) && isJSDocTypeExpression(node)) {
63808
+ const host2 = getJSDocHost(node);
63809
+ if (host2) {
63810
+ node = getSingleVariableOfVariableStatement(host2) || host2;
63811
+ }
63812
+ }
63775
63813
  if (isValidESSymbolDeclaration(node)) {
63776
63814
  const symbol = isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node);
63777
63815
  if (symbol) {
@@ -66716,7 +66754,7 @@ function createTypeChecker(host) {
66716
66754
  }
66717
66755
  if (relation === comparableRelation && sourceFlags & 262144 /* TypeParameter */) {
66718
66756
  let constraint = getConstraintOfTypeParameter(source2);
66719
- if (constraint && hasNonCircularBaseConstraint(source2)) {
66757
+ if (constraint) {
66720
66758
  while (constraint && someType(constraint, (c) => !!(c.flags & 262144 /* TypeParameter */))) {
66721
66759
  if (result2 = isRelatedTo(
66722
66760
  constraint,
@@ -69345,6 +69383,9 @@ function createTypeChecker(host) {
69345
69383
  inferToTemplateLiteralType(source, target);
69346
69384
  } else {
69347
69385
  source = getReducedType(source);
69386
+ if (isGenericMappedType(source) && isGenericMappedType(target)) {
69387
+ invokeOnce(source, target, inferFromGenericMappedTypes);
69388
+ }
69348
69389
  if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
69349
69390
  const apparentSource = getApparentType(source);
69350
69391
  if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
@@ -69608,6 +69649,14 @@ function createTypeChecker(host) {
69608
69649
  }
69609
69650
  }
69610
69651
  }
69652
+ function inferFromGenericMappedTypes(source, target) {
69653
+ inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
69654
+ inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
69655
+ const sourceNameType = getNameTypeFromMappedType(source);
69656
+ const targetNameType = getNameTypeFromMappedType(target);
69657
+ if (sourceNameType && targetNameType)
69658
+ inferFromTypes(sourceNameType, targetNameType);
69659
+ }
69611
69660
  function inferFromObjectTypes(source, target) {
69612
69661
  var _a, _b;
69613
69662
  if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
@@ -69615,12 +69664,7 @@ function createTypeChecker(host) {
69615
69664
  return;
69616
69665
  }
69617
69666
  if (isGenericMappedType(source) && isGenericMappedType(target)) {
69618
- inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
69619
- inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
69620
- const sourceNameType = getNameTypeFromMappedType(source);
69621
- const targetNameType = getNameTypeFromMappedType(target);
69622
- if (sourceNameType && targetNameType)
69623
- inferFromTypes(sourceNameType, targetNameType);
69667
+ inferFromGenericMappedTypes(source, target);
69624
69668
  }
69625
69669
  if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {
69626
69670
  const constraintType = getConstraintTypeFromMappedType(target);
@@ -134218,10 +134262,11 @@ function buildLinkParts(link, checker) {
134218
134262
  }
134219
134263
  } else {
134220
134264
  const symbol = checker == null ? void 0 : checker.getSymbolAtLocation(link.name);
134265
+ const targetSymbol = symbol && checker ? getSymbolTarget(symbol, checker) : void 0;
134221
134266
  const suffix = findLinkNameEnd(link.text);
134222
134267
  const name = getTextOfNode(link.name) + link.text.slice(0, suffix);
134223
134268
  const text = skipSeparatorFromLinkText(link.text.slice(suffix));
134224
- const decl = (symbol == null ? void 0 : symbol.valueDeclaration) || ((_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a[0]);
134269
+ const decl = (targetSymbol == null ? void 0 : targetSymbol.valueDeclaration) || ((_a = targetSymbol == null ? void 0 : targetSymbol.declarations) == null ? void 0 : _a[0]);
134225
134270
  if (decl) {
134226
134271
  parts.push(linkNamePart(name, decl));
134227
134272
  if (text)
@@ -147624,21 +147669,24 @@ __export(ts_CallHierarchy_exports, {
147624
147669
  function isNamedExpression(node) {
147625
147670
  return (isFunctionExpression(node) || isClassExpression(node)) && isNamedDeclaration(node);
147626
147671
  }
147627
- function isConstNamedExpression(node) {
147628
- return (isFunctionExpression(node) || isArrowFunction(node) || isClassExpression(node)) && isVariableDeclaration(node.parent) && node === node.parent.initializer && isIdentifier(node.parent.name) && !!(getCombinedNodeFlags(node.parent) & 2 /* Const */);
147672
+ function isVariableLike2(node) {
147673
+ return isPropertyDeclaration(node) || isVariableDeclaration(node);
147674
+ }
147675
+ function isAssignedExpression(node) {
147676
+ return (isFunctionExpression(node) || isArrowFunction(node) || isClassExpression(node)) && isVariableLike2(node.parent) && node === node.parent.initializer && isIdentifier(node.parent.name) && (!!(getCombinedNodeFlags(node.parent) & 2 /* Const */) || isPropertyDeclaration(node.parent));
147629
147677
  }
147630
147678
  function isPossibleCallHierarchyDeclaration(node) {
147631
147679
  return isSourceFile(node) || isModuleDeclaration(node) || isFunctionDeclaration(node) || isFunctionExpression(node) || isClassDeclaration(node) || isClassExpression(node) || isClassStaticBlockDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isGetAccessorDeclaration(node) || isSetAccessorDeclaration(node);
147632
147680
  }
147633
147681
  function isValidCallHierarchyDeclaration(node) {
147634
- return isSourceFile(node) || isModuleDeclaration(node) && isIdentifier(node.name) || isFunctionDeclaration(node) || isClassDeclaration(node) || isClassStaticBlockDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isGetAccessorDeclaration(node) || isSetAccessorDeclaration(node) || isNamedExpression(node) || isConstNamedExpression(node);
147682
+ return isSourceFile(node) || isModuleDeclaration(node) && isIdentifier(node.name) || isFunctionDeclaration(node) || isClassDeclaration(node) || isClassStaticBlockDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isGetAccessorDeclaration(node) || isSetAccessorDeclaration(node) || isNamedExpression(node) || isAssignedExpression(node);
147635
147683
  }
147636
147684
  function getCallHierarchyDeclarationReferenceNode(node) {
147637
147685
  if (isSourceFile(node))
147638
147686
  return node;
147639
147687
  if (isNamedDeclaration(node))
147640
147688
  return node.name;
147641
- if (isConstNamedExpression(node))
147689
+ if (isAssignedExpression(node))
147642
147690
  return node.parent.name;
147643
147691
  return Debug.checkDefined(node.modifiers && find(node.modifiers, isDefaultModifier3));
147644
147692
  }
@@ -147668,7 +147716,7 @@ function getCallHierarchyItemName(program, node) {
147668
147716
  const prefix = symbol ? `${typeChecker.symbolToString(symbol, node.parent)} ` : "";
147669
147717
  return { text: `${prefix}static {}`, pos, end };
147670
147718
  }
147671
- const declName = isConstNamedExpression(node) ? node.parent.name : Debug.checkDefined(getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
147719
+ const declName = isAssignedExpression(node) ? node.parent.name : Debug.checkDefined(getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
147672
147720
  let text = isIdentifier(declName) ? idText(declName) : isStringOrNumericLiteralLike(declName) ? declName.text : isComputedPropertyName(declName) ? isStringOrNumericLiteralLike(declName.expression) ? declName.expression.text : void 0 : void 0;
147673
147721
  if (text === void 0) {
147674
147722
  const typeChecker = program.getTypeChecker();
@@ -147684,8 +147732,11 @@ function getCallHierarchyItemName(program, node) {
147684
147732
  return { text, pos: declName.getStart(), end: declName.getEnd() };
147685
147733
  }
147686
147734
  function getCallHierarchItemContainerName(node) {
147687
- var _a, _b;
147688
- if (isConstNamedExpression(node)) {
147735
+ var _a, _b, _c, _d;
147736
+ if (isAssignedExpression(node)) {
147737
+ if (isPropertyDeclaration(node.parent) && isClassLike(node.parent.parent)) {
147738
+ return isClassExpression(node.parent.parent) ? (_a = getAssignedName(node.parent.parent)) == null ? void 0 : _a.getText() : (_b = node.parent.parent.name) == null ? void 0 : _b.getText();
147739
+ }
147689
147740
  if (isModuleBlock(node.parent.parent.parent.parent) && isIdentifier(node.parent.parent.parent.parent.parent.name)) {
147690
147741
  return node.parent.parent.parent.parent.parent.name.getText();
147691
147742
  }
@@ -147696,9 +147747,9 @@ function getCallHierarchItemContainerName(node) {
147696
147747
  case 178 /* SetAccessor */:
147697
147748
  case 174 /* MethodDeclaration */:
147698
147749
  if (node.parent.kind === 210 /* ObjectLiteralExpression */) {
147699
- return (_a = getAssignedName(node.parent)) == null ? void 0 : _a.getText();
147750
+ return (_c = getAssignedName(node.parent)) == null ? void 0 : _c.getText();
147700
147751
  }
147701
- return (_b = getNameOfDeclaration(node.parent)) == null ? void 0 : _b.getText();
147752
+ return (_d = getNameOfDeclaration(node.parent)) == null ? void 0 : _d.getText();
147702
147753
  case 262 /* FunctionDeclaration */:
147703
147754
  case 263 /* ClassDeclaration */:
147704
147755
  case 267 /* ModuleDeclaration */:
@@ -147771,7 +147822,7 @@ function resolveCallHierarchyDeclaration(program, location) {
147771
147822
  const ancestor = findAncestor(location.parent, isValidCallHierarchyDeclaration);
147772
147823
  return ancestor && findImplementationOrAllInitialDeclarations(typeChecker, ancestor);
147773
147824
  }
147774
- if (isVariableDeclaration(location.parent) && location.parent.initializer && isConstNamedExpression(location.parent.initializer)) {
147825
+ if (isVariableLike2(location.parent) && location.parent.initializer && isAssignedExpression(location.parent.initializer)) {
147775
147826
  return location.parent.initializer;
147776
147827
  }
147777
147828
  return void 0;
@@ -147786,7 +147837,7 @@ function resolveCallHierarchyDeclaration(program, location) {
147786
147837
  location = location.parent;
147787
147838
  continue;
147788
147839
  }
147789
- if (isVariableDeclaration(location) && location.initializer && isConstNamedExpression(location.initializer)) {
147840
+ if (isVariableDeclaration(location) && location.initializer && isAssignedExpression(location.initializer)) {
147790
147841
  return location.initializer;
147791
147842
  }
147792
147843
  if (!followingSymbol) {
@@ -153742,21 +153793,14 @@ function addEnumMemberDeclaration(changes, checker, { token, parentDeclaration }
153742
153793
  const type = checker.getTypeAtLocation(member);
153743
153794
  return !!(type && type.flags & 402653316 /* StringLike */);
153744
153795
  });
153796
+ const sourceFile = parentDeclaration.getSourceFile();
153745
153797
  const enumMember = factory.createEnumMember(token, hasStringInitializer ? factory.createStringLiteral(token.text) : void 0);
153746
- changes.replaceNode(
153747
- parentDeclaration.getSourceFile(),
153748
- parentDeclaration,
153749
- factory.updateEnumDeclaration(
153750
- parentDeclaration,
153751
- parentDeclaration.modifiers,
153752
- parentDeclaration.name,
153753
- concatenate(parentDeclaration.members, singleElementArray(enumMember))
153754
- ),
153755
- {
153756
- leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll,
153757
- trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude
153758
- }
153759
- );
153798
+ const last2 = lastOrUndefined(parentDeclaration.members);
153799
+ if (last2) {
153800
+ changes.insertNodeInListAfter(sourceFile, last2, enumMember, parentDeclaration.members);
153801
+ } else {
153802
+ changes.insertMemberAtStart(sourceFile, parentDeclaration, enumMember);
153803
+ }
153760
153804
  }
153761
153805
  function addFunctionDeclaration(changes, context, info) {
153762
153806
  const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
@@ -153859,7 +153903,7 @@ function tryGetValueFromType(context, checker, importAdder, quotePreference, typ
153859
153903
  /*enclosingDeclaration*/
153860
153904
  void 0,
153861
153905
  /*flags*/
153862
- void 0
153906
+ 64 /* UseFullyQualifiedType */
153863
153907
  );
153864
153908
  return enumMember === void 0 || name === void 0 ? factory.createNumericLiteral(0) : factory.createPropertyAccessExpression(name, checker.symbolToString(enumMember));
153865
153909
  }
@@ -170284,7 +170328,7 @@ ${options.prefix}` : "\n" : options.prefix
170284
170328
  const afterMinusOneStartLinePosition = getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile);
170285
170329
  multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition;
170286
170330
  }
170287
- if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) {
170331
+ if (hasCommentsBeforeLineBreak(sourceFile.text, after.end) || !positionsAreOnSameLine(containingList.pos, containingList.end, sourceFile)) {
170288
170332
  multilineList = true;
170289
170333
  }
170290
170334
  if (multilineList) {
@@ -173939,6 +173983,7 @@ __export(ts_exports2, {
173939
173983
  changeAnyExtension: () => changeAnyExtension,
173940
173984
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
173941
173985
  changeExtension: () => changeExtension,
173986
+ changeFullExtension: () => changeFullExtension,
173942
173987
  changesAffectModuleResolution: () => changesAffectModuleResolution,
173943
173988
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
173944
173989
  childIsDecorated: () => childIsDecorated,
@@ -174378,6 +174423,7 @@ __export(ts_exports2, {
174378
174423
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
174379
174424
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
174380
174425
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
174426
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
174381
174427
  getDeclarationFromName: () => getDeclarationFromName,
174382
174428
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
174383
174429
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -188738,6 +188784,7 @@ start(initializeNodeSystem(), require("os").platform());
188738
188784
  changeAnyExtension,
188739
188785
  changeCompilerHostLikeToUseCache,
188740
188786
  changeExtension,
188787
+ changeFullExtension,
188741
188788
  changesAffectModuleResolution,
188742
188789
  changesAffectingProgramStructure,
188743
188790
  childIsDecorated,
@@ -189177,6 +189224,7 @@ start(initializeNodeSystem(), require("os").platform());
189177
189224
  getDeclarationEmitExtensionForPath,
189178
189225
  getDeclarationEmitOutputFilePath,
189179
189226
  getDeclarationEmitOutputFilePathWorker,
189227
+ getDeclarationFileExtension,
189180
189228
  getDeclarationFromName,
189181
189229
  getDeclarationModifierFlagsFromSymbol,
189182
189230
  getDeclarationOfKind,
@@ -9914,13 +9914,13 @@ declare namespace ts {
9914
9914
  * A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
9915
9915
  * `options` parameter.
9916
9916
  *
9917
- * @param fileName The normalized absolute path to check the format of (it need not exist on disk)
9917
+ * @param fileName The file name to check the format of (it need not exist on disk)
9918
9918
  * @param [packageJsonInfoCache] A cache for package file lookups - it's best to have a cache when this function is called often
9919
9919
  * @param host The ModuleResolutionHost which can perform the filesystem lookups for package json data
9920
9920
  * @param options The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution`
9921
9921
  * @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
9922
9922
  */
9923
- function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode;
9923
+ function getImpliedNodeFormatForFile(fileName: string, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode;
9924
9924
  /**
9925
9925
  * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
9926
9926
  * that represent a compilation unit.
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.20240102`;
38
+ version = `${versionMajorMinor}.0-dev.20240104`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6862,6 +6862,13 @@ ${lanes.join("\n")}
6862
6862
  const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);
6863
6863
  return pathext ? path.slice(0, path.length - pathext.length) + (startsWith(ext, ".") ? ext : "." + ext) : path;
6864
6864
  }
6865
+ function changeFullExtension(path, newExtension) {
6866
+ const declarationExtension = getDeclarationFileExtension(path);
6867
+ if (declarationExtension) {
6868
+ return path.slice(0, path.length - declarationExtension.length) + (startsWith(newExtension, ".") ? newExtension : "." + newExtension);
6869
+ }
6870
+ return changeAnyExtension(path, newExtension);
6871
+ }
6865
6872
  function comparePathsWorker(a, b, componentComparer) {
6866
6873
  if (a === b)
6867
6874
  return 0 /* EqualTo */;
@@ -28453,7 +28460,25 @@ ${lanes.join("\n")}
28453
28460
  return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length2);
28454
28461
  }
28455
28462
  function isDeclarationFileName(fileName) {
28456
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
28463
+ return getDeclarationFileExtension(fileName) !== void 0;
28464
+ }
28465
+ function getDeclarationFileExtension(fileName) {
28466
+ const standardExtension = getAnyExtensionFromPath(
28467
+ fileName,
28468
+ supportedDeclarationExtensions,
28469
+ /*ignoreCase*/
28470
+ false
28471
+ );
28472
+ if (standardExtension) {
28473
+ return standardExtension;
28474
+ }
28475
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
28476
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
28477
+ if (index >= 0) {
28478
+ return fileName.substring(index);
28479
+ }
28480
+ }
28481
+ return void 0;
28457
28482
  }
28458
28483
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
28459
28484
  if (!mode) {
@@ -37918,9 +37943,11 @@ ${lanes.join("\n")}
37918
37943
  // Host only
37919
37944
  ["dom", "lib.dom.d.ts"],
37920
37945
  ["dom.iterable", "lib.dom.iterable.d.ts"],
37946
+ ["dom.asynciterable", "lib.dom.asynciterable.d.ts"],
37921
37947
  ["webworker", "lib.webworker.d.ts"],
37922
37948
  ["webworker.importscripts", "lib.webworker.importscripts.d.ts"],
37923
37949
  ["webworker.iterable", "lib.webworker.iterable.d.ts"],
37950
+ ["webworker.asynciterable", "lib.webworker.asynciterable.d.ts"],
37924
37951
  ["scripthost", "lib.scripthost.d.ts"],
37925
37952
  // ES2015 Or ESNext By-feature options
37926
37953
  ["es2015.core", "lib.es2015.core.d.ts"],
@@ -41004,7 +41031,7 @@ ${lanes.join("\n")}
41004
41031
  /*excludes*/
41005
41032
  void 0,
41006
41033
  [
41007
- isDeclarationFileName(target) ? replaceFirstStar(target, "**/*") : changeAnyExtension(replaceFirstStar(target, "**/*"), getDeclarationEmitExtensionForPath(target))
41034
+ changeFullExtension(replaceFirstStar(target, "**/*"), ".*")
41008
41035
  ]
41009
41036
  ).forEach((entry) => {
41010
41037
  entrypoints = appendIfUnique(entrypoints, {
@@ -53434,7 +53461,7 @@ ${lanes.join("\n")}
53434
53461
  });
53435
53462
  }
53436
53463
  function serializeAsAlias(symbol, localName, modifierFlags) {
53437
- var _a2, _b, _c, _d, _e;
53464
+ var _a2, _b, _c, _d, _e, _f;
53438
53465
  const node = getDeclarationOfAliasSymbol(symbol);
53439
53466
  if (!node)
53440
53467
  return Debug.fail();
@@ -53632,6 +53659,9 @@ ${lanes.join("\n")}
53632
53659
  }
53633
53660
  case 281 /* ExportSpecifier */:
53634
53661
  const specifier = node.parent.parent.moduleSpecifier;
53662
+ if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
53663
+ verbatimTargetName = "default" /* Default */;
53664
+ }
53635
53665
  serializeExportSpecifier(
53636
53666
  unescapeLeadingUnderscores(symbol.escapedName),
53637
53667
  specifier ? verbatimTargetName : targetName,
@@ -61528,6 +61558,12 @@ ${lanes.join("\n")}
61528
61558
  return type;
61529
61559
  }
61530
61560
  function getESSymbolLikeTypeForNode(node) {
61561
+ if (isInJSFile(node) && isJSDocTypeExpression(node)) {
61562
+ const host2 = getJSDocHost(node);
61563
+ if (host2) {
61564
+ node = getSingleVariableOfVariableStatement(host2) || host2;
61565
+ }
61566
+ }
61531
61567
  if (isValidESSymbolDeclaration(node)) {
61532
61568
  const symbol = isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node);
61533
61569
  if (symbol) {
@@ -64472,7 +64508,7 @@ ${lanes.join("\n")}
64472
64508
  }
64473
64509
  if (relation === comparableRelation && sourceFlags & 262144 /* TypeParameter */) {
64474
64510
  let constraint = getConstraintOfTypeParameter(source2);
64475
- if (constraint && hasNonCircularBaseConstraint(source2)) {
64511
+ if (constraint) {
64476
64512
  while (constraint && someType(constraint, (c) => !!(c.flags & 262144 /* TypeParameter */))) {
64477
64513
  if (result2 = isRelatedTo(
64478
64514
  constraint,
@@ -67101,6 +67137,9 @@ ${lanes.join("\n")}
67101
67137
  inferToTemplateLiteralType(source, target);
67102
67138
  } else {
67103
67139
  source = getReducedType(source);
67140
+ if (isGenericMappedType(source) && isGenericMappedType(target)) {
67141
+ invokeOnce(source, target, inferFromGenericMappedTypes);
67142
+ }
67104
67143
  if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
67105
67144
  const apparentSource = getApparentType(source);
67106
67145
  if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
@@ -67364,6 +67403,14 @@ ${lanes.join("\n")}
67364
67403
  }
67365
67404
  }
67366
67405
  }
67406
+ function inferFromGenericMappedTypes(source, target) {
67407
+ inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
67408
+ inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
67409
+ const sourceNameType = getNameTypeFromMappedType(source);
67410
+ const targetNameType = getNameTypeFromMappedType(target);
67411
+ if (sourceNameType && targetNameType)
67412
+ inferFromTypes(sourceNameType, targetNameType);
67413
+ }
67367
67414
  function inferFromObjectTypes(source, target) {
67368
67415
  var _a, _b;
67369
67416
  if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
@@ -67371,12 +67418,7 @@ ${lanes.join("\n")}
67371
67418
  return;
67372
67419
  }
67373
67420
  if (isGenericMappedType(source) && isGenericMappedType(target)) {
67374
- inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
67375
- inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
67376
- const sourceNameType = getNameTypeFromMappedType(source);
67377
- const targetNameType = getNameTypeFromMappedType(target);
67378
- if (sourceNameType && targetNameType)
67379
- inferFromTypes(sourceNameType, targetNameType);
67421
+ inferFromGenericMappedTypes(source, target);
67380
67422
  }
67381
67423
  if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {
67382
67424
  const constraintType = getConstraintTypeFromMappedType(target);
@@ -132473,10 +132515,11 @@ ${lanes.join("\n")}
132473
132515
  }
132474
132516
  } else {
132475
132517
  const symbol = checker == null ? void 0 : checker.getSymbolAtLocation(link.name);
132518
+ const targetSymbol = symbol && checker ? getSymbolTarget(symbol, checker) : void 0;
132476
132519
  const suffix = findLinkNameEnd(link.text);
132477
132520
  const name = getTextOfNode(link.name) + link.text.slice(0, suffix);
132478
132521
  const text = skipSeparatorFromLinkText(link.text.slice(suffix));
132479
- const decl = (symbol == null ? void 0 : symbol.valueDeclaration) || ((_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a[0]);
132522
+ const decl = (targetSymbol == null ? void 0 : targetSymbol.valueDeclaration) || ((_a = targetSymbol == null ? void 0 : targetSymbol.declarations) == null ? void 0 : _a[0]);
132480
132523
  if (decl) {
132481
132524
  parts.push(linkNamePart(name, decl));
132482
132525
  if (text)
@@ -146245,21 +146288,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
146245
146288
  function isNamedExpression(node) {
146246
146289
  return (isFunctionExpression(node) || isClassExpression(node)) && isNamedDeclaration(node);
146247
146290
  }
146248
- function isConstNamedExpression(node) {
146249
- return (isFunctionExpression(node) || isArrowFunction(node) || isClassExpression(node)) && isVariableDeclaration(node.parent) && node === node.parent.initializer && isIdentifier(node.parent.name) && !!(getCombinedNodeFlags(node.parent) & 2 /* Const */);
146291
+ function isVariableLike2(node) {
146292
+ return isPropertyDeclaration(node) || isVariableDeclaration(node);
146293
+ }
146294
+ function isAssignedExpression(node) {
146295
+ return (isFunctionExpression(node) || isArrowFunction(node) || isClassExpression(node)) && isVariableLike2(node.parent) && node === node.parent.initializer && isIdentifier(node.parent.name) && (!!(getCombinedNodeFlags(node.parent) & 2 /* Const */) || isPropertyDeclaration(node.parent));
146250
146296
  }
146251
146297
  function isPossibleCallHierarchyDeclaration(node) {
146252
146298
  return isSourceFile(node) || isModuleDeclaration(node) || isFunctionDeclaration(node) || isFunctionExpression(node) || isClassDeclaration(node) || isClassExpression(node) || isClassStaticBlockDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isGetAccessorDeclaration(node) || isSetAccessorDeclaration(node);
146253
146299
  }
146254
146300
  function isValidCallHierarchyDeclaration(node) {
146255
- return isSourceFile(node) || isModuleDeclaration(node) && isIdentifier(node.name) || isFunctionDeclaration(node) || isClassDeclaration(node) || isClassStaticBlockDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isGetAccessorDeclaration(node) || isSetAccessorDeclaration(node) || isNamedExpression(node) || isConstNamedExpression(node);
146301
+ return isSourceFile(node) || isModuleDeclaration(node) && isIdentifier(node.name) || isFunctionDeclaration(node) || isClassDeclaration(node) || isClassStaticBlockDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isGetAccessorDeclaration(node) || isSetAccessorDeclaration(node) || isNamedExpression(node) || isAssignedExpression(node);
146256
146302
  }
146257
146303
  function getCallHierarchyDeclarationReferenceNode(node) {
146258
146304
  if (isSourceFile(node))
146259
146305
  return node;
146260
146306
  if (isNamedDeclaration(node))
146261
146307
  return node.name;
146262
- if (isConstNamedExpression(node))
146308
+ if (isAssignedExpression(node))
146263
146309
  return node.parent.name;
146264
146310
  return Debug.checkDefined(node.modifiers && find(node.modifiers, isDefaultModifier3));
146265
146311
  }
@@ -146289,7 +146335,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
146289
146335
  const prefix = symbol ? `${typeChecker.symbolToString(symbol, node.parent)} ` : "";
146290
146336
  return { text: `${prefix}static {}`, pos, end };
146291
146337
  }
146292
- const declName = isConstNamedExpression(node) ? node.parent.name : Debug.checkDefined(getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
146338
+ const declName = isAssignedExpression(node) ? node.parent.name : Debug.checkDefined(getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
146293
146339
  let text = isIdentifier(declName) ? idText(declName) : isStringOrNumericLiteralLike(declName) ? declName.text : isComputedPropertyName(declName) ? isStringOrNumericLiteralLike(declName.expression) ? declName.expression.text : void 0 : void 0;
146294
146340
  if (text === void 0) {
146295
146341
  const typeChecker = program.getTypeChecker();
@@ -146305,8 +146351,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
146305
146351
  return { text, pos: declName.getStart(), end: declName.getEnd() };
146306
146352
  }
146307
146353
  function getCallHierarchItemContainerName(node) {
146308
- var _a, _b;
146309
- if (isConstNamedExpression(node)) {
146354
+ var _a, _b, _c, _d;
146355
+ if (isAssignedExpression(node)) {
146356
+ if (isPropertyDeclaration(node.parent) && isClassLike(node.parent.parent)) {
146357
+ return isClassExpression(node.parent.parent) ? (_a = getAssignedName(node.parent.parent)) == null ? void 0 : _a.getText() : (_b = node.parent.parent.name) == null ? void 0 : _b.getText();
146358
+ }
146310
146359
  if (isModuleBlock(node.parent.parent.parent.parent) && isIdentifier(node.parent.parent.parent.parent.parent.name)) {
146311
146360
  return node.parent.parent.parent.parent.parent.name.getText();
146312
146361
  }
@@ -146317,9 +146366,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
146317
146366
  case 178 /* SetAccessor */:
146318
146367
  case 174 /* MethodDeclaration */:
146319
146368
  if (node.parent.kind === 210 /* ObjectLiteralExpression */) {
146320
- return (_a = getAssignedName(node.parent)) == null ? void 0 : _a.getText();
146369
+ return (_c = getAssignedName(node.parent)) == null ? void 0 : _c.getText();
146321
146370
  }
146322
- return (_b = getNameOfDeclaration(node.parent)) == null ? void 0 : _b.getText();
146371
+ return (_d = getNameOfDeclaration(node.parent)) == null ? void 0 : _d.getText();
146323
146372
  case 262 /* FunctionDeclaration */:
146324
146373
  case 263 /* ClassDeclaration */:
146325
146374
  case 267 /* ModuleDeclaration */:
@@ -146392,7 +146441,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
146392
146441
  const ancestor = findAncestor(location.parent, isValidCallHierarchyDeclaration);
146393
146442
  return ancestor && findImplementationOrAllInitialDeclarations(typeChecker, ancestor);
146394
146443
  }
146395
- if (isVariableDeclaration(location.parent) && location.parent.initializer && isConstNamedExpression(location.parent.initializer)) {
146444
+ if (isVariableLike2(location.parent) && location.parent.initializer && isAssignedExpression(location.parent.initializer)) {
146396
146445
  return location.parent.initializer;
146397
146446
  }
146398
146447
  return void 0;
@@ -146407,7 +146456,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
146407
146456
  location = location.parent;
146408
146457
  continue;
146409
146458
  }
146410
- if (isVariableDeclaration(location) && location.initializer && isConstNamedExpression(location.initializer)) {
146459
+ if (isVariableDeclaration(location) && location.initializer && isAssignedExpression(location.initializer)) {
146411
146460
  return location.initializer;
146412
146461
  }
146413
146462
  if (!followingSymbol) {
@@ -152485,21 +152534,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
152485
152534
  const type = checker.getTypeAtLocation(member);
152486
152535
  return !!(type && type.flags & 402653316 /* StringLike */);
152487
152536
  });
152537
+ const sourceFile = parentDeclaration.getSourceFile();
152488
152538
  const enumMember = factory.createEnumMember(token, hasStringInitializer ? factory.createStringLiteral(token.text) : void 0);
152489
- changes.replaceNode(
152490
- parentDeclaration.getSourceFile(),
152491
- parentDeclaration,
152492
- factory.updateEnumDeclaration(
152493
- parentDeclaration,
152494
- parentDeclaration.modifiers,
152495
- parentDeclaration.name,
152496
- concatenate(parentDeclaration.members, singleElementArray(enumMember))
152497
- ),
152498
- {
152499
- leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll,
152500
- trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude
152501
- }
152502
- );
152539
+ const last2 = lastOrUndefined(parentDeclaration.members);
152540
+ if (last2) {
152541
+ changes.insertNodeInListAfter(sourceFile, last2, enumMember, parentDeclaration.members);
152542
+ } else {
152543
+ changes.insertMemberAtStart(sourceFile, parentDeclaration, enumMember);
152544
+ }
152503
152545
  }
152504
152546
  function addFunctionDeclaration(changes, context, info) {
152505
152547
  const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
@@ -152602,7 +152644,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
152602
152644
  /*enclosingDeclaration*/
152603
152645
  void 0,
152604
152646
  /*flags*/
152605
- void 0
152647
+ 64 /* UseFullyQualifiedType */
152606
152648
  );
152607
152649
  return enumMember === void 0 || name === void 0 ? factory.createNumericLiteral(0) : factory.createPropertyAccessExpression(name, checker.symbolToString(enumMember));
152608
152650
  }
@@ -170137,7 +170179,7 @@ ${options.prefix}` : "\n" : options.prefix
170137
170179
  const afterMinusOneStartLinePosition = getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile);
170138
170180
  multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition;
170139
170181
  }
170140
- if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) {
170182
+ if (hasCommentsBeforeLineBreak(sourceFile.text, after.end) || !positionsAreOnSameLine(containingList.pos, containingList.end, sourceFile)) {
170141
170183
  multilineList = true;
170142
170184
  }
170143
170185
  if (multilineList) {
@@ -185490,6 +185532,7 @@ ${e.message}`;
185490
185532
  changeAnyExtension: () => changeAnyExtension,
185491
185533
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
185492
185534
  changeExtension: () => changeExtension,
185535
+ changeFullExtension: () => changeFullExtension,
185493
185536
  changesAffectModuleResolution: () => changesAffectModuleResolution,
185494
185537
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
185495
185538
  childIsDecorated: () => childIsDecorated,
@@ -185929,6 +185972,7 @@ ${e.message}`;
185929
185972
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
185930
185973
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
185931
185974
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
185975
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
185932
185976
  getDeclarationFromName: () => getDeclarationFromName,
185933
185977
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
185934
185978
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -187910,6 +187954,7 @@ ${e.message}`;
187910
187954
  changeAnyExtension: () => changeAnyExtension,
187911
187955
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
187912
187956
  changeExtension: () => changeExtension,
187957
+ changeFullExtension: () => changeFullExtension,
187913
187958
  changesAffectModuleResolution: () => changesAffectModuleResolution,
187914
187959
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
187915
187960
  childIsDecorated: () => childIsDecorated,
@@ -188349,6 +188394,7 @@ ${e.message}`;
188349
188394
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
188350
188395
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
188351
188396
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
188397
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
188352
188398
  getDeclarationFromName: () => getDeclarationFromName,
188353
188399
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
188354
188400
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -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.20240102`;
57
+ var version = `${versionMajorMinor}.0-dev.20240104`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -25616,7 +25616,25 @@ var IncrementalParser;
25616
25616
  })(InvalidPosition || (InvalidPosition = {}));
25617
25617
  })(IncrementalParser || (IncrementalParser = {}));
25618
25618
  function isDeclarationFileName(fileName) {
25619
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
25619
+ return getDeclarationFileExtension(fileName) !== void 0;
25620
+ }
25621
+ function getDeclarationFileExtension(fileName) {
25622
+ const standardExtension = getAnyExtensionFromPath(
25623
+ fileName,
25624
+ supportedDeclarationExtensions,
25625
+ /*ignoreCase*/
25626
+ false
25627
+ );
25628
+ if (standardExtension) {
25629
+ return standardExtension;
25630
+ }
25631
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
25632
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
25633
+ if (index >= 0) {
25634
+ return fileName.substring(index);
25635
+ }
25636
+ }
25637
+ return void 0;
25620
25638
  }
25621
25639
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
25622
25640
  if (!mode) {
@@ -25859,9 +25877,11 @@ var libEntries = [
25859
25877
  // Host only
25860
25878
  ["dom", "lib.dom.d.ts"],
25861
25879
  ["dom.iterable", "lib.dom.iterable.d.ts"],
25880
+ ["dom.asynciterable", "lib.dom.asynciterable.d.ts"],
25862
25881
  ["webworker", "lib.webworker.d.ts"],
25863
25882
  ["webworker.importscripts", "lib.webworker.importscripts.d.ts"],
25864
25883
  ["webworker.iterable", "lib.webworker.iterable.d.ts"],
25884
+ ["webworker.asynciterable", "lib.webworker.asynciterable.d.ts"],
25865
25885
  ["scripthost", "lib.scripthost.d.ts"],
25866
25886
  // ES2015 Or ESNext By-feature options
25867
25887
  ["es2015.core", "lib.es2015.core.d.ts"],
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.20240102",
5
+ "version": "5.4.0-dev.20240104",
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": "b999336b35178ff9f8521e41fb4a7bce0c6d5bcc"
116
+ "gitHead": "0ea57f6ca19c23e0bc690bd2706f6b6e11a97e02"
117
117
  }