typescript 4.1.0-dev.20201101 → 4.1.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/lib.es5.d.ts CHANGED
@@ -1396,7 +1396,7 @@ interface ArrayConstructor {
1396
1396
  (arrayLength?: number): any[];
1397
1397
  <T>(arrayLength: number): T[];
1398
1398
  <T>(...items: T[]): T[];
1399
- isArray<T>(arg: T | {}): arg is T extends readonly any[] ? (unknown extends T ? never : readonly any[]) : any[];
1399
+ isArray(arg: any): arg is any[];
1400
1400
  readonly prototype: any[];
1401
1401
  }
1402
1402
 
package/lib/protocol.d.ts CHANGED
@@ -2569,7 +2569,9 @@ declare namespace ts.server.protocol {
2569
2569
  None = "None",
2570
2570
  Preserve = "Preserve",
2571
2571
  ReactNative = "ReactNative",
2572
- React = "React"
2572
+ React = "React",
2573
+ ReactJSX = "ReactJSX",
2574
+ ReactJSXDev = "ReactJSXDev"
2573
2575
  }
2574
2576
  const enum ModuleKind {
2575
2577
  None = "None",
@@ -2579,6 +2581,7 @@ declare namespace ts.server.protocol {
2579
2581
  System = "System",
2580
2582
  ES6 = "ES6",
2581
2583
  ES2015 = "ES2015",
2584
+ ES2020 = "ES2020",
2582
2585
  ESNext = "ESNext"
2583
2586
  }
2584
2587
  const enum ModuleResolutionKind {
@@ -2599,6 +2602,7 @@ declare namespace ts.server.protocol {
2599
2602
  ES2018 = "ES2018",
2600
2603
  ES2019 = "ES2019",
2601
2604
  ES2020 = "ES2020",
2605
+ JSON = "JSON",
2602
2606
  ESNext = "ESNext"
2603
2607
  }
2604
2608
  }
package/lib/tsc.js CHANGED
@@ -67,7 +67,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
67
67
  var ts;
68
68
  (function (ts) {
69
69
  ts.versionMajorMinor = "4.1";
70
- ts.version = ts.versionMajorMinor + ".0-dev.20201101";
70
+ ts.version = "4.1.3";
71
71
  var NativeCollections;
72
72
  (function (NativeCollections) {
73
73
  function tryGetNativeMap() {
@@ -5154,8 +5154,6 @@ var ts;
5154
5154
  Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."),
5155
5155
  Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."),
5156
5156
  _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."),
5157
- Provides_a_root_package_name_when_using_outFile_with_declarations: diag(1390, ts.DiagnosticCategory.Message, "Provides_a_root_package_name_when_using_outFile_with_declarations_1390", "Provides a root package name when using outFile with declarations."),
5158
- The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_declaration_emit: diag(1391, ts.DiagnosticCategory.Error, "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391", "The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit."),
5159
5157
  The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
5160
5158
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
5161
5159
  Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", undefined, true),
@@ -10703,6 +10701,18 @@ var ts;
10703
10701
  };
10704
10702
  }
10705
10703
  ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain;
10704
+ function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) {
10705
+ return {
10706
+ file: sourceFile,
10707
+ start: 0,
10708
+ length: 0,
10709
+ code: messageChain.code,
10710
+ category: messageChain.category,
10711
+ messageText: messageChain.next ? messageChain : messageChain.messageText,
10712
+ relatedInformation: relatedInformation
10713
+ };
10714
+ }
10715
+ ts.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain;
10706
10716
  function createDiagnosticForRange(sourceFile, range, message) {
10707
10717
  return {
10708
10718
  file: sourceFile,
@@ -13195,16 +13205,7 @@ var ts;
13195
13205
  var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory());
13196
13206
  var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, false);
13197
13207
  var extensionless = removeFileExtension(relativePath);
13198
- if (referencePath) {
13199
- return ts.ensurePathIsNonModuleName(extensionless);
13200
- }
13201
- var options = host.getCompilerOptions();
13202
- var rootPkgName = options.bundledPackageName || "";
13203
- var newPath = ts.combinePaths(rootPkgName, extensionless);
13204
- if (rootPkgName && getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs && ts.endsWith(newPath, "/index")) {
13205
- return newPath.slice(0, newPath.length - "/index".length);
13206
- }
13207
- return newPath;
13208
+ return referencePath ? ts.ensurePathIsNonModuleName(extensionless) : extensionless;
13208
13209
  }
13209
13210
  ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath;
13210
13211
  function getOwnEmitOutputFilePath(fileName, host, extension) {
@@ -29658,13 +29659,6 @@ var ts;
29658
29659
  category: ts.Diagnostics.Advanced_Options,
29659
29660
  description: ts.Diagnostics.Emit_class_fields_with_Define_instead_of_Set,
29660
29661
  },
29661
- {
29662
- name: "bundledPackageName",
29663
- type: "string",
29664
- affectsEmit: true,
29665
- category: ts.Diagnostics.Advanced_Options,
29666
- description: ts.Diagnostics.Provides_a_root_package_name_when_using_outFile_with_declarations,
29667
- },
29668
29662
  {
29669
29663
  name: "keyofStringsOnly",
29670
29664
  type: "boolean",
@@ -36021,6 +36015,14 @@ var ts;
36021
36015
  }
36022
36016
  }
36023
36017
  function errorOrSuggestion(isError, location, message, arg0, arg1, arg2, arg3) {
36018
+ if (location.pos < 0 || location.end < 0) {
36019
+ if (!isError) {
36020
+ return;
36021
+ }
36022
+ var file = ts.getSourceFileOfNode(location);
36023
+ addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message));
36024
+ return;
36025
+ }
36024
36026
  addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message));
