typescript 5.3.2 → 5.4.0-beta
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/cancellationToken.js +0 -1
- package/lib/lib.dom.asynciterable.d.ts +28 -0
- package/lib/lib.dom.d.ts +363 -153
- package/lib/lib.dom.iterable.d.ts +35 -28
- package/lib/lib.es2016.d.ts +1 -0
- package/lib/lib.es2016.intl.d.ts +31 -0
- package/lib/lib.es2018.full.d.ts +1 -0
- package/lib/lib.es2018.intl.d.ts +6 -5
- package/lib/lib.es2019.full.d.ts +1 -0
- package/lib/lib.es2020.full.d.ts +1 -0
- package/lib/lib.es2020.intl.d.ts +36 -16
- package/lib/lib.es2020.string.d.ts +15 -1
- package/lib/lib.es2021.full.d.ts +1 -0
- package/lib/lib.es2021.intl.d.ts +2 -2
- package/lib/lib.es2022.full.d.ts +1 -0
- package/lib/lib.es2022.intl.d.ts +2 -2
- package/lib/lib.es2023.full.d.ts +1 -0
- package/lib/lib.es5.d.ts +21 -6
- package/lib/lib.esnext.collection.d.ts +29 -0
- package/lib/lib.esnext.d.ts +3 -0
- package/lib/lib.esnext.disposable.d.ts +1 -1
- package/lib/lib.esnext.full.d.ts +1 -0
- package/lib/lib.esnext.object.d.ts +29 -0
- package/lib/lib.esnext.promise.d.ts +35 -0
- package/lib/lib.webworker.asynciterable.d.ts +28 -0
- package/lib/lib.webworker.d.ts +202 -111
- package/lib/lib.webworker.iterable.d.ts +29 -28
- package/lib/tsc.js +2555 -1248
- package/lib/tsserver.js +4154 -2107
- package/lib/typescript.d.ts +100 -21
- package/lib/typescript.js +4109 -1903
- package/lib/typingsInstaller.js +499 -205
- package/package.json +28 -29
package/lib/typingsInstaller.js
CHANGED
|
@@ -53,8 +53,8 @@ var fs = __toESM(require("fs"));
|
|
|
53
53
|
var path = __toESM(require("path"));
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
|
-
var versionMajorMinor = "5.
|
|
57
|
-
var version = "5.
|
|
56
|
+
var versionMajorMinor = "5.4";
|
|
57
|
+
var version = "5.4.0-beta";
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -568,23 +568,6 @@ function compareStringsCaseSensitive(a, b) {
|
|
|
568
568
|
function getStringComparer(ignoreCase) {
|
|
569
569
|
return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive;
|
|
570
570
|
}
|
|
571
|
-
var createUIStringComparer = (() => {
|
|
572
|
-
return createIntlCollatorStringComparer;
|
|
573
|
-
function compareWithCallback(a, b, comparer) {
|
|
574
|
-
if (a === b)
|
|
575
|
-
return 0 /* EqualTo */;
|
|
576
|
-
if (a === void 0)
|
|
577
|
-
return -1 /* LessThan */;
|
|
578
|
-
if (b === void 0)
|
|
579
|
-
return 1 /* GreaterThan */;
|
|
580
|
-
const value = comparer(a, b);
|
|
581
|
-
return value < 0 ? -1 /* LessThan */ : value > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */;
|
|
582
|
-
}
|
|
583
|
-
function createIntlCollatorStringComparer(locale) {
|
|
584
|
-
const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare;
|
|
585
|
-
return (a, b) => compareWithCallback(a, b, comparer);
|
|
586
|
-
}
|
|
587
|
-
})();
|
|
588
571
|
function getSpellingSuggestion(name, candidates, getName) {
|
|
589
572
|
const maximumLengthDifference = Math.max(2, Math.floor(name.length * 0.34));
|
|
590
573
|
let bestDistance = Math.floor(name.length * 0.4) + 1;
|
|
@@ -651,9 +634,9 @@ function levenshteinWithMax(s1, s2, max) {
|
|
|
651
634
|
const res = previous[s2.length];
|
|
652
635
|
return res > max ? void 0 : res;
|
|
653
636
|
}
|
|
654
|
-
function endsWith(str, suffix) {
|
|
637
|
+
function endsWith(str, suffix, ignoreCase) {
|
|
655
638
|
const expectedPos = str.length - suffix.length;
|
|
656
|
-
return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;
|
|
639
|
+
return expectedPos >= 0 && (ignoreCase ? equateStringsCaseInsensitive(str.slice(expectedPos), suffix) : str.indexOf(suffix, expectedPos) === expectedPos);
|
|
657
640
|
}
|
|
658
641
|
function removeMinAndVersionNumbers(fileName) {
|
|
659
642
|
let end = fileName.length;
|
|
@@ -740,8 +723,8 @@ function findBestPatternMatch(values, getPattern, candidate) {
|
|
|
740
723
|
}
|
|
741
724
|
return matchedValue;
|
|
742
725
|
}
|
|
743
|
-
function startsWith(str, prefix) {
|
|
744
|
-
return str.lastIndexOf(prefix, 0) === 0;
|
|
726
|
+
function startsWith(str, prefix, ignoreCase) {
|
|
727
|
+
return ignoreCase ? equateStringsCaseInsensitive(str.slice(0, prefix.length), prefix) : str.lastIndexOf(prefix, 0) === 0;
|
|
745
728
|
}
|
|
746
729
|
function isPatternMatch({ prefix, suffix }, candidate) {
|
|
747
730
|
return candidate.length >= prefix.length + suffix.length && startsWith(candidate, prefix) && endsWith(candidate, suffix);
|
|
@@ -2961,6 +2944,7 @@ var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => {
|
|
|
2961
2944
|
return ModifierFlags3;
|
|
2962
2945
|
})(ModifierFlags || {});
|
|
2963
2946
|
var RelationComparisonResult = /* @__PURE__ */ ((RelationComparisonResult3) => {
|
|
2947
|
+
RelationComparisonResult3[RelationComparisonResult3["None"] = 0] = "None";
|
|
2964
2948
|
RelationComparisonResult3[RelationComparisonResult3["Succeeded"] = 1] = "Succeeded";
|
|
2965
2949
|
RelationComparisonResult3[RelationComparisonResult3["Failed"] = 2] = "Failed";
|
|
2966
2950
|
RelationComparisonResult3[RelationComparisonResult3["Reported"] = 4] = "Reported";
|
|
@@ -3017,7 +3001,7 @@ var SymbolFlags = /* @__PURE__ */ ((SymbolFlags2) => {
|
|
|
3017
3001
|
SymbolFlags2[SymbolFlags2["Transient"] = 33554432] = "Transient";
|
|
3018
3002
|
SymbolFlags2[SymbolFlags2["Assignment"] = 67108864] = "Assignment";
|
|
3019
3003
|
SymbolFlags2[SymbolFlags2["ModuleExports"] = 134217728] = "ModuleExports";
|
|
3020
|
-
SymbolFlags2[SymbolFlags2["All"] =
|
|
3004
|
+
SymbolFlags2[SymbolFlags2["All"] = -1] = "All";
|
|
3021
3005
|
SymbolFlags2[SymbolFlags2["Enum"] = 384] = "Enum";
|
|
3022
3006
|
SymbolFlags2[SymbolFlags2["Variable"] = 3] = "Variable";
|
|
3023
3007
|
SymbolFlags2[SymbolFlags2["Value"] = 111551] = "Value";
|
|
@@ -3085,6 +3069,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3085
3069
|
TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
|
|
3086
3070
|
TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
|
|
3087
3071
|
TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
|
|
3072
|
+
TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
|
|
3088
3073
|
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
|
|
3089
3074
|
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
|
|
3090
3075
|
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
|
|
@@ -3112,7 +3097,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3112
3097
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
3113
3098
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
3114
3099
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
3115
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
3100
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
3116
3101
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
3117
3102
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
3118
3103
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -3122,6 +3107,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3122
3107
|
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
|
|
3123
3108
|
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
|
|
3124
3109
|
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
|
|
3110
|
+
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
|
|
3125
3111
|
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
|
|
3126
3112
|
return TypeFlags2;
|
|
3127
3113
|
})(TypeFlags || {});
|
|
@@ -3168,6 +3154,7 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
3168
3154
|
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 67108864] = "IsUnknownLikeUnion";
|
|
3169
3155
|
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 16777216] = "IsNeverIntersectionComputed";
|
|
3170
3156
|
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 33554432] = "IsNeverIntersection";
|
|
3157
|
+
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] = 67108864] = "IsConstrainedTypeVariable";
|
|
3171
3158
|
return ObjectFlags3;
|
|
3172
3159
|
})(ObjectFlags || {});
|
|
3173
3160
|
var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => {
|
|
@@ -3934,6 +3921,7 @@ function createSystemWatchFunctions({
|
|
|
3934
3921
|
useNonPollingWatchers,
|
|
3935
3922
|
tscWatchDirectory,
|
|
3936
3923
|
inodeWatching,
|
|
3924
|
+
fsWatchWithTimestamp,
|
|
3937
3925
|
sysLog: sysLog2
|
|
3938
3926
|
}) {
|
|
3939
3927
|
const pollingWatches = /* @__PURE__ */ new Map();
|
|
@@ -4172,7 +4160,7 @@ function createSystemWatchFunctions({
|
|
|
4172
4160
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4173
4161
|
}
|
|
4174
4162
|
try {
|
|
4175
|
-
const presentWatcher = fsWatchWorker(
|
|
4163
|
+
const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
4176
4164
|
fileOrDirectory,
|
|
4177
4165
|
recursive,
|
|
4178
4166
|
inodeWatching ? callbackChangingToMissingFileSystemEntry : callback
|
|
@@ -4235,6 +4223,18 @@ function createSystemWatchFunctions({
|
|
|
4235
4223
|
);
|
|
4236
4224
|
}
|
|
4237
4225
|
}
|
|
4226
|
+
function fsWatchWorkerHandlingTimestamp(fileOrDirectory, recursive, callback) {
|
|
4227
|
+
let modifiedTime = getModifiedTime2(fileOrDirectory) || missingFileModifiedTime;
|
|
4228
|
+
return fsWatchWorker(fileOrDirectory, recursive, (eventName, relativeFileName, currentModifiedTime) => {
|
|
4229
|
+
if (eventName === "change") {
|
|
4230
|
+
currentModifiedTime || (currentModifiedTime = getModifiedTime2(fileOrDirectory) || missingFileModifiedTime);
|
|
4231
|
+
if (currentModifiedTime.getTime() === modifiedTime.getTime())
|
|
4232
|
+
return;
|
|
4233
|
+
}
|
|
4234
|
+
modifiedTime = currentModifiedTime || getModifiedTime2(fileOrDirectory) || missingFileModifiedTime;
|
|
4235
|
+
callback(eventName, relativeFileName, modifiedTime);
|
|
4236
|
+
});
|
|
4237
|
+
}
|
|
4238
4238
|
}
|
|
4239
4239
|
function patchWriteFileEnsuringDirectory(sys2) {
|
|
4240
4240
|
const originalWriteFile = sys2.writeFile;
|
|
@@ -4263,12 +4263,13 @@ var sys = (() => {
|
|
|
4263
4263
|
let activeSession;
|
|
4264
4264
|
let profilePath = "./profile.cpuprofile";
|
|
4265
4265
|
const Buffer2 = require("buffer").Buffer;
|
|
4266
|
-
const
|
|
4266
|
+
const isMacOs = process.platform === "darwin";
|
|
4267
|
+
const isLinuxOrMacOs = process.platform === "linux" || isMacOs;
|
|
4267
4268
|
const platform = _os.platform();
|
|
4268
4269
|
const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
|
|
4269
4270
|
const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
4270
4271
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
4271
|
-
const fsSupportsRecursiveFsWatch = process.platform === "win32" ||
|
|
4272
|
+
const fsSupportsRecursiveFsWatch = process.platform === "win32" || isMacOs;
|
|
4272
4273
|
const getCurrentDirectory = memoize(() => process.cwd());
|
|
4273
4274
|
const { watchFile, watchDirectory } = createSystemWatchFunctions({
|
|
4274
4275
|
pollingWatchFileWorker: fsWatchFileWorker,
|
|
@@ -4288,6 +4289,7 @@ var sys = (() => {
|
|
|
4288
4289
|
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
4289
4290
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
4290
4291
|
inodeWatching: isLinuxOrMacOs,
|
|
4292
|
+
fsWatchWithTimestamp: isMacOs,
|
|
4291
4293
|
sysLog
|
|
4292
4294
|
});
|
|
4293
4295
|
const nodeSystem = {
|
|
@@ -4310,6 +4312,7 @@ var sys = (() => {
|
|
|
4310
4312
|
resolvePath: (path2) => _path.resolve(path2),
|
|
4311
4313
|
fileExists,
|
|
4312
4314
|
directoryExists,
|
|
4315
|
+
getAccessibleFileSystemEntries,
|
|
4313
4316
|
createDirectory(directoryName) {
|
|
4314
4317
|
if (!nodeSystem.directoryExists(directoryName)) {
|
|
4315
4318
|
try {
|
|
@@ -5314,6 +5317,10 @@ var Diagnostics = {
|
|
|
5314
5317
|
ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
5315
5318
|
A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
5316
5319
|
An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),
|
|
5320
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1289, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
5321
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
5322
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
5323
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
5317
5324
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
5318
5325
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
5319
5326
|
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
@@ -5377,7 +5384,7 @@ var Diagnostics = {
|
|
|
5377
5384
|
await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1 /* Error */, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
5378
5385
|
_0_was_imported_here: diag(1376, 3 /* Message */, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
5379
5386
|
_0_was_exported_here: diag(1377, 3 /* Message */, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
5380
|
-
|
|
5387
|
+
Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1 /* Error */, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
|
|
5381
5388
|
An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."),
|
|
5382
5389
|
An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
|
|
5383
5390
|
Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
|
|
@@ -5428,7 +5435,7 @@ var Diagnostics = {
|
|
|
5428
5435
|
File_redirects_to_file_0: diag(1429, 3 /* Message */, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
|
|
5429
5436
|
The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
|
|
5430
5437
|
for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
5431
|
-
|
|
5438
|
+
Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
|
|
5432
5439
|
Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."),
|
|
5433
5440
|
Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
|
|
5434
5441
|
Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1 /* Error */, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
|
|
@@ -6011,9 +6018,9 @@ var Diagnostics = {
|
|
|
6011
6018
|
Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, 1 /* Error */, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),
|
|
6012
6019
|
Namespace_name_cannot_be_0: diag(2819, 1 /* Error */, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
|
|
6013
6020
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
6014
|
-
|
|
6021
|
+
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),
|
|
6015
6022
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1 /* Error */, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
6016
|
-
|
|
6023
|
+
Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),
|
|
6017
6024
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
6018
6025
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
|
|
6019
6026
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),
|
|
@@ -6033,7 +6040,7 @@ var Diagnostics = {
|
|
|
6033
6040
|
The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined: diag(2851, 1 /* Error */, "The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851", "The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),
|
|
6034
6041
|
await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
|
|
6035
6042
|
await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
6036
|
-
|
|
6043
|
+
Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
|
|
6037
6044
|
Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1 /* Error */, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
|
|
6038
6045
|
Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2856, 1 /* Error */, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),
|
|
6039
6046
|
Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
|
|
@@ -6044,6 +6051,10 @@ var Diagnostics = {
|
|
|
6044
6051
|
Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
|
|
6045
6052
|
A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
|
|
6046
6053
|
A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
|
|
6054
|
+
Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
6055
|
+
Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2866, 1 /* Error */, "Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866", "Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
6056
|
+
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun: diag(2867, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),
|
|
6057
|
+
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig: diag(2868, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),
|
|
6047
6058
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
6048
6059
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
6049
6060
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -6152,6 +6163,8 @@ var Diagnostics = {
|
|
|
6152
6163
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
6153
6164
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
6154
6165
|
Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
6166
|
+
Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
|
|
6167
|
+
One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1 /* Error */, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
|
|
6155
6168
|
The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
6156
6169
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
6157
6170
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -6183,7 +6196,7 @@ var Diagnostics = {
|
|
|
6183
6196
|
Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: diag(5068, 1 /* Error */, "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068", "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),
|
|
6184
6197
|
Option_0_cannot_be_specified_without_specifying_option_1_or_option_2: diag(5069, 1 /* Error */, "Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069", "Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),
|
|
6185
6198
|
Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic: diag(5070, 1 /* Error */, "Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070", "Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'."),
|
|
6186
|
-
|
|
6199
|
+
Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd: diag(5071, 1 /* Error */, "Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd_5071", "Option '--resolveJsonModule' cannot be specified when 'module' is set to 'none', 'system', or 'umd'."),
|
|
6187
6200
|
Unknown_build_option_0: diag(5072, 1 /* Error */, "Unknown_build_option_0_5072", "Unknown build option '{0}'."),
|
|
6188
6201
|
Build_option_0_requires_a_value_of_type_1: diag(5073, 1 /* Error */, "Build_option_0_requires_a_value_of_type_1_5073", "Build option '{0}' requires a value of type {1}."),
|
|
6189
6202
|
Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified: diag(5074, 1 /* Error */, "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074", "Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),
|
|
@@ -6206,7 +6219,7 @@ var Diagnostics = {
|
|
|
6206
6219
|
The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."),
|
|
6207
6220
|
Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."),
|
|
6208
6221
|
Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."),
|
|
6209
|
-
|
|
6222
|
+
Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later."),
|
|
6210
6223
|
Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),
|
|
6211
6224
|
An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),
|
|
6212
6225
|
Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
|
|
@@ -6507,6 +6520,8 @@ var Diagnostics = {
|
|
|
6507
6520
|
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}'."),
|
|
6508
6521
|
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."),
|
|
6509
6522
|
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.`),
|
|
6523
|
+
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."),
|
|
6524
|
+
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'."),
|
|
6510
6525
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
6511
6526
|
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."),
|
|
6512
6527
|
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}'."),
|
|
@@ -7124,6 +7139,12 @@ var Diagnostics = {
|
|
|
7124
7139
|
Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
|
|
7125
7140
|
Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
|
|
7126
7141
|
Add_missing_comma_for_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_object_member_completion_0_95187", "Add missing comma for object member completion '{0}'."),
|
|
7142
|
+
Add_missing_parameter_to_0: diag(95188, 3 /* Message */, "Add_missing_parameter_to_0_95188", "Add missing parameter to '{0}'"),
|
|
7143
|
+
Add_missing_parameters_to_0: diag(95189, 3 /* Message */, "Add_missing_parameters_to_0_95189", "Add missing parameters to '{0}'"),
|
|
7144
|
+
Add_all_missing_parameters: diag(95190, 3 /* Message */, "Add_all_missing_parameters_95190", "Add all missing parameters"),
|
|
7145
|
+
Add_optional_parameter_to_0: diag(95191, 3 /* Message */, "Add_optional_parameter_to_0_95191", "Add optional parameter to '{0}'"),
|
|
7146
|
+
Add_optional_parameters_to_0: diag(95192, 3 /* Message */, "Add_optional_parameters_to_0_95192", "Add optional parameters to '{0}'"),
|
|
7147
|
+
Add_all_optional_parameters: diag(95193, 3 /* Message */, "Add_all_optional_parameters_95193", "Add all optional parameters"),
|
|
7127
7148
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
7128
7149
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
7129
7150
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -8416,7 +8437,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8416
8437
|
}
|
|
8417
8438
|
const ch = codePointAt(text, pos);
|
|
8418
8439
|
if (pos === 0) {
|
|
8419
|
-
if (
|
|
8440
|
+
if (text.slice(0, 256).includes("\uFFFD")) {
|
|
8420
8441
|
error(Diagnostics.File_appears_to_be_binary);
|
|
8421
8442
|
pos = end;
|
|
8422
8443
|
return token = 8 /* NonTextFileMarkerTrivia */;
|
|
@@ -10576,12 +10597,12 @@ function canHaveJSDoc(node) {
|
|
|
10576
10597
|
function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
10577
10598
|
let result;
|
|
10578
10599
|
if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
|
|
10579
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
10600
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
|
|
10580
10601
|
}
|
|
10581
10602
|
let node = hostNode;
|
|
10582
10603
|
while (node && node.parent) {
|
|
10583
10604
|
if (hasJSDocNodes(node)) {
|
|
10584
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
10605
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
|
|
10585
10606
|
}
|
|
10586
10607
|
if (node.kind === 169 /* Parameter */) {
|
|
10587
10608
|
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
|
|
@@ -10595,12 +10616,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
|
10595
10616
|
}
|
|
10596
10617
|
return result || emptyArray;
|
|
10597
10618
|
}
|
|
10598
|
-
function filterOwnedJSDocTags(hostNode,
|
|
10599
|
-
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
|
|
10603
|
-
|
|
10619
|
+
function filterOwnedJSDocTags(hostNode, comments) {
|
|
10620
|
+
const lastJsDoc = last(comments);
|
|
10621
|
+
return flatMap(comments, (jsDoc) => {
|
|
10622
|
+
if (jsDoc === lastJsDoc) {
|
|
10623
|
+
const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
|
|
10624
|
+
return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
|
|
10625
|
+
} else {
|
|
10626
|
+
return filter(jsDoc.tags, isJSDocOverloadTag);
|
|
10627
|
+
}
|
|
10628
|
+
});
|
|
10604
10629
|
}
|
|
10605
10630
|
function ownsJSDocTag(hostNode, tag) {
|
|
10606
10631
|
return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
@@ -11114,7 +11139,7 @@ function Symbol4(flags, name) {
|
|
|
11114
11139
|
this.exportSymbol = void 0;
|
|
11115
11140
|
this.constEnumOnlyModule = void 0;
|
|
11116
11141
|
this.isReferenced = void 0;
|
|
11117
|
-
this.
|
|
11142
|
+
this.lastAssignmentPos = void 0;
|
|
11118
11143
|
this.links = void 0;
|
|
11119
11144
|
}
|
|
11120
11145
|
function Type3(checker, flags) {
|
|
@@ -11287,46 +11312,237 @@ function createCompilerDiagnostic(message, ...args) {
|
|
|
11287
11312
|
function getLanguageVariant(scriptKind) {
|
|
11288
11313
|
return scriptKind === 4 /* TSX */ || scriptKind === 2 /* JSX */ || scriptKind === 1 /* JS */ || scriptKind === 6 /* JSON */ ? 1 /* JSX */ : 0 /* Standard */;
|
|
11289
11314
|
}
|
|
11290
|
-
function
|
|
11291
|
-
return
|
|
11292
|
-
}
|
|
11293
|
-
function getEmitModuleKind(compilerOptions) {
|
|
11294
|
-
return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
|
|
11315
|
+
function createComputedCompilerOptions(options) {
|
|
11316
|
+
return options;
|
|
11295
11317
|
}
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
|
|
11310
|
-
|
|
11311
|
-
|
|
11318
|
+
var computedOptions = createComputedCompilerOptions({
|
|
11319
|
+
target: {
|
|
11320
|
+
dependencies: ["module"],
|
|
11321
|
+
computeValue: (compilerOptions) => {
|
|
11322
|
+
return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
|
|
11323
|
+
}
|
|
11324
|
+
},
|
|
11325
|
+
module: {
|
|
11326
|
+
dependencies: ["target"],
|
|
11327
|
+
computeValue: (compilerOptions) => {
|
|
11328
|
+
return typeof compilerOptions.module === "number" ? compilerOptions.module : computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
|
|
11329
|
+
}
|
|
11330
|
+
},
|
|
11331
|
+
moduleResolution: {
|
|
11332
|
+
dependencies: ["module", "target"],
|
|
11333
|
+
computeValue: (compilerOptions) => {
|
|
11334
|
+
let moduleResolution = compilerOptions.moduleResolution;
|
|
11335
|
+
if (moduleResolution === void 0) {
|
|
11336
|
+
switch (computedOptions.module.computeValue(compilerOptions)) {
|
|
11337
|
+
case 1 /* CommonJS */:
|
|
11338
|
+
moduleResolution = 2 /* Node10 */;
|
|
11339
|
+
break;
|
|
11340
|
+
case 100 /* Node16 */:
|
|
11341
|
+
moduleResolution = 3 /* Node16 */;
|
|
11342
|
+
break;
|
|
11343
|
+
case 199 /* NodeNext */:
|
|
11344
|
+
moduleResolution = 99 /* NodeNext */;
|
|
11345
|
+
break;
|
|
11346
|
+
case 200 /* Preserve */:
|
|
11347
|
+
moduleResolution = 100 /* Bundler */;
|
|
11348
|
+
break;
|
|
11349
|
+
default:
|
|
11350
|
+
moduleResolution = 1 /* Classic */;
|
|
11351
|
+
break;
|
|
11352
|
+
}
|
|
11353
|
+
}
|
|
11354
|
+
return moduleResolution;
|
|
11355
|
+
}
|
|
11356
|
+
},
|
|
11357
|
+
moduleDetection: {
|
|
11358
|
+
dependencies: ["module", "target"],
|
|
11359
|
+
computeValue: (compilerOptions) => {
|
|
11360
|
+
return compilerOptions.moduleDetection || (computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
|
|
11361
|
+
}
|
|
11362
|
+
},
|
|
11363
|
+
isolatedModules: {
|
|
11364
|
+
dependencies: ["verbatimModuleSyntax"],
|
|
11365
|
+
computeValue: (compilerOptions) => {
|
|
11366
|
+
return !!(compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax);
|
|
11367
|
+
}
|
|
11368
|
+
},
|
|
11369
|
+
esModuleInterop: {
|
|
11370
|
+
dependencies: ["module", "target"],
|
|
11371
|
+
computeValue: (compilerOptions) => {
|
|
11372
|
+
if (compilerOptions.esModuleInterop !== void 0) {
|
|
11373
|
+
return compilerOptions.esModuleInterop;
|
|
11374
|
+
}
|
|
11375
|
+
switch (computedOptions.module.computeValue(compilerOptions)) {
|
|
11376
|
+
case 100 /* Node16 */:
|
|
11377
|
+
case 199 /* NodeNext */:
|
|
11378
|
+
case 200 /* Preserve */:
|
|
11379
|
+
return true;
|
|
11380
|
+
}
|
|
11381
|
+
return false;
|
|
11382
|
+
}
|
|
11383
|
+
},
|
|
11384
|
+
allowSyntheticDefaultImports: {
|
|
11385
|
+
dependencies: ["module", "target", "moduleResolution"],
|
|
11386
|
+
computeValue: (compilerOptions) => {
|
|
11387
|
+
if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
|
|
11388
|
+
return compilerOptions.allowSyntheticDefaultImports;
|
|
11389
|
+
}
|
|
11390
|
+
return computedOptions.esModuleInterop.computeValue(compilerOptions) || computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
|
|
11391
|
+
}
|
|
11392
|
+
},
|
|
11393
|
+
resolvePackageJsonExports: {
|
|
11394
|
+
dependencies: ["moduleResolution"],
|
|
11395
|
+
computeValue: (compilerOptions) => {
|
|
11396
|
+
const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
|
|
11397
|
+
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
11398
|
+
return false;
|
|
11399
|
+
}
|
|
11400
|
+
if (compilerOptions.resolvePackageJsonExports !== void 0) {
|
|
11401
|
+
return compilerOptions.resolvePackageJsonExports;
|
|
11402
|
+
}
|
|
11403
|
+
switch (moduleResolution) {
|
|
11404
|
+
case 3 /* Node16 */:
|
|
11405
|
+
case 99 /* NodeNext */:
|
|
11406
|
+
case 100 /* Bundler */:
|
|
11407
|
+
return true;
|
|
11408
|
+
}
|
|
11409
|
+
return false;
|
|
11410
|
+
}
|
|
11411
|
+
},
|
|
11412
|
+
resolvePackageJsonImports: {
|
|
11413
|
+
dependencies: ["moduleResolution", "resolvePackageJsonExports"],
|
|
11414
|
+
computeValue: (compilerOptions) => {
|
|
11415
|
+
const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
|
|
11416
|
+
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
11417
|
+
return false;
|
|
11418
|
+
}
|
|
11419
|
+
if (compilerOptions.resolvePackageJsonExports !== void 0) {
|
|
11420
|
+
return compilerOptions.resolvePackageJsonExports;
|
|
11421
|
+
}
|
|
11422
|
+
switch (moduleResolution) {
|
|
11423
|
+
case 3 /* Node16 */:
|
|
11424
|
+
case 99 /* NodeNext */:
|
|
11425
|
+
case 100 /* Bundler */:
|
|
11426
|
+
return true;
|
|
11427
|
+
}
|
|
11428
|
+
return false;
|
|
11429
|
+
}
|
|
11430
|
+
},
|
|
11431
|
+
resolveJsonModule: {
|
|
11432
|
+
dependencies: ["moduleResolution", "module", "target"],
|
|
11433
|
+
computeValue: (compilerOptions) => {
|
|
11434
|
+
if (compilerOptions.resolveJsonModule !== void 0) {
|
|
11435
|
+
return compilerOptions.resolveJsonModule;
|
|
11436
|
+
}
|
|
11437
|
+
return computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
|
|
11438
|
+
}
|
|
11439
|
+
},
|
|
11440
|
+
declaration: {
|
|
11441
|
+
dependencies: ["composite"],
|
|
11442
|
+
computeValue: (compilerOptions) => {
|
|
11443
|
+
return !!(compilerOptions.declaration || compilerOptions.composite);
|
|
11444
|
+
}
|
|
11445
|
+
},
|
|
11446
|
+
preserveConstEnums: {
|
|
11447
|
+
dependencies: ["isolatedModules", "verbatimModuleSyntax"],
|
|
11448
|
+
computeValue: (compilerOptions) => {
|
|
11449
|
+
return !!(compilerOptions.preserveConstEnums || computedOptions.isolatedModules.computeValue(compilerOptions));
|
|
11450
|
+
}
|
|
11451
|
+
},
|
|
11452
|
+
incremental: {
|
|
11453
|
+
dependencies: ["composite"],
|
|
11454
|
+
computeValue: (compilerOptions) => {
|
|
11455
|
+
return !!(compilerOptions.incremental || compilerOptions.composite);
|
|
11456
|
+
}
|
|
11457
|
+
},
|
|
11458
|
+
declarationMap: {
|
|
11459
|
+
dependencies: ["declaration", "composite"],
|
|
11460
|
+
computeValue: (compilerOptions) => {
|
|
11461
|
+
return !!(compilerOptions.declarationMap && computedOptions.declaration.computeValue(compilerOptions));
|
|
11462
|
+
}
|
|
11463
|
+
},
|
|
11464
|
+
allowJs: {
|
|
11465
|
+
dependencies: ["checkJs"],
|
|
11466
|
+
computeValue: (compilerOptions) => {
|
|
11467
|
+
return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
|
|
11468
|
+
}
|
|
11469
|
+
},
|
|
11470
|
+
useDefineForClassFields: {
|
|
11471
|
+
dependencies: ["target", "module"],
|
|
11472
|
+
computeValue: (compilerOptions) => {
|
|
11473
|
+
return compilerOptions.useDefineForClassFields === void 0 ? computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
|
|
11474
|
+
}
|
|
11475
|
+
},
|
|
11476
|
+
noImplicitAny: {
|
|
11477
|
+
dependencies: ["strict"],
|
|
11478
|
+
computeValue: (compilerOptions) => {
|
|
11479
|
+
return getStrictOptionValue(compilerOptions, "noImplicitAny");
|
|
11480
|
+
}
|
|
11481
|
+
},
|
|
11482
|
+
noImplicitThis: {
|
|
11483
|
+
dependencies: ["strict"],
|
|
11484
|
+
computeValue: (compilerOptions) => {
|
|
11485
|
+
return getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
11486
|
+
}
|
|
11487
|
+
},
|
|
11488
|
+
strictNullChecks: {
|
|
11489
|
+
dependencies: ["strict"],
|
|
11490
|
+
computeValue: (compilerOptions) => {
|
|
11491
|
+
return getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
11492
|
+
}
|
|
11493
|
+
},
|
|
11494
|
+
strictFunctionTypes: {
|
|
11495
|
+
dependencies: ["strict"],
|
|
11496
|
+
computeValue: (compilerOptions) => {
|
|
11497
|
+
return getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
11498
|
+
}
|
|
11499
|
+
},
|
|
11500
|
+
strictBindCallApply: {
|
|
11501
|
+
dependencies: ["strict"],
|
|
11502
|
+
computeValue: (compilerOptions) => {
|
|
11503
|
+
return getStrictOptionValue(compilerOptions, "strictBindCallApply");
|
|
11504
|
+
}
|
|
11505
|
+
},
|
|
11506
|
+
strictPropertyInitialization: {
|
|
11507
|
+
dependencies: ["strict"],
|
|
11508
|
+
computeValue: (compilerOptions) => {
|
|
11509
|
+
return getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
|
|
11510
|
+
}
|
|
11511
|
+
},
|
|
11512
|
+
alwaysStrict: {
|
|
11513
|
+
dependencies: ["strict"],
|
|
11514
|
+
computeValue: (compilerOptions) => {
|
|
11515
|
+
return getStrictOptionValue(compilerOptions, "alwaysStrict");
|
|
11516
|
+
}
|
|
11517
|
+
},
|
|
11518
|
+
useUnknownInCatchVariables: {
|
|
11519
|
+
dependencies: ["strict"],
|
|
11520
|
+
computeValue: (compilerOptions) => {
|
|
11521
|
+
return getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
11312
11522
|
}
|
|
11313
11523
|
}
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11524
|
+
});
|
|
11525
|
+
var getEmitScriptTarget = computedOptions.target.computeValue;
|
|
11526
|
+
var getEmitModuleKind = computedOptions.module.computeValue;
|
|
11527
|
+
var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
|
|
11528
|
+
var getEmitModuleDetectionKind = computedOptions.moduleDetection.computeValue;
|
|
11529
|
+
var getIsolatedModules = computedOptions.isolatedModules.computeValue;
|
|
11530
|
+
var getESModuleInterop = computedOptions.esModuleInterop.computeValue;
|
|
11531
|
+
var getAllowSyntheticDefaultImports = computedOptions.allowSyntheticDefaultImports.computeValue;
|
|
11532
|
+
var getResolvePackageJsonExports = computedOptions.resolvePackageJsonExports.computeValue;
|
|
11533
|
+
var getResolvePackageJsonImports = computedOptions.resolvePackageJsonImports.computeValue;
|
|
11534
|
+
var getResolveJsonModule = computedOptions.resolveJsonModule.computeValue;
|
|
11535
|
+
var getEmitDeclarations = computedOptions.declaration.computeValue;
|
|
11536
|
+
var shouldPreserveConstEnums = computedOptions.preserveConstEnums.computeValue;
|
|
11537
|
+
var isIncrementalCompilation = computedOptions.incremental.computeValue;
|
|
11538
|
+
var getAreDeclarationMapsEnabled = computedOptions.declarationMap.computeValue;
|
|
11539
|
+
var getAllowJSCompilerOption = computedOptions.allowJs.computeValue;
|
|
11540
|
+
var getUseDefineForClassFields = computedOptions.useDefineForClassFields.computeValue;
|
|
11319
11541
|
function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
|
|
11320
11542
|
return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
|
|
11321
11543
|
}
|
|
11322
|
-
function
|
|
11323
|
-
|
|
11324
|
-
return compilerOptions.resolveJsonModule;
|
|
11325
|
-
}
|
|
11326
|
-
return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
|
|
11327
|
-
}
|
|
11328
|
-
function getAllowJSCompilerOption(compilerOptions) {
|
|
11329
|
-
return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
|
|
11544
|
+
function getStrictOptionValue(compilerOptions, flag) {
|
|
11545
|
+
return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
|
|
11330
11546
|
}
|
|
11331
11547
|
var reservedCharacterPattern = /[^\w\s/]/g;
|
|
11332
11548
|
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
|
|
@@ -11384,7 +11600,7 @@ function getRegularExpressionsForWildcards(specs, basePath, usage) {
|
|
|
11384
11600
|
function isImplicitGlob(lastPathComponent) {
|
|
11385
11601
|
return !/[.*?]/.test(lastPathComponent);
|
|
11386
11602
|
}
|
|
11387
|
-
function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 }) {
|
|
11603
|
+
function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 } = wildcardMatchers[usage]) {
|
|
11388
11604
|
let subpattern = "";
|
|
11389
11605
|
let hasWrittenComponent = false;
|
|
11390
11606
|
const components = getNormalizedPathComponents(spec, basePath);
|
|
@@ -11739,6 +11955,10 @@ function getEscapedTextOfJsxNamespacedName(node) {
|
|
|
11739
11955
|
function getTextOfJsxNamespacedName(node) {
|
|
11740
11956
|
return `${idText(node.namespace)}:${idText(node.name)}`;
|
|
11741
11957
|
}
|
|
11958
|
+
var stringReplace = String.prototype.replace;
|
|
11959
|
+
function replaceFirstStar(s, replacement) {
|
|
11960
|
+
return stringReplace.call(s, "*", replacement);
|
|
11961
|
+
}
|
|
11742
11962
|
|
|
11743
11963
|
// src/compiler/factory/baseNodeFactory.ts
|
|
11744
11964
|
function createBaseNodeFactory() {
|
|
@@ -12334,7 +12554,7 @@ var nullNodeConverters = {
|
|
|
12334
12554
|
var nextAutoGenerateId = 0;
|
|
12335
12555
|
var nodeFactoryPatchers = [];
|
|
12336
12556
|
function createNodeFactory(flags, baseFactory2) {
|
|
12337
|
-
const
|
|
12557
|
+
const setOriginal = flags & 8 /* NoOriginalNode */ ? identity : setOriginalNode;
|
|
12338
12558
|
const parenthesizerRules = memoize(() => flags & 1 /* NoParenthesizerRules */ ? nullParenthesizerRules : createParenthesizerRules(factory2));
|
|
12339
12559
|
const converters = memoize(() => flags & 2 /* NoNodeConverters */ ? nullNodeConverters : createNodeConverters(factory2));
|
|
12340
12560
|
const getBinaryCreateFunction = memoizeOne((operator) => (left, right) => createBinaryExpression(left, operator, right));
|
|
@@ -13041,8 +13261,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13041
13261
|
return update(updated, original);
|
|
13042
13262
|
}
|
|
13043
13263
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
13264
|
+
const text = typeof value === "number" ? value + "" : value;
|
|
13265
|
+
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
13044
13266
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
13045
|
-
node.text =
|
|
13267
|
+
node.text = text;
|
|
13046
13268
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
13047
13269
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
13048
13270
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -15832,7 +16054,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15832
16054
|
}
|
|
15833
16055
|
function cloneSourceFile(source) {
|
|
15834
16056
|
const node = source.redirectInfo ? cloneRedirectedSourceFile(source) : cloneSourceFileWorker(source);
|
|
15835
|
-
|
|
16057
|
+
setOriginal(node, source);
|
|
15836
16058
|
return node;
|
|
15837
16059
|
}
|
|
15838
16060
|
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
|
|
@@ -15965,7 +16187,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15965
16187
|
const clone2 = createBaseIdentifier(node.escapedText);
|
|
15966
16188
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
15967
16189
|
clone2.transformFlags = node.transformFlags;
|
|
15968
|
-
|
|
16190
|
+
setOriginal(clone2, node);
|
|
15969
16191
|
setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
|
|
15970
16192
|
return clone2;
|
|
15971
16193
|
}
|
|
@@ -15976,7 +16198,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15976
16198
|
clone2.flowNode = node.flowNode;
|
|
15977
16199
|
clone2.symbol = node.symbol;
|
|
15978
16200
|
clone2.transformFlags = node.transformFlags;
|
|
15979
|
-
|
|
16201
|
+
setOriginal(clone2, node);
|
|
15980
16202
|
const typeArguments = getIdentifierTypeArguments(node);
|
|
15981
16203
|
if (typeArguments)
|
|
15982
16204
|
setIdentifierTypeArguments(clone2, typeArguments);
|
|
@@ -15986,7 +16208,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15986
16208
|
const clone2 = createBasePrivateIdentifier(node.escapedText);
|
|
15987
16209
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
15988
16210
|
clone2.transformFlags = node.transformFlags;
|
|
15989
|
-
|
|
16211
|
+
setOriginal(clone2, node);
|
|
15990
16212
|
setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
|
|
15991
16213
|
return clone2;
|
|
15992
16214
|
}
|
|
@@ -15994,7 +16216,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15994
16216
|
const clone2 = createBasePrivateIdentifier(node.escapedText);
|
|
15995
16217
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
15996
16218
|
clone2.transformFlags = node.transformFlags;
|
|
15997
|
-
|
|
16219
|
+
setOriginal(clone2, node);
|
|
15998
16220
|
return clone2;
|
|
15999
16221
|
}
|
|
16000
16222
|
function cloneNode(node) {
|
|
@@ -16019,7 +16241,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
16019
16241
|
const clone2 = !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
|
|
16020
16242
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
16021
16243
|
clone2.transformFlags = node.transformFlags;
|
|
16022
|
-
|
|
16244
|
+
setOriginal(clone2, node);
|
|
16023
16245
|
for (const key in node) {
|
|
16024
16246
|
if (hasProperty(clone2, key) || !hasProperty(node, key)) {
|
|
16025
16247
|
continue;
|
|
@@ -16544,7 +16766,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
16544
16766
|
return typeof value === "number" ? createToken(value) : value;
|
|
16545
16767
|
}
|
|
16546
16768
|
function asEmbeddedStatement(statement) {
|
|
16547
|
-
return statement && isNotEmittedStatement(statement) ? setTextRange(
|
|
16769
|
+
return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginal(createEmptyStatement(), statement), statement) : statement;
|
|
16548
16770
|
}
|
|
16549
16771
|
function asVariableDeclaration(variableDeclaration) {
|
|
16550
16772
|
if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
|
|
@@ -16560,19 +16782,13 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
16560
16782
|
}
|
|
16561
16783
|
return variableDeclaration;
|
|
16562
16784
|
}
|
|
16563
|
-
|
|
16564
|
-
|
|
16565
|
-
|
|
16566
|
-
|
|
16567
|
-
|
|
16568
|
-
|
|
16569
|
-
}
|
|
16570
|
-
function updateWithOriginal(updated, original) {
|
|
16571
|
-
if (updated !== original) {
|
|
16572
|
-
setOriginalNode(updated, original);
|
|
16573
|
-
setTextRange(updated, original);
|
|
16785
|
+
function update(updated, original) {
|
|
16786
|
+
if (updated !== original) {
|
|
16787
|
+
setOriginal(updated, original);
|
|
16788
|
+
setTextRange(updated, original);
|
|
16789
|
+
}
|
|
16790
|
+
return updated;
|
|
16574
16791
|
}
|
|
16575
|
-
return updated;
|
|
16576
16792
|
}
|
|
16577
16793
|
function getDefaultTagNameForKind(kind) {
|
|
16578
16794
|
switch (kind) {
|
|
@@ -17341,6 +17557,9 @@ function isJSDocReadonlyTag(node) {
|
|
|
17341
17557
|
function isJSDocOverrideTag(node) {
|
|
17342
17558
|
return node.kind === 344 /* JSDocOverrideTag */;
|
|
17343
17559
|
}
|
|
17560
|
+
function isJSDocOverloadTag(node) {
|
|
17561
|
+
return node.kind === 346 /* JSDocOverloadTag */;
|
|
17562
|
+
}
|
|
17344
17563
|
function isJSDocDeprecatedTag(node) {
|
|
17345
17564
|
return node.kind === 338 /* JSDocDeprecatedTag */;
|
|
17346
17565
|
}
|
|
@@ -18708,8 +18927,10 @@ var Parser;
|
|
|
18708
18927
|
setTextRangePosWidth(sourceFile, 0, sourceText.length);
|
|
18709
18928
|
setFields(sourceFile);
|
|
18710
18929
|
if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */) {
|
|
18930
|
+
const oldSourceFile = sourceFile;
|
|
18711
18931
|
sourceFile = reparseTopLevelAwait(sourceFile);
|
|
18712
|
-
|
|
18932
|
+
if (oldSourceFile !== sourceFile)
|
|
18933
|
+
setFields(sourceFile);
|
|
18713
18934
|
}
|
|
18714
18935
|
return sourceFile;
|
|
18715
18936
|
function setFields(sourceFile2) {
|
|
@@ -20107,8 +20328,7 @@ var Parser;
|
|
|
20107
20328
|
function parseJSDocFunctionType() {
|
|
20108
20329
|
const pos = getNodePos();
|
|
20109
20330
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
20110
|
-
if (
|
|
20111
|
-
nextToken();
|
|
20331
|
+
if (tryParse(nextTokenIsOpenParen)) {
|
|
20112
20332
|
const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
|
|
20113
20333
|
const type = parseReturnType(
|
|
20114
20334
|
59 /* ColonToken */,
|
|
@@ -23029,6 +23249,10 @@ var Parser;
|
|
|
23029
23249
|
function nextTokenIsStringLiteral() {
|
|
23030
23250
|
return nextToken() === 11 /* StringLiteral */;
|
|
23031
23251
|
}
|
|
23252
|
+
function nextTokenIsFromKeywordOrEqualsToken() {
|
|
23253
|
+
nextToken();
|
|
23254
|
+
return token() === 161 /* FromKeyword */ || token() === 64 /* EqualsToken */;
|
|
23255
|
+
}
|
|
23032
23256
|
function nextTokenIsIdentifierOrStringLiteralOnSameLine() {
|
|
23033
23257
|
nextToken();
|
|
23034
23258
|
return !scanner.hasPrecedingLineBreak() && (isIdentifier2() || token() === 11 /* StringLiteral */);
|
|
@@ -23724,7 +23948,7 @@ var Parser;
|
|
|
23724
23948
|
identifier = parseIdentifier();
|
|
23725
23949
|
}
|
|
23726
23950
|
let isTypeOnly = false;
|
|
23727
|
-
if (
|
|
23951
|
+
if ((identifier == null ? void 0 : identifier.escapedText) === "type" && (token() !== 161 /* FromKeyword */ || isIdentifier2() && lookAhead(nextTokenIsFromKeywordOrEqualsToken)) && (isIdentifier2() || tokenAfterImportDefinitelyProducesImportDeclaration())) {
|
|
23728
23952
|
isTypeOnly = true;
|
|
23729
23953
|
identifier = isIdentifier2() ? parseIdentifier() : void 0;
|
|
23730
23954
|
}
|
|
@@ -24507,18 +24731,7 @@ var Parser;
|
|
|
24507
24731
|
}
|
|
24508
24732
|
nextTokenJSDoc();
|
|
24509
24733
|
skipWhitespace();
|
|
24510
|
-
const
|
|
24511
|
-
let name = tokenIsIdentifierOrKeyword(token()) ? parseEntityName(
|
|
24512
|
-
/*allowReservedWords*/
|
|
24513
|
-
true
|
|
24514
|
-
) : void 0;
|
|
24515
|
-
if (name) {
|
|
24516
|
-
while (token() === 81 /* PrivateIdentifier */) {
|
|
24517
|
-
reScanHashToken();
|
|
24518
|
-
nextTokenJSDoc();
|
|
24519
|
-
name = finishNode(factory2.createJSDocMemberName(name, parseIdentifier()), p2);
|
|
24520
|
-
}
|
|
24521
|
-
}
|
|
24734
|
+
const name = parseJSDocLinkName();
|
|
24522
24735
|
const text = [];
|
|
24523
24736
|
while (token() !== 20 /* CloseBraceToken */ && token() !== 4 /* NewLineTrivia */ && token() !== 1 /* EndOfFileToken */) {
|
|
24524
24737
|
text.push(scanner.getTokenText());
|
|
@@ -24527,6 +24740,26 @@ var Parser;
|
|
|
24527
24740
|
const create = linkType === "link" ? factory2.createJSDocLink : linkType === "linkcode" ? factory2.createJSDocLinkCode : factory2.createJSDocLinkPlain;
|
|
24528
24741
|
return finishNode(create(name, text.join("")), start2, scanner.getTokenEnd());
|
|
24529
24742
|
}
|
|
24743
|
+
function parseJSDocLinkName() {
|
|
24744
|
+
if (tokenIsIdentifierOrKeyword(token())) {
|
|
24745
|
+
const pos = getNodePos();
|
|
24746
|
+
let name = parseIdentifierName();
|
|
24747
|
+
while (parseOptional(25 /* DotToken */)) {
|
|
24748
|
+
name = finishNode(factory2.createQualifiedName(name, token() === 81 /* PrivateIdentifier */ ? createMissingNode(
|
|
24749
|
+
80 /* Identifier */,
|
|
24750
|
+
/*reportAtCurrentPosition*/
|
|
24751
|
+
false
|
|
24752
|
+
) : parseIdentifier()), pos);
|
|
24753
|
+
}
|
|
24754
|
+
while (token() === 81 /* PrivateIdentifier */) {
|
|
24755
|
+
reScanHashToken();
|
|
24756
|
+
nextTokenJSDoc();
|
|
24757
|
+
name = finishNode(factory2.createJSDocMemberName(name, parseIdentifier()), pos);
|
|
24758
|
+
}
|
|
24759
|
+
return name;
|
|
24760
|
+
}
|
|
24761
|
+
return void 0;
|
|
24762
|
+
}
|
|
24530
24763
|
function parseJSDocLinkPrefix() {
|
|
24531
24764
|
skipWhitespaceOrAsterisk();
|
|
24532
24765
|
if (token() === 19 /* OpenBraceToken */ && nextTokenJSDoc() === 60 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc())) {
|
|
@@ -24928,6 +25161,8 @@ var Parser;
|
|
|
24928
25161
|
break;
|
|
24929
25162
|
case "template":
|
|
24930
25163
|
return parseTemplateTag(start2, tagName, indent3, indentText);
|
|
25164
|
+
case "this":
|
|
25165
|
+
return parseThisTag(start2, tagName, indent3, indentText);
|
|
24931
25166
|
default:
|
|
24932
25167
|
return false;
|
|
24933
25168
|
}
|
|
@@ -24942,6 +25177,12 @@ var Parser;
|
|
|
24942
25177
|
if (isBracketed) {
|
|
24943
25178
|
skipWhitespace();
|
|
24944
25179
|
}
|
|
25180
|
+
const modifiers = parseModifiers(
|
|
25181
|
+
/*allowDecorators*/
|
|
25182
|
+
false,
|
|
25183
|
+
/*permitConstAsModifier*/
|
|
25184
|
+
true
|
|
25185
|
+
);
|
|
24945
25186
|
const name = parseJSDocIdentifierName(Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
|
|
24946
25187
|
let defaultType;
|
|
24947
25188
|
if (isBracketed) {
|
|
@@ -24954,8 +25195,7 @@ var Parser;
|
|
|
24954
25195
|
return void 0;
|
|
24955
25196
|
}
|
|
24956
25197
|
return finishNode(factory2.createTypeParameterDeclaration(
|
|
24957
|
-
|
|
24958
|
-
void 0,
|
|
25198
|
+
modifiers,
|
|
24959
25199
|
name,
|
|
24960
25200
|
/*constraint*/
|
|
24961
25201
|
void 0,
|
|
@@ -25390,7 +25630,25 @@ var IncrementalParser;
|
|
|
25390
25630
|
})(InvalidPosition || (InvalidPosition = {}));
|
|
25391
25631
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
25392
25632
|
function isDeclarationFileName(fileName) {
|
|
25393
|
-
return
|
|
25633
|
+
return getDeclarationFileExtension(fileName) !== void 0;
|
|
25634
|
+
}
|
|
25635
|
+
function getDeclarationFileExtension(fileName) {
|
|
25636
|
+
const standardExtension = getAnyExtensionFromPath(
|
|
25637
|
+
fileName,
|
|
25638
|
+
supportedDeclarationExtensions,
|
|
25639
|
+
/*ignoreCase*/
|
|
25640
|
+
false
|
|
25641
|
+
);
|
|
25642
|
+
if (standardExtension) {
|
|
25643
|
+
return standardExtension;
|
|
25644
|
+
}
|
|
25645
|
+
if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
|
|
25646
|
+
const index = getBaseFileName(fileName).lastIndexOf(".d.");
|
|
25647
|
+
if (index >= 0) {
|
|
25648
|
+
return fileName.substring(index);
|
|
25649
|
+
}
|
|
25650
|
+
}
|
|
25651
|
+
return void 0;
|
|
25394
25652
|
}
|
|
25395
25653
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
25396
25654
|
if (!mode) {
|
|
@@ -25633,9 +25891,11 @@ var libEntries = [
|
|
|
25633
25891
|
// Host only
|
|
25634
25892
|
["dom", "lib.dom.d.ts"],
|
|
25635
25893
|
["dom.iterable", "lib.dom.iterable.d.ts"],
|
|
25894
|
+
["dom.asynciterable", "lib.dom.asynciterable.d.ts"],
|
|
25636
25895
|
["webworker", "lib.webworker.d.ts"],
|
|
25637
25896
|
["webworker.importscripts", "lib.webworker.importscripts.d.ts"],
|
|
25638
25897
|
["webworker.iterable", "lib.webworker.iterable.d.ts"],
|
|
25898
|
+
["webworker.asynciterable", "lib.webworker.asynciterable.d.ts"],
|
|
25639
25899
|
["scripthost", "lib.scripthost.d.ts"],
|
|
25640
25900
|
// ES2015 Or ESNext By-feature options
|
|
25641
25901
|
["es2015.core", "lib.es2015.core.d.ts"],
|
|
@@ -25648,6 +25908,7 @@ var libEntries = [
|
|
|
25648
25908
|
["es2015.symbol", "lib.es2015.symbol.d.ts"],
|
|
25649
25909
|
["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"],
|
|
25650
25910
|
["es2016.array.include", "lib.es2016.array.include.d.ts"],
|
|
25911
|
+
["es2016.intl", "lib.es2016.intl.d.ts"],
|
|
25651
25912
|
["es2017.date", "lib.es2017.date.d.ts"],
|
|
25652
25913
|
["es2017.object", "lib.es2017.object.d.ts"],
|
|
25653
25914
|
["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"],
|
|
@@ -25686,16 +25947,17 @@ var libEntries = [
|
|
|
25686
25947
|
["es2023.array", "lib.es2023.array.d.ts"],
|
|
25687
25948
|
["es2023.collection", "lib.es2023.collection.d.ts"],
|
|
25688
25949
|
["esnext.array", "lib.es2023.array.d.ts"],
|
|
25689
|
-
["esnext.collection", "lib.
|
|
25950
|
+
["esnext.collection", "lib.esnext.collection.d.ts"],
|
|
25690
25951
|
["esnext.symbol", "lib.es2019.symbol.d.ts"],
|
|
25691
25952
|
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
|
|
25692
25953
|
["esnext.intl", "lib.esnext.intl.d.ts"],
|
|
25693
25954
|
["esnext.disposable", "lib.esnext.disposable.d.ts"],
|
|
25694
25955
|
["esnext.bigint", "lib.es2020.bigint.d.ts"],
|
|
25695
25956
|
["esnext.string", "lib.es2022.string.d.ts"],
|
|
25696
|
-
["esnext.promise", "lib.
|
|
25957
|
+
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
25697
25958
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
25698
25959
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
25960
|
+
["esnext.object", "lib.esnext.object.d.ts"],
|
|
25699
25961
|
["decorators", "lib.decorators.d.ts"],
|
|
25700
25962
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
25701
25963
|
];
|
|
@@ -25979,6 +26241,7 @@ var targetOptionDeclaration = {
|
|
|
25979
26241
|
affectsModuleResolution: true,
|
|
25980
26242
|
affectsEmit: true,
|
|
25981
26243
|
affectsBuildInfo: true,
|
|
26244
|
+
deprecatedKeys: /* @__PURE__ */ new Set(["es3"]),
|
|
25982
26245
|
paramType: Diagnostics.VERSION,
|
|
25983
26246
|
showInSimplifiedHelpView: true,
|
|
25984
26247
|
category: Diagnostics.Language_and_Environment,
|
|
@@ -26000,7 +26263,8 @@ var moduleOptionDeclaration = {
|
|
|
26000
26263
|
es2022: 7 /* ES2022 */,
|
|
26001
26264
|
esnext: 99 /* ESNext */,
|
|
26002
26265
|
node16: 100 /* Node16 */,
|
|
26003
|
-
nodenext: 199 /* NodeNext
|
|
26266
|
+
nodenext: 199 /* NodeNext */,
|
|
26267
|
+
preserve: 200 /* Preserve */
|
|
26004
26268
|
})),
|
|
26005
26269
|
affectsSourceFile: true,
|
|
26006
26270
|
affectsModuleResolution: true,
|
|
@@ -27405,7 +27669,7 @@ function formatExtensions(extensions) {
|
|
|
27405
27669
|
result.push("JSON");
|
|
27406
27670
|
return result.join(", ");
|
|
27407
27671
|
}
|
|
27408
|
-
function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, cache,
|
|
27672
|
+
function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, cache, alternateResult) {
|
|
27409
27673
|
if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) {
|
|
27410
27674
|
const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled);
|
|
27411
27675
|
if (originalPath)
|
|
@@ -27419,10 +27683,10 @@ function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName
|
|
|
27419
27683
|
diagnostics,
|
|
27420
27684
|
state.resultFromCache,
|
|
27421
27685
|
cache,
|
|
27422
|
-
|
|
27686
|
+
alternateResult
|
|
27423
27687
|
);
|
|
27424
27688
|
}
|
|
27425
|
-
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache,
|
|
27689
|
+
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache, alternateResult) {
|
|
27426
27690
|
if (resultFromCache) {
|
|
27427
27691
|
if (!(cache == null ? void 0 : cache.isReadonly)) {
|
|
27428
27692
|
resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
|
|
@@ -27450,7 +27714,7 @@ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibra
|
|
|
27450
27714
|
failedLookupLocations: initializeResolutionField(failedLookupLocations),
|
|
27451
27715
|
affectingLocations: initializeResolutionField(affectingLocations),
|
|
27452
27716
|
resolutionDiagnostics: initializeResolutionField(diagnostics),
|
|
27453
|
-
|
|
27717
|
+
alternateResult
|
|
27454
27718
|
};
|
|
27455
27719
|
}
|
|
27456
27720
|
function initializeResolutionField(value) {
|
|
@@ -27626,6 +27890,9 @@ function getConditions(options, resolutionMode) {
|
|
|
27626
27890
|
}
|
|
27627
27891
|
return concatenate(conditions, options.customConditions);
|
|
27628
27892
|
}
|
|
27893
|
+
function isPackageJsonInfo(entry) {
|
|
27894
|
+
return !!(entry == null ? void 0 : entry.contents);
|
|
27895
|
+
}
|
|
27629
27896
|
function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
27630
27897
|
var _a, _b, _c;
|
|
27631
27898
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
@@ -27647,20 +27914,7 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
27647
27914
|
} else {
|
|
27648
27915
|
let moduleResolution = compilerOptions.moduleResolution;
|
|
27649
27916
|
if (moduleResolution === void 0) {
|
|
27650
|
-
|
|
27651
|
-
case 1 /* CommonJS */:
|
|
27652
|
-
moduleResolution = 2 /* Node10 */;
|
|
27653
|
-
break;
|
|
27654
|
-
case 100 /* Node16 */:
|
|
27655
|
-
moduleResolution = 3 /* Node16 */;
|
|
27656
|
-
break;
|
|
27657
|
-
case 199 /* NodeNext */:
|
|
27658
|
-
moduleResolution = 99 /* NodeNext */;
|
|
27659
|
-
break;
|
|
27660
|
-
default:
|
|
27661
|
-
moduleResolution = 1 /* Classic */;
|
|
27662
|
-
break;
|
|
27663
|
-
}
|
|
27917
|
+
moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
27664
27918
|
if (traceEnabled) {
|
|
27665
27919
|
trace(host, Diagnostics.Module_resolution_kind_is_not_specified_using_0, ModuleResolutionKind[moduleResolution]);
|
|
27666
27920
|
}
|
|
@@ -27924,7 +28178,7 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
|
|
|
27924
28178
|
return nodeModuleNameResolverWorker(conditions ? 30 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions);
|
|
27925
28179
|
}
|
|
27926
28180
|
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference, conditions) {
|
|
27927
|
-
var _a, _b, _c, _d;
|
|
28181
|
+
var _a, _b, _c, _d, _e;
|
|
27928
28182
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
27929
28183
|
const failedLookupLocations = [];
|
|
27930
28184
|
const affectingLocations = [];
|
|
@@ -27946,7 +28200,8 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
27946
28200
|
requestContainingDirectory: containingDirectory,
|
|
27947
28201
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
27948
28202
|
isConfigLookup,
|
|
27949
|
-
candidateIsFromPackageJsonField: false
|
|
28203
|
+
candidateIsFromPackageJsonField: false,
|
|
28204
|
+
resolvedPackageDirectory: false
|
|
27950
28205
|
};
|
|
27951
28206
|
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
27952
28207
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", state.conditions.map((c) => `'${c}'`).join(", "));
|
|
@@ -27959,29 +28214,46 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
27959
28214
|
} else {
|
|
27960
28215
|
result = tryResolve(extensions, state);
|
|
27961
28216
|
}
|
|
27962
|
-
let
|
|
27963
|
-
if (
|
|
27964
|
-
|
|
27965
|
-
|
|
27966
|
-
|
|
27967
|
-
|
|
27968
|
-
|
|
27969
|
-
|
|
27970
|
-
|
|
27971
|
-
|
|
27972
|
-
|
|
28217
|
+
let alternateResult;
|
|
28218
|
+
if (state.resolvedPackageDirectory && !isConfigLookup && !isExternalModuleNameRelative(moduleName)) {
|
|
28219
|
+
const wantedTypesButGotJs = (result == null ? void 0 : result.value) && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension);
|
|
28220
|
+
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && wantedTypesButGotJs && features & 8 /* Exports */ && (conditions == null ? void 0 : conditions.includes("import"))) {
|
|
28221
|
+
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
28222
|
+
const diagnosticState = {
|
|
28223
|
+
...state,
|
|
28224
|
+
features: state.features & ~8 /* Exports */,
|
|
28225
|
+
reportDiagnostic: noop
|
|
28226
|
+
};
|
|
28227
|
+
const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
|
|
28228
|
+
if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) {
|
|
28229
|
+
alternateResult = diagnosticResult.value.resolved.path;
|
|
28230
|
+
}
|
|
28231
|
+
} else if ((!(result == null ? void 0 : result.value) || wantedTypesButGotJs) && moduleResolution === 2 /* Node10 */) {
|
|
28232
|
+
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update);
|
|
28233
|
+
const diagnosticsCompilerOptions = { ...state.compilerOptions, moduleResolution: 100 /* Bundler */ };
|
|
28234
|
+
const diagnosticState = {
|
|
28235
|
+
...state,
|
|
28236
|
+
compilerOptions: diagnosticsCompilerOptions,
|
|
28237
|
+
features: 30 /* BundlerDefault */,
|
|
28238
|
+
conditions: getConditions(diagnosticsCompilerOptions),
|
|
28239
|
+
reportDiagnostic: noop
|
|
28240
|
+
};
|
|
28241
|
+
const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
|
|
28242
|
+
if ((_c = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _c.isExternalLibraryImport) {
|
|
28243
|
+
alternateResult = diagnosticResult.value.resolved.path;
|
|
28244
|
+
}
|
|
27973
28245
|
}
|
|
27974
28246
|
}
|
|
27975
28247
|
return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
|
|
27976
28248
|
moduleName,
|
|
27977
|
-
(
|
|
27978
|
-
(
|
|
28249
|
+
(_d = result == null ? void 0 : result.value) == null ? void 0 : _d.resolved,
|
|
28250
|
+
(_e = result == null ? void 0 : result.value) == null ? void 0 : _e.isExternalLibraryImport,
|
|
27979
28251
|
failedLookupLocations,
|
|
27980
28252
|
affectingLocations,
|
|
27981
28253
|
diagnostics,
|
|
27982
28254
|
state,
|
|
27983
28255
|
cache,
|
|
27984
|
-
|
|
28256
|
+
alternateResult
|
|
27985
28257
|
);
|
|
27986
28258
|
function tryResolve(extensions2, state2) {
|
|
27987
28259
|
const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName(
|
|
@@ -28253,13 +28525,13 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
28253
28525
|
}
|
|
28254
28526
|
const existing = (_b = state.packageJsonInfoCache) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
28255
28527
|
if (existing !== void 0) {
|
|
28256
|
-
if (
|
|
28528
|
+
if (isPackageJsonInfo(existing)) {
|
|
28257
28529
|
if (traceEnabled)
|
|
28258
28530
|
trace(host, Diagnostics.File_0_exists_according_to_earlier_cached_lookups, packageJsonPath);
|
|
28259
28531
|
(_c = state.affectingLocations) == null ? void 0 : _c.push(packageJsonPath);
|
|
28260
28532
|
return existing.packageDirectory === packageDirectory ? existing : { packageDirectory, contents: existing.contents };
|
|
28261
28533
|
} else {
|
|
28262
|
-
if (existing && traceEnabled)
|
|
28534
|
+
if (existing.directoryExists && traceEnabled)
|
|
28263
28535
|
trace(host, Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups, packageJsonPath);
|
|
28264
28536
|
(_d = state.failedLookupLocations) == null ? void 0 : _d.push(packageJsonPath);
|
|
28265
28537
|
return void 0;
|
|
@@ -28281,7 +28553,7 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
28281
28553
|
trace(host, Diagnostics.File_0_does_not_exist, packageJsonPath);
|
|
28282
28554
|
}
|
|
28283
28555
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
28284
|
-
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, directoryExists);
|
|
28556
|
+
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, { packageDirectory, directoryExists });
|
|
28285
28557
|
(_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath);
|
|
28286
28558
|
}
|
|
28287
28559
|
}
|
|
@@ -28943,6 +29215,9 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
28943
29215
|
if (rest !== "") {
|
|
28944
29216
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
28945
29217
|
}
|
|
29218
|
+
if (packageInfo) {
|
|
29219
|
+
state.resolvedPackageDirectory = true;
|
|
29220
|
+
}
|
|
28946
29221
|
if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & 8 /* Exports */) {
|
|
28947
29222
|
return (_b = loadModuleFromExports(packageInfo, extensions, combinePaths(".", rest), state, cache, redirectedReference)) == null ? void 0 : _b.value;
|
|
28948
29223
|
}
|
|
@@ -28979,7 +29254,7 @@ function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, p
|
|
|
28979
29254
|
trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
|
|
28980
29255
|
}
|
|
28981
29256
|
const resolved = forEach(paths[matchedPatternText], (subst) => {
|
|
28982
|
-
const path2 = matchedStar ? subst
|
|
29257
|
+
const path2 = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
|
|
28983
29258
|
const candidate = normalizePath(combinePaths(baseDirectory, path2));
|
|
28984
29259
|
if (state.traceEnabled) {
|
|
28985
29260
|
trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path2);
|
|
@@ -29049,7 +29324,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
29049
29324
|
requestContainingDirectory: containingDirectory,
|
|
29050
29325
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
29051
29326
|
isConfigLookup: false,
|
|
29052
|
-
candidateIsFromPackageJsonField: false
|
|
29327
|
+
candidateIsFromPackageJsonField: false,
|
|
29328
|
+
resolvedPackageDirectory: false
|
|
29053
29329
|
};
|
|
29054
29330
|
const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
|
|
29055
29331
|
return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
|
|
@@ -29264,7 +29540,8 @@ var intrinsicTypeKinds = new Map(Object.entries({
|
|
|
29264
29540
|
Uppercase: 0 /* Uppercase */,
|
|
29265
29541
|
Lowercase: 1 /* Lowercase */,
|
|
29266
29542
|
Capitalize: 2 /* Capitalize */,
|
|
29267
|
-
Uncapitalize: 3 /* Uncapitalize
|
|
29543
|
+
Uncapitalize: 3 /* Uncapitalize */,
|
|
29544
|
+
NoInfer: 4 /* NoInfer */
|
|
29268
29545
|
}));
|
|
29269
29546
|
function getNodeId(node) {
|
|
29270
29547
|
if (!node.id) {
|
|
@@ -31843,6 +32120,32 @@ var TypingsInstaller = class {
|
|
|
31843
32120
|
}
|
|
31844
32121
|
this.processCacheLocation(this.globalCachePath);
|
|
31845
32122
|
}
|
|
32123
|
+
/** @internal */
|
|
32124
|
+
handleRequest(req) {
|
|
32125
|
+
switch (req.kind) {
|
|
32126
|
+
case "discover":
|
|
32127
|
+
this.install(req);
|
|
32128
|
+
break;
|
|
32129
|
+
case "closeProject":
|
|
32130
|
+
this.closeProject(req);
|
|
32131
|
+
break;
|
|
32132
|
+
case "typesRegistry": {
|
|
32133
|
+
const typesRegistry = {};
|
|
32134
|
+
this.typesRegistry.forEach((value, key) => {
|
|
32135
|
+
typesRegistry[key] = value;
|
|
32136
|
+
});
|
|
32137
|
+
const response = { kind: EventTypesRegistry, typesRegistry };
|
|
32138
|
+
this.sendResponse(response);
|
|
32139
|
+
break;
|
|
32140
|
+
}
|
|
32141
|
+
case "installPackage": {
|
|
32142
|
+
this.installPackage(req);
|
|
32143
|
+
break;
|
|
32144
|
+
}
|
|
32145
|
+
default:
|
|
32146
|
+
Debug.assertNever(req);
|
|
32147
|
+
}
|
|
32148
|
+
}
|
|
31846
32149
|
closeProject(req) {
|
|
31847
32150
|
this.closeWatchers(req.projectName);
|
|
31848
32151
|
}
|
|
@@ -31898,6 +32201,37 @@ var TypingsInstaller = class {
|
|
|
31898
32201
|
}
|
|
31899
32202
|
}
|
|
31900
32203
|
}
|
|
32204
|
+
/** @internal */
|
|
32205
|
+
installPackage(req) {
|
|
32206
|
+
const { fileName, packageName, projectName, projectRootPath, id } = req;
|
|
32207
|
+
const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
|
|
32208
|
+
if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) {
|
|
32209
|
+
return directory;
|
|
32210
|
+
}
|
|
32211
|
+
}) || projectRootPath;
|
|
32212
|
+
if (cwd) {
|
|
32213
|
+
this.installWorker(-1, [packageName], cwd, (success) => {
|
|
32214
|
+
const message = success ? `Package ${packageName} installed.` : `There was an error installing ${packageName}.`;
|
|
32215
|
+
const response = {
|
|
32216
|
+
kind: ActionPackageInstalled,
|
|
32217
|
+
projectName,
|
|
32218
|
+
id,
|
|
32219
|
+
success,
|
|
32220
|
+
message
|
|
32221
|
+
};
|
|
32222
|
+
this.sendResponse(response);
|
|
32223
|
+
});
|
|
32224
|
+
} else {
|
|
32225
|
+
const response = {
|
|
32226
|
+
kind: ActionPackageInstalled,
|
|
32227
|
+
projectName,
|
|
32228
|
+
id,
|
|
32229
|
+
success: false,
|
|
32230
|
+
message: "Could not determine a project root path."
|
|
32231
|
+
};
|
|
32232
|
+
this.sendResponse(response);
|
|
32233
|
+
}
|
|
32234
|
+
}
|
|
31901
32235
|
initializeSafeList() {
|
|
31902
32236
|
if (this.typesMapLocation) {
|
|
31903
32237
|
const safeListFromMap = ts_JsTyping_exports.loadTypesMap(this.installTypingHost, this.typesMapLocation);
|
|
@@ -32231,40 +32565,7 @@ var NodeTypingsInstaller = class extends TypingsInstaller {
|
|
|
32231
32565
|
this.sendResponse(this.delayedInitializationError);
|
|
32232
32566
|
this.delayedInitializationError = void 0;
|
|
32233
32567
|
}
|
|
32234
|
-
|
|
32235
|
-
case "discover":
|
|
32236
|
-
this.install(req);
|
|
32237
|
-
break;
|
|
32238
|
-
case "closeProject":
|
|
32239
|
-
this.closeProject(req);
|
|
32240
|
-
break;
|
|
32241
|
-
case "typesRegistry": {
|
|
32242
|
-
const typesRegistry = {};
|
|
32243
|
-
this.typesRegistry.forEach((value, key) => {
|
|
32244
|
-
typesRegistry[key] = value;
|
|
32245
|
-
});
|
|
32246
|
-
const response = { kind: EventTypesRegistry, typesRegistry };
|
|
32247
|
-
this.sendResponse(response);
|
|
32248
|
-
break;
|
|
32249
|
-
}
|
|
32250
|
-
case "installPackage": {
|
|
32251
|
-
const { fileName, packageName, projectName, projectRootPath } = req;
|
|
32252
|
-
const cwd = getDirectoryOfPackageJson(fileName, this.installTypingHost) || projectRootPath;
|
|
32253
|
-
if (cwd) {
|
|
32254
|
-
this.installWorker(-1, [packageName], cwd, (success) => {
|
|
32255
|
-
const message = success ? `Package ${packageName} installed.` : `There was an error installing ${packageName}.`;
|
|
32256
|
-
const response = { kind: ActionPackageInstalled, projectName, success, message };
|
|
32257
|
-
this.sendResponse(response);
|
|
32258
|
-
});
|
|
32259
|
-
} else {
|
|
32260
|
-
const response = { kind: ActionPackageInstalled, projectName, success: false, message: "Could not determine a project root path." };
|
|
32261
|
-
this.sendResponse(response);
|
|
32262
|
-
}
|
|
32263
|
-
break;
|
|
32264
|
-
}
|
|
32265
|
-
default:
|
|
32266
|
-
Debug.assertNever(req);
|
|
32267
|
-
}
|
|
32568
|
+
super.handleRequest(req);
|
|
32268
32569
|
}
|
|
32269
32570
|
sendResponse(response) {
|
|
32270
32571
|
if (this.log.isEnabled()) {
|
|
@@ -32277,7 +32578,7 @@ var NodeTypingsInstaller = class extends TypingsInstaller {
|
|
|
32277
32578
|
}
|
|
32278
32579
|
installWorker(requestId, packageNames, cwd, onRequestCompleted) {
|
|
32279
32580
|
if (this.log.isEnabled()) {
|
|
32280
|
-
this.log.writeLine(`#${requestId} with arguments
|
|
32581
|
+
this.log.writeLine(`#${requestId} with cwd: ${cwd} arguments: ${JSON.stringify(packageNames)}`);
|
|
32281
32582
|
}
|
|
32282
32583
|
const start = Date.now();
|
|
32283
32584
|
const hasError = installNpmPackages(this.npmPath, version, packageNames, (command) => this.execSyncAndLog(command, { cwd }));
|
|
@@ -32304,13 +32605,6 @@ var NodeTypingsInstaller = class extends TypingsInstaller {
|
|
|
32304
32605
|
}
|
|
32305
32606
|
}
|
|
32306
32607
|
};
|
|
32307
|
-
function getDirectoryOfPackageJson(fileName, host) {
|
|
32308
|
-
return forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
|
|
32309
|
-
if (host.fileExists(combinePaths(directory, "package.json"))) {
|
|
32310
|
-
return directory;
|
|
32311
|
-
}
|
|
32312
|
-
});
|
|
32313
|
-
}
|
|
32314
32608
|
var logFilePath = findArgument(Arguments.LogFile);
|
|
32315
32609
|
var globalTypingsCacheLocation = findArgument(Arguments.GlobalCacheLocation);
|
|
32316
32610
|
var typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation);
|