@typescript-deploys/pr-build 4.7.0-pr-48294-7 → 4.7.0-pr-48264-4
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/protocol.d.ts +4 -0
- package/lib/tsc.js +98 -96
- package/lib/tsserver.js +393 -164
- package/lib/tsserverlibrary.d.ts +10 -1
- package/lib/tsserverlibrary.js +393 -164
- package/lib/typescript.js +278 -160
- package/lib/typescriptServices.js +278 -160
- package/lib/typingsInstaller.js +121 -100
- package/package.json +1 -1
package/lib/protocol.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ declare namespace ts.server.protocol {
|
|
|
42
42
|
Rename = "rename",
|
|
43
43
|
Saveto = "saveto",
|
|
44
44
|
SignatureHelp = "signatureHelp",
|
|
45
|
+
SourceDefinitionAndBoundSpan = "sourceDefinitionAndBoundSpan",
|
|
45
46
|
Status = "status",
|
|
46
47
|
TypeDefinition = "typeDefinition",
|
|
47
48
|
ProjectInfo = "projectInfo",
|
|
@@ -661,6 +662,9 @@ declare namespace ts.server.protocol {
|
|
|
661
662
|
interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
|
|
662
663
|
readonly command: CommandTypes.DefinitionAndBoundSpan;
|
|
663
664
|
}
|
|
665
|
+
interface SourceDefinitionAndBoundSpanRequest extends FileLocationRequest {
|
|
666
|
+
readonly command: CommandTypes.SourceDefinitionAndBoundSpan;
|
|
667
|
+
}
|
|
664
668
|
interface DefinitionAndBoundSpanResponse extends Response {
|
|
665
669
|
readonly body: DefinitionInfoAndBoundSpan;
|
|
666
670
|
}
|
package/lib/tsc.js
CHANGED
|
@@ -11431,6 +11431,10 @@ var ts;
|
|
|
11431
11431
|
}
|
|
11432
11432
|
}
|
|
11433
11433
|
ts.isAnyImportSyntax = isAnyImportSyntax;
|
|
11434
|
+
function isAnyImportOrBareOrAccessedRequire(node) {
|
|
11435
|
+
return isAnyImportSyntax(node) || isVariableDeclarationInitializedToBareOrAccessedRequire(node);
|
|
11436
|
+
}
|
|
11437
|
+
ts.isAnyImportOrBareOrAccessedRequire = isAnyImportOrBareOrAccessedRequire;
|
|
11434
11438
|
function isLateVisibilityPaintedStatement(node) {
|
|
11435
11439
|
switch (node.kind) {
|
|
11436
11440
|
case 265:
|
|
@@ -12861,14 +12865,14 @@ var ts;
|
|
|
12861
12865
|
}
|
|
12862
12866
|
ts.isFunctionSymbol = isFunctionSymbol;
|
|
12863
12867
|
function tryGetModuleSpecifierFromDeclaration(node) {
|
|
12864
|
-
var _a, _b
|
|
12868
|
+
var _a, _b;
|
|
12865
12869
|
switch (node.kind) {
|
|
12866
12870
|
case 253:
|
|
12867
|
-
return node.initializer.arguments[0]
|
|
12871
|
+
return (_a = ts.findAncestor(node.initializer, function (node) { return isRequireCall(node, true); })) === null || _a === void 0 ? void 0 : _a.arguments[0];
|
|
12868
12872
|
case 265:
|
|
12869
|
-
return
|
|
12873
|
+
return ts.tryCast(node.moduleSpecifier, ts.isStringLiteralLike);
|
|
12870
12874
|
case 264:
|
|
12871
|
-
return
|
|
12875
|
+
return ts.tryCast((_b = ts.tryCast(node.moduleReference, ts.isExternalModuleReference)) === null || _b === void 0 ? void 0 : _b.expression, ts.isStringLiteralLike);
|
|
12872
12876
|
default:
|
|
12873
12877
|
ts.Debug.assertNever(node);
|
|
12874
12878
|
}
|
|
@@ -13343,18 +13347,22 @@ var ts;
|
|
|
13343
13347
|
}
|
|
13344
13348
|
ts.isIdentifierName = isIdentifierName;
|
|
13345
13349
|
function isAliasSymbolDeclaration(node) {
|
|
13346
|
-
|
|
13350
|
+
if (node.kind === 264 ||
|
|
13347
13351
|
node.kind === 263 ||
|
|
13348
13352
|
node.kind === 266 && !!node.name ||
|
|
13349
13353
|
node.kind === 267 ||
|
|
13350
13354
|
node.kind === 273 ||
|
|
13351
13355
|
node.kind === 269 ||
|
|
13352
13356
|
node.kind === 274 ||
|
|
13353
|
-
node.kind === 270 && exportAssignmentIsAlias(node)
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13357
|
+
node.kind === 270 && exportAssignmentIsAlias(node)) {
|
|
13358
|
+
return true;
|
|
13359
|
+
}
|
|
13360
|
+
return isInJSFile(node) && (ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 && exportAssignmentIsAlias(node) ||
|
|
13361
|
+
ts.isPropertyAccessExpression(node)
|
|
13362
|
+
&& ts.isBinaryExpression(node.parent)
|
|
13363
|
+
&& node.parent.left === node
|
|
13364
|
+
&& node.parent.operatorToken.kind === 63
|
|
13365
|
+
&& isAliasableExpression(node.parent.right));
|
|
13358
13366
|
}
|
|
13359
13367
|
ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
|
|
13360
13368
|
function getAliasDeclarationFromName(node) {
|
|
@@ -13365,6 +13373,7 @@ var ts;
|
|
|
13365
13373
|
case 274:
|
|
13366
13374
|
case 270:
|
|
13367
13375
|
case 264:
|
|
13376
|
+
case 273:
|
|
13368
13377
|
return node.parent;
|
|
13369
13378
|
case 160:
|
|
13370
13379
|
do {
|
|
@@ -32004,6 +32013,13 @@ var ts;
|
|
|
32004
32013
|
description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
|
|
32005
32014
|
defaultValueDescription: false,
|
|
32006
32015
|
},
|
|
32016
|
+
{
|
|
32017
|
+
name: "noDtsResolution",
|
|
32018
|
+
type: "boolean",
|
|
32019
|
+
affectsModuleResolution: true,
|
|
32020
|
+
category: ts.Diagnostics.Modules,
|
|
32021
|
+
defaultValueDescription: false,
|
|
32022
|
+
},
|
|
32007
32023
|
{
|
|
32008
32024
|
name: "sourceRoot",
|
|
32009
32025
|
type: "string",
|
|
@@ -34104,6 +34120,7 @@ var ts;
|
|
|
34104
34120
|
Extensions[Extensions["Json"] = 2] = "Json";
|
|
34105
34121
|
Extensions[Extensions["TSConfig"] = 3] = "TSConfig";
|
|
34106
34122
|
Extensions[Extensions["DtsOnly"] = 4] = "DtsOnly";
|
|
34123
|
+
Extensions[Extensions["TypeScriptButNotDts"] = 5] = "TypeScriptButNotDts";
|
|
34107
34124
|
})(Extensions || (Extensions = {}));
|
|
34108
34125
|
function resolvedTypeScriptOnly(resolved) {
|
|
34109
34126
|
if (!resolved) {
|
|
@@ -34900,13 +34917,31 @@ var ts;
|
|
|
34900
34917
|
return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, jsOnlyExtensions, undefined);
|
|
34901
34918
|
}
|
|
34902
34919
|
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, lookupConfig) {
|
|
34903
|
-
|
|
34920
|
+
var extensions;
|
|
34921
|
+
if (lookupConfig) {
|
|
34922
|
+
extensions = tsconfigExtensions;
|
|
34923
|
+
}
|
|
34924
|
+
else if (compilerOptions.noDtsResolution) {
|
|
34925
|
+
extensions = [Extensions.TypeScriptButNotDts];
|
|
34926
|
+
if (compilerOptions.allowJs)
|
|
34927
|
+
extensions.push(Extensions.JavaScript);
|
|
34928
|
+
if (compilerOptions.resolveJsonModule)
|
|
34929
|
+
extensions.push(Extensions.Json);
|
|
34930
|
+
}
|
|
34931
|
+
else {
|
|
34932
|
+
extensions = compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions;
|
|
34933
|
+
}
|
|
34934
|
+
return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, ts.getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, redirectedReference);
|
|
34904
34935
|
}
|
|
34905
34936
|
ts.nodeModuleNameResolver = nodeModuleNameResolver;
|
|
34906
34937
|
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) {
|
|
34907
34938
|
var _a, _b;
|
|
34908
34939
|
var traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
34909
34940
|
var failedLookupLocations = [];
|
|
34941
|
+
var conditions = features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"];
|
|
34942
|
+
if (compilerOptions.noDtsResolution) {
|
|
34943
|
+
conditions.pop();
|
|
34944
|
+
}
|
|
34910
34945
|
var state = {
|
|
34911
34946
|
compilerOptions: compilerOptions,
|
|
34912
34947
|
host: host,
|
|
@@ -34914,7 +34949,7 @@ var ts;
|
|
|
34914
34949
|
failedLookupLocations: failedLookupLocations,
|
|
34915
34950
|
packageJsonInfoCache: cache,
|
|
34916
34951
|
features: features,
|
|
34917
|
-
conditions:
|
|
34952
|
+
conditions: conditions,
|
|
34918
34953
|
};
|
|
34919
34954
|
var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); });
|
|
34920
34955
|
return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache);
|
|
@@ -35089,20 +35124,22 @@ var ts;
|
|
|
35089
35124
|
default: return tryExtension(".d.ts");
|
|
35090
35125
|
}
|
|
35091
35126
|
case Extensions.TypeScript:
|
|
35127
|
+
case Extensions.TypeScriptButNotDts:
|
|
35128
|
+
var useDts = extensions === Extensions.TypeScript;
|
|
35092
35129
|
switch (originalExtension) {
|
|
35093
35130
|
case ".mjs":
|
|
35094
35131
|
case ".mts":
|
|
35095
35132
|
case ".d.mts":
|
|
35096
|
-
return tryExtension(".mts") || tryExtension(".d.mts");
|
|
35133
|
+
return tryExtension(".mts") || (useDts ? tryExtension(".d.mts") : undefined);
|
|
35097
35134
|
case ".cjs":
|
|
35098
35135
|
case ".cts":
|
|
35099
35136
|
case ".d.cts":
|
|
35100
|
-
return tryExtension(".cts") || tryExtension(".d.cts");
|
|
35137
|
+
return tryExtension(".cts") || (useDts ? tryExtension(".d.cts") : undefined);
|
|
35101
35138
|
case ".json":
|
|
35102
35139
|
candidate += ".json";
|
|
35103
|
-
return tryExtension(".d.ts");
|
|
35140
|
+
return useDts ? tryExtension(".d.ts") : undefined;
|
|
35104
35141
|
default:
|
|
35105
|
-
return tryExtension(".ts") || tryExtension(".tsx") || tryExtension(".d.ts");
|
|
35142
|
+
return tryExtension(".ts") || tryExtension(".tsx") || (useDts ? tryExtension(".d.ts") : undefined);
|
|
35106
35143
|
}
|
|
35107
35144
|
case Extensions.JavaScript:
|
|
35108
35145
|
switch (originalExtension) {
|
|
@@ -35307,6 +35344,7 @@ var ts;
|
|
|
35307
35344
|
switch (extensions) {
|
|
35308
35345
|
case Extensions.JavaScript:
|
|
35309
35346
|
case Extensions.Json:
|
|
35347
|
+
case Extensions.TypeScriptButNotDts:
|
|
35310
35348
|
packageFile = readPackageJsonMainField(jsonContent, candidate, state);
|
|
35311
35349
|
break;
|
|
35312
35350
|
case Extensions.TypeScript:
|
|
@@ -35375,6 +35413,8 @@ var ts;
|
|
|
35375
35413
|
return extension === ".json";
|
|
35376
35414
|
case Extensions.TypeScript:
|
|
35377
35415
|
return extension === ".ts" || extension === ".tsx" || extension === ".d.ts";
|
|
35416
|
+
case Extensions.TypeScriptButNotDts:
|
|
35417
|
+
return extension === ".ts" || extension === ".tsx";
|
|
35378
35418
|
case Extensions.DtsOnly:
|
|
35379
35419
|
return extension === ".d.ts";
|
|
35380
35420
|
}
|
|
@@ -45300,7 +45340,7 @@ var ts;
|
|
|
45300
45340
|
if (!omitTypeAlias) {
|
|
45301
45341
|
return errorType;
|
|
45302
45342
|
}
|
|
45303
|
-
return
|
|
45343
|
+
return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]);
|
|
45304
45344
|
}
|
|
45305
45345
|
var members = ts.createSymbolTable();
|
|
45306
45346
|
for (var _b = 0, spreadableProperties_1 = spreadableProperties; _b < spreadableProperties_1.length; _b++) {
|
|
@@ -45693,7 +45733,7 @@ var ts;
|
|
|
45693
45733
|
}
|
|
45694
45734
|
}
|
|
45695
45735
|
var sourceTypes = ts.some(constructorTypes, function (t) { return !!(t.flags & ~98304); }) ? constructorTypes : types;
|
|
45696
|
-
type = getUnionType(sourceTypes
|
|
45736
|
+
type = getUnionType(sourceTypes);
|
|
45697
45737
|
}
|
|
45698
45738
|
}
|
|
45699
45739
|
var widened = getWidenedType(addOptionality(type, false, definedInMethod && !definedInConstructor));
|
|
@@ -46866,7 +46906,7 @@ var ts;
|
|
|
46866
46906
|
}
|
|
46867
46907
|
}
|
|
46868
46908
|
if (memberTypeList.length) {
|
|
46869
|
-
var enumType_1 = getUnionType(memberTypeList, 1, symbol, undefined
|
|
46909
|
+
var enumType_1 = getUnionType(memberTypeList, 1, symbol, undefined);
|
|
46870
46910
|
if (enumType_1.flags & 1048576) {
|
|
46871
46911
|
enumType_1.flags |= 1024;
|
|
46872
46912
|
enumType_1.symbol = symbol;
|
|
@@ -49213,7 +49253,7 @@ var ts;
|
|
|
49213
49253
|
type.resolvedTypeArguments = source.resolvedTypeArguments;
|
|
49214
49254
|
return type;
|
|
49215
49255
|
}
|
|
49216
|
-
function createDeferredTypeReference(target, node, mapper, aliasSymbol, aliasTypeArguments
|
|
49256
|
+
function createDeferredTypeReference(target, node, mapper, aliasSymbol, aliasTypeArguments) {
|
|
49217
49257
|
if (!aliasSymbol) {
|
|
49218
49258
|
aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
49219
49259
|
var localAliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol);
|
|
@@ -49225,7 +49265,6 @@ var ts;
|
|
|
49225
49265
|
type.mapper = mapper;
|
|
49226
49266
|
type.aliasSymbol = aliasSymbol;
|
|
49227
49267
|
type.aliasTypeArguments = aliasTypeArguments;
|
|
49228
|
-
type.aliasMapper = aliasMapper;
|
|
49229
49268
|
return type;
|
|
49230
49269
|
}
|
|
49231
49270
|
function getTypeArguments(type) {
|
|
@@ -49283,7 +49322,7 @@ var ts;
|
|
|
49283
49322
|
}
|
|
49284
49323
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
49285
49324
|
}
|
|
49286
|
-
function
|
|
49325
|
+
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
49287
49326
|
var type = getDeclaredTypeOfSymbol(symbol);
|
|
49288
49327
|
if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) {
|
|
49289
49328
|
return getStringMappingType(symbol, typeArguments[0]);
|
|
@@ -49297,33 +49336,6 @@ var ts;
|
|
|
49297
49336
|
}
|
|
49298
49337
|
return instantiation;
|
|
49299
49338
|
}
|
|
49300
|
-
function getLocalTypeAliasInstantiation(symbol, typeArguments, outerTypeParameterMapper, aliasSymbol, aliasTypeArguments) {
|
|
49301
|
-
var type = getDeclaredTypeOfSymbol(symbol);
|
|
49302
|
-
if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) {
|
|
49303
|
-
return getStringMappingType(symbol, typeArguments[0]);
|
|
49304
|
-
}
|
|
49305
|
-
var links = getSymbolLinks(symbol);
|
|
49306
|
-
var outerTypeParameters = getOuterTypeParametersOfAlias(symbol);
|
|
49307
|
-
var mappedOuterParams = outerTypeParameterMapper && outerTypeParameters && instantiateTypes(outerTypeParameters, outerTypeParameterMapper);
|
|
49308
|
-
var typeParameters = links.typeParameters;
|
|
49309
|
-
var id = getTypeListId(ts.concatenate(mappedOuterParams, typeArguments)) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
49310
|
-
var instantiation = links.instantiations.get(id);
|
|
49311
|
-
if (!instantiation) {
|
|
49312
|
-
var outerTypeArgumentMapper = outerTypeParameters && mappedOuterParams && createTypeMapper(outerTypeParameters, mappedOuterParams);
|
|
49313
|
-
var argumentMapper = createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJSFile(symbol.valueDeclaration)));
|
|
49314
|
-
var combinedMapper = outerTypeArgumentMapper ? combineTypeMappers(argumentMapper, outerTypeArgumentMapper) : argumentMapper;
|
|
49315
|
-
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, combinedMapper, aliasSymbol, aliasTypeArguments));
|
|
49316
|
-
}
|
|
49317
|
-
return instantiation;
|
|
49318
|
-
}
|
|
49319
|
-
function getOuterTypeParametersOfAlias(symbol) {
|
|
49320
|
-
var _a;
|
|
49321
|
-
var links = getSymbolLinks(symbol);
|
|
49322
|
-
if (!links.outerTypeParameters) {
|
|
49323
|
-
links.outerTypeParameters = ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a[0]) && getOuterTypeParameters(symbol.declarations[0], true);
|
|
49324
|
-
}
|
|
49325
|
-
return links.outerTypeParameters;
|
|
49326
|
-
}
|
|
49327
49339
|
function getTypeFromTypeAliasReference(node, symbol) {
|
|
49328
49340
|
if (ts.getCheckFlags(symbol) & 1048576) {
|
|
49329
49341
|
var typeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
@@ -49350,7 +49362,7 @@ var ts;
|
|
|
49350
49362
|
}
|
|
49351
49363
|
var aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
49352
49364
|
var newAliasSymbol = aliasSymbol && (isLocalTypeAlias(symbol) || !isLocalTypeAlias(aliasSymbol)) ? aliasSymbol : undefined;
|
|
49353
|
-
return
|
|
49365
|
+
return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, getTypeArgumentsForAliasSymbol(newAliasSymbol));
|
|
49354
49366
|
}
|
|
49355
49367
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
49356
49368
|
}
|
|
@@ -50186,7 +50198,7 @@ var ts;
|
|
|
50186
50198
|
result.types = types;
|
|
50187
50199
|
return result;
|
|
50188
50200
|
}
|
|
50189
|
-
function getUnionType(types, unionReduction, aliasSymbol, aliasTypeArguments,
|
|
50201
|
+
function getUnionType(types, unionReduction, aliasSymbol, aliasTypeArguments, origin) {
|
|
50190
50202
|
if (unionReduction === void 0) { unionReduction = 1; }
|
|
50191
50203
|
if (types.length === 0) {
|
|
50192
50204
|
return neverType;
|
|
@@ -50253,7 +50265,7 @@ var ts;
|
|
|
50253
50265
|
}
|
|
50254
50266
|
var objectFlags = (includes & 36323363 ? 0 : 65536) |
|
|
50255
50267
|
(includes & 2097152 ? 33554432 : 0);
|
|
50256
|
-
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments,
|
|
50268
|
+
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
50257
50269
|
}
|
|
50258
50270
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
50259
50271
|
var first;
|
|
@@ -50288,7 +50300,7 @@ var ts;
|
|
|
50288
50300
|
function typePredicateKindsMatch(a, b) {
|
|
50289
50301
|
return a.kind === b.kind && a.parameterIndex === b.parameterIndex;
|
|
50290
50302
|
}
|
|
50291
|
-
function getUnionTypeFromSortedList(types, objectFlags, aliasSymbol, aliasTypeArguments,
|
|
50303
|
+
function getUnionTypeFromSortedList(types, objectFlags, aliasSymbol, aliasTypeArguments, origin) {
|
|
50292
50304
|
if (types.length === 0) {
|
|
50293
50305
|
return neverType;
|
|
50294
50306
|
}
|
|
@@ -50308,7 +50320,6 @@ var ts;
|
|
|
50308
50320
|
type.origin = origin;
|
|
50309
50321
|
type.aliasSymbol = aliasSymbol;
|
|
50310
50322
|
type.aliasTypeArguments = aliasTypeArguments;
|
|
50311
|
-
type.aliasMapper = aliasMapper;
|
|
50312
50323
|
if (types.length === 2 && types[0].flags & 512 && types[1].flags & 512) {
|
|
50313
50324
|
type.flags |= 16;
|
|
50314
50325
|
type.intrinsicName = "boolean";
|
|
@@ -50321,7 +50332,7 @@ var ts;
|
|
|
50321
50332
|
var links = getNodeLinks(node);
|
|
50322
50333
|
if (!links.resolvedType) {
|
|
50323
50334
|
var aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
50324
|
-
links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), 1, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol)
|
|
50335
|
+
links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), 1, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
|
|
50325
50336
|
}
|
|
50326
50337
|
return links.resolvedType;
|
|
50327
50338
|
}
|
|
@@ -50459,16 +50470,15 @@ var ts;
|
|
|
50459
50470
|
types[index] = getUnionTypeFromSortedList(result, 65536);
|
|
50460
50471
|
return true;
|
|
50461
50472
|
}
|
|
50462
|
-
function createIntersectionType(types, aliasSymbol, aliasTypeArguments
|
|
50473
|
+
function createIntersectionType(types, aliasSymbol, aliasTypeArguments) {
|
|
50463
50474
|
var result = createType(2097152);
|
|
50464
50475
|
result.objectFlags = getPropagatingFlagsOfTypes(types, 98304);
|
|
50465
50476
|
result.types = types;
|
|
50466
50477
|
result.aliasSymbol = aliasSymbol;
|
|
50467
50478
|
result.aliasTypeArguments = aliasTypeArguments;
|
|
50468
|
-
result.aliasMapper = aliasMapper;
|
|
50469
50479
|
return result;
|
|
50470
50480
|
}
|
|
50471
|
-
function getIntersectionType(types, aliasSymbol, aliasTypeArguments
|
|
50481
|
+
function getIntersectionType(types, aliasSymbol, aliasTypeArguments) {
|
|
50472
50482
|
var typeMembershipMap = new ts.Map();
|
|
50473
50483
|
var includes = addTypesToIntersection(typeMembershipMap, 0, types);
|
|
50474
50484
|
var typeSet = ts.arrayFrom(typeMembershipMap.values());
|
|
@@ -50516,16 +50526,16 @@ var ts;
|
|
|
50516
50526
|
if (!result) {
|
|
50517
50527
|
if (includes & 1048576) {
|
|
50518
50528
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
50519
|
-
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments
|
|
50529
|
+
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
50520
50530
|
}
|
|
50521
50531
|
else if (eachIsUnionContaining(typeSet, 32768)) {
|
|
50522
50532
|
var undefinedOrMissingType = exactOptionalPropertyTypes && ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
|
|
50523
50533
|
removeFromEach(typeSet, 32768);
|
|
50524
|
-
result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1, aliasSymbol, aliasTypeArguments
|
|
50534
|
+
result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1, aliasSymbol, aliasTypeArguments);
|
|
50525
50535
|
}
|
|
50526
50536
|
else if (eachIsUnionContaining(typeSet, 65536)) {
|
|
50527
50537
|
removeFromEach(typeSet, 65536);
|
|
50528
|
-
result = getUnionType([getIntersectionType(typeSet), nullType], 1, aliasSymbol, aliasTypeArguments
|
|
50538
|
+
result = getUnionType([getIntersectionType(typeSet), nullType], 1, aliasSymbol, aliasTypeArguments);
|
|
50529
50539
|
}
|
|
50530
50540
|
else {
|
|
50531
50541
|
if (!checkCrossProductUnion(typeSet)) {
|
|
@@ -50533,7 +50543,7 @@ var ts;
|
|
|
50533
50543
|
}
|
|
50534
50544
|
var constituents = getCrossProductIntersections(typeSet);
|
|
50535
50545
|
var origin = ts.some(constituents, function (t) { return !!(t.flags & 2097152); }) ? createOriginUnionOrIntersectionType(2097152, typeSet) : undefined;
|
|
50536
|
-
result = getUnionType(constituents, 1, aliasSymbol, aliasTypeArguments,
|
|
50546
|
+
result = getUnionType(constituents, 1, aliasSymbol, aliasTypeArguments, origin);
|
|
50537
50547
|
}
|
|
50538
50548
|
}
|
|
50539
50549
|
else {
|
|
@@ -50579,7 +50589,7 @@ var ts;
|
|
|
50579
50589
|
var links = getNodeLinks(node);
|
|
50580
50590
|
if (!links.resolvedType) {
|
|
50581
50591
|
var aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
50582
|
-
links.resolvedType = getIntersectionType(ts.map(node.types, getTypeFromTypeNode), aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol)
|
|
50592
|
+
links.resolvedType = getIntersectionType(ts.map(node.types, getTypeFromTypeNode), aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
|
|
50583
50593
|
}
|
|
50584
50594
|
return links.resolvedType;
|
|
50585
50595
|
}
|
|
@@ -50674,7 +50684,7 @@ var ts;
|
|
|
50674
50684
|
var propertyTypes = ts.map(getPropertiesOfType(type), function (prop) { return getLiteralTypeFromProperty(prop, include); });
|
|
50675
50685
|
var indexKeyTypes = ts.map(getIndexInfosOfType(type), function (info) { return info !== enumNumberIndexInfo && isKeyTypeIncluded(info.keyType, include) ?
|
|
50676
50686
|
info.keyType === stringType && include & 8 ? stringOrNumberType : info.keyType : neverType; });
|
|
50677
|
-
return getUnionType(ts.concatenate(propertyTypes, indexKeyTypes), 1, undefined, undefined,
|
|
50687
|
+
return getUnionType(ts.concatenate(propertyTypes, indexKeyTypes), 1, undefined, undefined, origin);
|
|
50678
50688
|
}
|
|
50679
50689
|
function isPossiblyReducibleByInstantiation(type) {
|
|
50680
50690
|
return ts.some(type.types, function (t) {
|
|
@@ -50701,7 +50711,7 @@ var ts;
|
|
|
50701
50711
|
return type;
|
|
50702
50712
|
}
|
|
50703
50713
|
var extractTypeAlias = getGlobalExtractSymbol();
|
|
50704
|
-
return extractTypeAlias ?
|
|
50714
|
+
return extractTypeAlias ? getTypeAliasInstantiation(extractTypeAlias, [type, stringType]) : stringType;
|
|
50705
50715
|
}
|
|
50706
50716
|
function getIndexTypeOrString(type) {
|
|
50707
50717
|
var indexType = getExtractStringType(getIndexType(type));
|
|
@@ -50831,14 +50841,13 @@ var ts;
|
|
|
50831
50841
|
result.type = type;
|
|
50832
50842
|
return result;
|
|
50833
50843
|
}
|
|
50834
|
-
function createIndexedAccessType(objectType, indexType, accessFlags, aliasSymbol, aliasTypeArguments
|
|
50844
|
+
function createIndexedAccessType(objectType, indexType, accessFlags, aliasSymbol, aliasTypeArguments) {
|
|
50835
50845
|
var type = createType(8388608);
|
|
50836
50846
|
type.objectType = objectType;
|
|
50837
50847
|
type.indexType = indexType;
|
|
50838
50848
|
type.accessFlags = accessFlags;
|
|
50839
50849
|
type.aliasSymbol = aliasSymbol;
|
|
50840
50850
|
type.aliasTypeArguments = aliasTypeArguments;
|
|
50841
|
-
type.aliasMapper = aliasMapper;
|
|
50842
50851
|
return type;
|
|
50843
50852
|
}
|
|
50844
50853
|
function isJSLiteralType(type) {
|
|
@@ -51156,9 +51165,9 @@ var ts;
|
|
|
51156
51165
|
var templateMapper = combineTypeMappers(objectType.mapper, mapper);
|
|
51157
51166
|
return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper);
|
|
51158
51167
|
}
|
|
51159
|
-
function getIndexedAccessType(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments
|
|
51168
|
+
function getIndexedAccessType(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) {
|
|
51160
51169
|
if (accessFlags === void 0) { accessFlags = 0; }
|
|
51161
|
-
return getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments
|
|
51170
|
+
return getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType);
|
|
51162
51171
|
}
|
|
51163
51172
|
function indexTypeLessThan(indexType, limit) {
|
|
51164
51173
|
return everyType(indexType, function (t) {
|
|
@@ -51172,7 +51181,7 @@ var ts;
|
|
|
51172
51181
|
return false;
|
|
51173
51182
|
});
|
|
51174
51183
|
}
|
|
51175
|
-
function getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments
|
|
51184
|
+
function getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) {
|
|
51176
51185
|
if (accessFlags === void 0) { accessFlags = 0; }
|
|
51177
51186
|
if (objectType === wildcardType || indexType === wildcardType) {
|
|
51178
51187
|
return wildcardType;
|
|
@@ -51192,7 +51201,7 @@ var ts;
|
|
|
51192
51201
|
var id = objectType.id + "," + indexType.id + "," + persistentAccessFlags + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
51193
51202
|
var type = indexedAccessTypes.get(id);
|
|
51194
51203
|
if (!type) {
|
|
51195
|
-
indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, persistentAccessFlags, aliasSymbol, aliasTypeArguments
|
|
51204
|
+
indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, persistentAccessFlags, aliasSymbol, aliasTypeArguments));
|
|
51196
51205
|
}
|
|
51197
51206
|
return type;
|
|
51198
51207
|
}
|
|
@@ -51217,8 +51226,8 @@ var ts;
|
|
|
51217
51226
|
return undefined;
|
|
51218
51227
|
}
|
|
51219
51228
|
return accessFlags & 4
|
|
51220
|
-
? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments
|
|
51221
|
-
: getUnionType(propTypes, 1, aliasSymbol, aliasTypeArguments
|
|
51229
|
+
? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments)
|
|
51230
|
+
: getUnionType(propTypes, 1, aliasSymbol, aliasTypeArguments);
|
|
51222
51231
|
}
|
|
51223
51232
|
return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, accessNode, accessFlags | 8 | 64);
|
|
51224
51233
|
}
|
|
@@ -51228,7 +51237,7 @@ var ts;
|
|
|
51228
51237
|
var objectType = getTypeFromTypeNode(node.objectType);
|
|
51229
51238
|
var indexType = getTypeFromTypeNode(node.indexType);
|
|
51230
51239
|
var potentialAlias = getAliasSymbolForTypeNode(node);
|
|
51231
|
-
var resolved = getIndexedAccessType(objectType, indexType, 0, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)
|
|
51240
|
+
var resolved = getIndexedAccessType(objectType, indexType, 0, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias));
|
|
51232
51241
|
links.resolvedType = resolved.flags & 8388608 &&
|
|
51233
51242
|
resolved.objectType === objectType &&
|
|
51234
51243
|
resolved.indexType === indexType ?
|
|
@@ -51346,7 +51355,6 @@ var ts;
|
|
|
51346
51355
|
result.combinedMapper = combinedMapper;
|
|
51347
51356
|
result.aliasSymbol = aliasSymbol || root.aliasSymbol;
|
|
51348
51357
|
result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root.aliasTypeArguments, mapper);
|
|
51349
|
-
result.aliasMapper = result.aliasSymbol ? mapper : undefined;
|
|
51350
51358
|
return "break";
|
|
51351
51359
|
};
|
|
51352
51360
|
while (true) {
|
|
@@ -52082,7 +52090,7 @@ var ts;
|
|
|
52082
52090
|
var result = target.instantiations.get(id);
|
|
52083
52091
|
if (!result) {
|
|
52084
52092
|
var newMapper = createTypeMapper(typeParameters, typeArguments);
|
|
52085
|
-
result = target.objectFlags & 4 ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments
|
|
52093
|
+
result = target.objectFlags & 4 ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) :
|
|
52086
52094
|
target.objectFlags & 32 ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) :
|
|
52087
52095
|
instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
52088
52096
|
target.instantiations.set(id, result);
|
|
@@ -52158,7 +52166,7 @@ var ts;
|
|
|
52158
52166
|
return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper));
|
|
52159
52167
|
}
|
|
52160
52168
|
return t;
|
|
52161
|
-
}, aliasSymbol, aliasTypeArguments
|
|
52169
|
+
}, aliasSymbol, aliasTypeArguments);
|
|
52162
52170
|
}
|
|
52163
52171
|
}
|
|
52164
52172
|
return instantiateType(getConstraintTypeFromMappedType(type), mapper) === wildcardType ? wildcardType : instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments);
|
|
@@ -52220,7 +52228,6 @@ var ts;
|
|
|
52220
52228
|
result.mapper = mapper;
|
|
52221
52229
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
52222
52230
|
result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);
|
|
52223
|
-
result.aliasMapper = mapper;
|
|
52224
52231
|
return result;
|
|
52225
52232
|
}
|
|
52226
52233
|
function getConditionalTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
@@ -52234,7 +52241,7 @@ var ts;
|
|
|
52234
52241
|
var checkType_1 = root.checkType;
|
|
52235
52242
|
var distributionType = root.isDistributive ? getMappedType(checkType_1, newMapper_1) : undefined;
|
|
52236
52243
|
result = distributionType && checkType_1 !== distributionType && distributionType.flags & (1048576 | 131072) ?
|
|
52237
|
-
mapTypeWithAlias(getReducedType(distributionType), function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, newMapper_1)); }, aliasSymbol, aliasTypeArguments
|
|
52244
|
+
mapTypeWithAlias(getReducedType(distributionType), function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, newMapper_1)); }, aliasSymbol, aliasTypeArguments) :
|
|
52238
52245
|
getConditionalType(root, newMapper_1, aliasSymbol, aliasTypeArguments);
|
|
52239
52246
|
root.instantiations.set(id, result);
|
|
52240
52247
|
}
|
|
@@ -52291,8 +52298,8 @@ var ts;
|
|
|
52291
52298
|
var newAliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
52292
52299
|
var newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);
|
|
52293
52300
|
return flags & 2097152 || origin && origin.flags & 2097152 ?
|
|
52294
|
-
getIntersectionType(newTypes, newAliasSymbol, newAliasTypeArguments
|
|
52295
|
-
getUnionType(newTypes, 1, newAliasSymbol, newAliasTypeArguments
|
|
52301
|
+
getIntersectionType(newTypes, newAliasSymbol, newAliasTypeArguments) :
|
|
52302
|
+
getUnionType(newTypes, 1, newAliasSymbol, newAliasTypeArguments);
|
|
52296
52303
|
}
|
|
52297
52304
|
if (flags & 4194304) {
|
|
52298
52305
|
return getIndexType(instantiateType(type.type, mapper));
|
|
@@ -52306,7 +52313,7 @@ var ts;
|
|
|
52306
52313
|
if (flags & 8388608) {
|
|
52307
52314
|
var newAliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
52308
52315
|
var newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);
|
|
52309
|
-
return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), type.accessFlags, undefined, newAliasSymbol, newAliasTypeArguments
|
|
52316
|
+
return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), type.accessFlags, undefined, newAliasSymbol, newAliasTypeArguments);
|
|
52310
52317
|
}
|
|
52311
52318
|
if (flags & 16777216) {
|
|
52312
52319
|
return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper), aliasSymbol, aliasTypeArguments);
|
|
@@ -54050,10 +54057,7 @@ var ts;
|
|
|
54050
54057
|
if (variances === ts.emptyArray) {
|
|
54051
54058
|
return 1;
|
|
54052
54059
|
}
|
|
54053
|
-
var
|
|
54054
|
-
var sourceArgs = outerTypeParameters && source.aliasMapper ? ts.concatenate(source.aliasTypeArguments, instantiateTypes(outerTypeParameters, source.aliasMapper)) : source.aliasTypeArguments;
|
|
54055
|
-
var targetArgs = outerTypeParameters && target.aliasMapper ? ts.concatenate(target.aliasTypeArguments, instantiateTypes(outerTypeParameters, target.aliasMapper)) : target.aliasTypeArguments;
|
|
54056
|
-
var varianceResult = relateVariances(sourceArgs, targetArgs, variances, intersectionState);
|
|
54060
|
+
var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState);
|
|
54057
54061
|
if (varianceResult !== undefined) {
|
|
54058
54062
|
return varianceResult;
|
|
54059
54063
|
}
|
|
@@ -55143,10 +55147,8 @@ var ts;
|
|
|
55143
55147
|
}
|
|
55144
55148
|
function getAliasVariances(symbol) {
|
|
55145
55149
|
var links = getSymbolLinks(symbol);
|
|
55146
|
-
|
|
55147
|
-
|
|
55148
|
-
var mapper = makeUnaryTypeMapper(param, marker);
|
|
55149
|
-
var type = getLocalTypeAliasInstantiation(symbol, instantiateTypes(links.typeParameters, mapper), mapper);
|
|
55150
|
+
return getVariancesWorker(links.typeParameters, links, function (_links, param, marker) {
|
|
55151
|
+
var type = getTypeAliasInstantiation(symbol, instantiateTypes(links.typeParameters, makeUnaryTypeMapper(param, marker)));
|
|
55150
55152
|
type.aliasTypeArgumentsContainsMarker = true;
|
|
55151
55153
|
return type;
|
|
55152
55154
|
});
|
|
@@ -55703,7 +55705,7 @@ var ts;
|
|
|
55703
55705
|
deferredGlobalNonNullableTypeAlias = getGlobalSymbol("NonNullable", 524288, undefined) || unknownSymbol;
|
|
55704
55706
|
}
|
|
55705
55707
|
return deferredGlobalNonNullableTypeAlias !== unknownSymbol ?
|
|
55706
|
-
|
|
55708
|
+
getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [reducedType]) :
|
|
55707
55709
|
reducedType;
|
|
55708
55710
|
}
|
|
55709
55711
|
function getNonNullableType(type) {
|
|
@@ -57668,7 +57670,7 @@ var ts;
|
|
|
57668
57670
|
newOrigin = createOriginUnionOrIntersectionType(1048576, originFiltered);
|
|
57669
57671
|
}
|
|
57670
57672
|
}
|
|
57671
|
-
return getUnionTypeFromSortedList(filtered, type.objectFlags, undefined, undefined,
|
|
57673
|
+
return getUnionTypeFromSortedList(filtered, type.objectFlags, undefined, undefined, newOrigin);
|
|
57672
57674
|
}
|
|
57673
57675
|
return type.flags & 131072 || f(type) ? type : neverType;
|
|
57674
57676
|
}
|
|
@@ -57704,9 +57706,9 @@ var ts;
|
|
|
57704
57706
|
}
|
|
57705
57707
|
return changed ? mappedTypes && getUnionType(mappedTypes, noReductions ? 0 : 1) : type;
|
|
57706
57708
|
}
|
|
57707
|
-
function mapTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments
|
|
57709
|
+
function mapTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
57708
57710
|
return type.flags & 1048576 && aliasSymbol ?
|
|
57709
|
-
getUnionType(ts.map(type.types, mapper), 1, aliasSymbol, aliasTypeArguments
|
|
57711
|
+
getUnionType(ts.map(type.types, mapper), 1, aliasSymbol, aliasTypeArguments) :
|
|
57710
57712
|
mapType(type, mapper);
|
|
57711
57713
|
}
|
|
57712
57714
|
function extractTypesOfKind(type, kind) {
|
|
@@ -60360,7 +60362,7 @@ var ts;
|
|
|
60360
60362
|
var params = getSymbolLinks(managedSym).typeParameters;
|
|
60361
60363
|
if (ts.length(params) >= 2) {
|
|
60362
60364
|
var args = fillMissingTypeArguments([ctorType, attributesType], params, 2, ts.isInJSFile(context));
|
|
60363
|
-
return
|
|
60365
|
+
return getTypeAliasInstantiation(managedSym, args);
|
|
60364
60366
|
}
|
|
60365
60367
|
}
|
|
60366
60368
|
if (ts.length(declaredManagedType.typeParameters) >= 2) {
|
|
@@ -67439,7 +67441,7 @@ var ts;
|
|
|
67439
67441
|
if (!baseConstraint || (baseConstraint.flags & 3) || isEmptyObjectType(baseConstraint) || isThenableType(baseConstraint)) {
|
|
67440
67442
|
var awaitedSymbol = getGlobalAwaitedSymbol(true);
|
|
67441
67443
|
if (awaitedSymbol) {
|
|
67442
|
-
return
|
|
67444
|
+
return getTypeAliasInstantiation(awaitedSymbol, [unwrapAwaitedType(type)]);
|
|
67443
67445
|
}
|
|
67444
67446
|
}
|
|
67445
67447
|
}
|