typescript 5.1.0-dev.20230424 → 5.1.0-dev.20230426

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/lib.es5.d.ts CHANGED
@@ -4329,12 +4329,21 @@ interface Float64Array {
4329
4329
  sort(compareFn?: (a: number, b: number) => number): this;
4330
4330
 
4331
4331
  /**
4332
+ * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements
4332
4333
  * at begin, inclusive, up to end, exclusive.
4333
4334
  * @param begin The index of the beginning of the array.
4334
4335
  * @param end The index of the end of the array.
4335
4336
  */
4336
4337
  subarray(begin?: number, end?: number): Float64Array;
4337
4338
 
4339
+ /**
4340
+ * Converts a number to a string by using the current locale.
4341
+ */
4342
+ toLocaleString(): string;
4343
+
4344
+ /**
4345
+ * Returns a string representation of an array.
4346
+ */
4338
4347
  toString(): string;
4339
4348
 
4340
4349
  /** Returns the primitive value of the specified object. */
@@ -4383,11 +4392,12 @@ declare var Float64Array: Float64ArrayConstructor;
4383
4392
 
4384
4393
  declare namespace Intl {
4385
4394
  interface CollatorOptions {
4386
- usage?: string | undefined;
4387
- localeMatcher?: string | undefined;
4395
+ usage?: "sort" | "search" | undefined;
4396
+ localeMatcher?: "lookup" | "best fit" | undefined;
4388
4397
  numeric?: boolean | undefined;
4389
- caseFirst?: string | undefined;
4390
- sensitivity?: string | undefined;
4398
+ caseFirst?: "upper" | "lower" | "false" | undefined;
4399
+ sensitivity?: "base" | "accent" | "case" | "variant" | undefined;
4400
+ collation?: "big5han" | "compat" | "dict" | "direct" | "ducet" | "emoji" | "eor" | "gb2312" | "phonebk" | "phonetic" | "pinyin" | "reformed" | "searchjl" | "stroke" | "trad" | "unihan" | "zhuyin" | undefined;
4391
4401
  ignorePunctuation?: boolean | undefined;
4392
4402
  }
4393
4403
 
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.1";
21
- var version = `${versionMajorMinor}.0-dev.20230424`;
21
+ var version = `${versionMajorMinor}.0-dev.20230426`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -49273,7 +49273,7 @@ function createTypeChecker(host) {
49273
49273
  if (symbol.flags & 524288 /* TypeAlias */) {
49274
49274
  serializeTypeAlias(symbol, symbolName2, modifierFlags);
49275
49275
  }
49276
- if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
49276
+ if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */ | 98304 /* Accessor */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
49277
49277
  if (propertyAsAlias) {
49278
49278
  const createdExport = serializeMaybeAliasAssignment(symbol);
49279
49279
  if (createdExport) {
@@ -67228,18 +67228,10 @@ function createTypeChecker(host) {
67228
67228
  function getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType) {
67229
67229
  const managedSym = getJsxLibraryManagedAttributes(ns);
67230
67230
  if (managedSym) {
67231
- const declaredManagedType = getDeclaredTypeOfSymbol(managedSym);
67232
67231
  const ctorType = getStaticTypeOfReferencedJsxConstructor(context);
67233
- if (managedSym.flags & 524288 /* TypeAlias */) {
67234
- const params = getSymbolLinks(managedSym).typeParameters;
67235
- if (length(params) >= 2) {
67236
- const args = fillMissingTypeArguments([ctorType, attributesType], params, 2, isInJSFile(context));
67237
- return getTypeAliasInstantiation(managedSym, args);
67238
- }
67239
- }
67240
- if (length(declaredManagedType.typeParameters) >= 2) {
67241
- const args = fillMissingTypeArguments([ctorType, attributesType], declaredManagedType.typeParameters, 2, isInJSFile(context));
67242
- return createTypeReference(declaredManagedType, args);
67232
+ const result = instantiateAliasOrInterfaceWithDefaults(managedSym, isInJSFile(context), ctorType, attributesType);
67233
+ if (result) {
67234
+ return result;
67243
67235
  }
67244
67236
  }
67245
67237
  return attributesType;
@@ -68126,6 +68118,9 @@ function createTypeChecker(host) {
68126
68118
  function getJsxLibraryManagedAttributes(jsxNamespace) {
68127
68119
  return jsxNamespace && getSymbol(jsxNamespace.exports, JsxNames.LibraryManagedAttributes, 788968 /* Type */);
68128
68120
  }
68121
+ function getJsxElementTypeSymbol(jsxNamespace) {
68122
+ return jsxNamespace && getSymbol(jsxNamespace.exports, JsxNames.ElementType, 788968 /* Type */);
68123
+ }
68129
68124
  function getJsxElementPropertiesName(jsxNamespace) {
68130
68125
  return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace);
68131
68126
  }
@@ -68232,11 +68227,32 @@ function createTypeChecker(host) {
68232
68227
  }
68233
68228
  }
68234
68229
  function getJsxElementTypeTypeAt(location) {
68235
- const type = getJsxType(JsxNames.ElementType, location);
68236
- if (isErrorType(type))
68230
+ const ns = getJsxNamespaceAt(location);
68231
+ if (!ns)
68232
+ return void 0;
68233
+ const sym = getJsxElementTypeSymbol(ns);
68234
+ if (!sym)
68235
+ return void 0;
68236
+ const type = instantiateAliasOrInterfaceWithDefaults(sym, isInJSFile(location));
68237
+ if (!type || isErrorType(type))
68237
68238
  return void 0;
68238
68239
  return type;
68239
68240
  }
68241
+ function instantiateAliasOrInterfaceWithDefaults(managedSym, inJs, ...typeArguments) {
68242
+ const declaredManagedType = getDeclaredTypeOfSymbol(managedSym);
68243
+ if (managedSym.flags & 524288 /* TypeAlias */) {
68244
+ const params = getSymbolLinks(managedSym).typeParameters;
68245
+ if (length(params) >= typeArguments.length) {
68246
+ const args = fillMissingTypeArguments(typeArguments, params, typeArguments.length, inJs);
68247
+ return length(args) === 0 ? declaredManagedType : getTypeAliasInstantiation(managedSym, args);
68248
+ }
68249
+ }
68250
+ if (length(declaredManagedType.typeParameters) >= typeArguments.length) {
68251
+ const args = fillMissingTypeArguments(typeArguments, declaredManagedType.typeParameters, typeArguments.length, inJs);
68252
+ return createTypeReference(declaredManagedType, args);
68253
+ }
68254
+ return void 0;
68255
+ }
68240
68256
  function getJsxIntrinsicTagNamesAt(location) {
68241
68257
  const intrinsics = getJsxType(JsxNames.IntrinsicElements, location);
68242
68258
  return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray;
@@ -103417,6 +103433,8 @@ function transformSystemModule(context) {
103417
103433
  return visitLabeledStatement(node);
103418
103434
  case 253 /* WithStatement */:
103419
103435
  return visitWithStatement(node);
103436
+ case 244 /* IfStatement */:
103437
+ return visitIfStatement(node);
103420
103438
  case 254 /* SwitchStatement */:
103421
103439
  return visitSwitchStatement(node);
103422
103440
  case 268 /* CaseBlock */:
@@ -103522,6 +103540,14 @@ function transformSystemModule(context) {
103522
103540
  Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock))
103523
103541
  );
103524
103542
  }
103543
+ function visitIfStatement(node) {
103544
+ return factory2.updateIfStatement(
103545
+ node,
103546
+ visitNode(node.expression, visitor, isExpression),
103547
+ Debug.checkDefined(visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)),
103548
+ visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
103549
+ );
103550
+ }
103525
103551
  function visitSwitchStatement(node) {
103526
103552
  return factory2.updateSwitchStatement(
103527
103553
  node,
package/lib/tsserver.js CHANGED
@@ -2303,7 +2303,7 @@ module.exports = __toCommonJS(server_exports);
2303
2303
 
2304
2304
  // src/compiler/corePublic.ts
2305
2305
  var versionMajorMinor = "5.1";
2306
- var version = `${versionMajorMinor}.0-dev.20230424`;
2306
+ var version = `${versionMajorMinor}.0-dev.20230426`;
2307
2307
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2308
2308
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2309
2309
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -53923,7 +53923,7 @@ function createTypeChecker(host) {
53923
53923
  if (symbol.flags & 524288 /* TypeAlias */) {
53924
53924
  serializeTypeAlias(symbol, symbolName2, modifierFlags);
53925
53925
  }
53926
- if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
53926
+ if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */ | 98304 /* Accessor */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
53927
53927
  if (propertyAsAlias) {
53928
53928
  const createdExport = serializeMaybeAliasAssignment(symbol);
53929
53929
  if (createdExport) {
@@ -71878,18 +71878,10 @@ function createTypeChecker(host) {
71878
71878
  function getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType) {
71879
71879
  const managedSym = getJsxLibraryManagedAttributes(ns);
71880
71880
  if (managedSym) {
71881
- const declaredManagedType = getDeclaredTypeOfSymbol(managedSym);
71882
71881
  const ctorType = getStaticTypeOfReferencedJsxConstructor(context);
71883
- if (managedSym.flags & 524288 /* TypeAlias */) {
71884
- const params = getSymbolLinks(managedSym).typeParameters;
71885
- if (length(params) >= 2) {
71886
- const args = fillMissingTypeArguments([ctorType, attributesType], params, 2, isInJSFile(context));
71887
- return getTypeAliasInstantiation(managedSym, args);
71888
- }
71889
- }
71890
- if (length(declaredManagedType.typeParameters) >= 2) {
71891
- const args = fillMissingTypeArguments([ctorType, attributesType], declaredManagedType.typeParameters, 2, isInJSFile(context));
71892
- return createTypeReference(declaredManagedType, args);
71882
+ const result = instantiateAliasOrInterfaceWithDefaults(managedSym, isInJSFile(context), ctorType, attributesType);
71883
+ if (result) {
71884
+ return result;
71893
71885
  }
71894
71886
  }
71895
71887
  return attributesType;
@@ -72776,6 +72768,9 @@ function createTypeChecker(host) {
72776
72768
  function getJsxLibraryManagedAttributes(jsxNamespace) {
72777
72769
  return jsxNamespace && getSymbol2(jsxNamespace.exports, JsxNames.LibraryManagedAttributes, 788968 /* Type */);
72778
72770
  }
72771
+ function getJsxElementTypeSymbol(jsxNamespace) {
72772
+ return jsxNamespace && getSymbol2(jsxNamespace.exports, JsxNames.ElementType, 788968 /* Type */);
72773
+ }
72779
72774
  function getJsxElementPropertiesName(jsxNamespace) {
72780
72775
  return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace);
72781
72776
  }
@@ -72882,11 +72877,32 @@ function createTypeChecker(host) {
72882
72877
  }
72883
72878
  }
72884
72879
  function getJsxElementTypeTypeAt(location) {
72885
- const type = getJsxType(JsxNames.ElementType, location);
72886
- if (isErrorType(type))
72880
+ const ns = getJsxNamespaceAt(location);
72881
+ if (!ns)
72882
+ return void 0;
72883
+ const sym = getJsxElementTypeSymbol(ns);
72884
+ if (!sym)
72885
+ return void 0;
72886
+ const type = instantiateAliasOrInterfaceWithDefaults(sym, isInJSFile(location));
72887
+ if (!type || isErrorType(type))
72887
72888
  return void 0;
72888
72889
  return type;
72889
72890
  }
72891
+ function instantiateAliasOrInterfaceWithDefaults(managedSym, inJs, ...typeArguments) {
72892
+ const declaredManagedType = getDeclaredTypeOfSymbol(managedSym);
72893
+ if (managedSym.flags & 524288 /* TypeAlias */) {
72894
+ const params = getSymbolLinks(managedSym).typeParameters;
72895
+ if (length(params) >= typeArguments.length) {
72896
+ const args = fillMissingTypeArguments(typeArguments, params, typeArguments.length, inJs);
72897
+ return length(args) === 0 ? declaredManagedType : getTypeAliasInstantiation(managedSym, args);
72898
+ }
72899
+ }
72900
+ if (length(declaredManagedType.typeParameters) >= typeArguments.length) {
72901
+ const args = fillMissingTypeArguments(typeArguments, declaredManagedType.typeParameters, typeArguments.length, inJs);
72902
+ return createTypeReference(declaredManagedType, args);
72903
+ }
72904
+ return void 0;
72905
+ }
72890
72906
  function getJsxIntrinsicTagNamesAt(location) {
72891
72907
  const intrinsics = getJsxType(JsxNames.IntrinsicElements, location);
72892
72908
  return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray;
@@ -108238,6 +108254,8 @@ function transformSystemModule(context) {
108238
108254
  return visitLabeledStatement(node);
108239
108255
  case 253 /* WithStatement */:
108240
108256
  return visitWithStatement(node);
108257
+ case 244 /* IfStatement */:
108258
+ return visitIfStatement(node);
108241
108259
  case 254 /* SwitchStatement */:
108242
108260
  return visitSwitchStatement(node);
108243
108261
  case 268 /* CaseBlock */:
@@ -108343,6 +108361,14 @@ function transformSystemModule(context) {
108343
108361
  Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock))
108344
108362
  );
108345
108363
  }
108364
+ function visitIfStatement(node) {
108365
+ return factory2.updateIfStatement(
108366
+ node,
108367
+ visitNode(node.expression, visitor, isExpression),
108368
+ Debug.checkDefined(visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)),
108369
+ visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
108370
+ );
108371
+ }
108346
108372
  function visitSwitchStatement(node) {
108347
108373
  return factory2.updateSwitchStatement(
108348
108374
  node,
@@ -8817,6 +8817,26 @@ declare namespace ts {
8817
8817
  parent: ConstructorDeclaration;
8818
8818
  name: Identifier;
8819
8819
  };
8820
+ /**
8821
+ * This function checks multiple locations for JSDoc comments that apply to a host node.
8822
+ * At each location, the whole comment may apply to the node, or only a specific tag in
8823
+ * the comment. In the first case, location adds the entire {@link JSDoc} object. In the
8824
+ * second case, it adds the applicable {@link JSDocTag}.
8825
+ *
8826
+ * For example, a JSDoc comment before a parameter adds the entire {@link JSDoc}. But a
8827
+ * `@param` tag on the parent function only adds the {@link JSDocTag} for the `@param`.
8828
+ *
8829
+ * ```ts
8830
+ * /** JSDoc will be returned for `a` *\/
8831
+ * const a = 0
8832
+ * /**
8833
+ * * Entire JSDoc will be returned for `b`
8834
+ * * @param c JSDocTag will be returned for `c`
8835
+ * *\/
8836
+ * function b(/** JSDoc will be returned for `c` *\/ c) {}
8837
+ * ```
8838
+ */
8839
+ function getJSDocCommentsAndTags(hostNode: Node): readonly (JSDoc | JSDocTag)[];
8820
8840
  /** @deprecated */
8821
8841
  function createUnparsedSourceFile(text: string): UnparsedSource;
8822
8842
  /** @deprecated */
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.1";
38
- version = `${versionMajorMinor}.0-dev.20230424`;
38
+ version = `${versionMajorMinor}.0-dev.20230426`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -51715,7 +51715,7 @@ ${lanes.join("\n")}
51715
51715
  if (symbol.flags & 524288 /* TypeAlias */) {
51716
51716
  serializeTypeAlias(symbol, symbolName2, modifierFlags);
51717
51717
  }
51718
- if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
51718
+ if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */ | 98304 /* Accessor */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
51719
51719
  if (propertyAsAlias) {
51720
51720
  const createdExport = serializeMaybeAliasAssignment(symbol);
51721
51721
  if (createdExport) {
@@ -69670,18 +69670,10 @@ ${lanes.join("\n")}
69670
69670
  function getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType) {
69671
69671
  const managedSym = getJsxLibraryManagedAttributes(ns);
69672
69672
  if (managedSym) {
69673
- const declaredManagedType = getDeclaredTypeOfSymbol(managedSym);
69674
69673
  const ctorType = getStaticTypeOfReferencedJsxConstructor(context);
69675
- if (managedSym.flags & 524288 /* TypeAlias */) {
69676
- const params = getSymbolLinks(managedSym).typeParameters;
69677
- if (length(params) >= 2) {
69678
- const args = fillMissingTypeArguments([ctorType, attributesType], params, 2, isInJSFile(context));
69679
- return getTypeAliasInstantiation(managedSym, args);
69680
- }
69681
- }
69682
- if (length(declaredManagedType.typeParameters) >= 2) {
69683
- const args = fillMissingTypeArguments([ctorType, attributesType], declaredManagedType.typeParameters, 2, isInJSFile(context));
69684
- return createTypeReference(declaredManagedType, args);
69674
+ const result = instantiateAliasOrInterfaceWithDefaults(managedSym, isInJSFile(context), ctorType, attributesType);
69675
+ if (result) {
69676
+ return result;
69685
69677
  }
69686
69678
  }
69687
69679
  return attributesType;
@@ -70568,6 +70560,9 @@ ${lanes.join("\n")}
70568
70560
  function getJsxLibraryManagedAttributes(jsxNamespace) {
70569
70561
  return jsxNamespace && getSymbol2(jsxNamespace.exports, JsxNames.LibraryManagedAttributes, 788968 /* Type */);
70570
70562
  }
70563
+ function getJsxElementTypeSymbol(jsxNamespace) {
70564
+ return jsxNamespace && getSymbol2(jsxNamespace.exports, JsxNames.ElementType, 788968 /* Type */);
70565
+ }
70571
70566
  function getJsxElementPropertiesName(jsxNamespace) {
70572
70567
  return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace);
70573
70568
  }
@@ -70674,11 +70669,32 @@ ${lanes.join("\n")}
70674
70669
  }
70675
70670
  }
70676
70671
  function getJsxElementTypeTypeAt(location) {
70677
- const type = getJsxType(JsxNames.ElementType, location);
70678
- if (isErrorType(type))
70672
+ const ns = getJsxNamespaceAt(location);
70673
+ if (!ns)
70674
+ return void 0;
70675
+ const sym = getJsxElementTypeSymbol(ns);
70676
+ if (!sym)
70677
+ return void 0;
70678
+ const type = instantiateAliasOrInterfaceWithDefaults(sym, isInJSFile(location));
70679
+ if (!type || isErrorType(type))
70679
70680
  return void 0;
70680
70681
  return type;
70681
70682
  }
70683
+ function instantiateAliasOrInterfaceWithDefaults(managedSym, inJs, ...typeArguments) {
70684
+ const declaredManagedType = getDeclaredTypeOfSymbol(managedSym);
70685
+ if (managedSym.flags & 524288 /* TypeAlias */) {
70686
+ const params = getSymbolLinks(managedSym).typeParameters;
70687
+ if (length(params) >= typeArguments.length) {
70688
+ const args = fillMissingTypeArguments(typeArguments, params, typeArguments.length, inJs);
70689
+ return length(args) === 0 ? declaredManagedType : getTypeAliasInstantiation(managedSym, args);
70690
+ }
70691
+ }
70692
+ if (length(declaredManagedType.typeParameters) >= typeArguments.length) {
70693
+ const args = fillMissingTypeArguments(typeArguments, declaredManagedType.typeParameters, typeArguments.length, inJs);
70694
+ return createTypeReference(declaredManagedType, args);
70695
+ }
70696
+ return void 0;
70697
+ }
70682
70698
  function getJsxIntrinsicTagNamesAt(location) {
70683
70699
  const intrinsics = getJsxType(JsxNames.IntrinsicElements, location);
70684
70700
  return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray;
@@ -106303,6 +106319,8 @@ ${lanes.join("\n")}
106303
106319
  return visitLabeledStatement(node);
106304
106320
  case 253 /* WithStatement */:
106305
106321
  return visitWithStatement(node);
106322
+ case 244 /* IfStatement */:
106323
+ return visitIfStatement(node);
106306
106324
  case 254 /* SwitchStatement */:
106307
106325
  return visitSwitchStatement(node);
106308
106326
  case 268 /* CaseBlock */:
@@ -106408,6 +106426,14 @@ ${lanes.join("\n")}
106408
106426
  Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock))
106409
106427
  );
106410
106428
  }
106429
+ function visitIfStatement(node) {
106430
+ return factory2.updateIfStatement(
106431
+ node,
106432
+ visitNode(node.expression, visitor, isExpression),
106433
+ Debug.checkDefined(visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)),
106434
+ visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
106435
+ );
106436
+ }
106411
106437
  function visitSwitchStatement(node) {
106412
106438
  return factory2.updateSwitchStatement(
106413
106439
  node,
@@ -4771,6 +4771,26 @@ declare namespace ts {
4771
4771
  parent: ConstructorDeclaration;
4772
4772
  name: Identifier;
4773
4773
  };
4774
+ /**
4775
+ * This function checks multiple locations for JSDoc comments that apply to a host node.
4776
+ * At each location, the whole comment may apply to the node, or only a specific tag in
4777
+ * the comment. In the first case, location adds the entire {@link JSDoc} object. In the
4778
+ * second case, it adds the applicable {@link JSDocTag}.
4779
+ *
4780
+ * For example, a JSDoc comment before a parameter adds the entire {@link JSDoc}. But a
4781
+ * `@param` tag on the parent function only adds the {@link JSDocTag} for the `@param`.
4782
+ *
4783
+ * ```ts
4784
+ * /** JSDoc will be returned for `a` *\/
4785
+ * const a = 0
4786
+ * /**
4787
+ * * Entire JSDoc will be returned for `b`
4788
+ * * @param c JSDocTag will be returned for `c`
4789
+ * *\/
4790
+ * function b(/** JSDoc will be returned for `c` *\/ c) {}
4791
+ * ```
4792
+ */
4793
+ function getJSDocCommentsAndTags(hostNode: Node): readonly (JSDoc | JSDocTag)[];
4774
4794
  /** @deprecated */
4775
4795
  function createUnparsedSourceFile(text: string): UnparsedSource;
4776
4796
  /** @deprecated */
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.1";
38
- version = `${versionMajorMinor}.0-dev.20230424`;
38
+ version = `${versionMajorMinor}.0-dev.20230426`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -51715,7 +51715,7 @@ ${lanes.join("\n")}
51715
51715
  if (symbol.flags & 524288 /* TypeAlias */) {
51716
51716
  serializeTypeAlias(symbol, symbolName2, modifierFlags);
51717
51717
  }
51718
- if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
51718
+ if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */ | 98304 /* Accessor */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
51719
51719
  if (propertyAsAlias) {
51720
51720
  const createdExport = serializeMaybeAliasAssignment(symbol);
51721
51721
  if (createdExport) {
@@ -69670,18 +69670,10 @@ ${lanes.join("\n")}
69670
69670
  function getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType) {
69671
69671
  const managedSym = getJsxLibraryManagedAttributes(ns);
69672
69672
  if (managedSym) {
69673
- const declaredManagedType = getDeclaredTypeOfSymbol(managedSym);
69674
69673
  const ctorType = getStaticTypeOfReferencedJsxConstructor(context);
69675
- if (managedSym.flags & 524288 /* TypeAlias */) {
69676
- const params = getSymbolLinks(managedSym).typeParameters;
69677
- if (length(params) >= 2) {
69678
- const args = fillMissingTypeArguments([ctorType, attributesType], params, 2, isInJSFile(context));
69679
- return getTypeAliasInstantiation(managedSym, args);
69680
- }
69681
- }
69682
- if (length(declaredManagedType.typeParameters) >= 2) {
69683
- const args = fillMissingTypeArguments([ctorType, attributesType], declaredManagedType.typeParameters, 2, isInJSFile(context));
69684
- return createTypeReference(declaredManagedType, args);
69674
+ const result = instantiateAliasOrInterfaceWithDefaults(managedSym, isInJSFile(context), ctorType, attributesType);
69675
+ if (result) {
69676
+ return result;
69685
69677
  }
69686
69678
  }
69687
69679
  return attributesType;
@@ -70568,6 +70560,9 @@ ${lanes.join("\n")}
70568
70560
  function getJsxLibraryManagedAttributes(jsxNamespace) {
70569
70561
  return jsxNamespace && getSymbol2(jsxNamespace.exports, JsxNames.LibraryManagedAttributes, 788968 /* Type */);
70570
70562
  }
70563
+ function getJsxElementTypeSymbol(jsxNamespace) {
70564
+ return jsxNamespace && getSymbol2(jsxNamespace.exports, JsxNames.ElementType, 788968 /* Type */);
70565
+ }
70571
70566
  function getJsxElementPropertiesName(jsxNamespace) {
70572
70567
  return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace);
70573
70568
  }
@@ -70674,11 +70669,32 @@ ${lanes.join("\n")}
70674
70669
  }
70675
70670
  }
70676
70671
  function getJsxElementTypeTypeAt(location) {
70677
- const type = getJsxType(JsxNames.ElementType, location);
70678
- if (isErrorType(type))
70672
+ const ns = getJsxNamespaceAt(location);
70673
+ if (!ns)
70674
+ return void 0;
70675
+ const sym = getJsxElementTypeSymbol(ns);
70676
+ if (!sym)
70677
+ return void 0;
70678
+ const type = instantiateAliasOrInterfaceWithDefaults(sym, isInJSFile(location));
70679
+ if (!type || isErrorType(type))
70679
70680
  return void 0;
70680
70681
  return type;
70681
70682
  }
70683
+ function instantiateAliasOrInterfaceWithDefaults(managedSym, inJs, ...typeArguments) {
70684
+ const declaredManagedType = getDeclaredTypeOfSymbol(managedSym);
70685
+ if (managedSym.flags & 524288 /* TypeAlias */) {
70686
+ const params = getSymbolLinks(managedSym).typeParameters;
70687
+ if (length(params) >= typeArguments.length) {
70688
+ const args = fillMissingTypeArguments(typeArguments, params, typeArguments.length, inJs);
70689
+ return length(args) === 0 ? declaredManagedType : getTypeAliasInstantiation(managedSym, args);
70690
+ }
70691
+ }
70692
+ if (length(declaredManagedType.typeParameters) >= typeArguments.length) {
70693
+ const args = fillMissingTypeArguments(typeArguments, declaredManagedType.typeParameters, typeArguments.length, inJs);
70694
+ return createTypeReference(declaredManagedType, args);
70695
+ }
70696
+ return void 0;
70697
+ }
70682
70698
  function getJsxIntrinsicTagNamesAt(location) {
70683
70699
  const intrinsics = getJsxType(JsxNames.IntrinsicElements, location);
70684
70700
  return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray;
@@ -106303,6 +106319,8 @@ ${lanes.join("\n")}
106303
106319
  return visitLabeledStatement(node);
106304
106320
  case 253 /* WithStatement */:
106305
106321
  return visitWithStatement(node);
106322
+ case 244 /* IfStatement */:
106323
+ return visitIfStatement(node);
106306
106324
  case 254 /* SwitchStatement */:
106307
106325
  return visitSwitchStatement(node);
106308
106326
  case 268 /* CaseBlock */:
@@ -106408,6 +106426,14 @@ ${lanes.join("\n")}
106408
106426
  Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock))
106409
106427
  );
106410
106428
  }
106429
+ function visitIfStatement(node) {
106430
+ return factory2.updateIfStatement(
106431
+ node,
106432
+ visitNode(node.expression, visitor, isExpression),
106433
+ Debug.checkDefined(visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)),
106434
+ visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
106435
+ );
106436
+ }
106411
106437
  function visitSwitchStatement(node) {
106412
106438
  return factory2.updateSwitchStatement(
106413
106439
  node,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.1";
57
- var version = `${versionMajorMinor}.0-dev.20230424`;
57
+ var version = `${versionMajorMinor}.0-dev.20230426`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
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.1.0-dev.20230424",
5
+ "version": "5.1.0-dev.20230426",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "14.21.1",
116
116
  "npm": "8.19.3"
117
117
  },
118
- "gitHead": "8749fb5c0a4a0e3407eb099322c85b850cc642aa"
118
+ "gitHead": "eb014a26522dd809ae4d0e85634a62eabda2755a"
119
119
  }