36025
36027
  }
36026
36028
  function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) {
@@ -37351,7 +37353,7 @@ var ts;
37351
37353
  var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
37352
37354
  var name = node.propertyName || node.name;
37353
37355
  if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) {
37354
- return getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText);
37356
+ return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias);
37355
37357
  }
37356
37358
  markSymbolOfAliasDeclarationIfTypeOnly(node, undefined, resolved, false);
37357
37359
  return resolved;
@@ -38591,7 +38593,6 @@ var ts;
38591
38593
  getProjectReferenceRedirect: function (fileName) { return host.getProjectReferenceRedirect(fileName); },
38592
38594
  isSourceOfProjectReferenceRedirect: function (fileName) { return host.isSourceOfProjectReferenceRedirect(fileName); },
38593
38595
  fileExists: function (fileName) { return host.fileExists(fileName); },
38594
- getCompilerOptions: function () { return host.getCompilerOptions(); }
38595
38596
  } : undefined },
38596
38597
  encounteredError: false,
38597
38598
  visitedTypes: undefined,
@@ -39530,7 +39531,6 @@ var ts;
39530
39531
  }
39531
39532
  function getSpecifierForModuleSymbol(symbol, context) {
39532
39533
  var _a;
39533
- var _b;
39534
39534
  var file = ts.getDeclarationOfKind(symbol, 297);
39535
39535
  if (!file) {
39536
39536
  var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); });
@@ -39569,7 +39569,7 @@ var ts;
39569
39569
  var moduleResolverHost = context.tracker.moduleResolverHost;
39570
39570
  var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions;
39571
39571
  specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative", importModuleSpecifierEnding: isBundle_1 ? "minimal" : undefined }));
39572
- (_a = (_b = links).specifierCache) !== null && _a !== void 0 ? _a : (_b.specifierCache = new ts.Map());
39572
+ (_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map());
39573
39573
  links.specifierCache.set(contextFile.path, specifier);
39574
39574
  }
39575
39575
  return specifier;
@@ -39974,8 +39974,7 @@ var ts;
39974
39974
  var resolverHost = {
39975
39975
  getCanonicalFileName: getCanonicalFileName,
39976
39976
  getCurrentDirectory: function () { return context.tracker.moduleResolverHost.getCurrentDirectory(); },
39977
- getCommonSourceDirectory: function () { return context.tracker.moduleResolverHost.getCommonSourceDirectory(); },
39978
- getCompilerOptions: function () { return context.tracker.moduleResolverHost.getCompilerOptions(); }
39977
+ getCommonSourceDirectory: function () { return context.tracker.moduleResolverHost.getCommonSourceDirectory(); }
39979
39978
  };
