@typescript-deploys/pr-build 5.1.0-pr-53758-6 → 5.1.0-pr-53756-16

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.
@@ -106,4 +106,13 @@ declare namespace Intl {
106
106
  */
107
107
  supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick<SegmenterOptions, "localeMatcher">): BCP47LanguageTag[];
108
108
  };
109
+
110
+ /**
111
+ * Returns a sorted array of the supported collation, calendar, currency, numbering system, timezones, and units by the implementation.
112
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf)
113
+ *
114
+ * @param key A string indicating the category of values to return.
115
+ * @returns A sorted array of the supported values.
116
+ */
117
+ function supportedValuesOf(key: "calendar" | "collation" | "currency" | "numberingSystem" | "timeZone" | "unit"): string[];
109
118
  }
package/lib/lib.es5.d.ts CHANGED
@@ -332,9 +332,14 @@ interface CallableFunction extends Function {
332
332
  /**
333
333
  * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
334
334
  * @param thisArg The object to be used as the this object.
335
- * @param args An array of argument values to be passed to the function.
336
335
  */
337
336
  apply<T, R>(this: (this: T) => R, thisArg: T): R;
337
+
338
+ /**
339
+ * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
340
+ * @param thisArg The object to be used as the this object.
341
+ * @param args An array of argument values to be passed to the function.
342
+ */
338
343
  apply<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;
339
344
 
340
345
  /**
@@ -348,23 +353,29 @@ interface CallableFunction extends Function {
348
353
  * For a given function, creates a bound function that has the same body as the original function.
349
354
  * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
350
355
  * @param thisArg The object to be used as the this object.
351
- * @param args Arguments to bind to the parameters of the function.
352
356
  */
353
357
  bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;
354
- bind<T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;
355
- bind<T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R;
356
- bind<T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R;
357
- bind<T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R;
358
- bind<T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R;
358
+
359
+ /**
360
+ * For a given function, creates a bound function that has the same body as the original function.
361
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
362
+ * @param thisArg The object to be used as the this object.
363
+ * @param args Arguments to bind to the parameters of the function.
364
+ */
365
+ bind<T, A extends any[], B extends any[], R>(this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R;
359
366
  }
360
367
 
361
368
  interface NewableFunction extends Function {
362
369
  /**
363
370
  * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
364
371
  * @param thisArg The object to be used as the this object.
365
- * @param args An array of argument values to be passed to the function.
366
372
  */
367
373
  apply<T>(this: new () => T, thisArg: T): void;
374
+ /**
375
+ * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
376
+ * @param thisArg The object to be used as the this object.
377
+ * @param args An array of argument values to be passed to the function.
378
+ */
368
379
  apply<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, args: A): void;
369
380
 
370
381
  /**
@@ -378,14 +389,16 @@ interface NewableFunction extends Function {
378
389
  * For a given function, creates a bound function that has the same body as the original function.
379
390
  * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
380
391
  * @param thisArg The object to be used as the this object.
381
- * @param args Arguments to bind to the parameters of the function.
382
392
  */
383
393
  bind<T>(this: T, thisArg: any): T;
384
- bind<A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;
385
- bind<A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R;
386
- bind<A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R;
387
- bind<A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R;
388
- bind<AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R;
394
+
395
+ /**
396
+ * For a given function, creates a bound function that has the same body as the original function.
397
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
398
+ * @param thisArg The object to be used as the this object.
399
+ * @param args Arguments to bind to the parameters of the function.
400
+ */
401
+ bind<A extends any[], B extends any[], R>(this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R;
389
402
  }
390
403
 
391
404
  interface IArguments {
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-insiders.20230412`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230413`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -3753,6 +3753,7 @@ var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => {
3753
3753
  SignatureFlags4[SignatureFlags4["IsInnerCallChain"] = 8] = "IsInnerCallChain";
3754
3754
  SignatureFlags4[SignatureFlags4["IsOuterCallChain"] = 16] = "IsOuterCallChain";
3755
3755
  SignatureFlags4[SignatureFlags4["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
3756
+ SignatureFlags4[SignatureFlags4["IsNonInferrable"] = 64] = "IsNonInferrable";
3756
3757
  SignatureFlags4[SignatureFlags4["PropagatingFlags"] = 39] = "PropagatingFlags";
3757
3758
  SignatureFlags4[SignatureFlags4["CallChainFlags"] = 24] = "CallChainFlags";
3758
3759
  return SignatureFlags4;
@@ -44749,11 +44750,6 @@ function createTypeChecker(host) {
44749
44750
  diagnosticMessage = error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
44750
44751
  } else if (result.flags & 256 /* RegularEnum */) {
44751
44752
  diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
44752
- } else {
44753
- Debug.assert(!!(result.flags & 128 /* ConstEnum */));
44754
- if (shouldPreserveConstEnums(compilerOptions)) {
44755
- diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
44756
- }
44757
44753
  }
44758
44754
  if (diagnosticMessage) {
44759
44755
  addRelatedInfo(
@@ -58189,7 +58185,7 @@ function createTypeChecker(host) {
58189
58185
  if (newConstraint.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(newBaseType), getRestrictiveInstantiation(newConstraint))) {
58190
58186
  return newBaseType;
58191
58187
  }
58192
- return newBaseType.flags & 8650752 /* TypeVariable */ || newConstraint.flags & 8650752 /* TypeVariable */ ? getSubstitutionType(newBaseType, newConstraint) : getIntersectionType([newConstraint, newBaseType]);
58188
+ return newBaseType.flags & 8650752 /* TypeVariable */ ? getSubstitutionType(newBaseType, newConstraint) : getIntersectionType([newConstraint, newBaseType]);
58193
58189
  }
58194
58190
  return type;
58195
58191
  }
@@ -63420,11 +63416,13 @@ function createTypeChecker(host) {
63420
63416
  }
63421
63417
  }
63422
63418
  function inferFromSignature(source, target) {
63423
- const saveBivariant = bivariant;
63424
- const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
63425
- bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
63426
- applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
63427
- bivariant = saveBivariant;
63419
+ if (!(source.flags & 64 /* IsNonInferrable */)) {
63420
+ const saveBivariant = bivariant;
63421
+ const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
63422
+ bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
63423
+ applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
63424
+ bivariant = saveBivariant;
63425
+ }
63428
63426
  applyToReturnTypes(source, target, inferFromTypes);
63429
63427
  }
63430
63428
  function inferFromIndexTypes(source, target) {
@@ -72324,7 +72322,7 @@ function createTypeChecker(host) {
72324
72322
  /*resolvedTypePredicate*/
72325
72323
  void 0,
72326
72324
  0,
72327
- 0 /* None */
72325
+ 64 /* IsNonInferrable */
72328
72326
  );
72329
72327
  const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
72330
72328
  returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
package/lib/tsserver.js CHANGED
@@ -2293,7 +2293,7 @@ module.exports = __toCommonJS(server_exports);
2293
2293
 
2294
2294
  // src/compiler/corePublic.ts
2295
2295
  var versionMajorMinor = "5.1";
2296
- var version = `${versionMajorMinor}.0-insiders.20230412`;
2296
+ var version = `${versionMajorMinor}.0-insiders.20230413`;
2297
2297
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2298
2298
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2299
2299
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6767,6 +6767,7 @@ var SignatureFlags = /* @__PURE__ */ ((SignatureFlags5) => {
6767
6767
  SignatureFlags5[SignatureFlags5["IsInnerCallChain"] = 8] = "IsInnerCallChain";
6768
6768
  SignatureFlags5[SignatureFlags5["IsOuterCallChain"] = 16] = "IsOuterCallChain";
6769
6769
  SignatureFlags5[SignatureFlags5["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
6770
+ SignatureFlags5[SignatureFlags5["IsNonInferrable"] = 64] = "IsNonInferrable";
6770
6771
  SignatureFlags5[SignatureFlags5["PropagatingFlags"] = 39] = "PropagatingFlags";
6771
6772
  SignatureFlags5[SignatureFlags5["CallChainFlags"] = 24] = "CallChainFlags";
6772
6773
  return SignatureFlags5;
@@ -49399,11 +49400,6 @@ function createTypeChecker(host) {
49399
49400
  diagnosticMessage = error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
49400
49401
  } else if (result.flags & 256 /* RegularEnum */) {
49401
49402
  diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
49402
- } else {
49403
- Debug.assert(!!(result.flags & 128 /* ConstEnum */));
49404
- if (shouldPreserveConstEnums(compilerOptions)) {
49405
- diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
49406
- }
49407
49403
  }
49408
49404
  if (diagnosticMessage) {
49409
49405
  addRelatedInfo(
@@ -62839,7 +62835,7 @@ function createTypeChecker(host) {
62839
62835
  if (newConstraint.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(newBaseType), getRestrictiveInstantiation(newConstraint))) {
62840
62836
  return newBaseType;
62841
62837
  }
62842
- return newBaseType.flags & 8650752 /* TypeVariable */ || newConstraint.flags & 8650752 /* TypeVariable */ ? getSubstitutionType(newBaseType, newConstraint) : getIntersectionType([newConstraint, newBaseType]);
62838
+ return newBaseType.flags & 8650752 /* TypeVariable */ ? getSubstitutionType(newBaseType, newConstraint) : getIntersectionType([newConstraint, newBaseType]);
62843
62839
  }
62844
62840
  return type;
62845
62841
  }
@@ -68070,11 +68066,13 @@ function createTypeChecker(host) {
68070
68066
  }
68071
68067
  }
68072
68068
  function inferFromSignature(source, target) {
68073
- const saveBivariant = bivariant;
68074
- const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
68075
- bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
68076
- applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
68077
- bivariant = saveBivariant;
68069
+ if (!(source.flags & 64 /* IsNonInferrable */)) {
68070
+ const saveBivariant = bivariant;
68071
+ const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
68072
+ bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
68073
+ applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
68074
+ bivariant = saveBivariant;
68075
+ }
68078
68076
  applyToReturnTypes(source, target, inferFromTypes);
68079
68077
  }
68080
68078
  function inferFromIndexTypes(source, target) {
@@ -76974,7 +76972,7 @@ function createTypeChecker(host) {
76974
76972
  /*resolvedTypePredicate*/
76975
76973
  void 0,
76976
76974
  0,
76977
- 0 /* None */
76975
+ 64 /* IsNonInferrable */
76978
76976
  );
76979
76977
  const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
76980
76978
  returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
@@ -127731,7 +127729,8 @@ function getDefaultFormatCodeSettings(newLineCharacter) {
127731
127729
  placeOpenBraceOnNewLineForFunctions: false,
127732
127730
  placeOpenBraceOnNewLineForControlBlocks: false,
127733
127731
  semicolons: "ignore" /* Ignore */,
127734
- trimTrailingWhitespace: true
127732
+ trimTrailingWhitespace: true,
127733
+ indentSwitchCase: true
127735
127734
  };
127736
127735
  }
127737
127736
  var testFormatSettings = getDefaultFormatCodeSettings("\n");
@@ -128909,7 +128908,13 @@ function findPrecedingToken(position, sourceFile, startNode2, excludeJsdoc) {
128909
128908
  sourceFile,
128910
128909
  n.kind
128911
128910
  );
128912
- return candidate2 && findRightmostToken(candidate2, sourceFile);
128911
+ if (candidate2) {
128912
+ if (!excludeJsdoc && isJSDocCommentContainingNode(candidate2) && candidate2.getChildren(sourceFile).length) {
128913
+ return find2(candidate2);
128914
+ }
128915
+ return findRightmostToken(candidate2, sourceFile);
128916
+ }
128917
+ return void 0;
128913
128918
  } else {
128914
128919
  return find2(child);
128915
128920
  }
@@ -168593,6 +168598,7 @@ var SmartIndenter;
168593
168598
  }
168594
168599
  SmartIndenter2.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn;
168595
168600
  function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) {
168601
+ var _a2;
168596
168602
  const childKind = child ? child.kind : 0 /* Unknown */;
168597
168603
  switch (parent2.kind) {
168598
168604
  case 243 /* ExpressionStatement */:
@@ -168608,9 +168614,6 @@ var SmartIndenter;
168608
168614
  case 186 /* TypeLiteral */:
168609
168615
  case 199 /* MappedType */:
168610
168616
  case 188 /* TupleType */:
168611
- case 268 /* CaseBlock */:
168612
- case 295 /* DefaultClause */:
168613
- case 294 /* CaseClause */:
168614
168617
  case 216 /* ParenthesizedExpression */:
168615
168618
  case 210 /* PropertyAccessExpression */:
168616
168619
  case 212 /* CallExpression */:
@@ -168639,7 +168642,11 @@ var SmartIndenter;
168639
168642
  case 280 /* ExportSpecifier */:
168640
168643
  case 275 /* ImportSpecifier */:
168641
168644
  case 171 /* PropertyDeclaration */:
168645
+ case 294 /* CaseClause */:
168646
+ case 295 /* DefaultClause */:
168642
168647
  return true;
168648
+ case 268 /* CaseBlock */:
168649
+ return (_a2 = settings.indentSwitchCase) != null ? _a2 : true;
168643
168650
  case 259 /* VariableDeclaration */:
168644
168651
  case 301 /* PropertyAssignment */:
168645
168652
  case 225 /* BinaryExpression */:
@@ -2718,6 +2718,7 @@ declare namespace ts {
2718
2718
  placeOpenBraceOnNewLineForControlBlocks?: boolean;
2719
2719
  insertSpaceBeforeTypeAnnotation?: boolean;
2720
2720
  semicolons?: SemicolonPreference;
2721
+ indentSwitchCase?: boolean;
2721
2722
  }
2722
2723
  interface UserPreferences {
2723
2724
  readonly disableSuggestions?: boolean;
@@ -10524,6 +10525,7 @@ declare namespace ts {
10524
10525
  readonly insertSpaceBeforeTypeAnnotation?: boolean;
10525
10526
  readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
10526
10527
  readonly semicolons?: SemicolonPreference;
10528
+ readonly indentSwitchCase?: boolean;
10527
10529
  }
10528
10530
  interface DefinitionInfo extends DocumentSpan {
10529
10531
  kind: ScriptElementKind;
@@ -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-insiders.20230412`;
38
+ version = `${versionMajorMinor}.0-insiders.20230413`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -4566,6 +4566,7 @@ ${lanes.join("\n")}
4566
4566
  SignatureFlags5[SignatureFlags5["IsInnerCallChain"] = 8] = "IsInnerCallChain";
4567
4567
  SignatureFlags5[SignatureFlags5["IsOuterCallChain"] = 16] = "IsOuterCallChain";
4568
4568
  SignatureFlags5[SignatureFlags5["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
4569
+ SignatureFlags5[SignatureFlags5["IsNonInferrable"] = 64] = "IsNonInferrable";
4569
4570
  SignatureFlags5[SignatureFlags5["PropagatingFlags"] = 39] = "PropagatingFlags";
4570
4571
  SignatureFlags5[SignatureFlags5["CallChainFlags"] = 24] = "CallChainFlags";
4571
4572
  return SignatureFlags5;
@@ -47200,11 +47201,6 @@ ${lanes.join("\n")}
47200
47201
  diagnosticMessage = error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
47201
47202
  } else if (result.flags & 256 /* RegularEnum */) {
47202
47203
  diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
47203
- } else {
47204
- Debug.assert(!!(result.flags & 128 /* ConstEnum */));
47205
- if (shouldPreserveConstEnums(compilerOptions)) {
47206
- diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
47207
- }
47208
47204
  }
47209
47205
  if (diagnosticMessage) {
47210
47206
  addRelatedInfo(
@@ -60640,7 +60636,7 @@ ${lanes.join("\n")}
60640
60636
  if (newConstraint.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(newBaseType), getRestrictiveInstantiation(newConstraint))) {
60641
60637
  return newBaseType;
60642
60638
  }
60643
- return newBaseType.flags & 8650752 /* TypeVariable */ || newConstraint.flags & 8650752 /* TypeVariable */ ? getSubstitutionType(newBaseType, newConstraint) : getIntersectionType([newConstraint, newBaseType]);
60639
+ return newBaseType.flags & 8650752 /* TypeVariable */ ? getSubstitutionType(newBaseType, newConstraint) : getIntersectionType([newConstraint, newBaseType]);
60644
60640
  }
60645
60641
  return type;
60646
60642
  }
@@ -65871,11 +65867,13 @@ ${lanes.join("\n")}
65871
65867
  }
65872
65868
  }
65873
65869
  function inferFromSignature(source, target) {
65874
- const saveBivariant = bivariant;
65875
- const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
65876
- bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
65877
- applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
65878
- bivariant = saveBivariant;
65870
+ if (!(source.flags & 64 /* IsNonInferrable */)) {
65871
+ const saveBivariant = bivariant;
65872
+ const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
65873
+ bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
65874
+ applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
65875
+ bivariant = saveBivariant;
65876
+ }
65879
65877
  applyToReturnTypes(source, target, inferFromTypes);
65880
65878
  }
65881
65879
  function inferFromIndexTypes(source, target) {
@@ -74775,7 +74773,7 @@ ${lanes.join("\n")}
74775
74773
  /*resolvedTypePredicate*/
74776
74774
  void 0,
74777
74775
  0,
74778
- 0 /* None */
74776
+ 64 /* IsNonInferrable */
74779
74777
  );
74780
74778
  const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
74781
74779
  returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
@@ -125968,7 +125966,8 @@ ${lanes.join("\n")}
125968
125966
  placeOpenBraceOnNewLineForFunctions: false,
125969
125967
  placeOpenBraceOnNewLineForControlBlocks: false,
125970
125968
  semicolons: "ignore" /* Ignore */,
125971
- trimTrailingWhitespace: true
125969
+ trimTrailingWhitespace: true,
125970
+ indentSwitchCase: true
125972
125971
  };
125973
125972
  }
125974
125973
  var ScriptSnapshot, PackageJsonDependencyGroup, PackageJsonAutoImportPreference, LanguageServiceMode, emptyOptions, SemanticClassificationFormat, OrganizeImportsMode, CompletionTriggerKind, InlayHintKind, HighlightSpanKind, IndentStyle, SemicolonPreference, testFormatSettings, SymbolDisplayPartKind, CompletionInfoFlags, OutliningSpanKind, OutputFileType, EndOfLineState, TokenClass, ScriptElementKind, ScriptElementKindModifier, ClassificationTypeNames, ClassificationType;
@@ -127221,7 +127220,13 @@ ${lanes.join("\n")}
127221
127220
  sourceFile,
127222
127221
  n.kind
127223
127222
  );
127224
- return candidate2 && findRightmostToken(candidate2, sourceFile);
127223
+ if (candidate2) {
127224
+ if (!excludeJsdoc && isJSDocCommentContainingNode(candidate2) && candidate2.getChildren(sourceFile).length) {
127225
+ return find2(candidate2);
127226
+ }
127227
+ return findRightmostToken(candidate2, sourceFile);
127228
+ }
127229
+ return void 0;
127225
127230
  } else {
127226
127231
  return find2(child);
127227
127232
  }
@@ -168087,6 +168092,7 @@ ${options.prefix}` : "\n" : options.prefix
168087
168092
  }
168088
168093
  SmartIndenter2.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn;
168089
168094
  function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) {
168095
+ var _a2;
168090
168096
  const childKind = child ? child.kind : 0 /* Unknown */;
168091
168097
  switch (parent2.kind) {
168092
168098
  case 243 /* ExpressionStatement */:
@@ -168102,9 +168108,6 @@ ${options.prefix}` : "\n" : options.prefix
168102
168108
  case 186 /* TypeLiteral */:
168103
168109
  case 199 /* MappedType */:
168104
168110
  case 188 /* TupleType */:
168105
- case 268 /* CaseBlock */:
168106
- case 295 /* DefaultClause */:
168107
- case 294 /* CaseClause */:
168108
168111
  case 216 /* ParenthesizedExpression */:
168109
168112
  case 210 /* PropertyAccessExpression */:
168110
168113
  case 212 /* CallExpression */:
@@ -168133,7 +168136,11 @@ ${options.prefix}` : "\n" : options.prefix
168133
168136
  case 280 /* ExportSpecifier */:
168134
168137
  case 275 /* ImportSpecifier */:
168135
168138
  case 171 /* PropertyDeclaration */:
168139
+ case 294 /* CaseClause */:
168140
+ case 295 /* DefaultClause */:
168136
168141
  return true;
168142
+ case 268 /* CaseBlock */:
168143
+ return (_a2 = settings.indentSwitchCase) != null ? _a2 : true;
168137
168144
  case 259 /* VariableDeclaration */:
168138
168145
  case 301 /* PropertyAssignment */:
168139
168146
  case 225 /* BinaryExpression */:
@@ -6594,6 +6594,7 @@ declare namespace ts {
6594
6594
  readonly insertSpaceBeforeTypeAnnotation?: boolean;
6595
6595
  readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
6596
6596
  readonly semicolons?: SemicolonPreference;
6597
+ readonly indentSwitchCase?: boolean;
6597
6598
  }
6598
6599
  interface DefinitionInfo extends DocumentSpan {
6599
6600
  kind: ScriptElementKind;
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-insiders.20230412`;
38
+ version = `${versionMajorMinor}.0-insiders.20230413`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -4566,6 +4566,7 @@ ${lanes.join("\n")}
4566
4566
  SignatureFlags5[SignatureFlags5["IsInnerCallChain"] = 8] = "IsInnerCallChain";
4567
4567
  SignatureFlags5[SignatureFlags5["IsOuterCallChain"] = 16] = "IsOuterCallChain";
4568
4568
  SignatureFlags5[SignatureFlags5["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
4569
+ SignatureFlags5[SignatureFlags5["IsNonInferrable"] = 64] = "IsNonInferrable";
4569
4570
  SignatureFlags5[SignatureFlags5["PropagatingFlags"] = 39] = "PropagatingFlags";
4570
4571
  SignatureFlags5[SignatureFlags5["CallChainFlags"] = 24] = "CallChainFlags";
4571
4572
  return SignatureFlags5;
@@ -47200,11 +47201,6 @@ ${lanes.join("\n")}
47200
47201
  diagnosticMessage = error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
47201
47202
  } else if (result.flags & 256 /* RegularEnum */) {
47202
47203
  diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
47203
- } else {
47204
- Debug.assert(!!(result.flags & 128 /* ConstEnum */));
47205
- if (shouldPreserveConstEnums(compilerOptions)) {
47206
- diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
47207
- }
47208
47204
  }
47209
47205
  if (diagnosticMessage) {
47210
47206
  addRelatedInfo(
@@ -60640,7 +60636,7 @@ ${lanes.join("\n")}
60640
60636
  if (newConstraint.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(newBaseType), getRestrictiveInstantiation(newConstraint))) {
60641
60637
  return newBaseType;
60642
60638
  }
60643
- return newBaseType.flags & 8650752 /* TypeVariable */ || newConstraint.flags & 8650752 /* TypeVariable */ ? getSubstitutionType(newBaseType, newConstraint) : getIntersectionType([newConstraint, newBaseType]);
60639
+ return newBaseType.flags & 8650752 /* TypeVariable */ ? getSubstitutionType(newBaseType, newConstraint) : getIntersectionType([newConstraint, newBaseType]);
60644
60640
  }
60645
60641
  return type;
60646
60642
  }
@@ -65871,11 +65867,13 @@ ${lanes.join("\n")}
65871
65867
  }
65872
65868
  }
65873
65869
  function inferFromSignature(source, target) {
65874
- const saveBivariant = bivariant;
65875
- const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
65876
- bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
65877
- applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
65878
- bivariant = saveBivariant;
65870
+ if (!(source.flags & 64 /* IsNonInferrable */)) {
65871
+ const saveBivariant = bivariant;
65872
+ const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
65873
+ bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
65874
+ applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
65875
+ bivariant = saveBivariant;
65876
+ }
65879
65877
  applyToReturnTypes(source, target, inferFromTypes);
65880
65878
  }
65881
65879
  function inferFromIndexTypes(source, target) {
@@ -74775,7 +74773,7 @@ ${lanes.join("\n")}
74775
74773
  /*resolvedTypePredicate*/
74776
74774
  void 0,
74777
74775
  0,
74778
- 0 /* None */
74776
+ 64 /* IsNonInferrable */
74779
74777
  );
74780
74778
  const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
74781
74779
  returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
@@ -125982,7 +125980,8 @@ ${lanes.join("\n")}
125982
125980
  placeOpenBraceOnNewLineForFunctions: false,
125983
125981
  placeOpenBraceOnNewLineForControlBlocks: false,
125984
125982
  semicolons: "ignore" /* Ignore */,
125985
- trimTrailingWhitespace: true
125983
+ trimTrailingWhitespace: true,
125984
+ indentSwitchCase: true
125986
125985
  };
125987
125986
  }
125988
125987
  var ScriptSnapshot, PackageJsonDependencyGroup, PackageJsonAutoImportPreference, LanguageServiceMode, emptyOptions, SemanticClassificationFormat, OrganizeImportsMode, CompletionTriggerKind, InlayHintKind, HighlightSpanKind, IndentStyle, SemicolonPreference, testFormatSettings, SymbolDisplayPartKind, CompletionInfoFlags, OutliningSpanKind, OutputFileType, EndOfLineState, TokenClass, ScriptElementKind, ScriptElementKindModifier, ClassificationTypeNames, ClassificationType;
@@ -127235,7 +127234,13 @@ ${lanes.join("\n")}
127235
127234
  sourceFile,
127236
127235
  n.kind
127237
127236
  );
127238
- return candidate2 && findRightmostToken(candidate2, sourceFile);
127237
+ if (candidate2) {
127238
+ if (!excludeJsdoc && isJSDocCommentContainingNode(candidate2) && candidate2.getChildren(sourceFile).length) {
127239
+ return find2(candidate2);
127240
+ }
127241
+ return findRightmostToken(candidate2, sourceFile);
127242
+ }
127243
+ return void 0;
127239
127244
  } else {
127240
127245
  return find2(child);
127241
127246
  }
@@ -168101,6 +168106,7 @@ ${options.prefix}` : "\n" : options.prefix
168101
168106
  }
168102
168107
  SmartIndenter2.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn;
168103
168108
  function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) {
168109
+ var _a2;
168104
168110
  const childKind = child ? child.kind : 0 /* Unknown */;
168105
168111
  switch (parent2.kind) {
168106
168112
  case 243 /* ExpressionStatement */:
@@ -168116,9 +168122,6 @@ ${options.prefix}` : "\n" : options.prefix
168116
168122
  case 186 /* TypeLiteral */:
168117
168123
  case 199 /* MappedType */:
168118
168124
  case 188 /* TupleType */:
168119
- case 268 /* CaseBlock */:
168120
- case 295 /* DefaultClause */:
168121
- case 294 /* CaseClause */:
168122
168125
  case 216 /* ParenthesizedExpression */:
168123
168126
  case 210 /* PropertyAccessExpression */:
168124
168127
  case 212 /* CallExpression */:
@@ -168147,7 +168150,11 @@ ${options.prefix}` : "\n" : options.prefix
168147
168150
  case 280 /* ExportSpecifier */:
168148
168151
  case 275 /* ImportSpecifier */:
168149
168152
  case 171 /* PropertyDeclaration */:
168153
+ case 294 /* CaseClause */:
168154
+ case 295 /* DefaultClause */:
168150
168155
  return true;
168156
+ case 268 /* CaseBlock */:
168157
+ return (_a2 = settings.indentSwitchCase) != null ? _a2 : true;
168151
168158
  case 259 /* VariableDeclaration */:
168152
168159
  case 301 /* PropertyAssignment */:
168153
168160
  case 225 /* BinaryExpression */:
@@ -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-insiders.20230412`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230413`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -3183,6 +3183,7 @@ var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => {
3183
3183
  SignatureFlags4[SignatureFlags4["IsInnerCallChain"] = 8] = "IsInnerCallChain";
3184
3184
  SignatureFlags4[SignatureFlags4["IsOuterCallChain"] = 16] = "IsOuterCallChain";
3185
3185
  SignatureFlags4[SignatureFlags4["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
3186
+ SignatureFlags4[SignatureFlags4["IsNonInferrable"] = 64] = "IsNonInferrable";
3186
3187
  SignatureFlags4[SignatureFlags4["PropagatingFlags"] = 39] = "PropagatingFlags";
3187
3188
  SignatureFlags4[SignatureFlags4["CallChainFlags"] = 24] = "CallChainFlags";
3188
3189
  return SignatureFlags4;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.1.0-pr-53758-6",
5
+ "version": "5.1.0-pr-53756-16",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "14.21.1",
115
115
  "npm": "8.19.3"
116
116
  },
117
- "gitHead": "f416421fb6211503675dd59bcf68b6ea2703b7e0"
117
+ "gitHead": "e1e71a8563ff75c6d75591c34985f7e18ad1610f"
118
118
  }