@typescript-deploys/pr-build 5.4.0-pr-57040-6 → 5.4.0-pr-57008-39
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 +271 -142
- package/lib/lib.dom.iterable.d.ts +34 -28
- package/lib/lib.es5.d.ts +5 -0
- package/lib/lib.webworker.d.ts +108 -99
- package/lib/lib.webworker.iterable.d.ts +28 -28
- package/lib/tsc.js +185 -329
- package/lib/tsserver.js +207 -337
- package/lib/typescript.js +207 -337
- package/lib/typingsInstaller.js +49 -24
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20240116`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4769,7 +4769,6 @@ ${lanes.join("\n")}
|
|
|
4769
4769
|
CharacterCodes2[CharacterCodes2["ideographicSpace"] = 12288] = "ideographicSpace";
|
|
4770
4770
|
CharacterCodes2[CharacterCodes2["mathematicalSpace"] = 8287] = "mathematicalSpace";
|
|
4771
4771
|
CharacterCodes2[CharacterCodes2["ogham"] = 5760] = "ogham";
|
|
4772
|
-
CharacterCodes2[CharacterCodes2["replacementCharacter"] = 65533] = "replacementCharacter";
|
|
4773
4772
|
CharacterCodes2[CharacterCodes2["_"] = 95] = "_";
|
|
4774
4773
|
CharacterCodes2[CharacterCodes2["$"] = 36] = "$";
|
|
4775
4774
|
CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
|
|
@@ -8480,6 +8479,8 @@ ${lanes.join("\n")}
|
|
|
8480
8479
|
Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
8481
8480
|
Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),
|
|
8482
8481
|
There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
|
|
8482
|
+
Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update: diag(6279, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."),
|
|
8483
|
+
There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler: diag(6280, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280", "There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."),
|
|
8483
8484
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
8484
8485
|
Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
|
|
8485
8486
|
Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
|
|
@@ -10307,7 +10308,7 @@ ${lanes.join("\n")}
|
|
|
10307
10308
|
}
|
|
10308
10309
|
const ch = codePointAt(text, pos);
|
|
10309
10310
|
if (pos === 0) {
|
|
10310
|
-
if (
|
|
10311
|
+
if (text.slice(0, 256).includes("\uFFFD")) {
|
|
10311
10312
|
error2(Diagnostics.File_appears_to_be_binary);
|
|
10312
10313
|
pos = end;
|
|
10313
10314
|
return token = 8 /* NonTextFileMarkerTrivia */;
|
|
@@ -13084,17 +13085,20 @@ ${lanes.join("\n")}
|
|
|
13084
13085
|
return oldRef.path === newRef.path && !oldRef.prepend === !newRef.prepend && !oldRef.circular === !newRef.circular;
|
|
13085
13086
|
}
|
|
13086
13087
|
function moduleResolutionIsEqualTo(oldResolution, newResolution) {
|
|
13087
|
-
return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.
|
|
13088
|
+
return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.alternateResult === newResolution.alternateResult;
|
|
13088
13089
|
}
|
|
13089
13090
|
function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
|
|
13090
13091
|
var _a;
|
|
13091
|
-
const
|
|
13092
|
-
const
|
|
13092
|
+
const alternateResult = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.alternateResult;
|
|
13093
|
+
const alternateResultMessage = alternateResult && (getEmitModuleResolutionKind(host.getCompilerOptions()) === 2 /* Node10 */ ? [Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler, [alternateResult]] : [
|
|
13094
|
+
Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
|
|
13095
|
+
[alternateResult, alternateResult.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName]
|
|
13096
|
+
]);
|
|
13097
|
+
const result = alternateResultMessage ? chainDiagnosticMessages(
|
|
13093
13098
|
/*details*/
|
|
13094
13099
|
void 0,
|
|
13095
|
-
|
|
13096
|
-
|
|
13097
|
-
node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
|
|
13100
|
+
alternateResultMessage[0],
|
|
13101
|
+
...alternateResultMessage[1]
|
|
13098
13102
|
) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
|
|
13099
13103
|
/*details*/
|
|
13100
13104
|
void 0,
|
|
@@ -39571,7 +39575,7 @@ ${lanes.join("\n")}
|
|
|
39571
39575
|
Debug.assert(extensionIsTS(resolved.extension));
|
|
39572
39576
|
return { fileName: resolved.path, packageId: resolved.packageId };
|
|
39573
39577
|
}
|
|
39574
|
-
function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, cache,
|
|
39578
|
+
function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, cache, alternateResult) {
|
|
39575
39579
|
if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) {
|
|
39576
39580
|
const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled);
|
|
39577
39581
|
if (originalPath)
|
|
@@ -39585,10 +39589,10 @@ ${lanes.join("\n")}
|
|
|
39585
39589
|
diagnostics,
|
|
39586
39590
|
state.resultFromCache,
|
|
39587
39591
|
cache,
|
|
39588
|
-
|
|
39592
|
+
alternateResult
|
|
39589
39593
|
);
|
|
39590
39594
|
}
|
|
39591
|
-
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache,
|
|
39595
|
+
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache, alternateResult) {
|
|
39592
39596
|
if (resultFromCache) {
|
|
39593
39597
|
if (!(cache == null ? void 0 : cache.isReadonly)) {
|
|
39594
39598
|
resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
|
|
@@ -39616,7 +39620,7 @@ ${lanes.join("\n")}
|
|
|
39616
39620
|
failedLookupLocations: initializeResolutionField(failedLookupLocations),
|
|
39617
39621
|
affectingLocations: initializeResolutionField(affectingLocations),
|
|
39618
39622
|
resolutionDiagnostics: initializeResolutionField(diagnostics),
|
|
39619
|
-
|
|
39623
|
+
alternateResult
|
|
39620
39624
|
};
|
|
39621
39625
|
}
|
|
39622
39626
|
function initializeResolutionField(value) {
|
|
@@ -39833,7 +39837,8 @@ ${lanes.join("\n")}
|
|
|
39833
39837
|
requestContainingDirectory: containingDirectory,
|
|
39834
39838
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
39835
39839
|
isConfigLookup: false,
|
|
39836
|
-
candidateIsFromPackageJsonField: false
|
|
39840
|
+
candidateIsFromPackageJsonField: false,
|
|
39841
|
+
resolvedPackageDirectory: false
|
|
39837
39842
|
};
|
|
39838
39843
|
let resolved = primaryLookup();
|
|
39839
39844
|
let primary = true;
|
|
@@ -40711,7 +40716,7 @@ ${lanes.join("\n")}
|
|
|
40711
40716
|
);
|
|
40712
40717
|
}
|
|
40713
40718
|
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference, conditions) {
|
|
40714
|
-
var _a, _b, _c, _d;
|
|
40719
|
+
var _a, _b, _c, _d, _e;
|
|
40715
40720
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
40716
40721
|
const failedLookupLocations = [];
|
|
40717
40722
|
const affectingLocations = [];
|
|
@@ -40733,7 +40738,8 @@ ${lanes.join("\n")}
|
|
|
40733
40738
|
requestContainingDirectory: containingDirectory,
|
|
40734
40739
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
40735
40740
|
isConfigLookup,
|
|
40736
|
-
candidateIsFromPackageJsonField: false
|
|
40741
|
+
candidateIsFromPackageJsonField: false,
|
|
40742
|
+
resolvedPackageDirectory: false
|
|
40737
40743
|
};
|
|
40738
40744
|
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
40739
40745
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", state.conditions.map((c) => `'${c}'`).join(", "));
|
|
@@ -40746,29 +40752,46 @@ ${lanes.join("\n")}
|
|
|
40746
40752
|
} else {
|
|
40747
40753
|
result = tryResolve(extensions, state);
|
|
40748
40754
|
}
|
|
40749
|
-
let
|
|
40750
|
-
if (
|
|
40751
|
-
|
|
40752
|
-
|
|
40753
|
-
|
|
40754
|
-
|
|
40755
|
-
|
|
40756
|
-
|
|
40757
|
-
|
|
40758
|
-
|
|
40759
|
-
|
|
40755
|
+
let alternateResult;
|
|
40756
|
+
if (state.resolvedPackageDirectory && !isConfigLookup && !isExternalModuleNameRelative(moduleName)) {
|
|
40757
|
+
const wantedTypesButGotJs = (result == null ? void 0 : result.value) && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension);
|
|
40758
|
+
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && wantedTypesButGotJs && features & 8 /* Exports */ && (conditions == null ? void 0 : conditions.includes("import"))) {
|
|
40759
|
+
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
40760
|
+
const diagnosticState = {
|
|
40761
|
+
...state,
|
|
40762
|
+
features: state.features & ~8 /* Exports */,
|
|
40763
|
+
reportDiagnostic: noop
|
|
40764
|
+
};
|
|
40765
|
+
const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
|
|
40766
|
+
if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) {
|
|
40767
|
+
alternateResult = diagnosticResult.value.resolved.path;
|
|
40768
|
+
}
|
|
40769
|
+
} else if ((!(result == null ? void 0 : result.value) || wantedTypesButGotJs) && moduleResolution === 2 /* Node10 */) {
|
|
40770
|
+
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update);
|
|
40771
|
+
const diagnosticsCompilerOptions = { ...state.compilerOptions, moduleResolution: 100 /* Bundler */ };
|
|
40772
|
+
const diagnosticState = {
|
|
40773
|
+
...state,
|
|
40774
|
+
compilerOptions: diagnosticsCompilerOptions,
|
|
40775
|
+
features: 30 /* BundlerDefault */,
|
|
40776
|
+
conditions: getConditions(diagnosticsCompilerOptions),
|
|
40777
|
+
reportDiagnostic: noop
|
|
40778
|
+
};
|
|
40779
|
+
const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
|
|
40780
|
+
if ((_c = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _c.isExternalLibraryImport) {
|
|
40781
|
+
alternateResult = diagnosticResult.value.resolved.path;
|
|
40782
|
+
}
|
|
40760
40783
|
}
|
|
40761
40784
|
}
|
|
40762
40785
|
return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
|
|
40763
40786
|
moduleName,
|
|
40764
|
-
(
|
|
40765
|
-
(
|
|
40787
|
+
(_d = result == null ? void 0 : result.value) == null ? void 0 : _d.resolved,
|
|
40788
|
+
(_e = result == null ? void 0 : result.value) == null ? void 0 : _e.isExternalLibraryImport,
|
|
40766
40789
|
failedLookupLocations,
|
|
40767
40790
|
affectingLocations,
|
|
40768
40791
|
diagnostics,
|
|
40769
40792
|
state,
|
|
40770
40793
|
cache,
|
|
40771
|
-
|
|
40794
|
+
alternateResult
|
|
40772
40795
|
);
|
|
40773
40796
|
function tryResolve(extensions2, state2) {
|
|
40774
40797
|
const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName(
|
|
@@ -41133,7 +41156,8 @@ ${lanes.join("\n")}
|
|
|
41133
41156
|
requestContainingDirectory: void 0,
|
|
41134
41157
|
reportDiagnostic: noop,
|
|
41135
41158
|
isConfigLookup: false,
|
|
41136
|
-
candidateIsFromPackageJsonField: false
|
|
41159
|
+
candidateIsFromPackageJsonField: false,
|
|
41160
|
+
resolvedPackageDirectory: false
|
|
41137
41161
|
};
|
|
41138
41162
|
}
|
|
41139
41163
|
function getPackageScopeForPath(fileName, state) {
|
|
@@ -41859,6 +41883,9 @@ ${lanes.join("\n")}
|
|
|
41859
41883
|
if (rest !== "") {
|
|
41860
41884
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
41861
41885
|
}
|
|
41886
|
+
if (packageInfo) {
|
|
41887
|
+
state.resolvedPackageDirectory = true;
|
|
41888
|
+
}
|
|
41862
41889
|
if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & 8 /* Exports */) {
|
|
41863
41890
|
return (_b = loadModuleFromExports(packageInfo, extensions, combinePaths(".", rest), state, cache, redirectedReference)) == null ? void 0 : _b.value;
|
|
41864
41891
|
}
|
|
@@ -41977,7 +42004,8 @@ ${lanes.join("\n")}
|
|
|
41977
42004
|
requestContainingDirectory: containingDirectory,
|
|
41978
42005
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
41979
42006
|
isConfigLookup: false,
|
|
41980
|
-
candidateIsFromPackageJsonField: false
|
|
42007
|
+
candidateIsFromPackageJsonField: false,
|
|
42008
|
+
resolvedPackageDirectory: false
|
|
41981
42009
|
};
|
|
41982
42010
|
const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
|
|
41983
42011
|
return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
|
|
@@ -42086,7 +42114,8 @@ ${lanes.join("\n")}
|
|
|
42086
42114
|
requestContainingDirectory: void 0,
|
|
42087
42115
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
42088
42116
|
isConfigLookup: false,
|
|
42089
|
-
candidateIsFromPackageJsonField: false
|
|
42117
|
+
candidateIsFromPackageJsonField: false,
|
|
42118
|
+
resolvedPackageDirectory: false
|
|
42090
42119
|
};
|
|
42091
42120
|
const resolved = loadModuleFromImmediateNodeModulesDirectory(
|
|
42092
42121
|
4 /* Declaration */,
|
|
@@ -49375,7 +49404,7 @@ ${lanes.join("\n")}
|
|
|
49375
49404
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
49376
49405
|
}
|
|
49377
49406
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
49378
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
49407
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
49379
49408
|
if (startsWith(moduleReference, "@types/")) {
|
|
49380
49409
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
49381
49410
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -49544,7 +49573,17 @@ ${lanes.join("\n")}
|
|
|
49544
49573
|
error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
|
|
49545
49574
|
}
|
|
49546
49575
|
} else {
|
|
49547
|
-
|
|
49576
|
+
if ((_k = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _k.alternateResult) {
|
|
49577
|
+
const errorInfo = createModuleNotFoundChain(currentSourceFile, host, moduleReference, mode, moduleReference);
|
|
49578
|
+
errorOrSuggestion(
|
|
49579
|
+
/*isError*/
|
|
49580
|
+
true,
|
|
49581
|
+
errorNode,
|
|
49582
|
+
chainDiagnosticMessages(errorInfo, moduleNotFoundError, moduleReference)
|
|
49583
|
+
);
|
|
49584
|
+
} else {
|
|
49585
|
+
error2(errorNode, moduleNotFoundError, moduleReference);
|
|
49586
|
+
}
|
|
49548
49587
|
}
|
|
49549
49588
|
}
|
|
49550
49589
|
}
|
|
@@ -50422,16 +50461,12 @@ ${lanes.join("\n")}
|
|
|
50422
50461
|
}
|
|
50423
50462
|
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
|
|
50424
50463
|
let aliasesToMakeVisible;
|
|
50425
|
-
let bindingElementToMakeVisible;
|
|
50426
50464
|
if (!every(filter(symbol.declarations, (d) => d.kind !== 80 /* Identifier */), getIsDeclarationVisible)) {
|
|
50427
50465
|
return void 0;
|
|
50428
50466
|
}
|
|
50429
|
-
return { accessibility: 0 /* Accessible */, aliasesToMakeVisible
|
|
50467
|
+
return { accessibility: 0 /* Accessible */, aliasesToMakeVisible };
|
|
50430
50468
|
function getIsDeclarationVisible(declaration) {
|
|
50431
50469
|
var _a, _b;
|
|
50432
|
-
if (isBindingElement(declaration) && findAncestor(declaration, isParameter)) {
|
|
50433
|
-
bindingElementToMakeVisible = declaration;
|
|
50434
|
-
}
|
|
50435
50470
|
if (!isDeclarationVisible(declaration)) {
|
|
50436
50471
|
const anyImportSyntax = getAnyImportSyntax(declaration);
|
|
50437
50472
|
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export
|
|
@@ -50942,7 +50977,13 @@ ${lanes.join("\n")}
|
|
|
50942
50977
|
return visitAndTransformType(type, (type2) => conditionalTypeToTypeNode(type2));
|
|
50943
50978
|
}
|
|
50944
50979
|
if (type.flags & 33554432 /* Substitution */) {
|
|
50945
|
-
|
|
50980
|
+
const typeNode = typeToTypeNodeHelper(type.baseType, context);
|
|
50981
|
+
const noInferSymbol = isNoInferType(type) && getGlobalTypeSymbol(
|
|
50982
|
+
"NoInfer",
|
|
50983
|
+
/*reportErrors*/
|
|
50984
|
+
false
|
|
50985
|
+
);
|
|
50986
|
+
return noInferSymbol ? symbolToTypeNode(noInferSymbol, context, 788968 /* Type */, [typeNode]) : typeNode;
|
|
50946
50987
|
}
|
|
50947
50988
|
return Debug.fail("Should be unreachable.");
|
|
50948
50989
|
function conditionalTypeToTypeNode(type2) {
|
|
@@ -58912,8 +58953,11 @@ ${lanes.join("\n")}
|
|
|
58912
58953
|
}
|
|
58913
58954
|
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
58914
58955
|
const type = getDeclaredTypeOfSymbol(symbol);
|
|
58915
|
-
if (type === intrinsicMarkerType
|
|
58916
|
-
|
|
58956
|
+
if (type === intrinsicMarkerType) {
|
|
58957
|
+
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
58958
|
+
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
58959
|
+
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
58960
|
+
}
|
|
58917
58961
|
}
|
|
58918
58962
|
const links = getSymbolLinks(symbol);
|
|
58919
58963
|
const typeParameters = links.typeParameters;
|
|
@@ -59067,10 +59111,19 @@ ${lanes.join("\n")}
|
|
|
59067
59111
|
}
|
|
59068
59112
|
return links.resolvedJSDocType;
|
|
59069
59113
|
}
|
|
59114
|
+
function getNoInferType(type) {
|
|
59115
|
+
return isNoInferTargetType(type) ? getOrCreateSubstitutionType(type, unknownType) : type;
|
|
59116
|
+
}
|
|
59117
|
+
function isNoInferTargetType(type) {
|
|
59118
|
+
return !!(type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, isNoInferTargetType) || type.flags & 33554432 /* Substitution */ && !isNoInferType(type) && isNoInferTargetType(type.baseType) || type.flags & 524288 /* Object */ && !isEmptyAnonymousObjectType(type) || type.flags & (465829888 /* Instantiable */ & ~33554432 /* Substitution */) && !isPatternLiteralType(type));
|
|
59119
|
+
}
|
|
59120
|
+
function isNoInferType(type) {
|
|
59121
|
+
return !!(type.flags & 33554432 /* Substitution */ && type.constraint.flags & 2 /* Unknown */);
|
|
59122
|
+
}
|
|
59070
59123
|
function getSubstitutionType(baseType, constraint) {
|
|
59071
|
-
|
|
59072
|
-
|
|
59073
|
-
|
|
59124
|
+
return constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */ ? baseType : getOrCreateSubstitutionType(baseType, constraint);
|
|
59125
|
+
}
|
|
59126
|
+
function getOrCreateSubstitutionType(baseType, constraint) {
|
|
59074
59127
|
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
|
|
59075
59128
|
const cached = substitutionTypes.get(id);
|
|
59076
59129
|
if (cached) {
|
|
@@ -59083,7 +59136,7 @@ ${lanes.join("\n")}
|
|
|
59083
59136
|
return result;
|
|
59084
59137
|
}
|
|
59085
59138
|
function getSubstitutionIntersection(substitutionType) {
|
|
59086
|
-
return getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
|
|
59139
|
+
return isNoInferType(substitutionType) ? substitutionType.baseType : getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
|
|
59087
59140
|
}
|
|
59088
59141
|
function isUnaryTupleTypeNode(node) {
|
|
59089
59142
|
return node.kind === 189 /* TupleType */ && node.elements.length === 1;
|
|
@@ -60612,7 +60665,7 @@ ${lanes.join("\n")}
|
|
|
60612
60665
|
}
|
|
60613
60666
|
function getIndexType(type, indexFlags = defaultIndexFlags) {
|
|
60614
60667
|
type = getReducedType(type);
|
|
60615
|
-
return shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === defaultIndexFlags);
|
|
60668
|
+
return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === defaultIndexFlags);
|
|
60616
60669
|
}
|
|
60617
60670
|
function getExtractStringType(type) {
|
|
60618
60671
|
if (keyofStringsOnly) {
|
|
@@ -62355,6 +62408,9 @@ ${lanes.join("\n")}
|
|
|
62355
62408
|
}
|
|
62356
62409
|
if (flags & 33554432 /* Substitution */) {
|
|
62357
62410
|
const newBaseType = instantiateType(type.baseType, mapper);
|
|
62411
|
+
if (isNoInferType(type)) {
|
|
62412
|
+
return getNoInferType(newBaseType);
|
|
62413
|
+
}
|
|
62358
62414
|
const newConstraint = instantiateType(type.constraint, mapper);
|
|
62359
62415
|
if (newBaseType.flags & 8650752 /* TypeVariable */ && isGenericType(newConstraint)) {
|
|
62360
62416
|
return getSubstitutionType(newBaseType, newConstraint);
|
|
@@ -67147,7 +67203,7 @@ ${lanes.join("\n")}
|
|
|
67147
67203
|
let expandingFlags = 0 /* None */;
|
|
67148
67204
|
inferFromTypes(originalSource, originalTarget);
|
|
67149
67205
|
function inferFromTypes(source, target) {
|
|
67150
|
-
if (!couldContainTypeVariables(target)) {
|
|
67206
|
+
if (!couldContainTypeVariables(target) || isNoInferType(target)) {
|
|
67151
67207
|
return;
|
|
67152
67208
|
}
|
|
67153
67209
|
if (source === wildcardType || source === blockedStringType) {
|
|
@@ -67196,6 +67252,9 @@ ${lanes.join("\n")}
|
|
|
67196
67252
|
}
|
|
67197
67253
|
}
|
|
67198
67254
|
if (target.flags & (8388608 /* IndexedAccess */ | 33554432 /* Substitution */)) {
|
|
67255
|
+
if (isNoInferType(target)) {
|
|
67256
|
+
return;
|
|
67257
|
+
}
|
|
67199
67258
|
target = getActualTypeVariable(target);
|
|
67200
67259
|
}
|
|
67201
67260
|
if (target.flags & 8650752 /* TypeVariable */) {
|
|
@@ -87971,7 +88030,8 @@ ${lanes.join("\n")}
|
|
|
87971
88030
|
Uppercase: 0 /* Uppercase */,
|
|
87972
88031
|
Lowercase: 1 /* Lowercase */,
|
|
87973
88032
|
Capitalize: 2 /* Capitalize */,
|
|
87974
|
-
Uncapitalize: 3 /* Uncapitalize
|
|
88033
|
+
Uncapitalize: 3 /* Uncapitalize */,
|
|
88034
|
+
NoInfer: 4 /* NoInfer */
|
|
87975
88035
|
}));
|
|
87976
88036
|
SymbolLinks = class {
|
|
87977
88037
|
};
|
|
@@ -111469,7 +111529,6 @@ ${lanes.join("\n")}
|
|
|
111469
111529
|
let lateStatementReplacementMap;
|
|
111470
111530
|
let suppressNewDiagnosticContexts;
|
|
111471
111531
|
let exportedModulesFromDeclarationEmit;
|
|
111472
|
-
const usedBindingElementAliases = /* @__PURE__ */ new Map();
|
|
111473
111532
|
const { factory: factory2 } = context;
|
|
111474
111533
|
const host = context.getEmitHost();
|
|
111475
111534
|
const symbolTracker = {
|
|
@@ -111535,17 +111594,6 @@ ${lanes.join("\n")}
|
|
|
111535
111594
|
}
|
|
111536
111595
|
}
|
|
111537
111596
|
}
|
|
111538
|
-
if (symbolAccessibilityResult.bindingElementToMakeVisible) {
|
|
111539
|
-
const bindingElement = symbolAccessibilityResult.bindingElementToMakeVisible;
|
|
111540
|
-
const parameter = findAncestor(bindingElement, isParameter);
|
|
111541
|
-
Debug.assert(parameter !== void 0);
|
|
111542
|
-
const parent2 = getOriginalNode(parameter.parent);
|
|
111543
|
-
let aliases = usedBindingElementAliases.get(parent2);
|
|
111544
|
-
if (!aliases) {
|
|
111545
|
-
usedBindingElementAliases.set(parent2, aliases = /* @__PURE__ */ new Map());
|
|
111546
|
-
}
|
|
111547
|
-
aliases.set(getOriginalNode(bindingElement), bindingElement.name);
|
|
111548
|
-
}
|
|
111549
111597
|
} else {
|
|
111550
111598
|
const errorInfo = getSymbolAccessibilityDiagnostic(symbolAccessibilityResult);
|
|
111551
111599
|
if (errorInfo) {
|
|
@@ -111878,7 +111926,7 @@ ${lanes.join("\n")}
|
|
|
111878
111926
|
});
|
|
111879
111927
|
return ret;
|
|
111880
111928
|
}
|
|
111881
|
-
function
|
|
111929
|
+
function filterBindingPatternInitializers(name) {
|
|
111882
111930
|
if (name.kind === 80 /* Identifier */) {
|
|
111883
111931
|
return name;
|
|
111884
111932
|
} else {
|
|
@@ -111895,180 +111943,15 @@ ${lanes.join("\n")}
|
|
|
111895
111943
|
if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) {
|
|
111896
111944
|
checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration);
|
|
111897
111945
|
}
|
|
111898
|
-
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !isIdentifierANonContextualKeyword(elem.propertyName)) {
|
|
111899
|
-
return factory2.updateBindingElement(
|
|
111900
|
-
elem,
|
|
111901
|
-
elem.dotDotDotToken,
|
|
111902
|
-
/*propertyName*/
|
|
111903
|
-
void 0,
|
|
111904
|
-
elem.propertyName,
|
|
111905
|
-
shouldPrintWithInitializer(elem) ? elem.initializer : void 0
|
|
111906
|
-
);
|
|
111907
|
-
}
|
|
111908
111946
|
return factory2.updateBindingElement(
|
|
111909
111947
|
elem,
|
|
111910
111948
|
elem.dotDotDotToken,
|
|
111911
111949
|
elem.propertyName,
|
|
111912
|
-
|
|
111950
|
+
filterBindingPatternInitializers(elem.name),
|
|
111913
111951
|
shouldPrintWithInitializer(elem) ? elem.initializer : void 0
|
|
111914
111952
|
);
|
|
111915
111953
|
}
|
|
111916
111954
|
}
|
|
111917
|
-
function ensureBindingAliasesInParameterList(input, updatedNode) {
|
|
111918
|
-
const original = getOriginalNode(input);
|
|
111919
|
-
const params = updatedNode.parameters;
|
|
111920
|
-
const aliases = usedBindingElementAliases.get(original);
|
|
111921
|
-
if (!aliases) {
|
|
111922
|
-
return updatedNode;
|
|
111923
|
-
}
|
|
111924
|
-
usedBindingElementAliases.delete(original);
|
|
111925
|
-
const newParams = map(params, addUsedBindingPatternsToParameter);
|
|
111926
|
-
const newParamsNodeArray = factory2.createNodeArray(newParams, params.hasTrailingComma);
|
|
111927
|
-
switch (updatedNode.kind) {
|
|
111928
|
-
case 174 /* MethodDeclaration */:
|
|
111929
|
-
return factory2.updateMethodDeclaration(
|
|
111930
|
-
updatedNode,
|
|
111931
|
-
updatedNode.modifiers,
|
|
111932
|
-
updatedNode.asteriskToken,
|
|
111933
|
-
updatedNode.name,
|
|
111934
|
-
updatedNode.questionToken,
|
|
111935
|
-
updatedNode.typeParameters,
|
|
111936
|
-
newParamsNodeArray,
|
|
111937
|
-
updatedNode.type,
|
|
111938
|
-
updatedNode.body
|
|
111939
|
-
);
|
|
111940
|
-
case 176 /* Constructor */:
|
|
111941
|
-
return factory2.updateConstructorDeclaration(
|
|
111942
|
-
updatedNode,
|
|
111943
|
-
updatedNode.modifiers,
|
|
111944
|
-
newParamsNodeArray,
|
|
111945
|
-
updatedNode.body
|
|
111946
|
-
);
|
|
111947
|
-
case 177 /* GetAccessor */:
|
|
111948
|
-
return factory2.updateGetAccessorDeclaration(
|
|
111949
|
-
updatedNode,
|
|
111950
|
-
updatedNode.modifiers,
|
|
111951
|
-
updatedNode.name,
|
|
111952
|
-
newParamsNodeArray,
|
|
111953
|
-
updatedNode.type,
|
|
111954
|
-
updatedNode.body
|
|
111955
|
-
);
|
|
111956
|
-
case 178 /* SetAccessor */:
|
|
111957
|
-
return factory2.updateSetAccessorDeclaration(
|
|
111958
|
-
updatedNode,
|
|
111959
|
-
updatedNode.modifiers,
|
|
111960
|
-
updatedNode.name,
|
|
111961
|
-
newParamsNodeArray,
|
|
111962
|
-
updatedNode.body
|
|
111963
|
-
);
|
|
111964
|
-
case 219 /* ArrowFunction */:
|
|
111965
|
-
return factory2.updateArrowFunction(
|
|
111966
|
-
updatedNode,
|
|
111967
|
-
updatedNode.modifiers,
|
|
111968
|
-
updatedNode.typeParameters,
|
|
111969
|
-
newParamsNodeArray,
|
|
111970
|
-
updatedNode.type,
|
|
111971
|
-
updatedNode.equalsGreaterThanToken,
|
|
111972
|
-
updatedNode.body
|
|
111973
|
-
);
|
|
111974
|
-
case 262 /* FunctionDeclaration */:
|
|
111975
|
-
return factory2.updateFunctionDeclaration(
|
|
111976
|
-
updatedNode,
|
|
111977
|
-
updatedNode.modifiers,
|
|
111978
|
-
updatedNode.asteriskToken,
|
|
111979
|
-
updatedNode.name,
|
|
111980
|
-
updatedNode.typeParameters,
|
|
111981
|
-
newParamsNodeArray,
|
|
111982
|
-
updatedNode.type,
|
|
111983
|
-
updatedNode.body
|
|
111984
|
-
);
|
|
111985
|
-
case 179 /* CallSignature */:
|
|
111986
|
-
return factory2.updateCallSignature(
|
|
111987
|
-
updatedNode,
|
|
111988
|
-
updatedNode.typeParameters,
|
|
111989
|
-
newParamsNodeArray,
|
|
111990
|
-
updatedNode.type
|
|
111991
|
-
);
|
|
111992
|
-
case 173 /* MethodSignature */:
|
|
111993
|
-
return factory2.updateMethodSignature(
|
|
111994
|
-
updatedNode,
|
|
111995
|
-
updatedNode.modifiers,
|
|
111996
|
-
updatedNode.name,
|
|
111997
|
-
updatedNode.questionToken,
|
|
111998
|
-
updatedNode.typeParameters,
|
|
111999
|
-
newParamsNodeArray,
|
|
112000
|
-
updatedNode.type
|
|
112001
|
-
);
|
|
112002
|
-
case 180 /* ConstructSignature */:
|
|
112003
|
-
return factory2.updateConstructSignature(
|
|
112004
|
-
updatedNode,
|
|
112005
|
-
updatedNode.typeParameters,
|
|
112006
|
-
newParamsNodeArray,
|
|
112007
|
-
updatedNode.type
|
|
112008
|
-
);
|
|
112009
|
-
case 184 /* FunctionType */:
|
|
112010
|
-
return factory2.updateFunctionTypeNode(
|
|
112011
|
-
updatedNode,
|
|
112012
|
-
updatedNode.typeParameters,
|
|
112013
|
-
newParamsNodeArray,
|
|
112014
|
-
updatedNode.type
|
|
112015
|
-
);
|
|
112016
|
-
case 185 /* ConstructorType */:
|
|
112017
|
-
return factory2.updateConstructorTypeNode(
|
|
112018
|
-
updatedNode,
|
|
112019
|
-
updatedNode.modifiers,
|
|
112020
|
-
updatedNode.typeParameters,
|
|
112021
|
-
newParamsNodeArray,
|
|
112022
|
-
updatedNode.type
|
|
112023
|
-
);
|
|
112024
|
-
default:
|
|
112025
|
-
Debug.assertNever(updatedNode);
|
|
112026
|
-
}
|
|
112027
|
-
function addUsedBindingPatternsToParameter(p) {
|
|
112028
|
-
return factory2.updateParameterDeclaration(
|
|
112029
|
-
p,
|
|
112030
|
-
p.modifiers,
|
|
112031
|
-
p.dotDotDotToken,
|
|
112032
|
-
addUsedBindingPatternAliases(p.name),
|
|
112033
|
-
p.questionToken,
|
|
112034
|
-
p.type,
|
|
112035
|
-
p.initializer
|
|
112036
|
-
);
|
|
112037
|
-
}
|
|
112038
|
-
function addUsedBindingPatternAliases(name) {
|
|
112039
|
-
if (name.kind === 80 /* Identifier */) {
|
|
112040
|
-
return name;
|
|
112041
|
-
} else {
|
|
112042
|
-
if (name.kind === 207 /* ArrayBindingPattern */) {
|
|
112043
|
-
return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isArrayBindingElement));
|
|
112044
|
-
} else {
|
|
112045
|
-
return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isBindingElement));
|
|
112046
|
-
}
|
|
112047
|
-
}
|
|
112048
|
-
function visitBindingElement(elem) {
|
|
112049
|
-
if (elem.kind === 232 /* OmittedExpression */) {
|
|
112050
|
-
return elem;
|
|
112051
|
-
}
|
|
112052
|
-
const usedAlias = aliases.get(getOriginalNode(elem));
|
|
112053
|
-
if (usedAlias && !elem.propertyName) {
|
|
112054
|
-
return factory2.updateBindingElement(
|
|
112055
|
-
elem,
|
|
112056
|
-
elem.dotDotDotToken,
|
|
112057
|
-
elem.name,
|
|
112058
|
-
usedAlias,
|
|
112059
|
-
elem.initializer
|
|
112060
|
-
);
|
|
112061
|
-
}
|
|
112062
|
-
return factory2.updateBindingElement(
|
|
112063
|
-
elem,
|
|
112064
|
-
elem.dotDotDotToken,
|
|
112065
|
-
elem.propertyName,
|
|
112066
|
-
addUsedBindingPatternAliases(elem.name),
|
|
112067
|
-
elem.initializer
|
|
112068
|
-
);
|
|
112069
|
-
}
|
|
112070
|
-
}
|
|
112071
|
-
}
|
|
112072
111955
|
function ensureParameter(p, modifierMask, type) {
|
|
112073
111956
|
let oldDiag;
|
|
112074
111957
|
if (!suppressNewDiagnosticContexts) {
|
|
@@ -112079,7 +111962,7 @@ ${lanes.join("\n")}
|
|
|
112079
111962
|
p,
|
|
112080
111963
|
maskModifiers(factory2, p, modifierMask),
|
|
112081
111964
|
p.dotDotDotToken,
|
|
112082
|
-
|
|
111965
|
+
filterBindingPatternInitializers(p.name),
|
|
112083
111966
|
resolver.isOptionalParameter(p) ? p.questionToken || factory2.createToken(58 /* QuestionToken */) : void 0,
|
|
112084
111967
|
ensureType(
|
|
112085
111968
|
p,
|
|
@@ -112455,25 +112338,19 @@ ${lanes.join("\n")}
|
|
|
112455
112338
|
return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments));
|
|
112456
112339
|
}
|
|
112457
112340
|
case 180 /* ConstructSignature */:
|
|
112458
|
-
return cleanup(
|
|
112341
|
+
return cleanup(factory2.updateConstructSignature(
|
|
112459
112342
|
input,
|
|
112460
|
-
|
|
112461
|
-
|
|
112462
|
-
|
|
112463
|
-
updateParamsList(input, input.parameters),
|
|
112464
|
-
ensureType(input, input.type)
|
|
112465
|
-
)
|
|
112343
|
+
ensureTypeParams(input, input.typeParameters),
|
|
112344
|
+
updateParamsList(input, input.parameters),
|
|
112345
|
+
ensureType(input, input.type)
|
|
112466
112346
|
));
|
|
112467
112347
|
case 176 /* Constructor */: {
|
|
112468
|
-
const ctor =
|
|
112469
|
-
|
|
112470
|
-
|
|
112471
|
-
|
|
112472
|
-
|
|
112473
|
-
|
|
112474
|
-
/*body*/
|
|
112475
|
-
void 0
|
|
112476
|
-
)
|
|
112348
|
+
const ctor = factory2.createConstructorDeclaration(
|
|
112349
|
+
/*modifiers*/
|
|
112350
|
+
ensureModifiers(input),
|
|
112351
|
+
updateParamsList(input, input.parameters, 0 /* None */),
|
|
112352
|
+
/*body*/
|
|
112353
|
+
void 0
|
|
112477
112354
|
);
|
|
112478
112355
|
return cleanup(ctor);
|
|
112479
112356
|
}
|
|
@@ -112484,20 +112361,17 @@ ${lanes.join("\n")}
|
|
|
112484
112361
|
void 0
|
|
112485
112362
|
);
|
|
112486
112363
|
}
|
|
112487
|
-
const sig =
|
|
112488
|
-
input,
|
|
112489
|
-
|
|
112490
|
-
|
|
112491
|
-
|
|
112492
|
-
|
|
112493
|
-
|
|
112494
|
-
|
|
112495
|
-
|
|
112496
|
-
|
|
112497
|
-
|
|
112498
|
-
/*body*/
|
|
112499
|
-
void 0
|
|
112500
|
-
)
|
|
112364
|
+
const sig = factory2.createMethodDeclaration(
|
|
112365
|
+
ensureModifiers(input),
|
|
112366
|
+
/*asteriskToken*/
|
|
112367
|
+
void 0,
|
|
112368
|
+
input.name,
|
|
112369
|
+
input.questionToken,
|
|
112370
|
+
ensureTypeParams(input, input.typeParameters),
|
|
112371
|
+
updateParamsList(input, input.parameters),
|
|
112372
|
+
ensureType(input, input.type),
|
|
112373
|
+
/*body*/
|
|
112374
|
+
void 0
|
|
112501
112375
|
);
|
|
112502
112376
|
return cleanup(sig);
|
|
112503
112377
|
}
|
|
@@ -112509,17 +112383,14 @@ ${lanes.join("\n")}
|
|
|
112509
112383
|
);
|
|
112510
112384
|
}
|
|
112511
112385
|
const accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input));
|
|
112512
|
-
return cleanup(
|
|
112386
|
+
return cleanup(factory2.updateGetAccessorDeclaration(
|
|
112513
112387
|
input,
|
|
112514
|
-
|
|
112515
|
-
|
|
112516
|
-
|
|
112517
|
-
|
|
112518
|
-
|
|
112519
|
-
|
|
112520
|
-
/*body*/
|
|
112521
|
-
void 0
|
|
112522
|
-
)
|
|
112388
|
+
ensureModifiers(input),
|
|
112389
|
+
input.name,
|
|
112390
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
112391
|
+
ensureType(input, accessorType),
|
|
112392
|
+
/*body*/
|
|
112393
|
+
void 0
|
|
112523
112394
|
));
|
|
112524
112395
|
}
|
|
112525
112396
|
case 178 /* SetAccessor */: {
|
|
@@ -112529,16 +112400,13 @@ ${lanes.join("\n")}
|
|
|
112529
112400
|
void 0
|
|
112530
112401
|
);
|
|
112531
112402
|
}
|
|
112532
|
-
return cleanup(
|
|
112403
|
+
return cleanup(factory2.updateSetAccessorDeclaration(
|
|
112533
112404
|
input,
|
|
112534
|
-
|
|
112535
|
-
|
|
112536
|
-
|
|
112537
|
-
|
|
112538
|
-
|
|
112539
|
-
/*body*/
|
|
112540
|
-
void 0
|
|
112541
|
-
)
|
|
112405
|
+
ensureModifiers(input),
|
|
112406
|
+
input.name,
|
|
112407
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
112408
|
+
/*body*/
|
|
112409
|
+
void 0
|
|
112542
112410
|
));
|
|
112543
112411
|
}
|
|
112544
112412
|
case 172 /* PropertyDeclaration */:
|
|
@@ -112577,29 +112445,25 @@ ${lanes.join("\n")}
|
|
|
112577
112445
|
void 0
|
|
112578
112446
|
);
|
|
112579
112447
|
}
|
|
112580
|
-
return cleanup(
|
|
112448
|
+
return cleanup(factory2.updateMethodSignature(
|
|
112581
112449
|
input,
|
|
112582
|
-
|
|
112583
|
-
|
|
112584
|
-
|
|
112585
|
-
|
|
112586
|
-
|
|
112587
|
-
|
|
112588
|
-
updateParamsList(input, input.parameters),
|
|
112589
|
-
ensureType(input, input.type)
|
|
112590
|
-
)
|
|
112450
|
+
ensureModifiers(input),
|
|
112451
|
+
input.name,
|
|
112452
|
+
input.questionToken,
|
|
112453
|
+
ensureTypeParams(input, input.typeParameters),
|
|
112454
|
+
updateParamsList(input, input.parameters),
|
|
112455
|
+
ensureType(input, input.type)
|
|
112591
112456
|
));
|
|
112592
112457
|
}
|
|
112593
112458
|
case 179 /* CallSignature */: {
|
|
112594
|
-
return cleanup(
|
|
112595
|
-
input,
|
|
112459
|
+
return cleanup(
|
|
112596
112460
|
factory2.updateCallSignature(
|
|
112597
112461
|
input,
|
|
112598
112462
|
ensureTypeParams(input, input.typeParameters),
|
|
112599
112463
|
updateParamsList(input, input.parameters),
|
|
112600
112464
|
ensureType(input, input.type)
|
|
112601
112465
|
)
|
|
112602
|
-
)
|
|
112466
|
+
);
|
|
112603
112467
|
}
|
|
112604
112468
|
case 181 /* IndexSignature */: {
|
|
112605
112469
|
return cleanup(factory2.updateIndexSignature(
|
|
@@ -112653,26 +112517,20 @@ ${lanes.join("\n")}
|
|
|
112653
112517
|
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
|
|
112654
112518
|
}
|
|
112655
112519
|
case 184 /* FunctionType */: {
|
|
112656
|
-
return cleanup(
|
|
112520
|
+
return cleanup(factory2.updateFunctionTypeNode(
|
|
112657
112521
|
input,
|
|
112658
|
-
|
|
112659
|
-
|
|
112660
|
-
|
|
112661
|
-
updateParamsList(input, input.parameters),
|
|
112662
|
-
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
112663
|
-
)
|
|
112522
|
+
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
|
|
112523
|
+
updateParamsList(input, input.parameters),
|
|
112524
|
+
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
112664
112525
|
));
|
|
112665
112526
|
}
|
|
112666
112527
|
case 185 /* ConstructorType */: {
|
|
112667
|
-
return cleanup(
|
|
112528
|
+
return cleanup(factory2.updateConstructorTypeNode(
|
|
112668
112529
|
input,
|
|
112669
|
-
|
|
112670
|
-
|
|
112671
|
-
|
|
112672
|
-
|
|
112673
|
-
updateParamsList(input, input.parameters),
|
|
112674
|
-
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
112675
|
-
)
|
|
112530
|
+
ensureModifiers(input),
|
|
112531
|
+
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
|
|
112532
|
+
updateParamsList(input, input.parameters),
|
|
112533
|
+
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
112676
112534
|
));
|
|
112677
112535
|
}
|
|
112678
112536
|
case 205 /* ImportType */: {
|
|
@@ -112858,20 +112716,17 @@ ${lanes.join("\n")}
|
|
|
112858
112716
|
));
|
|
112859
112717
|
}
|
|
112860
112718
|
case 262 /* FunctionDeclaration */: {
|
|
112861
|
-
const clean2 = cleanup(
|
|
112719
|
+
const clean2 = cleanup(factory2.updateFunctionDeclaration(
|
|
112862
112720
|
input,
|
|
112863
|
-
|
|
112864
|
-
|
|
112865
|
-
|
|
112866
|
-
|
|
112867
|
-
|
|
112868
|
-
|
|
112869
|
-
|
|
112870
|
-
|
|
112871
|
-
|
|
112872
|
-
/*body*/
|
|
112873
|
-
void 0
|
|
112874
|
-
)
|
|
112721
|
+
ensureModifiers(input),
|
|
112722
|
+
/*asteriskToken*/
|
|
112723
|
+
void 0,
|
|
112724
|
+
input.name,
|
|
112725
|
+
ensureTypeParams(input, input.typeParameters),
|
|
112726
|
+
updateParamsList(input, input.parameters),
|
|
112727
|
+
ensureType(input, input.type),
|
|
112728
|
+
/*body*/
|
|
112729
|
+
void 0
|
|
112875
112730
|
));
|
|
112876
112731
|
if (clean2 && resolver.isExpandoFunctionDeclaration(input) && shouldEmitFunctionProperties(input)) {
|
|
112877
112732
|
const props = resolver.getPropertiesOfContainerFunction(input);
|
|
@@ -126365,10 +126220,10 @@ ${lanes.join("\n")}
|
|
|
126365
126220
|
}
|
|
126366
126221
|
function watchFailedLookupLocationOfResolution(resolution) {
|
|
126367
126222
|
Debug.assert(!!resolution.refCount);
|
|
126368
|
-
const { failedLookupLocations, affectingLocations,
|
|
126369
|
-
if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length) && !
|
|
126223
|
+
const { failedLookupLocations, affectingLocations, alternateResult } = resolution;
|
|
126224
|
+
if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length) && !alternateResult)
|
|
126370
126225
|
return;
|
|
126371
|
-
if ((failedLookupLocations == null ? void 0 : failedLookupLocations.length) ||
|
|
126226
|
+
if ((failedLookupLocations == null ? void 0 : failedLookupLocations.length) || alternateResult)
|
|
126372
126227
|
resolutionsWithFailedLookups.add(resolution);
|
|
126373
126228
|
let setAtRoot = false;
|
|
126374
126229
|
if (failedLookupLocations) {
|
|
@@ -126376,8 +126231,8 @@ ${lanes.join("\n")}
|
|
|
126376
126231
|
setAtRoot = watchFailedLookupLocation(failedLookupLocation, setAtRoot);
|
|
126377
126232
|
}
|
|
126378
126233
|
}
|
|
126379
|
-
if (
|
|
126380
|
-
setAtRoot = watchFailedLookupLocation(
|
|
126234
|
+
if (alternateResult)
|
|
126235
|
+
setAtRoot = watchFailedLookupLocation(alternateResult, setAtRoot);
|
|
126381
126236
|
if (setAtRoot) {
|
|
126382
126237
|
setDirectoryWatcher(
|
|
126383
126238
|
rootDir,
|
|
@@ -126386,7 +126241,7 @@ ${lanes.join("\n")}
|
|
|
126386
126241
|
true
|
|
126387
126242
|
);
|
|
126388
126243
|
}
|
|
126389
|
-
watchAffectingLocationsOfResolution(resolution, !(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !
|
|
126244
|
+
watchAffectingLocationsOfResolution(resolution, !(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !alternateResult);
|
|
126390
126245
|
}
|
|
126391
126246
|
function watchAffectingLocationsOfResolution(resolution, addToResolutionsWithOnlyAffectingLocations) {
|
|
126392
126247
|
Debug.assert(!!resolution.refCount);
|
|
@@ -126524,7 +126379,7 @@ ${lanes.join("\n")}
|
|
|
126524
126379
|
if ((resolutions == null ? void 0 : resolutions.delete(resolution)) && !resolutions.size)
|
|
126525
126380
|
resolvedFileToResolution.delete(key);
|
|
126526
126381
|
}
|
|
126527
|
-
const { failedLookupLocations, affectingLocations,
|
|
126382
|
+
const { failedLookupLocations, affectingLocations, alternateResult } = resolution;
|
|
126528
126383
|
if (resolutionsWithFailedLookups.delete(resolution)) {
|
|
126529
126384
|
let removeAtRoot = false;
|
|
126530
126385
|
if (failedLookupLocations) {
|
|
@@ -126532,8 +126387,8 @@ ${lanes.join("\n")}
|
|
|
126532
126387
|
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
|
|
126533
126388
|
}
|
|
126534
126389
|
}
|
|
126535
|
-
if (
|
|
126536
|
-
removeAtRoot = stopWatchFailedLookupLocation(
|
|
126390
|
+
if (alternateResult)
|
|
126391
|
+
removeAtRoot = stopWatchFailedLookupLocation(alternateResult, removeAtRoot, syncDirWatcherRemove);
|
|
126537
126392
|
if (removeAtRoot)
|
|
126538
126393
|
removeDirectoryWatcher(rootPath, syncDirWatcherRemove);
|
|
126539
126394
|
} else if (affectingLocations == null ? void 0 : affectingLocations.length) {
|
|
@@ -126700,7 +126555,7 @@ ${lanes.join("\n")}
|
|
|
126700
126555
|
return true;
|
|
126701
126556
|
if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks)
|
|
126702
126557
|
return false;
|
|
126703
|
-
return ((_a = resolution.failedLookupLocations) == null ? void 0 : _a.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)))) || !!resolution.
|
|
126558
|
+
return ((_a = resolution.failedLookupLocations) == null ? void 0 : _a.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)))) || !!resolution.alternateResult && isInvalidatedFailedLookup(resolutionHost.toPath(resolution.alternateResult));
|
|
126704
126559
|
}
|
|
126705
126560
|
function isInvalidatedFailedLookup(locationPath) {
|
|
126706
126561
|
return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) || [], (fileOrDirectoryPath) => startsWith(locationPath, fileOrDirectoryPath) ? true : void 0) || firstDefinedIterator((isInDirectoryChecks == null ? void 0 : isInDirectoryChecks.keys()) || [], (dirPath) => locationPath.length > dirPath.length && startsWith(locationPath, dirPath) && (isDiskPathRoot(dirPath) || locationPath[dirPath.length] === directorySeparator) ? true : void 0);
|
|
@@ -134074,7 +133929,7 @@ ${lanes.join("\n")}
|
|
|
134074
133929
|
const pattern = getPatternFromSpec(spec, "", "exclude");
|
|
134075
133930
|
return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames2) : void 0;
|
|
134076
133931
|
});
|
|
134077
|
-
forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, (module2, file) => cb(
|
|
133932
|
+
forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, host, (module2, file) => cb(
|
|
134078
133933
|
module2,
|
|
134079
133934
|
file,
|
|
134080
133935
|
program,
|
|
@@ -134085,7 +133940,7 @@ ${lanes.join("\n")}
|
|
|
134085
133940
|
if (autoImportProvider) {
|
|
134086
133941
|
const start = timestamp();
|
|
134087
133942
|
const checker = program.getTypeChecker();
|
|
134088
|
-
forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, (module2, file) => {
|
|
133943
|
+
forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, host, (module2, file) => {
|
|
134089
133944
|
if (file && !program.getSourceFile(file.fileName) || !file && !checker.resolveName(
|
|
134090
133945
|
module2.name,
|
|
134091
133946
|
/*location*/
|
|
@@ -134106,11 +133961,26 @@ ${lanes.join("\n")}
|
|
|
134106
133961
|
(_b = host.log) == null ? void 0 : _b.call(host, `forEachExternalModuleToImportFrom autoImportProvider: ${timestamp() - start}`);
|
|
134107
133962
|
}
|
|
134108
133963
|
}
|
|
134109
|
-
function forEachExternalModule(checker, allSourceFiles, excludePatterns, cb) {
|
|
134110
|
-
var _a;
|
|
134111
|
-
const
|
|
133964
|
+
function forEachExternalModule(checker, allSourceFiles, excludePatterns, host, cb) {
|
|
133965
|
+
var _a, _b;
|
|
133966
|
+
const realpathsWithSymlinks = (_a = host.getSymlinkCache) == null ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
133967
|
+
const isExcluded = excludePatterns && (({ fileName, path }) => {
|
|
133968
|
+
if (excludePatterns.some((p) => p.test(fileName)))
|
|
133969
|
+
return true;
|
|
133970
|
+
if ((realpathsWithSymlinks == null ? void 0 : realpathsWithSymlinks.size) && pathContainsNodeModules(fileName)) {
|
|
133971
|
+
let dir = getDirectoryPath(fileName);
|
|
133972
|
+
return forEachAncestorDirectory(getDirectoryPath(path), (dirPath) => {
|
|
133973
|
+
const symlinks = realpathsWithSymlinks.get(ensureTrailingDirectorySeparator(dirPath));
|
|
133974
|
+
if (symlinks) {
|
|
133975
|
+
return symlinks.some((s) => excludePatterns.some((p) => p.test(fileName.replace(dir, s))));
|
|
133976
|
+
}
|
|
133977
|
+
dir = getDirectoryPath(dir);
|
|
133978
|
+
}) ?? false;
|
|
133979
|
+
}
|
|
133980
|
+
return false;
|
|
133981
|
+
});
|
|
134112
133982
|
for (const ambient of checker.getAmbientModules()) {
|
|
134113
|
-
if (!ambient.name.includes("*") && !(excludePatterns && ((
|
|
133983
|
+
if (!ambient.name.includes("*") && !(excludePatterns && ((_b = ambient.declarations) == null ? void 0 : _b.every((d) => isExcluded(d.getSourceFile()))))) {
|
|
134114
133984
|
cb(
|
|
134115
133985
|
ambient,
|
|
134116
133986
|
/*sourceFile*/
|
|
@@ -134119,7 +133989,7 @@ ${lanes.join("\n")}
|
|
|
134119
133989
|
}
|
|
134120
133990
|
}
|
|
134121
133991
|
for (const sourceFile of allSourceFiles) {
|
|
134122
|
-
if (isExternalOrCommonJsModule(sourceFile) && !(isExcluded == null ? void 0 : isExcluded(sourceFile
|
|
133992
|
+
if (isExternalOrCommonJsModule(sourceFile) && !(isExcluded == null ? void 0 : isExcluded(sourceFile))) {
|
|
134123
133993
|
cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile);
|
|
134124
133994
|
}
|
|
134125
133995
|
}
|