39980
39979
  var newName = ts.getResolvedExternalModuleName(resolverHost, targetFile);
39981
39980
  return ts.factory.createStringLiteral(newName);
@@ -52613,6 +52612,7 @@ var ts;
52613
52612
  return errorType;
52614
52613
  }
52615
52614
  flowDepth++;
52615
+ var sharedFlow;
52616
52616
  while (true) {
52617
52617
  var flags = flow.flags;
52618
52618
  if (flags & 4096) {
@@ -52622,6 +52622,7 @@ var ts;
52622
52622
  return sharedFlowTypes[i];
52623
52623
  }
52624
52624
  }
52625
+ sharedFlow = flow;
52625
52626
  }
52626
52627
  var type = void 0;
52627
52628
  if (flags & 16) {
@@ -52681,8 +52682,8 @@ var ts;
52681
52682
  else {
52682
52683
  type = convertAutoToAny(declaredType);
52683
52684
  }
52684
- if (flags & 4096) {
52685
- sharedFlowNodes[sharedFlowCount] = flow;
52685
+ if (sharedFlow) {
52686
+ sharedFlowNodes[sharedFlowCount] = sharedFlow;
52686
52687
  sharedFlowTypes[sharedFlowCount] = type;
52687
52688
  sharedFlowCount++;
52688
52689
  }
@@ -55287,10 +55288,10 @@ var ts;
55287
55288
  return links.jsxNamespace;
55288
55289
  }
55289
55290
  if (!links || links.jsxNamespace !== false) {
55290
- var namespaceName = getJsxNamespace(location);
55291
- var resolvedNamespace = resolveName(location, namespaceName, 1920, undefined, namespaceName, false);
55291
+ var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location);
55292
55292
  if (!resolvedNamespace || resolvedNamespace === unknownSymbol) {
55293
- resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location);
55293
+ var namespaceName = getJsxNamespace(location);
55294
+ resolvedNamespace = resolveName(location, namespaceName, 1920, undefined, namespaceName, false);
55294
55295
  }
55295
55296
  if (resolvedNamespace) {
55296
55297
  var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920));
@@ -55458,17 +55459,19 @@ var ts;
55458
55459
  checkGrammarJsxElement(node);
55459
55460
  }
55460
55461
  checkJsxPreconditions(node);
55461
- var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 ? ts.Diagnostics.Cannot_find_name_0 : undefined;
55462
- var jsxFactoryNamespace = getJsxNamespace(node);
55463
- var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node;
55464
- var jsxFactorySym;
55465
- if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) {
55466
- jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551, jsxFactoryRefErr, jsxFactoryNamespace, true);
55467
- }
55468
- if (jsxFactorySym) {
55469
- jsxFactorySym.isReferenced = 67108863;
55470
- if (jsxFactorySym.flags & 2097152 && !getTypeOnlyAliasDeclaration(jsxFactorySym)) {
55471
- markAliasSymbolAsReferenced(jsxFactorySym);
55462
+ if (!getJsxNamespaceContainerForImplicitImport(node)) {
55463
+ var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 ? ts.Diagnostics.Cannot_find_name_0 : undefined;
55464
+ var jsxFactoryNamespace = getJsxNamespace(node);
55465
+ var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node;
55466
+ var jsxFactorySym = void 0;
55467
+ if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) {
55468
+ jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551, jsxFactoryRefErr, jsxFactoryNamespace, true);
55469
+ }
55470
+ if (jsxFactorySym) {
55471
+ jsxFactorySym.isReferenced = 67108863;
55472
+ if (jsxFactorySym.flags & 2097152 && !getTypeOnlyAliasDeclaration(jsxFactorySym)) {
55473
+ markAliasSymbolAsReferenced(jsxFactorySym);
55474
+ }
55472
55475
  }
55473
55476
  }
