typescript 4.6.0-dev.20211201 → 4.6.0-dev.20211205

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/typescript.js CHANGED
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211201";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211205";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -1037,7 +1037,11 @@ var ts;
1037
1037
  }
1038
1038
  return deduplicated;
1039
1039
  }
1040
- function insertSorted(array, insert, compare) {
1040
+ function createSortedArray() {
1041
+ return []; // TODO: GH#19873
1042
+ }
1043
+ ts.createSortedArray = createSortedArray;
1044
+ function insertSorted(array, insert, compare, allowDuplicates) {
1041
1045
  if (array.length === 0) {
1042
1046
  array.push(insert);
1043
1047
  return;
@@ -1046,6 +1050,9 @@ var ts;
1046
1050
  if (insertIndex < 0) {
1047
1051
  array.splice(~insertIndex, 0, insert);
1048
1052
  }
1053
+ else if (allowDuplicates) {
1054
+ array.splice(insertIndex, 0, insert);
1055
+ }
1049
1056
  }
1050
1057
  ts.insertSorted = insertSorted;
1051
1058
  function sortAndDeduplicate(array, comparer, equalityComparer) {
@@ -8411,6 +8418,7 @@ var ts;
8411
8418
  Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, ts.DiagnosticCategory.Error, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),
8412
8419
  An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."),
8413
8420
  Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."),
8421
+ Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function: diag(2311, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311", "Cannot find name '{0}'. Did you mean to write this in an async function?"),
8414
8422
  An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, ts.DiagnosticCategory.Error, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."),
8415
8423
  Type_parameter_0_has_a_circular_constraint: diag(2313, ts.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."),
8416
8424
  Generic_type_0_requires_1_type_argument_s: diag(2314, ts.DiagnosticCategory.Error, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."),
@@ -20952,6 +20960,10 @@ var ts;
20952
20960
  return text.replace(/\$/gm, "\\$");
20953
20961
  }
20954
20962
  ts.escapeSnippetText = escapeSnippetText;
20963
+ function isThisTypeParameter(type) {
20964
+ return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType);
20965
+ }
20966
+ ts.isThisTypeParameter = isThisTypeParameter;
20955
20967
  })(ts || (ts = {}));
20956
20968
  /* @internal */
20957
20969
  var ts;
@@ -38204,7 +38216,11 @@ var ts;
38204
38216
  var ts;
38205
38217
  (function (ts) {
38206
38218
  /* @internal */
38207
- ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean", defaultValueDescription: "false" };
38219
+ ts.compileOnSaveCommandLineOption = {
38220
+ name: "compileOnSave",
38221
+ type: "boolean",
38222
+ defaultValueDescription: false,
38223
+ };
38208
38224
  var jsxOptionMap = new ts.Map(ts.getEntries({
38209
38225
  "preserve": 1 /* Preserve */,
38210
38226
  "react-native": 3 /* ReactNative */,
@@ -38318,6 +38334,7 @@ var ts;
38318
38334
  })),
38319
38335
  category: ts.Diagnostics.Watch_and_Build_Modes,
38320
38336
  description: ts.Diagnostics.Specify_how_the_TypeScript_watch_mode_works,
38337
+ defaultValueDescription: ts.WatchFileKind.UseFsEvents,
38321
38338
  },
38322
38339
  {
38323
38340
  name: "watchDirectory",
@@ -38329,6 +38346,7 @@ var ts;
38329
38346
  })),
38330
38347
  category: ts.Diagnostics.Watch_and_Build_Modes,
38331
38348
  description: ts.Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality,
38349
+ defaultValueDescription: ts.WatchDirectoryKind.UseFsEvents,
38332
38350
  },
38333
38351
  {
38334
38352
  name: "fallbackPolling",
@@ -38340,13 +38358,14 @@ var ts;
38340
38358
  })),
38341
38359
  category: ts.Diagnostics.Watch_and_Build_Modes,
38342
38360
  description: ts.Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers,
38361
+ defaultValueDescription: ts.PollingWatchKind.PriorityInterval,
38343
38362
  },
38344
38363
  {
38345
38364
  name: "synchronousWatchDirectory",
38346
38365
  type: "boolean",
38347
38366
  category: ts.Diagnostics.Watch_and_Build_Modes,
38348
38367
  description: ts.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,
38349
- defaultValueDescription: "false",
38368
+ defaultValueDescription: false,
38350
38369
  },
38351
38370
  {
38352
38371
  name: "excludeDirectories",
@@ -38382,13 +38401,13 @@ var ts;
38382
38401
  showInSimplifiedHelpView: true,
38383
38402
  category: ts.Diagnostics.Command_line_Options,
38384
38403
  description: ts.Diagnostics.Print_this_message,
38385
- defaultValueDescription: "false",
38404
+ defaultValueDescription: false,
38386
38405
  },
38387
38406
  {
38388
38407
  name: "help",
38389
38408
  shortName: "?",
38390
38409
  type: "boolean",
38391
- defaultValueDescription: "false",
38410
+ defaultValueDescription: false,
38392
38411
  },
38393
38412
  {
38394
38413
  name: "watch",
@@ -38398,7 +38417,7 @@ var ts;
38398
38417
  isCommandLineOnly: true,
38399
38418
  category: ts.Diagnostics.Command_line_Options,
38400
38419
  description: ts.Diagnostics.Watch_input_files,
38401
- defaultValueDescription: "false",
38420
+ defaultValueDescription: false,
38402
38421
  },
38403
38422
  {
38404
38423
  name: "preserveWatchOutput",
@@ -38406,28 +38425,28 @@ var ts;
38406
38425
  showInSimplifiedHelpView: false,
38407
38426
  category: ts.Diagnostics.Output_Formatting,
38408
38427
  description: ts.Diagnostics.Disable_wiping_the_console_in_watch_mode,
38409
- defaultValueDescription: "false",
38428
+ defaultValueDescription: false,
38410
38429
  },
38411
38430
  {
38412
38431
  name: "listFiles",
38413
38432
  type: "boolean",
38414
38433
  category: ts.Diagnostics.Compiler_Diagnostics,
38415
38434
  description: ts.Diagnostics.Print_all_of_the_files_read_during_the_compilation,
38416
- defaultValueDescription: "false"
38435
+ defaultValueDescription: false,
38417
38436
  },
38418
38437
  {
38419
38438
  name: "explainFiles",
38420
38439
  type: "boolean",
38421
38440
  category: ts.Diagnostics.Compiler_Diagnostics,
38422
38441
  description: ts.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included,
38423
- defaultValueDescription: "false",
38442
+ defaultValueDescription: false,
38424
38443
  },
38425
38444
  {
38426
38445
  name: "listEmittedFiles",
38427
38446
  type: "boolean",
38428
38447
  category: ts.Diagnostics.Compiler_Diagnostics,
38429
38448
  description: ts.Diagnostics.Print_the_names_of_emitted_files_after_a_compilation,
38430
- defaultValueDescription: "false"
38449
+ defaultValueDescription: false,
38431
38450
  },
38432
38451
  {
38433
38452
  name: "pretty",
@@ -38435,28 +38454,28 @@ var ts;
38435
38454
  showInSimplifiedHelpView: true,
38436
38455
  category: ts.Diagnostics.Output_Formatting,
38437
38456
  description: ts.Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,
38438
- defaultValueDescription: "true"
38457
+ defaultValueDescription: true,
38439
38458
  },
