@typescript-deploys/pr-build 4.8.0-pr-49881-8 → 4.8.0-pr-49884-15

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.dom.d.ts CHANGED
@@ -13848,11 +13848,11 @@ declare var SubmitEvent: {
13848
13848
  * Available only in secure contexts.
13849
13849
  */
13850
13850
  interface SubtleCrypto {
13851
- decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
13851
+ decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
13852
13852
  deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
13853
13853
  deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
13854
13854
  digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
13855
- encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
13855
+ encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
13856
13856
  exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
13857
13857
  exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
13858
13858
  generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
@@ -3008,11 +3008,11 @@ declare var StorageManager: {
3008
3008
  * Available only in secure contexts.
3009
3009
  */
3010
3010
  interface SubtleCrypto {
3011
- decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
3011
+ decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
3012
3012
  deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
3013
3013
  deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
3014
3014
  digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
3015
- encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
3015
+ encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
3016
3016
  exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
3017
3017
  exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
3018
3018
  generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.8";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20220715";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220720";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -28486,6 +28486,9 @@ var ts;
28486
28486
  var typeArguments = tryParse(parseTypeArgumentsInExpression);
28487
28487
  if (typeArguments !== undefined) {
28488
28488
  parseErrorAt(startPos, getNodePos(), ts.Diagnostics.super_may_not_use_type_arguments);
28489
+ if (!isTemplateStartOfTaggedTemplate()) {
28490
+ expression = factory.createExpressionWithTypeArguments(expression, typeArguments);
28491
+ }
28489
28492
  }
28490
28493
  }
28491
28494
  if (token() === 20 || token() === 24 || token() === 22) {
@@ -41382,7 +41385,7 @@ var ts;
41382
41385
  }
41383
41386
  }
41384
41387
  function checkAndReportErrorForInvalidInitializer() {
41385
- if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 && useDefineForClassFields)) {
41388
+ if (propertyWithInvalidInitializer && !(useDefineForClassFields && ts.getEmitScriptTarget(compilerOptions) >= 9)) {
41386
41389
  error(errorLocation, errorLocation && propertyWithInvalidInitializer.type && ts.textRangeContainsPositionInclusive(propertyWithInvalidInitializer.type, errorLocation.pos)
41387
41390
  ? ts.Diagnostics.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor
41388
41391
  : ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyWithInvalidInitializer.name), diagnosticName(nameArg));
@@ -49034,6 +49037,9 @@ var ts;
49034
49037
  else if (type.objectFlags & 32) {
49035
49038
  resolveMappedTypeMembers(type);
49036
49039
  }
49040
+ else {
49041
+ ts.Debug.fail("Unhandled object type " + ts.Debug.formatObjectFlags(type.objectFlags));
49042
+ }
49037
49043
  }
49038
49044
  else if (type.flags & 1048576) {
49039
49045
  resolveUnionTypeMembers(type);
@@ -49041,6 +49047,9 @@ var ts;
49041
49047
  else if (type.flags & 2097152) {
49042
49048
  resolveIntersectionTypeMembers(type);
49043
49049
  }
49050
+ else {
49051
+ ts.Debug.fail("Unhandled type " + ts.Debug.formatTypeFlags(type.flags));
49052
+ }
49044
49053
  }
49045
49054
  return type;
49046
49055
  }
@@ -49710,12 +49719,15 @@ var ts;
49710
49719
  return getApplicableIndexInfo(type, isLateBoundName(name) ? esSymbolType : getStringLiteralType(ts.unescapeLeadingUnderscores(name)));
49711
49720
  }