55474
55477
  if (isNodeOpeningLikeElement) {
@@ -57018,9 +57021,9 @@ var ts;
57018
57021
  var oldCandidatesForArgumentError = candidatesForArgumentError;
57019
57022
  var oldCandidateForArgumentArityError = candidateForArgumentArityError;
57020
57023
  var oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
57021
- var declCount = ts.length((_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol.declarations);
57022
- var isOverload = declCount > 1;
57023
- var implDecl = isOverload ? ts.find(((_b = failed.declaration) === null || _b === void 0 ? void 0 : _b.symbol.declarations) || ts.emptyArray, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined;
57024
+ var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray;
57025
+ var isOverload = failedSignatureDeclarations.length > 1;
57026
+ var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined;
57024
57027
  if (implDecl) {
57025
57028
  var candidate = getSignatureFromDeclaration(implDecl);
57026
57029
  var isSingleNonGenericCandidate_1 = !candidate.typeParameters;
@@ -87301,6 +87304,8 @@ var ts;
87301
87304
  ts.addEmitFlags(importDecl, 67108864);
87302
87305
  ts.setParent(externalHelpersModuleReference, importDecl);
87303
87306
  ts.setParent(importDecl, file);
87307
+ externalHelpersModuleReference.flags &= ~8;
87308
+ importDecl.flags &= ~8;
87304
87309
  return externalHelpersModuleReference;
87305
87310
  }
87306
87311
  function collectExternalModuleReferences(file) {
@@ -88060,9 +88065,6 @@ var ts;
88060
88065
  programDiagnostics.add(ts.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? "out" : "outFile"));
88061
88066
  }
88062
88067
  }
88063
- if (outputFile && ts.getEmitDeclarations(options) && ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs && !options.bundledPackageName) {
88064
- createDiagnosticForOptionName(ts.Diagnostics.The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_declaration_emit, options.out ? "out" : "outFile");
88065
- }
88066
88068
  if (options.resolveJsonModule) {
88067
88069
  if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs) {
88068
88070
  createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
@@ -90457,7 +90459,7 @@ var ts;
90457
90459
  function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, host, _b) {
90458
90460
  var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory;
90459
90461
  var ending = _b.ending, relativePreference = _b.relativePreference;
90460
- var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs, bundledPackageName = compilerOptions.bundledPackageName;
90462
+ var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs;
90461
90463
  var relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) ||
90462
90464
  removeExtensionAndIndexPostFix(ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions);
90463
90465
  if (!baseUrl && !paths || relativePreference === 0) {
@@ -90468,9 +90470,8 @@ var ts;
90468
90470
  if (!relativeToBaseUrl) {
90469
90471
  return relativePath;
90470
90472
  }
90471
- var bundledPkgReference = bundledPackageName ? ts.combinePaths(bundledPackageName, relativeToBaseUrl) : relativeToBaseUrl;
90472
- var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(bundledPkgReference, ending, compilerOptions);
90473
- var fromPaths = paths && tryGetModuleNameFromPaths(ts.removeFileExtension(bundledPkgReference), importRelativeToBaseUrl, paths);
90473
+ var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions);
90474
+ var fromPaths = paths && tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths);
90474
90475
  var nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths;