38440
38459
  {
38441
38460
  name: "traceResolution",
38442
38461
  type: "boolean",
38443
38462
  category: ts.Diagnostics.Compiler_Diagnostics,
38444
38463
  description: ts.Diagnostics.Log_paths_used_during_the_moduleResolution_process,
38445
- defaultValueDescription: "false"
38464
+ defaultValueDescription: false,
38446
38465
  },
38447
38466
  {
38448
38467
  name: "diagnostics",
38449
38468
  type: "boolean",
38450
38469
  category: ts.Diagnostics.Compiler_Diagnostics,
38451
38470
  description: ts.Diagnostics.Output_compiler_performance_information_after_building,
38452
- defaultValueDescription: "false"
38471
+ defaultValueDescription: false,
38453
38472
  },
38454
38473
  {
38455
38474
  name: "extendedDiagnostics",
38456
38475
  type: "boolean",
38457
38476
  category: ts.Diagnostics.Compiler_Diagnostics,
38458
38477
  description: ts.Diagnostics.Output_more_detailed_compiler_performance_information_after_building,
38459
- defaultValueDescription: "false"
38478
+ defaultValueDescription: false,
38460
38479
  },
38461
38480
  {
38462
38481
  name: "generateCpuProfile",
@@ -38492,7 +38511,7 @@ var ts;
38492
38511
  affectsEmit: true,
38493
38512
  category: ts.Diagnostics.Watch_and_Build_Modes,
38494
38513
  description: ts.Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it,
38495
- defaultValueDescription: "false",
38514
+ defaultValueDescription: false,
38496
38515
  },
38497
38516
  {
38498
38517
  name: "locale",
@@ -38528,7 +38547,7 @@ var ts;
38528
38547
  showInSimplifiedHelpView: true,
38529
38548
  category: ts.Diagnostics.Language_and_Environment,
38530
38549
  description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
38531
- defaultValueDescription: "ES3"
38550
+ defaultValueDescription: 0 /* ES3 */,
38532
38551
  };
38533
38552
  var commandOptionsWithoutBuild = [
38534
38553
  // CommandLine only options
@@ -38538,7 +38557,7 @@ var ts;
38538
38557
  showInSimplifiedHelpView: true,
38539
38558
  category: ts.Diagnostics.Command_line_Options,
38540
38559
  description: ts.Diagnostics.Show_all_compiler_options,
38541
- defaultValueDescription: "false",
38560
+ defaultValueDescription: false,
38542
38561
  },
38543
38562
  {
38544
38563
  name: "version",
@@ -38547,7 +38566,7 @@ var ts;
38547
38566
  showInSimplifiedHelpView: true,
38548
38567
  category: ts.Diagnostics.Command_line_Options,
38549
38568
  description: ts.Diagnostics.Print_the_compiler_s_version,
38550
- defaultValueDescription: "false",
38569
+ defaultValueDescription: false,
38551
38570
  },
38552
38571
  {
38553
38572
  name: "init",
@@ -38555,7 +38574,7 @@ var ts;
38555
38574
  showInSimplifiedHelpView: true,
38556
38575
  category: ts.Diagnostics.Command_line_Options,
38557
38576
  description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,
38558
- defaultValueDescription: "false",
38577
+ defaultValueDescription: false,
38559
38578
  },
38560
38579
  {
38561
38580
  name: "project",
@@ -38574,7 +38593,7 @@ var ts;
38574
38593
  showInSimplifiedHelpView: true,
38575
38594
  category: ts.Diagnostics.Command_line_Options,
38576
38595
  description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
38577
- defaultValueDescription: "false",
38596
+ defaultValueDescription: false,
38578
38597
  },
38579
38598
  {
38580
38599
  name: "showConfig",
@@ -38583,7 +38602,7 @@ var ts;
38583
38602
  category: ts.Diagnostics.Command_line_Options,
38584
38603
  isCommandLineOnly: true,
38585
38604
  description: ts.Diagnostics.Print_the_final_configuration_instead_of_building,
38586
- defaultValueDescription: "false",
38605
+ defaultValueDescription: false,
38587
38606
  },
38588
38607
  {
38589
38608
  name: "listFilesOnly",
@@ -38593,7 +38612,7 @@ var ts;
38593
38612
  affectsEmit: true,
38594
38613
  isCommandLineOnly: true,
38595
38614
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
38596
- defaultValueDescription: "false",
38615
+ defaultValueDescription: false,
38597
38616
  },
38598
38617
  // Basic
38599
38618
  ts.targetOptionDeclaration,
@@ -38620,13 +38639,15 @@ var ts;
38620
38639
  showInSimplifiedHelpView: true,
38621
38640
  category: ts.Diagnostics.Modules,
38622
38641
  description: ts.Diagnostics.Specify_what_module_code_is_generated,
38642
+ defaultValueDescription: undefined,
38623
38643
  },
38624
38644
  {
38625
38645
  name: "lib",
38626
38646
  type: "list",
38627
38647
  element: {
38628
38648
  name: "lib",
38629
- type: ts.libMap
38649
+ type: ts.libMap,
38650
+ defaultValueDescription: undefined,
38630
38651
  },
38631
38652
  affectsProgramStructure: true,
38632
38653
  showInSimplifiedHelpView: true,
@@ -38641,7 +38662,7 @@ var ts;
38641
38662
  showInSimplifiedHelpView: true,
38642
38663
  category: ts.Diagnostics.JavaScript_Support,
38643
38664
  description: ts.Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,
38644
- defaultValueDescription: "false"
38665
+ defaultValueDescription: false,
38645
38666
  },
38646
38667
  {
38647
38668
  name: "checkJs",
@@ -38649,7 +38670,7 @@ var ts;
38649
38670
  showInSimplifiedHelpView: true,
38650
38671
  category: ts.Diagnostics.JavaScript_Support,
38651
38672
  description: ts.Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
38652
- defaultValueDescription: "false"
38673
+ defaultValueDescription: false,
38653
38674
  },
38654
38675
  {
38655
38676
  name: "jsx",
@@ -38661,7 +38682,7 @@ var ts;
38661
38682
  showInSimplifiedHelpView: true,
38662
38683
  category: ts.Diagnostics.Language_and_Environment,
38663
38684
  description: ts.Diagnostics.Specify_what_JSX_code_is_generated,
38664
- defaultValueDescription: "undefined"
38685
+ defaultValueDescription: undefined,
38665
38686
  },
38666
38687
  {
38667
38688
  name: "declaration",
@@ -38681,7 +38702,7 @@ var ts;
38681
38702
  showInSimplifiedHelpView: true,
38682
38703
  category: ts.Diagnostics.Emit,
38683
38704
  transpileOptionValue: undefined,
38684
- defaultValueDescription: "false",
38705
+ defaultValueDescription: false,
38685
38706
  description: ts.Diagnostics.Create_sourcemaps_for_d_ts_files
38686
38707
  },
38687
38708
  {
@@ -38692,7 +38713,7 @@ var ts;
38692
38713
  category: ts.Diagnostics.Emit,
38693
38714
  description: ts.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
38694
38715
  transpileOptionValue: undefined,
38695
- defaultValueDescription: "false",
38716
+ defaultValueDescription: false,
38696
38717
  },