49712
49721
  function getTypeParametersFromDeclaration(declaration) {
49722
+ var _a;
49713
49723
  var result;
49714
- for (var _i = 0, _a = ts.getEffectiveTypeParameterDeclarations(declaration); _i < _a.length; _i++) {
49715
- var node = _a[_i];
49724
+ for (var _i = 0, _b = ts.getEffectiveTypeParameterDeclarations(declaration); _i < _b.length; _i++) {
49725
+ var node = _b[_i];
49716
49726
  result = ts.appendIfUnique(result, getDeclaredTypeOfTypeParameter(node.symbol));
49717
49727
  }
49718
- return result;
49728
+ return (result === null || result === void 0 ? void 0 : result.length) ? result
49729
+ : ts.isFunctionDeclaration(declaration) ? (_a = getSignatureOfTypeTag(declaration)) === null || _a === void 0 ? void 0 : _a.typeParameters
49730
+ : undefined;
49719
49731
  }
49720
49732
  function symbolsToArray(symbols) {
49721
49733
  var result = [];
@@ -56817,7 +56829,7 @@ var ts;
56817
56829
  if (!isLiteralOfContextualType(type, contextualType)) {
56818
56830
  type = getWidenedUniqueESSymbolType(getWidenedLiteralType(type));
56819
56831
  }
56820
- return type;
56832
+ return getRegularTypeOfLiteralType(type);
56821
56833
  }
56822
56834
  function getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(type, contextualSignatureReturnType, isAsync) {
56823
56835
  if (type && isUnitType(type)) {
@@ -57761,15 +57773,11 @@ var ts;
57761
57773
  inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target));
57762
57774
  }
57763
57775
  else if (source.flags & 4194304 && target.flags & 4194304) {
57764
- contravariant = !contravariant;
57765
- inferFromTypes(source.type, target.type);
57766
- contravariant = !contravariant;
57776
+ inferFromContravariantTypes(source.type, target.type);
57767
57777
  }
57768
57778
  else if ((isLiteralType(source) || source.flags & 4) && target.flags & 4194304) {
57769
57779
  var empty = createEmptyObjectTypeFromStringLiteral(source);
57770
- contravariant = !contravariant;
57771
- inferWithPriority(empty, target.type, 256);
57772
- contravariant = !contravariant;
57780
+ inferFromContravariantTypesWithPriority(empty, target.type, 256);
57773
57781
  }
57774
57782
  else if (source.flags & 8388608 && target.flags & 8388608) {
57775
57783
  inferFromTypes(source.objectType, target.objectType);
@@ -57782,10 +57790,7 @@ var ts;
57782
57790
  }
57783
57791
  else if (source.flags & 33554432) {
57784
57792
  inferFromTypes(source.baseType, target);
57785
- var oldPriority = priority;
57786
- priority |= 4;
57787
- inferFromTypes(source.substitute, target);
57788
- priority = oldPriority;
57793
+ inferWithPriority(source.substitute, target, 4);
57789
57794
  }
57790
57795
  else if (target.flags & 16777216) {
57791
57796
  invokeOnce(source, target, inferToConditionalType);
@@ -57824,6 +57829,18 @@ var ts;
57824
57829
  inferFromTypes(source, target);
57825
57830
  priority = savePriority;
57826
57831
  }
57832
+ function inferFromContravariantTypesWithPriority(source, target, newPriority) {
57833
+ var savePriority = priority;
57834
+ priority |= newPriority;
57835
+ inferFromContravariantTypes(source, target);
57836
+ priority = savePriority;
57837
+ }
57838
+ function inferToMultipleTypesWithPriority(source, targets, targetFlags, newPriority) {
57839
+ var savePriority = priority;
57840
+ priority |= newPriority;
57841
+ inferToMultipleTypes(source, targets, targetFlags);
57842
+ priority = savePriority;
57843
+ }
57827
57844
  function invokeOnce(source, target, action) {
57828
57845
  var key = source.id + "," + target.id;
57829
57846
  var status = visited && visited.get(key);
@@ -57886,10 +57903,13 @@ var ts;
57886
57903
  }
57887
57904
  }