90475
90476
  if (!nonRelative) {
90476
90477
  return relativePath;
package/lib/tsserver.js CHANGED
@@ -79,7 +79,7 @@ var __extends = (this && this.__extends) || (function () {
79
79
  var extendStatics = function (d, b) {
80
80
  extendStatics = Object.setPrototypeOf ||
81
81
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
82
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
82
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
83
83
  return extendStatics(d, b);
84
84
  };
85
85
  return function (d, b) {
@@ -94,7 +94,7 @@ var ts;
94
94
  // If changing the text in this section, be sure to test `configurePrerelease` too.
95
95
  ts.versionMajorMinor = "4.1";
96
96
  /** The version of the TypeScript compiler release */
97
- ts.version = ts.versionMajorMinor + ".0-dev.20201101";
97
+ ts.version = "4.1.3";
98
98
  /* @internal */
99
99
  var Comparison;
100
100
  (function (Comparison) {
@@ -7797,8 +7797,6 @@ var ts;
7797
7797
  Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."),
7798
7798
  Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."),
7799
7799
  _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."),
7800
- Provides_a_root_package_name_when_using_outFile_with_declarations: diag(1390, ts.DiagnosticCategory.Message, "Provides_a_root_package_name_when_using_outFile_with_declarations_1390", "Provides a root package name when using outFile with declarations."),
7801
- The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_declaration_emit: diag(1391, ts.DiagnosticCategory.Error, "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391", "The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit."),
7802
7800
  The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
7803
7801
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
7804
7802
  Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
@@ -14047,6 +14045,18 @@ var ts;
14047
14045
  };
14048
14046
  }
14049
14047
  ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain;
14048
+ function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) {
14049
+ return {
14050
+ file: sourceFile,
14051
+ start: 0,
14052
+ length: 0,
14053
+ code: messageChain.code,
14054
+ category: messageChain.category,
14055
+ messageText: messageChain.next ? messageChain : messageChain.messageText,
14056
+ relatedInformation: relatedInformation
14057
+ };
14058
+ }
14059
+ ts.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain;
14050
14060
  function createDiagnosticForRange(sourceFile, range, message) {
14051
14061
  return {
14052
14062
  file: sourceFile,
@@ -16956,16 +16966,7 @@ var ts;
16956
16966
  var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory());
16957
16967
  var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
16958
16968
  var extensionless = removeFileExtension(relativePath);
16959
- if (referencePath) {
16960
- return ts.ensurePathIsNonModuleName(extensionless);
16961
- }
16962
- var options = host.getCompilerOptions();
16963
- var rootPkgName = options.bundledPackageName || "";
16964
- var newPath = ts.combinePaths(rootPkgName, extensionless);
16965
- if (rootPkgName && getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs && ts.endsWith(newPath, "/index")) {
16966
- return newPath.slice(0, newPath.length - "/index".length);
16967
- }
16968
- return newPath;
16969
+ return referencePath ? ts.ensurePathIsNonModuleName(extensionless) : extensionless;
16969
16970
  }
16970
16971
  ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath;
16971
16972
  function getOwnEmitOutputFilePath(fileName, host, extension) {
@@ -36547,13 +36548,6 @@ var ts;
36547
36548
  category: ts.Diagnostics.Advanced_Options,
36548
36549
  description: ts.Diagnostics.Emit_class_fields_with_Define_instead_of_Set,
36549
36550
  },
36550
- {
36551
- name: "bundledPackageName",
36552
- type: "string",
36553
- affectsEmit: true,
36554
- category: ts.Diagnostics.Advanced_Options,
36555
- description: ts.Diagnostics.Provides_a_root_package_name_when_using_outFile_with_declarations,
36556
- },
36557
36551
  {
36558
36552
  name: "keyofStringsOnly",
36559
36553
  type: "boolean",
@@ -44115,6 +44109,16 @@ var ts;
44115
44109
  }
44116
44110
  }
44117
44111
  function errorOrSuggestion(isError, location, message, arg0, arg1, arg2, arg3) {
44112
+ // Pseudo-synthesized input node
44113
+ if (location.pos < 0 || location.end < 0) {
44114
+ if (!isError) {
44115
+ return; // Drop suggestions (we have no span to suggest on)
44116
+ }
44117
+ // Issue errors globally
44118
+ var file = ts.getSourceFileOfNode(location);
44119
+ addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); // eslint-disable-line no-in-operator
44120
+ return;
44121
+ }
44118
44122
  addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); // eslint-disable-line no-in-operator
44119
44123
  }
44120
44124
  function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) {
@@ -45690,7 +45694,7 @@ var ts;
45690
45694
  var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
45691
45695
  var name = node.propertyName || node.name;
45692
45696
  if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) {
45693
- return getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText);
45697
+ return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias);
45694
45698
  }
45695
45699
  markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false);
45696
45700
  return resolved;
@@ -47117,7 +47121,6 @@ var ts;
47117
47121
  getProjectReferenceRedirect: function (fileName) { return host.getProjectReferenceRedirect(fileName); },
47118
47122
  isSourceOfProjectReferenceRedirect: function (fileName) { return host.isSourceOfProjectReferenceRedirect(fileName); },
47119
47123
  fileExists: function (fileName) { return host.fileExists(fileName); },
47120
- getCompilerOptions: function () { return host.getCompilerOptions(); }
47121
47124
  } : undefined },
47122
47125
  encounteredError: false,
47123
47126
  visitedTypes: undefined,
@@ -48110,7 +48113,6 @@ var ts;
48110
48113
  }
48111
48114
  function getSpecifierForModuleSymbol(symbol, context) {
48112
48115
  var _a;
48113
- var _b;
48114
48116
  var file = ts.getDeclarationOfKind(symbol, 297 /* SourceFile */);
48115
48117
  if (!file) {
48116
48118
  var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); });