38697
38718
  {
38698
38719
  name: "sourceMap",
@@ -38700,7 +38721,7 @@ var ts;
38700
38721
  affectsEmit: true,
38701
38722
  showInSimplifiedHelpView: true,
38702
38723
  category: ts.Diagnostics.Emit,
38703
- defaultValueDescription: "false",
38724
+ defaultValueDescription: false,
38704
38725
  description: ts.Diagnostics.Create_source_map_files_for_emitted_JavaScript_files,
38705
38726
  },
38706
38727
  {
@@ -38741,7 +38762,7 @@ var ts;
38741
38762
  isTSConfigOnly: true,
38742
38763
  category: ts.Diagnostics.Projects,
38743
38764
  transpileOptionValue: undefined,
38744
- defaultValueDescription: "false",
38765
+ defaultValueDescription: false,
38745
38766
  description: ts.Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references,
38746
38767
  },
38747
38768
  {
@@ -38761,7 +38782,7 @@ var ts;
38761
38782
  affectsEmit: true,
38762
38783
  showInSimplifiedHelpView: true,
38763
38784
  category: ts.Diagnostics.Emit,
38764
- defaultValueDescription: "false",
38785
+ defaultValueDescription: false,
38765
38786
  description: ts.Diagnostics.Disable_emitting_comments,
38766
38787
  },
38767
38788
  {
@@ -38771,7 +38792,7 @@ var ts;
38771
38792
  category: ts.Diagnostics.Emit,
38772
38793
  description: ts.Diagnostics.Disable_emitting_files_from_a_compilation,
38773
38794
  transpileOptionValue: undefined,
38774
- defaultValueDescription: "false"
38795
+ defaultValueDescription: false,
38775
38796
  },
38776
38797
  {
38777
38798
  name: "importHelpers",
@@ -38779,7 +38800,7 @@ var ts;
38779
38800
  affectsEmit: true,
38780
38801
  category: ts.Diagnostics.Emit,
38781
38802
  description: ts.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
38782
- defaultValueDescription: "false"
38803
+ defaultValueDescription: false,
38783
38804
  },
38784
38805
  {
38785
38806
  name: "importsNotUsedAsValues",
@@ -38791,7 +38812,8 @@ var ts;
38791
38812
  affectsEmit: true,
38792
38813
  affectsSemanticDiagnostics: true,
38793
38814
  category: ts.Diagnostics.Emit,
38794
- description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types
38815
+ description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,
38816
+ defaultValueDescription: 0 /* Remove */,
38795
38817
  },
38796
38818
  {
38797
38819
  name: "downlevelIteration",
@@ -38799,7 +38821,7 @@ var ts;
38799
38821
  affectsEmit: true,
38800
38822
  category: ts.Diagnostics.Emit,
38801
38823
  description: ts.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
38802
- defaultValueDescription: "false"
38824
+ defaultValueDescription: false,
38803
38825
  },
38804
38826
  {
38805
38827
  name: "isolatedModules",
@@ -38807,7 +38829,7 @@ var ts;
38807
38829
  category: ts.Diagnostics.Interop_Constraints,
38808
38830
  description: ts.Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports,
38809
38831
  transpileOptionValue: true,
38810
- defaultValueDescription: "false"
38832
+ defaultValueDescription: false,
38811
38833
  },
38812
38834
  // Strict Type Checks
38813
38835
  {
@@ -38818,7 +38840,7 @@ var ts;
38818
38840
  showInSimplifiedHelpView: true,
38819
38841
  category: ts.Diagnostics.Type_Checking,
38820
38842
  description: ts.Diagnostics.Enable_all_strict_type_checking_options,
38821
- defaultValueDescription: "false"
38843
+ defaultValueDescription: false,
38822
38844
  },
38823
38845
  {
38824
38846
  name: "noImplicitAny",
@@ -38879,7 +38901,7 @@ var ts;
38879
38901
  strictFlag: true,
38880
38902
  category: ts.Diagnostics.Type_Checking,
38881
38903
  description: ts.Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any,
38882
- defaultValueDescription: "false",
38904
+ defaultValueDescription: false,
38883
38905
  },
38884
38906
  {
38885
38907
  name: "alwaysStrict",
@@ -38897,7 +38919,7 @@ var ts;
38897
38919
  affectsSemanticDiagnostics: true,
38898
38920
  category: ts.Diagnostics.Type_Checking,
38899
38921
  description: ts.Diagnostics.Enable_error_reporting_when_a_local_variables_aren_t_read,
38900
- defaultValueDescription: "false"
38922
+ defaultValueDescription: false,
38901
38923
  },
38902
38924
  {
38903
38925
  name: "noUnusedParameters",
@@ -38905,7 +38927,7 @@ var ts;
38905
38927
  affectsSemanticDiagnostics: true,
38906
38928
  category: ts.Diagnostics.Type_Checking,
38907
38929
  description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
38908
- defaultValueDescription: "false"
38930
+ defaultValueDescription: false,
38909
38931
  },
38910
38932
  {
38911
38933
  name: "exactOptionalPropertyTypes",
@@ -38913,7 +38935,7 @@ var ts;
38913
38935
  affectsSemanticDiagnostics: true,
38914
38936
  category: ts.Diagnostics.Type_Checking,
38915
38937
  description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
38916
- defaultValueDescription: "false",
38938
+ defaultValueDescription: false,
38917
38939
  },
38918
38940
  {
38919
38941
  name: "noImplicitReturns",
@@ -38921,7 +38943,7 @@ var ts;
38921
38943
  affectsSemanticDiagnostics: true,
38922
38944
  category: ts.Diagnostics.Type_Checking,
38923
38945
  description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
38924
- defaultValueDescription: "false"
38946
+ defaultValueDescription: false,
38925
38947
  },
38926
38948
  {
38927
38949
  name: "noFallthroughCasesInSwitch",
@@ -38930,7 +38952,7 @@ var ts;
38930
38952
  affectsSemanticDiagnostics: true,
38931
38953
  category: ts.Diagnostics.Type_Checking,
38932
38954
  description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
38933
- defaultValueDescription: "false",
38955
+ defaultValueDescription: false,
38934
38956
  },
38935
38957
  {
38936
38958
  name: "noUncheckedIndexedAccess",
@@ -38938,7 +38960,7 @@ var ts;
38938
38960
  affectsSemanticDiagnostics: true,
38939
38961
  category: ts.Diagnostics.Type_Checking,
38940
38962
  description: ts.Diagnostics.Include_undefined_in_index_signature_results,
38941
- defaultValueDescription: "false",
38963
+ defaultValueDescription: false,
38942
38964
  },
38943
38965
  {
38944
38966
  name: "noImplicitOverride",
@@ -38946,7 +38968,7 @@ var ts;
38946
38968
  affectsSemanticDiagnostics: true,
38947
38969
  category: ts.Diagnostics.Type_Checking,
38948
38970
  description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
38949
- defaultValueDescription: "false",
38971
+ defaultValueDescription: false,
38950
38972
  },
38951
38973
  {
38952
38974
  name: "noPropertyAccessFromIndexSignature",
@@ -38954,7 +38976,7 @@ var ts;
38954
38976
  showInSimplifiedHelpView: false,
38955
38977
  category: ts.Diagnostics.Type_Checking,
38956
38978
  description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
38957
- defaultValueDescription: "false"
38979
+ defaultValueDescription: false,
38958
38980
  },
38959
38981
  // Module Resolution