57888
57905
  function inferFromContravariantTypes(source, target) {
57906
+ contravariant = !contravariant;
57907
+ inferFromTypes(source, target);
57908
+ contravariant = !contravariant;
57909
+ }
57910
+ function inferFromContravariantTypesIfStrictFunctionTypes(source, target) {
57889
57911
  if (strictFunctionTypes || priority & 1024) {
57890
- contravariant = !contravariant;
57891
- inferFromTypes(source, target);
57892
- contravariant = !contravariant;
57912
+ inferFromContravariantTypes(source, target);
57893
57913
  }
57894
57914
  else {
57895
57915
  inferFromTypes(source, target);
@@ -58020,11 +58040,8 @@ var ts;
58020
58040
  inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target));
58021
58041
  }
58022
58042
  else {
58023
- var savePriority = priority;
58024
- priority |= contravariant ? 64 : 0;
58025
58043
  var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)];
58026
- inferToMultipleTypes(source, targetTypes, target.flags);
58027
- priority = savePriority;
58044
+ inferToMultipleTypesWithPriority(source, targetTypes, target.flags, contravariant ? 64 : 0);
58028
58045
  }
58029
58046
  }
58030
58047
  function inferToTemplateLiteralType(source, target) {
@@ -58183,7 +58200,7 @@ var ts;
58183
58200
  var saveBivariant = bivariant;
58184
58201
  var kind = target.declaration ? target.declaration.kind : 0;
58185
58202
  bivariant = bivariant || kind === 169 || kind === 168 || kind === 171;
58186
- applyToParameterTypes(source, target, inferFromContravariantTypes);
58203
+ applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
58187
58204
  bivariant = saveBivariant;
58188
58205
  applyToReturnTypes(source, target, inferFromTypes);
58189
58206
  }
@@ -59510,7 +59527,7 @@ var ts;
59510
59527
  return declaredType;
59511
59528
  }
59512
59529
  if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 243 && isMatchingReference(reference, node.parent.parent.expression)) {
59513
- return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)));
59530
+ return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))));
59514
59531
  }
59515
59532
  return undefined;
59516
59533
  }
@@ -60158,16 +60175,23 @@ var ts;
60158
60175
  if (!assumeTrue) {
60159
60176
  return filterType(type, function (t) { return !isRelated(t, candidate); });
60160
60177
  }
60161
- if (type.flags & 1048576) {
60162
- var assignableType = filterType(type, function (t) { return isRelated(t, candidate); });
60163
- if (!(assignableType.flags & 131072)) {
60164
- return assignableType;
60165
- }
60178
+ if (type.flags & 3) {
60179
+ return candidate;
60166
60180
  }
60167
- return isTypeSubtypeOf(candidate, type) ? candidate :
60168
- isTypeAssignableTo(type, candidate) ? type :
60169
- isTypeAssignableTo(candidate, type) ? candidate :
60170
- getIntersectionType([type, candidate]);
60181
+ var keyPropertyName = type.flags & 1048576 ? getKeyPropertyName(type) : undefined;
60182
+ var narrowedType = mapType(candidate, function (c) {
60183
+ var discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName);
60184
+ var matching = discriminant && getConstituentTypeForKeyType(type, discriminant);
60185
+ var directlyRelated = mapType(matching || type, function (t) { return isRelated(t, c) ? t : isRelated(c, t) ? c : neverType; });
60186
+ return directlyRelated.flags & 131072 ?
60187
+ mapType(type, function (t) { return maybeTypeOfKind(t, 465829888) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType; }) :
60188
+ directlyRelated;
60189
+ });
60190
+ return !(narrowedType.flags & 131072) ? narrowedType :
60191
+ isTypeSubtypeOf(candidate, type) ? candidate :
60192
+ isTypeAssignableTo(type, candidate) ? type :
60193
+ isTypeAssignableTo(candidate, type) ? candidate :
60194
+ getIntersectionType([type, candidate]);
60171
60195
  }