@@ -48155,7 +48157,7 @@ var ts;
48155
48157
  var moduleResolverHost = context.tracker.moduleResolverHost;
48156
48158
  var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions;
48157
48159
  specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative", importModuleSpecifierEnding: isBundle_1 ? "minimal" : undefined }));
48158
- (_a = (_b = links).specifierCache) !== null && _a !== void 0 ? _a : (_b.specifierCache = new ts.Map());
48160
+ (_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map());
48159
48161
  links.specifierCache.set(contextFile.path, specifier);
48160
48162
  }
48161
48163
  return specifier;
@@ -48597,8 +48599,7 @@ var ts;
48597
48599
  var resolverHost = {
48598
48600
  getCanonicalFileName: getCanonicalFileName,
48599
48601
  getCurrentDirectory: function () { return context.tracker.moduleResolverHost.getCurrentDirectory(); },
48600
- getCommonSourceDirectory: function () { return context.tracker.moduleResolverHost.getCommonSourceDirectory(); },
48601
- getCompilerOptions: function () { return context.tracker.moduleResolverHost.getCompilerOptions(); }
48602
+ getCommonSourceDirectory: function () { return context.tracker.moduleResolverHost.getCommonSourceDirectory(); }
48602
48603
  };
48603
48604
  var newName = ts.getResolvedExternalModuleName(resolverHost, targetFile);
48604
48605
  return ts.factory.createStringLiteral(newName);
@@ -63122,6 +63123,7 @@ var ts;
63122
63123
  return errorType;
63123
63124
  }
63124
63125
  flowDepth++;
63126
+ var sharedFlow;
63125
63127
  while (true) {
63126
63128
  var flags = flow.flags;
63127
63129
  if (flags & 4096 /* Shared */) {
@@ -63134,6 +63136,7 @@ var ts;
63134
63136
  return sharedFlowTypes[i];
63135
63137
  }
63136
63138
  }
63139
+ sharedFlow = flow;
63137
63140
  }
63138
63141
  var type = void 0;
63139
63142
  if (flags & 16 /* Assignment */) {
@@ -63197,9 +63200,9 @@ var ts;
63197
63200
  // simply return the non-auto declared type to reduce follow-on errors.
63198
63201
  type = convertAutoToAny(declaredType);
63199
63202
  }
63200
- if (flags & 4096 /* Shared */) {
63203
+ if (sharedFlow) {
63201
63204
  // Record visited node and the associated type in the cache.
63202
- sharedFlowNodes[sharedFlowCount] = flow;
63205
+ sharedFlowNodes[sharedFlowCount] = sharedFlow;
63203
63206
  sharedFlowTypes[sharedFlowCount] = type;
63204
63207
  sharedFlowCount++;
63205
63208
  }
@@ -66327,10 +66330,10 @@ var ts;
66327
66330
  return links.jsxNamespace;
66328
66331
  }
66329
66332
  if (!links || links.jsxNamespace !== false) {
66330
- var namespaceName = getJsxNamespace(location);
66331
- var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false);
66333
+ var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location);
66332
66334
  if (!resolvedNamespace || resolvedNamespace === unknownSymbol) {
66333
- resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location);
66335
+ var namespaceName = getJsxNamespace(location);
66336
+ resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false);
66334
66337
  }
66335
66338
  if (resolvedNamespace) {
66336
66339
  var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */));
@@ -66537,23 +66540,25 @@ var ts;
66537
66540
  checkGrammarJsxElement(node);
66538
66541
  }
66539
66542
  checkJsxPreconditions(node);