38960
38982
  {
@@ -39048,14 +39070,14 @@ var ts;
39048
39070
  showInSimplifiedHelpView: true,
39049
39071
  category: ts.Diagnostics.Interop_Constraints,
39050
39072
  description: ts.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
39051
- defaultValueDescription: "false"
39073
+ defaultValueDescription: false,
39052
39074
  },
39053
39075
  {
39054
39076
  name: "preserveSymlinks",
39055
39077
  type: "boolean",
39056
39078
  category: ts.Diagnostics.Interop_Constraints,
39057
39079
  description: ts.Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,
39058
- defaultValueDescription: "false",
39080
+ defaultValueDescription: false,
39059
39081
  },
39060
39082
  {
39061
39083
  name: "allowUmdGlobalAccess",
@@ -39063,7 +39085,7 @@ var ts;
39063
39085
  affectsSemanticDiagnostics: true,
39064
39086
  category: ts.Diagnostics.Modules,
39065
39087
  description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
39066
- defaultValueDescription: "false"
39088
+ defaultValueDescription: false,
39067
39089
  },
39068
39090
  // Source Maps
39069
39091
  {
@@ -39088,7 +39110,7 @@ var ts;
39088
39110
  affectsEmit: true,
39089
39111
  category: ts.Diagnostics.Emit,
39090
39112
  description: ts.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
39091
- defaultValueDescription: "false"
39113
+ defaultValueDescription: false,
39092
39114
  },
39093
39115
  {
39094
39116
  name: "inlineSources",
@@ -39096,7 +39118,7 @@ var ts;
39096
39118
  affectsEmit: true,
39097
39119
  category: ts.Diagnostics.Emit,
39098
39120
  description: ts.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
39099
- defaultValueDescription: "false"
39121
+ defaultValueDescription: false,
39100
39122
  },
39101
39123
  // Experimental
39102
39124
  {
@@ -39105,7 +39127,7 @@ var ts;
39105
39127
  affectsSemanticDiagnostics: true,
39106
39128
  category: ts.Diagnostics.Language_and_Environment,
39107
39129
  description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
39108
- defaultValueDescription: "false",
39130
+ defaultValueDescription: false,
39109
39131
  },
39110
39132
  {
39111
39133
  name: "emitDecoratorMetadata",
@@ -39114,7 +39136,7 @@ var ts;
39114
39136
  affectsEmit: true,
39115
39137
  category: ts.Diagnostics.Language_and_Environment,
39116
39138
  description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
39117
- defaultValueDescription: "false",
39139
+ defaultValueDescription: false,
39118
39140
  },
39119
39141
  // Advanced
39120
39142
  {
@@ -39146,7 +39168,7 @@ var ts;
39146
39168
  affectsModuleResolution: true,
39147
39169
  category: ts.Diagnostics.Modules,
39148
39170
  description: ts.Diagnostics.Enable_importing_json_files,
39149
- defaultValueDescription: "false"
39171
+ defaultValueDescription: false,
39150
39172
  },
39151
39173
  {
39152
39174
  name: "out",
@@ -39172,7 +39194,7 @@ var ts;
39172
39194
  type: "boolean",
39173
39195
  category: ts.Diagnostics.Completeness,
39174
39196
  description: ts.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
39175
- defaultValueDescription: "false",
39197
+ defaultValueDescription: false,
39176
39198
  },
39177
39199
  {
39178
39200
  name: "charset",
@@ -39187,7 +39209,7 @@ var ts;
39187
39209
  affectsEmit: true,
39188
39210
  category: ts.Diagnostics.Emit,
39189
39211
  description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
39190
- defaultValueDescription: "false"
39212
+ defaultValueDescription: false,
39191
39213
  },
39192
39214
  {
39193
39215
  name: "newLine",
@@ -39207,7 +39229,7 @@ var ts;
39207
39229
  affectsSemanticDiagnostics: true,
39208
39230
  category: ts.Diagnostics.Output_Formatting,
39209
39231
  description: ts.Diagnostics.Disable_truncating_types_in_error_messages,
39210
- defaultValueDescription: "false"
39232
+ defaultValueDescription: false,
39211
39233
  },
39212
39234
  {
39213
39235
  name: "noLib",
@@ -39218,7 +39240,7 @@ var ts;
39218
39240
  // We are not returning a sourceFile for lib file when asked by the program,
39219
39241
  // so pass --noLib to avoid reporting a file not found error.
39220
39242
  transpileOptionValue: true,
39221
- defaultValueDescription: "false"
39243
+ defaultValueDescription: false,
39222
39244
  },
39223
39245
  {
39224
39246
  name: "noResolve",
@@ -39229,7 +39251,7 @@ var ts;
39229
39251
  // We are not doing a full typecheck, we are not resolving the whole context,
39230
39252
  // so pass --noResolve to avoid reporting missing file errors.
39231
39253
  transpileOptionValue: true,
39232
- defaultValueDescription: "false"
39254
+ defaultValueDescription: false,
39233
39255
  },
39234
39256
  {
39235
39257
  name: "stripInternal",
@@ -39237,7 +39259,7 @@ var ts;
39237
39259
  affectsEmit: true,
39238
39260
  category: ts.Diagnostics.Emit,
39239
39261
  description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
39240
- defaultValueDescription: "false",
39262
+ defaultValueDescription: false,
39241
39263
  },
39242
39264
  {
39243
39265
  name: "disableSizeLimit",
@@ -39245,7 +39267,7 @@ var ts;
39245
39267
  affectsProgramStructure: true,
39246
39268
  category: ts.Diagnostics.Editor_Support,
39247
39269
  description: ts.Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server,
39248
- defaultValueDescription: "false"
39270
+ defaultValueDescription: false,
39249
39271
  },
39250
39272
  {
39251
39273
  name: "disableSourceOfProjectReferenceRedirect",
@@ -39253,7 +39275,7 @@ var ts;
39253
39275
  isTSConfigOnly: true,
39254
39276
  category: ts.Diagnostics.Projects,
39255
39277
  description: ts.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,
39256
- defaultValueDescription: "false",
39278
+ defaultValueDescription: false,
39257
39279
  },
39258
39280
  {
39259
39281
  name: "disableSolutionSearching",
@@ -39261,7 +39283,7 @@ var ts;
39261
39283
  isTSConfigOnly: true,
39262
39284
  category: ts.Diagnostics.Projects,
39263
39285
  description: ts.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing,
39264
- defaultValueDescription: "false",
39286
+ defaultValueDescription: false,
39265
39287
  },
39266
39288
  {
39267
39289
  name: "disableReferencedProjectLoad",
@@ -39269,7 +39291,7 @@ var ts;
39269
39291
  isTSConfigOnly: true,
39270
39292
  category: ts.Diagnostics.Projects,
39271
39293
  description: ts.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,
39272
- defaultValueDescription: "false",
39294
+ defaultValueDescription: false,
39273
39295
  },
39274
39296
  {
39275
39297
  name: "noImplicitUseStrict",
@@ -39277,7 +39299,7 @@ var ts;
39277
39299
  affectsSemanticDiagnostics: true,
39278
39300
  category: ts.Diagnostics.Backwards_Compatibility,
39279
39301
  description: ts.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
39280
- defaultValueDescription: "false"
39302
+ defaultValueDescription: false,
39281
39303
  },
39282
39304
  {
39283
39305
  name: "noEmitHelpers",
@@ -39285,7 +39307,7 @@ var ts;
39285
39307
  affectsEmit: true,
39286
39308
  category: ts.Diagnostics.Emit,
39287
39309
  description: ts.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
39288
- defaultValueDescription: "false"
39310
+ defaultValueDescription: false,
39289
39311
  },