60172
60196
  function narrowTypeByCallExpression(type, callExpression, assumeTrue) {
60173
60197
  if (hasMatchingArgument(callExpression, reference)) {
@@ -64219,7 +64243,7 @@ var ts;
64219
64243
  var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node);
64220
64244
  var reportErrors = !candidatesOutArray;
64221
64245
  var typeArguments;
64222
- if (!isDecorator) {
64246
+ if (!isDecorator && !ts.isSuperCall(node)) {
64223
64247
  typeArguments = node.typeArguments;
64224
64248
  if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 106) {
64225
64249
  ts.forEach(typeArguments, checkSourceElement);
@@ -66327,7 +66351,7 @@ var ts;
66327
66351
  error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator));
66328
66352
  }
66329
66353
  if (node.operator === 39) {
66330
- if (maybeTypeOfKind(operandType, 2112)) {
66354
+ if (maybeTypeOfKindConsideringBaseConstraint(operandType, 2112)) {
66331
66355
  error(node.operand, ts.Diagnostics.Operator_0_cannot_be_applied_to_type_1, ts.tokenToString(node.operator), typeToString(getBaseTypeOfLiteralType(operandType)));
66332
66356
  }
66333
66357
  return numberType;
@@ -66718,7 +66742,7 @@ var ts;
66718
66742
  if (operator === 55 || operator === 56 || operator === 60) {
66719
66743
  if (operator === 55) {
66720
66744
  var parent = ts.walkUpParenthesizedExpressions(node.parent);
66721
- checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, ts.isIfStatement(parent) ? parent.thenStatement : undefined);
66745
+ checkTestingKnownTruthyCallableOrAwaitableType(node.left, ts.isIfStatement(parent) ? parent.thenStatement : undefined);
66722
66746
  }
66723
66747
  checkTruthinessOfType(leftType, node.left);
66724
66748
  }
@@ -67191,8 +67215,8 @@ var ts;
67191
67215
  }
67192
67216
  }
67193
67217
  function checkConditionalExpression(node, checkMode) {
67194
- var type = checkTruthinessExpression(node.condition);
67195
- checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type, node.whenTrue);
67218
+ checkTruthinessExpression(node.condition);
67219
+ checkTestingKnownTruthyCallableOrAwaitableType(node.condition, node.whenTrue);
67196
67220
  var type1 = checkExpression(node.whenTrue, checkMode);
67197
67221
  var type2 = checkExpression(node.whenFalse, checkMode);
67198
67222
  return getUnionType([type1, type2], 2);
@@ -70034,19 +70058,17 @@ var ts;
70034
70058
  }
70035
70059
  function checkIfStatement(node) {
70036
70060
  checkGrammarStatementInAmbientContext(node);
70037
- var type = checkTruthinessExpression(node.expression);
70038
- checkTestingKnownTruthyCallableOrAwaitableType(node.expression, type, node.thenStatement);
70061
+ checkTruthinessExpression(node.expression);
70062
+ checkTestingKnownTruthyCallableOrAwaitableType(node.expression, node.thenStatement);
70039
70063
  checkSourceElement(node.thenStatement);
70040
70064
  if (node.thenStatement.kind === 236) {
70041
70065
  error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
70042
70066
  }
70043
70067
  checkSourceElement(node.elseStatement);
70044
70068
  }
70045
- function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, condType, body) {
70069
+ function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, body) {
70046
70070
  if (!strictNullChecks)
70047
70071
  return;
70048
- if (!(getTypeFacts(condType) & 4194304))
70049
- return;
70050
70072
  helper(condExpr, body);
70051
70073
  while (ts.isBinaryExpression(condExpr) && condExpr.operatorToken.kind === 56) {
70052
70074
  condExpr = condExpr.left;
@@ -70059,7 +70081,7 @@ var ts;
70059
70081
  : condExpr;
70060
70082
  if (ts.isModuleExportsAccessExpression(location))
70061
70083
  return;
70062
- var type = location === condExpr ? condType : checkTruthinessExpression(location);
70084
+ var type = checkTruthinessExpression(location);
70063
70085
  var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
70064
70086
  if (!(getTypeFacts(type) & 4194304) || isPropertyExpressionCast)
70065
70087
  return;