66540
- // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import.
66541
- // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error.
66542
- var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined;
66543
- var jsxFactoryNamespace = getJsxNamespace(node);
66544
- var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node;
66545
- // allow null as jsxFragmentFactory
66546
- var jsxFactorySym;
66547
- if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) {
66548
- jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true);
66549
- }
66550
- if (jsxFactorySym) {
66551
- // Mark local symbol as referenced here because it might not have been marked
66552
- // if jsx emit was not jsxFactory as there wont be error being emitted
66553
- jsxFactorySym.isReferenced = 67108863 /* All */;
66554
- // If react/jsxFactory symbol is alias, mark it as refereced
66555
- if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) {
66556
- markAliasSymbolAsReferenced(jsxFactorySym);
66543
+ if (!getJsxNamespaceContainerForImplicitImport(node)) {
66544
+ // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import.
66545
+ // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error.
66546
+ var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined;
66547
+ var jsxFactoryNamespace = getJsxNamespace(node);
66548
+ var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node;
66549
+ // allow null as jsxFragmentFactory
66550
+ var jsxFactorySym = void 0;
66551
+ if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) {
66552
+ jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true);
66553
+ }
66554
+ if (jsxFactorySym) {
66555
+ // Mark local symbol as referenced here because it might not have been marked
66556
+ // if jsx emit was not jsxFactory as there wont be error being emitted
66557
+ jsxFactorySym.isReferenced = 67108863 /* All */;
66558
+ // If react/jsxFactory symbol is alias, mark it as refereced
66559
+ if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) {
66560
+ markAliasSymbolAsReferenced(jsxFactorySym);
66561
+ }
66557
66562
  }
66558
66563
  }
66559
66564
  if (isNodeOpeningLikeElement) {
@@ -68364,9 +68369,9 @@ var ts;
68364
68369
  var oldCandidatesForArgumentError = candidatesForArgumentError;
68365
68370
  var oldCandidateForArgumentArityError = candidateForArgumentArityError;
68366
68371
  var oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
68367
- var declCount = ts.length((_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol.declarations);
68368
- var isOverload = declCount > 1;
68369
- var implDecl = isOverload ? ts.find(((_b = failed.declaration) === null || _b === void 0 ? void 0 : _b.symbol.declarations) || ts.emptyArray, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined;
68372
+ var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray;
68373
+ var isOverload = failedSignatureDeclarations.length > 1;
68374
+ var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined;
68370
68375
  if (implDecl) {
68371
68376
  var candidate = getSignatureFromDeclaration(implDecl);
68372
68377
  var isSingleNonGenericCandidate_1 = !candidate.typeParameters;
@@ -106352,6 +106357,10 @@ var ts;
106352
106357
  ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */);
106353
106358
  ts.setParent(externalHelpersModuleReference, importDecl);
106354
106359
  ts.setParent(importDecl, file);
106360
+ // explicitly unset the synthesized flag on these declarations so the checker API will answer questions about them
106361
+ // (which is required to build the dependency graph for incremental emit)
106362
+ externalHelpersModuleReference.flags &= ~8 /* Synthesized */;
106363
+ importDecl.flags &= ~8 /* Synthesized */;
106355
106364
  return externalHelpersModuleReference;
106356
106365
  }
106357
106366
  function collectExternalModuleReferences(file) {
@@ -107197,10 +107206,6 @@ var ts;
107197
107206
  programDiagnostics.add(ts.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? "out" : "outFile"));
107198
107207
  }
107199
107208
  }
107200
- // Without a package name, for multiple files being bundled into a .d.ts file you basically get a file which doesn't wrk
107201
- if (outputFile && ts.getEmitDeclarations(options) && ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs && !options.bundledPackageName) {
107202
- createDiagnosticForOptionName(ts.Diagnostics.The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_declaration_emit, options.out ? "out" : "outFile");
107203
- }
107204
107209
  if (options.resolveJsonModule) {
107205
107210
  if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs) {
107206
107211
  createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
@@ -110057,7 +110062,7 @@ var ts;
110057
110062
  function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, host, _b) {
110058
110063
  var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory;
110059
110064
  var ending = _b.ending, relativePreference = _b.relativePreference;
110060
- var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs, bundledPackageName = compilerOptions.bundledPackageName;
110065
+ var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs;
110061
110066
  var relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) ||
110062
110067
  removeExtensionAndIndexPostFix(ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions);