39290
39312
  {
39291
39313
  name: "noEmitOnError",
@@ -39294,7 +39316,7 @@ var ts;
39294
39316
  category: ts.Diagnostics.Emit,
39295
39317
  transpileOptionValue: undefined,
39296
39318
  description: ts.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
39297
- defaultValueDescription: "false"
39319
+ defaultValueDescription: false,
39298
39320
  },
39299
39321
  {
39300
39322
  name: "preserveConstEnums",
@@ -39302,7 +39324,7 @@ var ts;
39302
39324
  affectsEmit: true,
39303
39325
  category: ts.Diagnostics.Emit,
39304
39326
  description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
39305
- defaultValueDescription: "false",
39327
+ defaultValueDescription: false,
39306
39328
  },
39307
39329
  {
39308
39330
  name: "declarationDir",
@@ -39319,7 +39341,7 @@ var ts;
39319
39341
  type: "boolean",
39320
39342
  category: ts.Diagnostics.Completeness,
39321
39343
  description: ts.Diagnostics.Skip_type_checking_all_d_ts_files,
39322
- defaultValueDescription: "false"
39344
+ defaultValueDescription: false,
39323
39345
  },
39324
39346
  {
39325
39347
  name: "allowUnusedLabels",
@@ -39328,7 +39350,7 @@ var ts;
39328
39350
  affectsSemanticDiagnostics: true,
39329
39351
  category: ts.Diagnostics.Type_Checking,
39330
39352
  description: ts.Diagnostics.Disable_error_reporting_for_unused_labels,
39331
- defaultValueDescription: "undefined"
39353
+ defaultValueDescription: undefined,
39332
39354
  },
39333
39355
  {
39334
39356
  name: "allowUnreachableCode",
@@ -39337,7 +39359,7 @@ var ts;
39337
39359
  affectsSemanticDiagnostics: true,
39338
39360
  category: ts.Diagnostics.Type_Checking,
39339
39361
  description: ts.Diagnostics.Disable_error_reporting_for_unreachable_code,
39340
- defaultValueDescription: "undefined"
39362
+ defaultValueDescription: undefined,
39341
39363
  },
39342
39364
  {
39343
39365
  name: "suppressExcessPropertyErrors",
@@ -39345,7 +39367,7 @@ var ts;
39345
39367
  affectsSemanticDiagnostics: true,
39346
39368
  category: ts.Diagnostics.Backwards_Compatibility,
39347
39369
  description: ts.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
39348
- defaultValueDescription: "false"
39370
+ defaultValueDescription: false,
39349
39371
  },
39350
39372
  {
39351
39373
  name: "suppressImplicitAnyIndexErrors",
@@ -39353,7 +39375,7 @@ var ts;
39353
39375
  affectsSemanticDiagnostics: true,
39354
39376
  category: ts.Diagnostics.Backwards_Compatibility,
39355
39377
  description: ts.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
39356
- defaultValueDescription: "false"
39378
+ defaultValueDescription: false,
39357
39379
  },
39358
39380
  {
39359
39381
  name: "forceConsistentCasingInFileNames",
@@ -39361,7 +39383,7 @@ var ts;
39361
39383
  affectsModuleResolution: true,
39362
39384
  category: ts.Diagnostics.Interop_Constraints,
39363
39385
  description: ts.Diagnostics.Ensure_that_casing_is_correct_in_imports,
39364
- defaultValueDescription: "false"
39386
+ defaultValueDescription: false,
39365
39387
  },
39366
39388
  {
39367
39389
  name: "maxNodeModuleJsDepth",
@@ -39369,7 +39391,7 @@ var ts;
39369
39391
  affectsModuleResolution: true,
39370
39392
  category: ts.Diagnostics.JavaScript_Support,
39371
39393
  description: ts.Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs,
39372
- defaultValueDescription: "0"
39394
+ defaultValueDescription: 0,
39373
39395
  },
39374
39396
  {
39375
39397
  name: "noStrictGenericChecks",
@@ -39377,7 +39399,7 @@ var ts;
39377
39399
  affectsSemanticDiagnostics: true,
39378
39400
  category: ts.Diagnostics.Backwards_Compatibility,
39379
39401
  description: ts.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
39380
- defaultValueDescription: "false"
39402
+ defaultValueDescription: false,
39381
39403
  },
39382
39404
  {
39383
39405
  name: "useDefineForClassFields",
@@ -39394,14 +39416,14 @@ var ts;
39394
39416
  affectsEmit: true,
39395
39417
  category: ts.Diagnostics.Emit,
39396
39418
  description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
39397
- defaultValueDescription: "false",
39419
+ defaultValueDescription: false,
39398
39420
  },
39399
39421
  {
39400
39422
  name: "keyofStringsOnly",
39401
39423
  type: "boolean",
39402
39424
  category: ts.Diagnostics.Backwards_Compatibility,
39403
39425
  description: ts.Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option,
39404
- defaultValueDescription: "false"
39426
+ defaultValueDescription: false,
39405
39427
  },
39406
39428
  {
39407
39429
  // A list of plugins to load in the language service
@@ -39443,7 +39465,7 @@ var ts;
39443
39465
  category: ts.Diagnostics.Command_line_Options,
39444
39466
  description: ts.Diagnostics.Enable_verbose_logging,
39445
39467
  type: "boolean",
39446
- defaultValueDescription: "false",
39468
+ defaultValueDescription: false,
39447
39469
  },
39448
39470
  {
39449
39471
  name: "dry",
@@ -39451,7 +39473,7 @@ var ts;
39451
39473
  category: ts.Diagnostics.Command_line_Options,
39452
39474
  description: ts.Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean,
39453
39475
  type: "boolean",
39454
- defaultValueDescription: "false",
39476
+ defaultValueDescription: false,
39455
39477
  },
39456
39478
  {
39457
39479
  name: "force",
@@ -39459,14 +39481,14 @@ var ts;
39459
39481
  category: ts.Diagnostics.Command_line_Options,
39460
39482
  description: ts.Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date,
39461
39483
  type: "boolean",
39462
- defaultValueDescription: "false",
39484
+ defaultValueDescription: false,
39463
39485
  },
39464
39486
  {
39465
39487
  name: "clean",
39466
39488
  category: ts.Diagnostics.Command_line_Options,
39467
39489
  description: ts.Diagnostics.Delete_the_outputs_of_all_projects,
39468
39490
  type: "boolean",
39469
- defaultValueDescription: "false",
39491
+ defaultValueDescription: false,
39470
39492
  }
39471
39493
  ];
39472
39494
  /* @internal */
@@ -39479,12 +39501,12 @@ var ts;
39479
39501
  */
39480
39502
  name: "enableAutoDiscovery",
39481
39503
  type: "boolean",
39482
- defaultValueDescription: "false",
39504
+ defaultValueDescription: false,
39483
39505
  },
39484
39506
  {
39485
39507
  name: "enable",
39486
39508
  type: "boolean",
39487
- defaultValueDescription: "false",
39509
+ defaultValueDescription: false,
39488
39510
  },
39489
39511
  {
39490
39512
  name: "include",
@@ -39505,7 +39527,7 @@ var ts;
39505
39527
  {
39506
39528
  name: "disableFilenameBasedTypeAcquisition",
39507
39529
  type: "boolean",
39508
- defaultValueDescription: "false",
39530
+ defaultValueDescription: false,
39509
39531
  },
39510
39532
  ];
