typescript 4.7.2 → 4.7.3
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/tsc.js +78 -31
- package/lib/tsserver.js +100 -37
- package/lib/tsserverlibrary.d.ts +26 -0
- package/lib/tsserverlibrary.js +100 -37
- package/lib/typescript.d.ts +26 -0
- package/lib/typescript.js +100 -37
- package/lib/typescriptServices.d.ts +26 -0
- package/lib/typescriptServices.js +100 -37
- package/lib/typingsInstaller.js +98 -35
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.7";
|
|
72
|
-
ts.version = "4.7.
|
|
72
|
+
ts.version = "4.7.3";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -5573,7 +5573,7 @@ var ts;
|
|
|
5573
5573
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, ts.DiagnosticCategory.Message, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."),
|
|
5574
5574
|
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, ts.DiagnosticCategory.Message, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"),
|
|
5575
5575
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
5576
|
-
|
|
5576
|
+
resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, ts.DiagnosticCategory.Error, "resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
5577
5577
|
resolution_mode_should_be_either_require_or_import: diag(1453, ts.DiagnosticCategory.Error, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
5578
5578
|
resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, ts.DiagnosticCategory.Error, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
|
|
5579
5579
|
resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, ts.DiagnosticCategory.Error, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
|
|
@@ -6077,6 +6077,7 @@ var ts;
|
|
|
6077
6077
|
Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
|
|
6078
6078
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
6079
6079
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
6080
|
+
The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(2841, ts.DiagnosticCategory.Error, "The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841", "The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
6080
6081
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
6081
6082
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.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}'."),
|
|
6082
6083
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.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}'."),
|
|
@@ -6184,7 +6185,7 @@ var ts;
|
|
|
6184
6185
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, ts.DiagnosticCategory.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}'."),
|
|
6185
6186
|
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, ts.DiagnosticCategory.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}'?"),
|
|
6186
6187
|
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, ts.DiagnosticCategory.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'."),
|
|
6187
|
-
|
|
6188
|
+
resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4125, ts.DiagnosticCategory.Error, "resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125", "'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
6188
6189
|
The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
6189
6190
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
6190
6191
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.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}'."),
|
|
@@ -12408,6 +12409,8 @@ var ts;
|
|
|
12408
12409
|
case 218:
|
|
12409
12410
|
case 231:
|
|
12410
12411
|
return true;
|
|
12412
|
+
case 228:
|
|
12413
|
+
return !ts.isHeritageClause(node.parent);
|
|
12411
12414
|
case 161:
|
|
12412
12415
|
while (node.parent.kind === 161) {
|
|
12413
12416
|
node = node.parent;
|
|
@@ -12571,9 +12574,6 @@ var ts;
|
|
|
12571
12574
|
}
|
|
12572
12575
|
ts.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire;
|
|
12573
12576
|
function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
|
|
12574
|
-
if (node.kind === 203) {
|
|
12575
|
-
node = node.parent.parent;
|
|
12576
|
-
}
|
|
12577
12577
|
return ts.isVariableDeclaration(node) &&
|
|
12578
12578
|
!!node.initializer &&
|
|
12579
12579
|
isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, true);
|
|
@@ -15843,13 +15843,13 @@ var ts;
|
|
|
15843
15843
|
return !file.isDeclarationFile ? walkTreeForJSXTags(file) : undefined;
|
|
15844
15844
|
}
|
|
15845
15845
|
function isFileForcedToBeModuleByFormat(file) {
|
|
15846
|
-
return file.impliedNodeFormat === ts.ModuleKind.ESNext && !file.isDeclarationFile ? true : undefined;
|
|
15846
|
+
return (file.impliedNodeFormat === ts.ModuleKind.ESNext || (ts.fileExtensionIsOneOf(file.fileName, [".cjs", ".cts"]))) && !file.isDeclarationFile ? true : undefined;
|
|
15847
15847
|
}
|
|
15848
15848
|
function getSetExternalModuleIndicator(options) {
|
|
15849
15849
|
switch (getEmitModuleDetectionKind(options)) {
|
|
15850
15850
|
case ts.ModuleDetectionKind.Force:
|
|
15851
15851
|
return function (file) {
|
|
15852
|
-
file.externalModuleIndicator = !file.isDeclarationFile ||
|
|
15852
|
+
file.externalModuleIndicator = ts.isFileProbablyExternalModule(file) || !file.isDeclarationFile || undefined;
|
|
15853
15853
|
};
|
|
15854
15854
|
case ts.ModuleDetectionKind.Legacy:
|
|
15855
15855
|
return function (file) {
|
|
@@ -15905,7 +15905,8 @@ var ts;
|
|
|
15905
15905
|
}
|
|
15906
15906
|
ts.getEmitModuleResolutionKind = getEmitModuleResolutionKind;
|
|
15907
15907
|
function getEmitModuleDetectionKind(options) {
|
|
15908
|
-
return options.moduleDetection ||
|
|
15908
|
+
return options.moduleDetection ||
|
|
15909
|
+
(getEmitModuleKind(options) === ts.ModuleKind.Node16 || getEmitModuleKind(options) === ts.ModuleKind.NodeNext ? ts.ModuleDetectionKind.Force : ts.ModuleDetectionKind.Auto);
|
|
15909
15910
|
}
|
|
15910
15911
|
ts.getEmitModuleDetectionKind = getEmitModuleDetectionKind;
|
|
15911
15912
|
function hasJsonModuleEmitEnabled(options) {
|
|
@@ -23341,6 +23342,10 @@ var ts;
|
|
|
23341
23342
|
return node.kind === 267;
|
|
23342
23343
|
}
|
|
23343
23344
|
ts.isImportClause = isImportClause;
|
|
23345
|
+
function isImportTypeAssertionContainer(node) {
|
|
23346
|
+
return node.kind === 295;
|
|
23347
|
+
}
|
|
23348
|
+
ts.isImportTypeAssertionContainer = isImportTypeAssertionContainer;
|
|
23344
23349
|
function isAssertClause(node) {
|
|
23345
23350
|
return node.kind === 293;
|
|
23346
23351
|
}
|
|
@@ -34231,7 +34236,7 @@ var ts;
|
|
|
34231
34236
|
}
|
|
34232
34237
|
if (ts.isImplicitGlob(spec.substring(spec.lastIndexOf(ts.directorySeparator) + 1))) {
|
|
34233
34238
|
return {
|
|
34234
|
-
key: useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec),
|
|
34239
|
+
key: ts.removeTrailingDirectorySeparator(useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec)),
|
|
34235
34240
|
flags: 1
|
|
34236
34241
|
};
|
|
34237
34242
|
}
|
|
@@ -35164,15 +35169,19 @@ var ts;
|
|
|
35164
35169
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
35165
35170
|
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
35166
35171
|
}
|
|
35167
|
-
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
35168
|
-
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
35169
|
-
var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
|
|
35170
|
-
return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions, redirectedReference);
|
|
35171
|
-
}
|
|
35172
35172
|
var jsOnlyExtensions = [Extensions.JavaScript];
|
|
35173
35173
|
var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
|
|
35174
35174
|
var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions, true), [Extensions.Json], false);
|
|
35175
35175
|
var tsconfigExtensions = [Extensions.TSConfig];
|
|
35176
|
+
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
35177
|
+
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
35178
|
+
var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
|
|
35179
|
+
var extensions = compilerOptions.noDtsResolution ? [Extensions.TsOnly, Extensions.JavaScript] : tsExtensions;
|
|
35180
|
+
if (compilerOptions.resolveJsonModule) {
|
|
35181
|
+
extensions = __spreadArray(__spreadArray([], extensions, true), [Extensions.Json], false);
|
|
35182
|
+
}
|
|
35183
|
+
return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference);
|
|
35184
|
+
}
|
|
35176
35185
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
35177
35186
|
return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, jsOnlyExtensions, undefined);
|
|
35178
35187
|
}
|
|
@@ -35795,13 +35804,32 @@ var ts;
|
|
|
35795
35804
|
}
|
|
35796
35805
|
return toSearchResult(undefined);
|
|
35797
35806
|
}
|
|
35807
|
+
function comparePatternKeys(a, b) {
|
|
35808
|
+
var aPatternIndex = a.indexOf("*");
|
|
35809
|
+
var bPatternIndex = b.indexOf("*");
|
|
35810
|
+
var baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
|
|
35811
|
+
var baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
|
|
35812
|
+
if (baseLenA > baseLenB)
|
|
35813
|
+
return -1;
|
|
35814
|
+
if (baseLenB > baseLenA)
|
|
35815
|
+
return 1;
|
|
35816
|
+
if (aPatternIndex === -1)
|
|
35817
|
+
return 1;
|
|
35818
|
+
if (bPatternIndex === -1)
|
|
35819
|
+
return -1;
|
|
35820
|
+
if (a.length > b.length)
|
|
35821
|
+
return -1;
|
|
35822
|
+
if (b.length > a.length)
|
|
35823
|
+
return 1;
|
|
35824
|
+
return 0;
|
|
35825
|
+
}
|
|
35798
35826
|
function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
|
|
35799
35827
|
var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
|
|
35800
35828
|
if (!ts.endsWith(moduleName, ts.directorySeparator) && moduleName.indexOf("*") === -1 && ts.hasProperty(lookupTable, moduleName)) {
|
|
35801
35829
|
var target = lookupTable[moduleName];
|
|
35802
35830
|
return loadModuleFromTargetImportOrExport(target, "", false);
|
|
35803
35831
|
}
|
|
35804
|
-
var expandingKeys = ts.sort(ts.filter(ts.getOwnKeys(lookupTable), function (k) { return k.indexOf("*") !== -1 || ts.endsWith(k, "/"); }),
|
|
35832
|
+
var expandingKeys = ts.sort(ts.filter(ts.getOwnKeys(lookupTable), function (k) { return k.indexOf("*") !== -1 || ts.endsWith(k, "/"); }), comparePatternKeys);
|
|
35805
35833
|
for (var _i = 0, expandingKeys_1 = expandingKeys; _i < expandingKeys_1.length; _i++) {
|
|
35806
35834
|
var potentialTarget = expandingKeys_1[_i];
|
|
35807
35835
|
if (state.features & NodeResolutionFeatures.ExportsPatternTrailers && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
@@ -36076,8 +36104,7 @@ var ts;
|
|
|
36076
36104
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
36077
36105
|
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
|
|
36078
36106
|
if (!pathAndExtension && packageInfo
|
|
36079
|
-
&& packageInfo.packageJsonContent.exports === undefined
|
|
36080
|
-
&& packageInfo.packageJsonContent.main === undefined
|
|
36107
|
+
&& (packageInfo.packageJsonContent.exports === undefined || packageInfo.packageJsonContent.exports === null)
|
|
36081
36108
|
&& state.features & NodeResolutionFeatures.EsmMode) {
|
|
36082
36109
|
pathAndExtension = loadModuleFromFile(extensions, ts.combinePaths(candidate, "index.js"), onlyRecordFailures, state);
|
|
36083
36110
|
}
|
|
@@ -38452,12 +38479,14 @@ var ts;
|
|
|
38452
38479
|
}
|
|
38453
38480
|
}
|
|
38454
38481
|
function setCommonJsModuleIndicator(node) {
|
|
38455
|
-
if (file.externalModuleIndicator) {
|
|
38482
|
+
if (file.externalModuleIndicator && file.externalModuleIndicator !== true) {
|
|
38456
38483
|
return false;
|
|
38457
38484
|
}
|
|
38458
38485
|
if (!file.commonJsModuleIndicator) {
|
|
38459
38486
|
file.commonJsModuleIndicator = node;
|
|
38460
|
-
|
|
38487
|
+
if (!file.externalModuleIndicator) {
|
|
38488
|
+
bindSourceFileAsExternalModule();
|
|
38489
|
+
}
|
|
38461
38490
|
}
|
|
38462
38491
|
return true;
|
|
38463
38492
|
}
|
|
@@ -38810,7 +38839,11 @@ var ts;
|
|
|
38810
38839
|
checkStrictModeEvalOrArguments(node, node.name);
|
|
38811
38840
|
}
|
|
38812
38841
|
if (!ts.isBindingPattern(node.name)) {
|
|
38813
|
-
|
|
38842
|
+
var possibleVariableDecl = node.kind === 254 ? node : node.parent.parent;
|
|
38843
|
+
if (ts.isInJSFile(node) &&
|
|
38844
|
+
ts.isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) &&
|
|
38845
|
+
!ts.getJSDocTypeTag(node) &&
|
|
38846
|
+
!(ts.getCombinedModifierFlags(node) & 1)) {
|
|
38814
38847
|
declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
|
|
38815
38848
|
}
|
|
38816
38849
|
else if (ts.isBlockOrCatchScoped(node)) {
|
|
@@ -41123,7 +41156,8 @@ var ts;
|
|
|
41123
41156
|
&& isAliasableOrJsExpression(node.parent.right)
|
|
41124
41157
|
|| node.kind === 297
|
|
41125
41158
|
|| node.kind === 296 && isAliasableOrJsExpression(node.initializer)
|
|
41126
|
-
|| ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)
|
|
41159
|
+
|| node.kind === 254 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)
|
|
41160
|
+
|| node.kind === 203 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
|
|
41127
41161
|
}
|
|
41128
41162
|
function isAliasableOrJsExpression(e) {
|
|
41129
41163
|
return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
|
|
@@ -41204,7 +41238,7 @@ var ts;
|
|
|
41204
41238
|
if (!ts.isSourceFileJS(file)) {
|
|
41205
41239
|
return hasExportAssignmentSymbol(moduleSymbol);
|
|
41206
41240
|
}
|
|
41207
|
-
return
|
|
41241
|
+
return typeof file.externalModuleIndicator !== "object" && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), undefined, dontResolveAlias);
|
|
41208
41242
|
}
|
|
41209
41243
|
function getTargetOfImportClause(node, dontResolveAlias) {
|
|
41210
41244
|
var _a;
|
|
@@ -43994,6 +44028,7 @@ var ts;
|
|
|
43994
44028
|
return symbol.parent ? ts.factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
43995
44029
|
}
|
|
43996
44030
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
44031
|
+
var _a, _b, _c, _d;
|
|
43997
44032
|
var chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384));
|
|
43998
44033
|
var isTypeOf = meaning === 111551;
|
|
43999
44034
|
if (ts.some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
@@ -44009,6 +44044,7 @@ var ts;
|
|
|
44009
44044
|
assertion = ts.factory.createImportTypeAssertionContainer(ts.factory.createAssertClause(ts.factory.createNodeArray([
|
|
44010
44045
|
ts.factory.createAssertEntry(ts.factory.createStringLiteral("resolution-mode"), ts.factory.createStringLiteral("import"))
|
|
44011
44046
|
])));
|
|
44047
|
+
(_b = (_a = context.tracker).reportImportTypeNodeResolutionModeOverride) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
44012
44048
|
}
|
|
44013
44049
|
}
|
|
44014
44050
|
if (!specifier) {
|
|
@@ -44026,6 +44062,7 @@ var ts;
|
|
|
44026
44062
|
assertion = ts.factory.createImportTypeAssertionContainer(ts.factory.createAssertClause(ts.factory.createNodeArray([
|
|
44027
44063
|
ts.factory.createAssertEntry(ts.factory.createStringLiteral("resolution-mode"), ts.factory.createStringLiteral(swappedMode === ts.ModuleKind.ESNext ? "import" : "require"))
|
|
44028
44064
|
])));
|
|
44065
|
+
(_d = (_c = context.tracker).reportImportTypeNodeResolutionModeOverride) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
44029
44066
|
}
|
|
44030
44067
|
}
|
|
44031
44068
|
if (!assertion) {
|
|
@@ -48695,7 +48732,7 @@ var ts;
|
|
|
48695
48732
|
var objectType;
|
|
48696
48733
|
return !!(type.flags & 8388608 && ts.getObjectFlags(objectType = type.objectType) & 32 &&
|
|
48697
48734
|
!isGenericMappedType(objectType) && isGenericIndexType(type.indexType) &&
|
|
48698
|
-
!objectType
|
|
48735
|
+
!(getMappedTypeModifiers(objectType) & 8) && !objectType.declaration.nameType);
|
|
48699
48736
|
}
|
|
48700
48737
|
function getApparentType(type) {
|
|
48701
48738
|
var t = !(type.flags & 465829888) ? type : getBaseConstraintOfType(type) || unknownType;
|
|
@@ -67596,8 +67633,11 @@ var ts;
|
|
|
67596
67633
|
if (node.assertions) {
|
|
67597
67634
|
var override = ts.getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode);
|
|
67598
67635
|
if (override) {
|
|
67636
|
+
if (!ts.isNightly()) {
|
|
67637
|
+
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next);
|
|
67638
|
+
}
|
|
67599
67639
|
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
67600
|
-
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.
|
|
67640
|
+
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
67601
67641
|
}
|
|
67602
67642
|
}
|
|
67603
67643
|
}
|
|
@@ -68965,7 +69005,7 @@ var ts;
|
|
|
68965
69005
|
return;
|
|
68966
69006
|
}
|
|
68967
69007
|
var symbol = getSymbolOfNode(node);
|
|
68968
|
-
if (symbol.flags & 2097152 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
|
|
69008
|
+
if (symbol.flags & 2097152 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 203 ? node.parent.parent : node)) {
|
|
68969
69009
|
checkAliasSymbol(node);
|
|
68970
69010
|
return;
|
|
68971
69011
|
}
|
|
@@ -71217,10 +71257,10 @@ var ts;
|
|
|
71217
71257
|
var override = ts.getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined);
|
|
71218
71258
|
if (validForTypeAssertions && override) {
|
|
71219
71259
|
if (!ts.isNightly()) {
|
|
71220
|
-
grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.
|
|
71260
|
+
grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next);
|
|
71221
71261
|
}
|
|
71222
71262
|
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
71223
|
-
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.
|
|
71263
|
+
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
71224
71264
|
}
|
|
71225
71265
|
return;
|
|
71226
71266
|
}
|
|
@@ -88352,7 +88392,8 @@ var ts;
|
|
|
88352
88392
|
trackReferencedAmbientModule: trackReferencedAmbientModule,
|
|
88353
88393
|
trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode,
|
|
88354
88394
|
reportNonlocalAugmentation: reportNonlocalAugmentation,
|
|
88355
|
-
reportNonSerializableProperty: reportNonSerializableProperty
|
|
88395
|
+
reportNonSerializableProperty: reportNonSerializableProperty,
|
|
88396
|
+
reportImportTypeNodeResolutionModeOverride: reportImportTypeNodeResolutionModeOverride,
|
|
88356
88397
|
};
|
|
88357
88398
|
var errorNameNode;
|
|
88358
88399
|
var errorFallbackNode;
|
|
@@ -88474,6 +88515,11 @@ var ts;
|
|
|
88474
88515
|
context.addDiagnostic(ts.createDiagnosticForNode((errorNameNode || errorFallbackNode), ts.Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
|
|
88475
88516
|
}
|
|
88476
88517
|
}
|
|
88518
|
+
function reportImportTypeNodeResolutionModeOverride() {
|
|
88519
|
+
if (!ts.isNightly() && (errorNameNode || errorFallbackNode)) {
|
|
88520
|
+
context.addDiagnostic(ts.createDiagnosticForNode((errorNameNode || errorFallbackNode), ts.Diagnostics.The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
|
|
88521
|
+
}
|
|
88522
|
+
}
|
|
88477
88523
|
function transformDeclarationsForJS(sourceFile, bundled) {
|
|
88478
88524
|
var oldDiag = getSymbolAccessibilityDiagnostic;
|
|
88479
88525
|
getSymbolAccessibilityDiagnostic = function (s) { return (s.errorNode && ts.canProduceDiagnostics(s.errorNode) ? ts.createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : ({
|
|
@@ -88890,7 +88936,7 @@ var ts;
|
|
|
88890
88936
|
var mode = ts.getResolutionModeOverrideForClause(assertClause);
|
|
88891
88937
|
if (mode !== undefined) {
|
|
88892
88938
|
if (!ts.isNightly()) {
|
|
88893
|
-
context.addDiagnostic(ts.createDiagnosticForNode(assertClause, ts.Diagnostics.
|
|
88939
|
+
context.addDiagnostic(ts.createDiagnosticForNode(assertClause, ts.Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
|
|
88894
88940
|
}
|
|
88895
88941
|
return assertClause;
|
|
88896
88942
|
}
|
|
@@ -97594,7 +97640,7 @@ var ts;
|
|
|
97594
97640
|
ts.setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective);
|
|
97595
97641
|
var mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
97596
97642
|
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
97597
|
-
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.
|
|
97643
|
+
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext));
|
|
97598
97644
|
}
|
|
97599
97645
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: ts.FileIncludeKind.TypeReferenceDirective, file: file.path, index: index, });
|
|
97600
97646
|
}
|
|
@@ -102211,6 +102257,7 @@ var ts;
|
|
|
102211
102257
|
}
|
|
102212
102258
|
function reloadFileNamesFromConfigFile() {
|
|
102213
102259
|
writeLog("Reloading new file names and options");
|
|
102260
|
+
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
102214
102261
|
rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
|
|
102215
102262
|
if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
|
|
102216
102263
|
hasChangedConfigFileParsingErrors = true;
|