110063
110068
  if (!baseUrl && !paths || relativePreference === 0 /* Relative */) {
@@ -110068,9 +110073,8 @@ var ts;
110068
110073
  if (!relativeToBaseUrl) {
110069
110074
  return relativePath;
110070
110075
  }
110071
- var bundledPkgReference = bundledPackageName ? ts.combinePaths(bundledPackageName, relativeToBaseUrl) : relativeToBaseUrl;
110072
- var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(bundledPkgReference, ending, compilerOptions);
110073
- var fromPaths = paths && tryGetModuleNameFromPaths(ts.removeFileExtension(bundledPkgReference), importRelativeToBaseUrl, paths);
110076
+ var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions);
110077
+ var fromPaths = paths && tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths);
110074
110078
  var nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths;
110075
110079
  if (!nonRelative) {
110076
110080
  return relativePath;
@@ -114845,8 +114849,7 @@ var ts;
114845
114849
  getSourceFiles: function () { return program.getSourceFiles(); },
114846
114850
  redirectTargetsMap: program.redirectTargetsMap,
114847
114851
  getProjectReferenceRedirect: function (fileName) { return program.getProjectReferenceRedirect(fileName); },
114848
- isSourceOfProjectReferenceRedirect: function (fileName) { return program.isSourceOfProjectReferenceRedirect(fileName); },
114849
- getCompilerOptions: function () { return program.getCompilerOptions(); }
114852
+ isSourceOfProjectReferenceRedirect: function (fileName) { return program.isSourceOfProjectReferenceRedirect(fileName); }
114850
114853
  };
114851
114854
  }
114852
114855
  ts.createModuleSpecifierResolutionHost = createModuleSpecifierResolutionHost;
@@ -146861,7 +146864,7 @@ var ts;
146861
146864
  * This is a semantic operation.
146862
146865
  */
146863
146866
  function getSignatureHelpItems(fileName, position, _a) {
146864
- var triggerReason = (_a === void 0 ? ts.emptyOptions : _a).triggerReason;
146867
+ var _b = _a === void 0 ? ts.emptyOptions : _a, triggerReason = _b.triggerReason;
146865
146868
  synchronizeHostData();
146866
146869
  var sourceFile = getValidSourceFile(fileName);
146867
146870
  return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken);
@@ -149980,6 +149983,8 @@ var ts;
149980
149983
  JsxEmit["Preserve"] = "Preserve";
149981
149984
  JsxEmit["ReactNative"] = "ReactNative";
149982
149985
  JsxEmit["React"] = "React";
149986
+ JsxEmit["ReactJSX"] = "ReactJSX";
149987
+ JsxEmit["ReactJSXDev"] = "ReactJSXDev";
149983
149988
  })(JsxEmit = protocol.JsxEmit || (protocol.JsxEmit = {}));
149984
149989
  var ModuleKind;
149985
149990
  (function (ModuleKind) {
@@ -149990,6 +149995,7 @@ var ts;
149990
149995
  ModuleKind["System"] = "System";
149991
149996
  ModuleKind["ES6"] = "ES6";
149992
149997
  ModuleKind["ES2015"] = "ES2015";
149998
+ ModuleKind["ES2020"] = "ES2020";
149993
149999
  ModuleKind["ESNext"] = "ESNext";
149994
150000
  })(ModuleKind = protocol.ModuleKind || (protocol.ModuleKind = {}));
149995
150001
  var ModuleResolutionKind;
@@ -150013,6 +150019,7 @@ var ts;
150013
150019
  ScriptTarget["ES2018"] = "ES2018";
150014
150020
  ScriptTarget["ES2019"] = "ES2019";
150015
150021
  ScriptTarget["ES2020"] = "ES2020";
150022
+ ScriptTarget["JSON"] = "JSON";
150016
150023
  ScriptTarget["ESNext"] = "ESNext";
150017
150024
  })(ScriptTarget = protocol.ScriptTarget || (protocol.ScriptTarget = {}));
150018
150025
  })(protocol = server.protocol || (server.protocol = {}));
@@ -157077,7 +157084,7 @@ var ts;
157077
157084
  };
157078
157085
  Session.prototype.getEncodedSemanticClassifications = function (args) {
157079
157086
  var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
157080
- return project.getLanguageService().getEncodedSemanticClassifications(file, args);
157087
+ return project.getLanguageService().getEncodedSemanticClassifications(file, args, args.format);
157081
157088
  };
157082
157089
  Session.prototype.getProject = function (projectFileName) {
157083
157090
  return projectFileName === undefined ? undefined : this.projectService.findProject(projectFileName);