39511
39533
  /*@internal*/
@@ -41637,7 +41659,10 @@ var ts;
41637
41659
  }
41638
41660
  }
41639
41661
  var failedLookupLocations = [];
41640
- var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.AllFeatures, conditions: ["node", "require", "types"] };
41662
+ var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
41663
+ ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
41664
+ NodeResolutionFeatures.None;
41665
+ var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
41641
41666
  var resolved = primaryLookup();
41642
41667
  var primary = true;
41643
41668
  if (!resolved) {
@@ -42312,13 +42337,15 @@ var ts;
42312
42337
  // not currently backported to node 12 - https://github.com/nodejs/Release/issues/690
42313
42338
  NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
42314
42339
  NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
42340
+ NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default";
42341
+ NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
42315
42342
  NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
42316
42343
  })(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
42317
42344
  function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
42318
- return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Imports | NodeResolutionFeatures.SelfName | NodeResolutionFeatures.Exports, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42345
+ return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42319
42346
  }
42320
42347
  function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
42321
- return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.AllFeatures, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42348
+ return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42322
42349
  }
42323
42350
  function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
42324
42351
  var containingDirectory = ts.getDirectoryPath(containingFile);
@@ -47024,6 +47051,7 @@ var ts;
47024
47051
  getIndexInfosOfType: getIndexInfosOfType,
47025
47052
  getSignaturesOfType: getSignaturesOfType,
47026
47053
  getIndexTypeOfType: function (type, kind) { return getIndexTypeOfType(type, kind === 0 /* String */ ? stringType : numberType); },
47054
+ getIndexType: function (type) { return getIndexType(type); },
47027
47055
  getBaseTypes: getBaseTypes,
47028
47056
  getBaseTypeOfLiteralType: getBaseTypeOfLiteralType,
47029
47057
  getWidenedType: getWidenedType,
@@ -48281,11 +48309,12 @@ var ts;
48281
48309
  *
48282
48310
  * @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters.
48283
48311
  */
48284
- function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) {
48312
+ function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions) {
48285
48313
  if (excludeGlobals === void 0) { excludeGlobals = false; }
48286
- return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol);
48314
+ if (getSpellingSuggstions === void 0) { getSpellingSuggstions = true; }
48315
+ return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions, getSymbol);
48287
48316
  }
48288
- function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) {
48317
+ function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) {
48289
48318
  var _a, _b, _c;
48290
48319
  var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location
48291
48320
  var result;
@@ -48602,7 +48631,7 @@ var ts;
48602
48631
  }
48603
48632
  }
48604
48633
  if (!result) {
48605
- if (nameNotFoundMessage) {
48634
+ if (nameNotFoundMessage && produceDiagnostics) {
48606
48635
  if (!errorLocation ||
48607
48636
  !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && // TODO: GH#18217
48608
48637
  !checkAndReportErrorForExtendingInterface(errorLocation) &&
@@ -48612,7 +48641,7 @@ var ts;
48612
48641
  !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
48613
48642
  !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
48614
48643
  var suggestion = void 0;
48615
- if (suggestionCount < maximumSuggestionCount) {
48644
+ if (getSpellingSuggestions && suggestionCount < maximumSuggestionCount) {
48616
48645
  suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);
48617
48646
  var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);
48618
48647
  if (isGlobalScopeAugmentationDeclaration) {
@@ -48648,7 +48677,7 @@ var ts;
48648
48677
  return undefined;
48649
48678
  }
48650
48679
  // Perform extra checks only if error reporting was requested
48651
- if (nameNotFoundMessage) {
48680
+ if (nameNotFoundMessage && produceDiagnostics) {
48652
48681
  if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields)) {
48653
48682
  // We have a match, but the reference occurred within a property initializer and the identifier also binds
48654
48683
  // to a local variable in the constructor where the code will be emitted. Note that this is actually allowed
@@ -51124,7 +51153,7 @@ var ts;
51124
51153
  context.approximateLength += 6;
51125
51154
  return ts.factory.createKeywordTypeNode(147 /* ObjectKeyword */);
51126
51155
  }
51127
- if (isThisTypeParameter(type)) {
51156
+ if (ts.isThisTypeParameter(type)) {
51128
51157
  if (context.flags & 4194304 /* InObjectTypeLiteral */) {
51129
51158
  if (!context.encounteredError && !(context.flags & 32768 /* AllowThisInObjectLiteral */)) {
51130
51159
  context.encounteredError = true;
@@ -59069,7 +59098,7 @@ var ts;
59069
59098
  }
59070
59099
  function getGlobalSymbol(name, meaning, diagnostic) {
59071
59100
  // Don't track references for global symbols anyway, so value if `isReference` is arbitrary
59072
- return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false);
59101
+ return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ false);
59073
59102
  }
59074
59103
  function getGlobalType(name, arity, reportErrors) {
59075
59104
  var symbol = getGlobalTypeSymbol(name, reportErrors);
@@ -60648,9 +60677,6 @@ var ts;
60648
60677
  return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 8388608 /* IsGenericObjectType */ : 0) |
60649
60678
  (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 16777216 /* IsGenericIndexType */ : 0);
60650
60679
  }
60651
- function isThisTypeParameter(type) {
60652
- return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType);
60653
- }
60654
60680
  function getSimplifiedType(type, writing) {
60655
60681
  return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) :
60656
60682
  type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) :
@@ -65848,7 +65874,7 @@ var ts;
65848
65874
  // flags for the string, number, boolean, "", 0, false, void, undefined, or null types respectively. Returns
65849
65875
  // no flags for all other types (including non-falsy literal types).
65850
65876
  function getFalsyFlags(type) {
65851
- return type.flags & 1048576 /* Union */ ? getFalsyFlagsOfTypes(type.types) :
65877
+ return type.flags & 3145728 /* UnionOrIntersection */ ? getFalsyFlagsOfTypes(type.types) :
65852
65878
  type.flags & 128 /* StringLiteral */ ? type.value === "" ? 128 /* StringLiteral */ : 0 :
65853
65879
  type.flags & 256 /* NumberLiteral */ ? type.value === 0 ? 256 /* NumberLiteral */ : 0 :
65854
65880
  type.flags & 2048 /* BigIntLiteral */ ? isZeroBigInt(type) ? 2048 /* BigIntLiteral */ : 0 :
@@ -67464,6 +67490,11 @@ var ts;
67464
67490
  case "BigInt64Array":
67465
67491
  case "BigUint64Array":
67466
67492
  return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later;
67493
+ case "await":
67494
+ if (ts.isCallExpression(node.parent)) {
67495
+ return ts.Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function;
67496
+ }
67497
+ // falls through
67467
67498
  default:
67468
67499
  if (node.parent.kind === 295 /* ShorthandPropertyAssignment */) {
67469
67500
  return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
@@ -69021,7 +69052,7 @@ var ts;
69021
69052
  function narrowByInKeyword(type, name, assumeTrue) {
69022
69053
  if (type.flags & 1048576 /* Union */
69023
69054
  || type.flags & 524288 /* Object */ && declaredType !== type
69024
- || isThisTypeParameter(type)
69055
+ || ts.isThisTypeParameter(type)
69025
69056
  || type.flags & 2097152 /* Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
69026
69057
  return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
69027
69058
  }
@@ -71841,15 +71872,9 @@ var ts;
71841
71872
  }
71842
71873
  }
71843
71874
  function isValidSpreadType(type) {
71844
- if (type.flags & 465829888 /* Instantiable */) {
71845
- var constraint = getBaseConstraintOfType(type);
71846
- if (constraint !== undefined) {
71847
- return isValidSpreadType(constraint);
71848
- }
71849
- }
71850
- return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) ||
71851
- getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) ||
71852
- type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType));
71875
+ var t = removeDefinitelyFalsyTypes(mapType(type, getBaseConstraintOrType));
71876
+ return !!(t.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) ||
71877
+ t.flags & 3145728 /* UnionOrIntersection */ && ts.every(t.types, isValidSpreadType));
71853
71878
  }
71854
71879
  function checkJsxSelfClosingElementDeferred(node) {
71855
71880
  checkJsxOpeningLikeElementOrOpeningFragment(node);
@@ -72800,7 +72825,7 @@ var ts;
72800
72825
  }
72801
72826
  var propType;
72802
72827
  if (!prop) {
72803
- var indexInfo = !ts.isPrivateIdentifier(right) && (assignmentKind === 0 /* None */ || !isGenericObjectType(leftType) || isThisTypeParameter(leftType)) ?
72828
+ var indexInfo = !ts.isPrivateIdentifier(right) && (assignmentKind === 0 /* None */ || !isGenericObjectType(leftType) || ts.isThisTypeParameter(leftType)) ?
72804
72829
  getApplicableIndexInfoForName(apparentType, right.escapedText) : undefined;
72805
72830
  if (!(indexInfo && indexInfo.type)) {
72806
72831
  var isUncheckedJS = isUncheckedJSSuggestion(node, leftType.symbol, /*excludeClasses*/ true);
@@ -72817,7 +72842,7 @@ var ts;
72817
72842
  return anyType;
72818
72843
  }
72819
72844
  if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) {
72820
- reportNonexistentProperty(right, isThisTypeParameter(leftType) ? apparentType : leftType, isUncheckedJS);
72845
+ reportNonexistentProperty(right, ts.isThisTypeParameter(leftType) ? apparentType : leftType, isUncheckedJS);
72821
72846
  }
72822
72847
  return errorType;
72823
72848
  }
@@ -73110,7 +73135,7 @@ var ts;
73110
73135
  }
73111
73136
  function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) {
73112
73137
  ts.Debug.assert(outerName !== undefined, "outername should always be defined");
73113
- var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) {
73138
+ var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ true, function (symbols, name, meaning) {
73114
73139
  ts.Debug.assertEqual(outerName, name, "name should equal outerName");
73115
73140
  var symbol = getSymbol(symbols, name, meaning);
73116
73141
  // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
@@ -73356,7 +73381,7 @@ var ts;
73356
73381
  }
73357
73382
  var effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType;
73358
73383
  var accessFlags = ts.isAssignmentTarget(node) ?
73359
- 4 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 2 /* NoIndexSignatures */ : 0) :
73384
+ 4 /* Writing */ | (isGenericObjectType(objectType) && !ts.isThisTypeParameter(objectType) ? 2 /* NoIndexSignatures */ : 0) :
73360
73385
  32 /* ExpressionPosition */;
73361
73386
  var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, accessFlags, node) || errorType;
73362
73387
  return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType, indexExpression, checkMode), node);
@@ -86818,18 +86843,22 @@ var ts;
86818
86843
  return false;
86819
86844
  }
86820
86845
  function checkNumericLiteralValueSize(node) {
86846
+ // We should test against `getTextOfNode(node)` rather than `node.text`, because `node.text` for large numeric literals can contain "."
86847
+ // e.g. `node.text` for numeric literal `1100000000000000000000` is `1.1e21`.
86848
+ var isFractional = ts.getTextOfNode(node).indexOf(".") !== -1;
86849
+ var isScientific = node.numericLiteralFlags & 16 /* Scientific */;
86821
86850
  // Scientific notation (e.g. 2e54 and 1e00000000010) can't be converted to bigint
86822
- // Literals with 15 or fewer characters aren't long enough to reach past 2^53 - 1
86823
86851
  // Fractional numbers (e.g. 9000000000000000.001) are inherently imprecise anyway
86824
- if (node.numericLiteralFlags & 16 /* Scientific */ || node.text.length <= 15 || node.text.indexOf(".") !== -1) {
86852
+ if (isFractional || isScientific) {
86825
86853
  return;
86826
86854
  }
86827
- // We can't rely on the runtime to accurately store and compare extremely large numeric values
86828
- // Even for internal use, we use getTextOfNode: https://github.com/microsoft/TypeScript/issues/33298
86829
- // Thus, if the runtime claims a too-large number is lower than Number.MAX_SAFE_INTEGER,
86830
- // it's likely addition operations on it will fail too
86831
- var apparentValue = +ts.getTextOfNode(node);
86832
- if (apparentValue <= Math.pow(2, 53) - 1 && apparentValue + 1 > apparentValue) {
86855
+ // Here `node` is guaranteed to be a numeric literal representing an integer.
86856
+ // We need to judge whether the integer `node` represents is <= 2 ** 53 - 1, which can be accomplished by comparing to `value` defined below because:
86857
+ // 1) when `node` represents an integer <= 2 ** 53 - 1, `node.text` is its exact string representation and thus `value` precisely represents the integer.
86858
+ // 2) otherwise, although `node.text` may be imprecise string representation, its mathematical value and consequently `value` cannot be less than 2 ** 53,
86859
+ // thus the result of the predicate won't be affected.
86860
+ var value = +node.text;
86861
+ if (value <= Math.pow(2, 53) - 1) {
86833
86862
  return;
86834
86863
  }
86835
86864
  addErrorOrSuggestion(/*isError*/ false, ts.createDiagnosticForNode(node, ts.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers));
@@ -90291,7 +90320,7 @@ var ts;
90291
90320
  // ], C.prototype, "prop");
90292
90321
  //
90293
90322
  var prefix = getClassMemberPrefix(node, member);
90294
- var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true);
90323
+ var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ !ts.hasSyntacticModifier(member, 2 /* Ambient */));
90295
90324
  var descriptor = languageVersion > 0 /* ES3 */
90296
90325
  ? member.kind === 166 /* PropertyDeclaration */
90297
90326
  // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it
@@ -128183,7 +128212,7 @@ var ts;
128183
128212
  case 0 /* Paths */:
128184
128213
  return convertPathCompletions(completion.paths);
128185
128214
  case 1 /* Properties */: {
128186
- var entries = [];
128215
+ var entries = ts.createSortedArray();
128187
128216
  Completions.getCompletionEntriesFromSymbols(completion.symbols, entries, contextToken, contextToken, sourceFile, sourceFile, host, program, 99 /* ESNext */, log, 4 /* String */, preferences, options); // Target will not be used, so arbitrary
128188
128217
  return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan: optionalReplacementSpan, entries: entries };
128189
128218
  }
@@ -128381,7 +128410,7 @@ var ts;
128381
128410
  var types = ts.flatMap(candidates, function (candidate) {
128382
128411
  if (!ts.signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
128383
128412
  return;
128384
- var type = checker.getParameterType(candidate, argumentInfo.argumentIndex);
128413
+ var type = candidate.getTypeParameterAtPosition(argumentInfo.argumentIndex);
128385
128414
  isNewIdentifier = isNewIdentifier || !!(type.flags & 4 /* String */);
128386
128415
  return getStringLiteralTypes(type, uniques);
128387
128416
  });
@@ -129065,6 +129094,29 @@ var ts;
129065
129094
  }
129066
129095
  }
129067
129096
  Completions.getCompletionsAtPosition = getCompletionsAtPosition;
129097
+ // Editors will use the `sortText` and then fall back to `name` for sorting, but leave ties in response order.
129098
+ // So, it's important that we sort those ties in the order we want them displayed if it matters. We don't
129099
+ // strictly need to sort by name or SortText here since clients are going to do it anyway, but we have to
129100
+ // do the work of comparing them so we can sort those ties appropriately; plus, it makes the order returned
129101
+ // by the language service consistent with what TS Server does and what editors typically do. This also makes
129102
+ // completions tests make more sense. We used to sort only alphabetically and only in the server layer, but
129103
+ // this made tests really weird, since most fourslash tests don't use the server.
129104
+ function compareCompletionEntries(entryInArray, entryToInsert) {
129105
+ var _a, _b;
129106
+ var result = ts.compareStringsCaseSensitiveUI(entryInArray.sortText, entryToInsert.sortText);
129107
+ if (result === 0 /* EqualTo */) {
129108
+ result = ts.compareStringsCaseSensitiveUI(entryInArray.name, entryToInsert.name);
129109
+ }
129110
+ if (result === 0 /* EqualTo */ && ((_a = entryInArray.data) === null || _a === void 0 ? void 0 : _a.moduleSpecifier) && ((_b = entryToInsert.data) === null || _b === void 0 ? void 0 : _b.moduleSpecifier)) {
129111
+ // Sort same-named auto-imports by module specifier
129112
+ result = ts.compareNumberOfDirectorySeparators(entryInArray.data.moduleSpecifier, entryToInsert.data.moduleSpecifier);
129113
+ }
129114
+ if (result === 0 /* EqualTo */) {
129115
+ // Fall back to symbol order - if we return `EqualTo`, `insertSorted` will put later symbols first.
129116
+ return -1 /* LessThan */;
129117
+ }
129118
+ return result;
129119
+ }
129068
129120
  function completionEntryDataIsResolved(data) {
129069
129121
  return !!(data === null || data === void 0 ? void 0 : data.moduleSpecifier);
129070
129122
  }
@@ -129151,7 +129203,7 @@ var ts;
129151
129203
  return completionInfo;
129152
129204
  }
129153
129205
  }
129154
- var entries = [];
129206
+ var entries = ts.createSortedArray();
129155
129207
  if (isUncheckedFile(sourceFile, compilerOptions)) {
129156
129208
  var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries,
129157
129209
  /*replacementToken*/ undefined, contextToken, location, sourceFile, host, program, ts.getEmitScriptTarget(compilerOptions), log, completionKind, preferences, compilerOptions, isTypeOnlyLocation, propertyAccessToConvert, isJsxIdentifierExpected, isJsxInitializer, importCompletionNode, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextIdMap);
@@ -129169,13 +129221,13 @@ var ts;
129169
129221
  for (var _i = 0, _a = getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && ts.isSourceFileJS(sourceFile)); _i < _a.length; _i++) {
129170
129222
  var keywordEntry = _a[_i];
129171
129223
  if (!entryNames.has(keywordEntry.name)) {
129172
- entries.push(keywordEntry);
129224
+ ts.insertSorted(entries, keywordEntry, compareCompletionEntries, /*allowDuplicates*/ true);
129173
129225
  }
129174
129226
  }
129175
129227
  }
129176
129228
  for (var _b = 0, literals_1 = literals; _b < literals_1.length; _b++) {
129177
129229
  var literal = literals_1[_b];
129178
- entries.push(createCompletionEntryForLiteral(sourceFile, preferences, literal));
129230
+ ts.insertSorted(entries, createCompletionEntryForLiteral(sourceFile, preferences, literal), compareCompletionEntries, /*allowDuplicates*/ true);
129179
129231
  }
129180
129232
  return {
129181
129233
  isGlobalCompletion: isInSnippetScope,
@@ -129251,13 +129303,13 @@ var ts;
129251
129303
  var realName = ts.unescapeLeadingUnderscores(name);
129252
129304
  if (!uniqueNames.has(realName) && ts.isIdentifierText(realName, target)) {
129253
129305
  uniqueNames.add(realName);
129254
- entries.push({
129306
+ ts.insertSorted(entries, {
129255
129307
  name: realName,
129256
129308
  kind: "warning" /* warning */,
129257
129309
  kindModifiers: "",
129258
129310
  sortText: SortText.JavascriptIdentifiers,
129259
129311
  isFromUncheckedFile: true
129260
- });
129312
+ }, compareCompletionEntries);
129261
129313
  }
129262
129314
  });
129263
129315
  }
@@ -129681,7 +129733,7 @@ var ts;
129681
129733
  /** True for locals; false for globals, module exports from other files, `this.` completions. */
129682
129734
  var shouldShadowLaterSymbols = !origin && !(symbol.parent === undefined && !ts.some(symbol.declarations, function (d) { return d.getSourceFile() === location.getSourceFile(); }));
129683
129735
  uniques.set(name, shouldShadowLaterSymbols);
129684
- entries.push(entry);
129736
+ ts.insertSorted(entries, entry, compareCompletionEntries, /*allowDuplicates*/ true);
129685
129737
  }
129686
129738
  log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start));
129687
129739
  // Prevent consumers of this map from having to worry about
@@ -152158,6 +152210,7 @@ var ts;
152158
152210
  var errorCodes = [
152159
152211
  ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
152160
152212
  ts.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
152213
+ ts.Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code
152161
152214
  ];
152162
152215
  codefix.registerCodeFix({
152163
152216
  errorCodes: errorCodes,
@@ -159968,6 +160021,9 @@ var ts;
159968
160021
  TypeObject.prototype.isClass = function () {
159969
160022
  return !!(ts.getObjectFlags(this) & 1 /* Class */);
159970
160023
  };
160024
+ TypeObject.prototype.isIndexType = function () {
160025
+ return !!(this.flags & 4194304 /* Index */);
160026
+ };
159971
160027
  Object.defineProperty(TypeObject.prototype, "typeArguments", {
159972
160028
  /**
159973
160029
  * This polyfills `referenceType.typeArguments` for API consumers
@@ -160000,6 +160056,16 @@ var ts;
160000
160056
  SignatureObject.prototype.getReturnType = function () {
160001
160057
  return this.checker.getReturnTypeOfSignature(this);
160002
160058
  };
160059
+ SignatureObject.prototype.getTypeParameterAtPosition = function (pos) {
160060
+ var type = this.checker.getParameterType(this, pos);
160061
+ if (type.isIndexType() && ts.isThisTypeParameter(type.type)) {
160062
+ var constraint = type.type.getConstraint();
160063
+ if (constraint) {
160064
+ return this.checker.getIndexType(constraint);
160065
+ }
160066
+ }
160067
+ return type;
160068
+ };
160003
160069
  SignatureObject.prototype.getDocumentationComment = function () {
160004
160070
  return this.documentationComment || (this.documentationComment = getDocumentationComment(ts.singleElementArray(this.declaration), this.checker));
160005
160071
  };