typescript 4.5.0-dev.20211019 → 4.5.0-dev.20211023

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.
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20211019";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20211023";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -8130,6 +8130,7 @@ var ts;
8130
8130
  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."),
8131
8131
  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."),
8132
8132
  _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."),
8133
+ _0_is_not_allowed_as_a_parameter_name: diag(1390, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_parameter_name_1390", "'{0}' is not allowed as a parameter name."),
8133
8134
  An_import_alias_cannot_use_import_type: diag(1392, ts.DiagnosticCategory.Error, "An_import_alias_cannot_use_import_type_1392", "An import alias cannot use 'import type'"),
8134
8135
  Imported_via_0_from_file_1: diag(1393, ts.DiagnosticCategory.Message, "Imported_via_0_from_file_1_1393", "Imported via {0} from file '{1}'"),
8135
8136
  Imported_via_0_from_file_1_with_packageId_2: diag(1394, ts.DiagnosticCategory.Message, "Imported_via_0_from_file_1_with_packageId_2_1394", "Imported via {0} from file '{1}' with packageId '{2}'"),
@@ -19982,7 +19983,7 @@ var ts;
19982
19983
  includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
19983
19984
  includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
19984
19985
  excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
19985
- basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames)
19986
+ basePaths: getBasePaths(absolutePath, includes, useCaseSensitiveFileNames)
19986
19987
  };
19987
19988
  }
19988
19989
  ts.getFileMatcherPatterns = getFileMatcherPatterns;
@@ -20004,20 +20005,20 @@ var ts;
20004
20005
  var visited = new ts.Map();
20005
20006
  var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
20006
20007
  for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
20007
- var basePath = _a[_i];
20008
- if (directoryExists(basePath)) {
20009
- visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
20008
+ var absoluteBasePath = _a[_i];
20009
+ if (directoryExists(absoluteBasePath)) {
20010
+ visitDirectory(absoluteBasePath, depth);
20010
20011
  }
20011
20012
  }
20012
20013
  return ts.flatten(results);
20013
- function visitDirectory(path, absolutePath, depth) {
20014
+ function visitDirectory(absolutePath, depth) {
20014
20015
  var canonicalPath = toCanonical(realpath(absolutePath));
20015
20016
  if (visited.has(canonicalPath))
20016
20017
  return;
20017
20018
  visited.set(canonicalPath, true);
20018
- var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories;
20019
+ var _a = getFileSystemEntries(absolutePath), files = _a.files, directories = _a.directories;
20019
20020
  var _loop_1 = function (current) {
20020
- var name = ts.combinePaths(path, current);
20021
+ var name = ts.combinePaths(absolutePath, current);
20021
20022
  var absoluteName = ts.combinePaths(absolutePath, current);
20022
20023
  if (extensions && !ts.fileExtensionIsOneOf(name, extensions))
20023
20024
  return "continue";
@@ -20045,11 +20046,10 @@ var ts;
20045
20046
  }
20046
20047
  for (var _c = 0, _d = ts.sort(directories, ts.compareStringsCaseSensitive); _c < _d.length; _c++) {
20047
20048
  var current = _d[_c];
20048
- var name = ts.combinePaths(path, current);
20049
20049
  var absoluteName = ts.combinePaths(absolutePath, current);
20050
20050
  if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) &&
20051
20051
  (!excludeRegex || !excludeRegex.test(absoluteName))) {
20052
- visitDirectory(name, absoluteName, depth);
20052
+ visitDirectory(absoluteName, depth);
20053
20053
  }
20054
20054
  }
20055
20055
  }
@@ -20057,10 +20057,11 @@ var ts;
20057
20057
  ts.matchFiles = matchFiles;
20058
20058
  /**
20059
20059
  * Computes the unique non-wildcard base paths amongst the provided include patterns.
20060
+ * @returns Absolute directory paths
20060
20061
  */
20061
- function getBasePaths(path, includes, useCaseSensitiveFileNames) {
20062
+ function getBasePaths(absoluteTsconfigPath, includes, useCaseSensitiveFileNames) {
20062
20063
  // Storage for our results in the form of literal paths (e.g. the paths as written by the user).
20063
- var basePaths = [path];
20064
+ var basePaths = [absoluteTsconfigPath];
20064
20065
  if (includes) {
20065
20066
  // Storage for literal base paths amongst the include patterns.
20066
20067
  var includeBasePaths = [];
@@ -20068,14 +20069,14 @@ var ts;
20068
20069
  var include = includes_1[_i];
20069
20070
  // We also need to check the relative paths by converting them to absolute and normalizing
20070
20071
  // in case they escape the base path (e.g "..\somedirectory")
20071
- var absolute = ts.isRootedDiskPath(include) ? include : ts.normalizePath(ts.combinePaths(path, include));
20072
+ var absoluteIncludePath = ts.isRootedDiskPath(include) ? include : ts.normalizePath(ts.combinePaths(absoluteTsconfigPath, include));
20072
20073
  // Append the literal and canonical candidate base paths.
20073
- includeBasePaths.push(getIncludeBasePath(absolute));
20074
+ includeBasePaths.push(getIncludeBasePath(absoluteIncludePath));
20074
20075
  }
20075
20076
  // Sort the offsets array using either the literal or canonical path representations.
20076
20077
  includeBasePaths.sort(ts.getStringComparer(!useCaseSensitiveFileNames));
20077
20078
  var _loop_2 = function (includeBasePath) {
20078
- if (ts.every(basePaths, function (basePath) { return !ts.containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) {
20079
+ if (ts.every(basePaths, function (basePath) { return !ts.containsPath(basePath, includeBasePath, absoluteTsconfigPath, !useCaseSensitiveFileNames); })) {
20079
20080
  basePaths.push(includeBasePath);
20080
20081
  }
20081
20082
  };
@@ -31922,7 +31923,10 @@ var ts;
31922
31923
  case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected);
31923
31924
  case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected);
31924
31925
  case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);
31925
- case 16 /* Parameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);
31926
+ case 16 /* Parameters */:
31927
+ return ts.isKeyword(token())
31928
+ ? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_parameter_name, ts.tokenToString(token()))
31929
+ : parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);
31926
31930
  case 19 /* TypeParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected);
31927
31931
  case 20 /* TypeArguments */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected);
31928
31932
  case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected);
@@ -37967,7 +37971,7 @@ var ts;
37967
37971
  var ts;
37968
37972
  (function (ts) {
37969
37973
  /* @internal */
37970
- ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" };
37974
+ ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean", defaultValueDescription: "false" };
37971
37975
  var jsxOptionMap = new ts.Map(ts.getEntries({
37972
37976
  "preserve": 1 /* Preserve */,
37973
37977
  "react-native": 3 /* ReactNative */,
@@ -38104,6 +38108,7 @@ var ts;
38104
38108
  type: "boolean",
38105
38109
  category: ts.Diagnostics.Watch_and_Build_Modes,
38106
38110
  description: ts.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,
38111
+ defaultValueDescription: "false",
38107
38112
  },
38108
38113
  {
38109
38114
  name: "excludeDirectories",
@@ -38139,11 +38144,13 @@ var ts;
38139
38144
  showInSimplifiedHelpView: true,
38140
38145
  category: ts.Diagnostics.Command_line_Options,
38141
38146
  description: ts.Diagnostics.Print_this_message,
38147
+ defaultValueDescription: "false",
38142
38148
  },
38143
38149
  {
38144
38150
  name: "help",
38145
38151
  shortName: "?",
38146
- type: "boolean"
38152
+ type: "boolean",
38153
+ defaultValueDescription: "false",
38147
38154
  },
38148
38155
  {
38149
38156
  name: "watch",
@@ -38153,6 +38160,7 @@ var ts;
38153
38160
  isCommandLineOnly: true,
38154
38161
  category: ts.Diagnostics.Command_line_Options,
38155
38162
  description: ts.Diagnostics.Watch_input_files,
38163
+ defaultValueDescription: "false",
38156
38164
  },
38157
38165
  {
38158
38166
  name: "preserveWatchOutput",
@@ -38160,7 +38168,7 @@ var ts;
38160
38168
  showInSimplifiedHelpView: false,
38161
38169
  category: ts.Diagnostics.Output_Formatting,
38162
38170
  description: ts.Diagnostics.Disable_wiping_the_console_in_watch_mode,
38163
- defaultValueDescription: "n/a"
38171
+ defaultValueDescription: "false",
38164
38172
  },
38165
38173
  {
38166
38174
  name: "listFiles",
@@ -38173,7 +38181,8 @@ var ts;
38173
38181
  name: "explainFiles",
38174
38182
  type: "boolean",
38175
38183
  category: ts.Diagnostics.Compiler_Diagnostics,
38176
- description: ts.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included
38184
+ description: ts.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included,
38185
+ defaultValueDescription: "false",
38177
38186
  },
38178
38187
  {
38179
38188
  name: "listEmittedFiles",
@@ -38244,7 +38253,8 @@ var ts;
38244
38253
  affectsSemanticDiagnostics: true,
38245
38254
  affectsEmit: true,
38246
38255
  category: ts.Diagnostics.Watch_and_Build_Modes,
38247
- 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
38256
+ 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,
38257
+ defaultValueDescription: "false",
38248
38258
  },
38249
38259
  {
38250
38260
  name: "locale",
@@ -38289,6 +38299,7 @@ var ts;
38289
38299
  showInSimplifiedHelpView: true,
38290
38300
  category: ts.Diagnostics.Command_line_Options,
38291
38301
  description: ts.Diagnostics.Show_all_compiler_options,
38302
+ defaultValueDescription: "false",
38292
38303
  },
38293
38304
  {
38294
38305
  name: "version",
@@ -38297,6 +38308,7 @@ var ts;
38297
38308
  showInSimplifiedHelpView: true,
38298
38309
  category: ts.Diagnostics.Command_line_Options,
38299
38310
  description: ts.Diagnostics.Print_the_compiler_s_version,
38311
+ defaultValueDescription: "false",
38300
38312
  },
38301
38313
  {
38302
38314
  name: "init",
@@ -38304,6 +38316,7 @@ var ts;
38304
38316
  showInSimplifiedHelpView: true,
38305
38317
  category: ts.Diagnostics.Command_line_Options,
38306
38318
  description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,
38319
+ defaultValueDescription: "false",
38307
38320
  },
38308
38321
  {
38309
38322
  name: "project",
@@ -38321,7 +38334,8 @@ var ts;
38321
38334
  shortName: "b",
38322
38335
  showInSimplifiedHelpView: true,
38323
38336
  category: ts.Diagnostics.Command_line_Options,
38324
- description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date
38337
+ description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
38338
+ defaultValueDescription: "false",
38325
38339
  },
38326
38340
  {
38327
38341
  name: "showConfig",
@@ -38329,7 +38343,8 @@ var ts;
38329
38343
  showInSimplifiedHelpView: true,
38330
38344
  category: ts.Diagnostics.Command_line_Options,
38331
38345
  isCommandLineOnly: true,
38332
- description: ts.Diagnostics.Print_the_final_configuration_instead_of_building
38346
+ description: ts.Diagnostics.Print_the_final_configuration_instead_of_building,
38347
+ defaultValueDescription: "false",
38333
38348
  },
38334
38349
  {
38335
38350
  name: "listFilesOnly",
@@ -38338,7 +38353,8 @@ var ts;
38338
38353
  affectsSemanticDiagnostics: true,
38339
38354
  affectsEmit: true,
38340
38355
  isCommandLineOnly: true,
38341
- description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing
38356
+ description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
38357
+ defaultValueDescription: "false",
38342
38358
  },
38343
38359
  // Basic
38344
38360
  ts.targetOptionDeclaration,
@@ -38458,7 +38474,6 @@ var ts;
38458
38474
  category: ts.Diagnostics.Emit,
38459
38475
  description: ts.Diagnostics.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output,
38460
38476
  transpileOptionValue: undefined,
38461
- defaultValueDescription: "n/a"
38462
38477
  },
38463
38478
  {
38464
38479
  name: "outDir",
@@ -38469,7 +38484,6 @@ var ts;
38469
38484
  showInSimplifiedHelpView: true,
38470
38485
  category: ts.Diagnostics.Emit,
38471
38486
  description: ts.Diagnostics.Specify_an_output_folder_for_all_emitted_files,
38472
- defaultValueDescription: "n/a"
38473
38487
  },
38474
38488
  {
38475
38489
  name: "rootDir",
@@ -38626,6 +38640,7 @@ var ts;
38626
38640
  strictFlag: true,
38627
38641
  category: ts.Diagnostics.Type_Checking,
38628
38642
  description: ts.Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any,
38643
+ defaultValueDescription: "false",
38629
38644
  },
38630
38645
  {
38631
38646
  name: "alwaysStrict",
@@ -38658,7 +38673,8 @@ var ts;
38658
38673
  type: "boolean",
38659
38674
  affectsSemanticDiagnostics: true,
38660
38675
  category: ts.Diagnostics.Type_Checking,
38661
- description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined
38676
+ description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
38677
+ defaultValueDescription: "false",
38662
38678
  },
38663
38679
  {
38664
38680
  name: "noImplicitReturns",
@@ -38674,21 +38690,24 @@ var ts;
38674
38690
  affectsBindDiagnostics: true,
38675
38691
  affectsSemanticDiagnostics: true,
38676
38692
  category: ts.Diagnostics.Type_Checking,
38677
- description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements
38693
+ description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
38694
+ defaultValueDescription: "false",
38678
38695
  },
38679
38696
  {
38680
38697
  name: "noUncheckedIndexedAccess",
38681
38698
  type: "boolean",
38682
38699
  affectsSemanticDiagnostics: true,
38683
38700
  category: ts.Diagnostics.Type_Checking,
38684
- description: ts.Diagnostics.Include_undefined_in_index_signature_results
38701
+ description: ts.Diagnostics.Include_undefined_in_index_signature_results,
38702
+ defaultValueDescription: "false",
38685
38703
  },
38686
38704
  {
38687
38705
  name: "noImplicitOverride",
38688
38706
  type: "boolean",
38689
38707
  affectsSemanticDiagnostics: true,
38690
38708
  category: ts.Diagnostics.Type_Checking,
38691
- description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier
38709
+ description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
38710
+ defaultValueDescription: "false",
38692
38711
  },
38693
38712
  {
38694
38713
  name: "noPropertyAccessFromIndexSignature",
@@ -38797,7 +38816,7 @@ var ts;
38797
38816
  type: "boolean",
38798
38817
  category: ts.Diagnostics.Interop_Constraints,
38799
38818
  description: ts.Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,
38800
- defaultValueDescription: "n/a"
38819
+ defaultValueDescription: "false",
38801
38820
  },
38802
38821
  {
38803
38822
  name: "allowUmdGlobalAccess",
@@ -38846,7 +38865,8 @@ var ts;
38846
38865
  type: "boolean",
38847
38866
  affectsSemanticDiagnostics: true,
38848
38867
  category: ts.Diagnostics.Language_and_Environment,
38849
- description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators
38868
+ description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
38869
+ defaultValueDescription: "false",
38850
38870
  },
38851
38871
  {
38852
38872
  name: "emitDecoratorMetadata",
@@ -38854,7 +38874,8 @@ var ts;
38854
38874
  affectsSemanticDiagnostics: true,
38855
38875
  affectsEmit: true,
38856
38876
  category: ts.Diagnostics.Language_and_Environment,
38857
- description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files
38877
+ description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
38878
+ defaultValueDescription: "false",
38858
38879
  },
38859
38880
  // Advanced
38860
38881
  {
@@ -38897,7 +38918,6 @@ var ts;
38897
38918
  category: ts.Diagnostics.Backwards_Compatibility,
38898
38919
  paramType: ts.Diagnostics.FILE,
38899
38920
  transpileOptionValue: undefined,
38900
- defaultValueDescription: "n/a",
38901
38921
  description: ts.Diagnostics.Deprecated_setting_Use_outFile_instead,
38902
38922
  },
38903
38923
  {
@@ -38978,6 +38998,7 @@ var ts;
38978
38998
  affectsEmit: true,
38979
38999
  category: ts.Diagnostics.Emit,
38980
39000
  description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
39001
+ defaultValueDescription: "false",
38981
39002
  },
38982
39003
  {
38983
39004
  name: "disableSizeLimit",
@@ -38992,21 +39013,24 @@ var ts;
38992
39013
  type: "boolean",
38993
39014
  isTSConfigOnly: true,
38994
39015
  category: ts.Diagnostics.Projects,
38995
- description: ts.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects
39016
+ description: ts.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,
39017
+ defaultValueDescription: "false",
38996
39018
  },
38997
39019
  {
38998
39020
  name: "disableSolutionSearching",
38999
39021
  type: "boolean",
39000
39022
  isTSConfigOnly: true,
39001
39023
  category: ts.Diagnostics.Projects,
39002
- description: ts.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing
39024
+ description: ts.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing,
39025
+ defaultValueDescription: "false",
39003
39026
  },
39004
39027
  {
39005
39028
  name: "disableReferencedProjectLoad",
39006
39029
  type: "boolean",
39007
39030
  isTSConfigOnly: true,
39008
39031
  category: ts.Diagnostics.Projects,
39009
- description: ts.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript
39032
+ description: ts.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,
39033
+ defaultValueDescription: "false",
39010
39034
  },
39011
39035
  {
39012
39036
  name: "noImplicitUseStrict",
@@ -39039,7 +39063,7 @@ var ts;
39039
39063
  affectsEmit: true,
39040
39064
  category: ts.Diagnostics.Emit,
39041
39065
  description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
39042
- defaultValueDescription: "n/a"
39066
+ defaultValueDescription: "false",
39043
39067
  },
39044
39068
  {
39045
39069
  name: "declarationDir",
@@ -39050,7 +39074,6 @@ var ts;
39050
39074
  category: ts.Diagnostics.Emit,
39051
39075
  transpileOptionValue: undefined,
39052
39076
  description: ts.Diagnostics.Specify_the_output_directory_for_generated_declaration_files,
39053
- defaultValueDescription: "n/a"
39054
39077
  },
39055
39078
  {
39056
39079
  name: "skipLibCheck",
@@ -39132,6 +39155,7 @@ var ts;
39132
39155
  affectsEmit: true,
39133
39156
  category: ts.Diagnostics.Emit,
39134
39157
  description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
39158
+ defaultValueDescription: "false",
39135
39159
  },
39136
39160
  {
39137
39161
  name: "keyofStringsOnly",
@@ -39179,27 +39203,31 @@ var ts;
39179
39203
  shortName: "v",
39180
39204
  category: ts.Diagnostics.Command_line_Options,
39181
39205
  description: ts.Diagnostics.Enable_verbose_logging,
39182
- type: "boolean"
39206
+ type: "boolean",
39207
+ defaultValueDescription: "false",
39183
39208
  },
39184
39209
  {
39185
39210
  name: "dry",
39186
39211
  shortName: "d",
39187
39212
  category: ts.Diagnostics.Command_line_Options,
39188
39213
  description: ts.Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean,
39189
- type: "boolean"
39214
+ type: "boolean",
39215
+ defaultValueDescription: "false",
39190
39216
  },
39191
39217
  {
39192
39218
  name: "force",
39193
39219
  shortName: "f",
39194
39220
  category: ts.Diagnostics.Command_line_Options,
39195
39221
  description: ts.Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date,
39196
- type: "boolean"
39222
+ type: "boolean",
39223
+ defaultValueDescription: "false",
39197
39224
  },
39198
39225
  {
39199
39226
  name: "clean",
39200
39227
  category: ts.Diagnostics.Command_line_Options,
39201
39228
  description: ts.Diagnostics.Delete_the_outputs_of_all_projects,
39202
- type: "boolean"
39229
+ type: "boolean",
39230
+ defaultValueDescription: "false",
39203
39231
  }
39204
39232
  ];
39205
39233
  /* @internal */
@@ -39212,10 +39240,12 @@ var ts;
39212
39240
  */
39213
39241
  name: "enableAutoDiscovery",
39214
39242
  type: "boolean",
39243
+ defaultValueDescription: "false",
39215
39244
  },
39216
39245
  {
39217
39246
  name: "enable",
39218
39247
  type: "boolean",
39248
+ defaultValueDescription: "false",
39219
39249
  },
39220
39250
  {
39221
39251
  name: "include",
@@ -39236,6 +39266,7 @@ var ts;
39236
39266
  {
39237
39267
  name: "disableFilenameBasedTypeAcquisition",
39238
39268
  type: "boolean",
39269
+ defaultValueDescription: "false",
39239
39270
  },
39240
39271
  ];
39241
39272
  /*@internal*/
@@ -45655,6 +45686,7 @@ var ts;
45655
45686
  case 168 /* MethodDeclaration */:
45656
45687
  case 171 /* GetAccessor */:
45657
45688
  case 172 /* SetAccessor */:
45689
+ case 169 /* ClassStaticBlockDeclaration */:
45658
45690
  // this.foo assignment in a JavaScript class
45659
45691
  // Bind this property to the containing class
45660
45692
  var containingClass = thisContainer.parent;
@@ -49715,8 +49747,8 @@ var ts;
49715
49747
  if (exportEquals !== moduleSymbol) {
49716
49748
  var type = getTypeOfSymbol(exportEquals);
49717
49749
  if (shouldTreatPropertiesOfExternalModuleAsExports(type)) {
49718
- getPropertiesOfType(type).forEach(function (symbol) {
49719
- cb(symbol, symbol.escapedName);
49750
+ forEachPropertyOfType(type, function (symbol, escapedName) {
49751
+ cb(symbol, escapedName);
49720
49752
  });
49721
49753
  }
49722
49754
  }
@@ -50048,12 +50080,15 @@ var ts;
50048
50080
  function getNamedMembers(members) {
50049
50081
  var result;
50050
50082
  members.forEach(function (symbol, id) {
50051
- if (!isReservedMemberName(id) && symbolIsValue(symbol)) {
50083
+ if (isNamedMember(symbol, id)) {
50052
50084
  (result || (result = [])).push(symbol);
50053
50085
  }
50054
50086
  });
50055
50087
  return result || ts.emptyArray;
50056
50088
  }
50089
+ function isNamedMember(member, escapedName) {
50090
+ return !isReservedMemberName(escapedName) && symbolIsValue(member);
50091
+ }
50057
50092
  function getNamedOrIndexSignatureMembers(members) {
50058
50093
  var result = getNamedMembers(members);
50059
50094
  var index = getIndexSymbolFromSymbolTable(members);
@@ -56886,6 +56921,16 @@ var ts;
56886
56921
  getPropertiesOfUnionOrIntersectionType(type) :
56887
56922
  getPropertiesOfObjectType(type);
56888
56923
  }
56924
+ function forEachPropertyOfType(type, action) {
56925
+ type = getReducedApparentType(type);
56926
+ if (type.flags & 3670016 /* StructuredType */) {
56927
+ resolveStructuredTypeMembers(type).members.forEach(function (symbol, escapedName) {
56928
+ if (isNamedMember(symbol, escapedName)) {
56929
+ action(symbol, escapedName);
56930
+ }
56931
+ });
56932
+ }
56933
+ }
56889
56934
  function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) {
56890
56935
  var list = obj.properties;
56891
56936
  return list.some(function (property) {
@@ -60361,12 +60406,6 @@ var ts;
60361
60406
  }
60362
60407
  return type[cache] = type;
60363
60408
  }
60364
- function isConditionalTypeAlwaysTrueDisregardingInferTypes(type) {
60365
- var extendsInferParamMapper = type.root.inferTypeParameters && createTypeMapper(type.root.inferTypeParameters, ts.map(type.root.inferTypeParameters, function () { return wildcardType; }));
60366
- var checkType = type.checkType;
60367
- var extendsType = type.extendsType;
60368
- return isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(instantiateType(extendsType, extendsInferParamMapper)));
60369
- }
60370
60409
  function getSimplifiedConditionalType(type, writing) {
60371
60410
  var checkType = type.checkType;
60372
60411
  var extendsType = type.extendsType;
@@ -60675,6 +60714,10 @@ var ts;
60675
60714
  }
60676
60715
  return result;
60677
60716
  }
60717
+ function isDistributionDependent(root) {
60718
+ return root.isDistributive && (isTypeParameterPossiblyReferenced(root.checkType, root.node.trueType) ||
60719
+ isTypeParameterPossiblyReferenced(root.checkType, root.node.falseType));
60720
+ }
60678
60721
  function getTypeFromConditionalTypeNode(node) {
60679
60722
  var links = getNodeLinks(node);
60680
60723
  if (!links.resolvedType) {
@@ -63831,31 +63874,21 @@ var ts;
63831
63874
  return 3 /* Maybe */;
63832
63875
  }
63833
63876
  var c = target;
63834
- // Check if the conditional is always true or always false but still deferred for distribution purposes
63835
- var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
63836
- var skipFalse = !skipTrue && isConditionalTypeAlwaysTrueDisregardingInferTypes(c);
63837
- // Instantiate with a replacement mapper if the conditional is distributive, replacing the check type with a clone of itself,
63838
- // this way {x: string | number, y: string | number} -> (T extends T ? { x: T, y: T } : never) appropriately _fails_ when
63839
- // T = string | number (since that will end up distributing and producing `{x: string, y: string} | {x: number, y: number}`,
63840
- // to which `{x: string | number, y: string | number}` isn't assignable)
63841
- var distributionMapper = void 0;
63842
- var checkVar = getActualTypeVariable(c.root.checkType);
63843
- if (c.root.isDistributive && checkVar.flags & 262144 /* TypeParameter */) {
63844
- var newParam = cloneTypeParameter(checkVar);
63845
- distributionMapper = prependTypeMapping(checkVar, newParam, c.mapper);
63846
- newParam.mapper = distributionMapper;
63847
- }
63848
- // TODO: Find a nice way to include potential conditional type breakdowns in error output, if they seem good (they usually don't)
63849
- var expanding = isDeeplyNestedType(target, targetStack, targetDepth);
63850
- var localResult = expanding ? 3 /* Maybe */ : undefined;
63851
- if (skipTrue || expanding || (localResult = isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.trueType), distributionMapper) : getTrueTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false))) {
63852
- if (!skipFalse && !expanding) {
63853
- localResult = (localResult || 3 /* Maybe */) & isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.falseType), distributionMapper) : getFalseTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false);
63854
- }
63855
- }
63856
- if (localResult) {
63857
- resetErrorInfo(saveErrorInfo);
63858
- return localResult;
63877
+ // We check for a relationship to a conditional type target only when the conditional type has no
63878
+ // 'infer' positions and is not distributive or is distributive but doesn't reference the check type
63879
+ // parameter in either of the result types.
63880
+ if (!c.root.inferTypeParameters && !isDistributionDependent(c.root)) {
63881
+ // Check if the conditional is always true or always false but still deferred for distribution purposes.
63882
+ var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
63883
+ var skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
63884
+ // TODO: Find a nice way to include potential conditional type breakdowns in error output, if they seem good (they usually don't)
63885
+ if (result = skipTrue ? -1 /* True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false)) {
63886
+ result &= skipFalse ? -1 /* True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false);
63887
+ if (result) {
63888
+ resetErrorInfo(saveErrorInfo);
63889
+ return result;
63890
+ }
63891
+ }
63859
63892
  }
63860
63893
  }
63861
63894
  else if (target.flags & 134217728 /* TemplateLiteral */) {
@@ -67002,17 +67035,16 @@ var ts;
67002
67035
  var inferredType = void 0;
67003
67036
  var signature = context.signature;
67004
67037
  if (signature) {
67005
- var inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : undefined;
67038
+ var inferredCovariantType_1 = inference.candidates ? getCovariantInference(inference, signature) : undefined;
67006
67039
  if (inference.contraCandidates) {
67007
- var inferredContravariantType = getContravariantInference(inference);
67008
67040
  // If we have both co- and contra-variant inferences, we prefer the contra-variant inference
67009
- // unless the co-variant inference is a subtype and not 'never'.
67010
- inferredType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) &&
67011
- isTypeSubtypeOf(inferredCovariantType, inferredContravariantType) ?
67012
- inferredCovariantType : inferredContravariantType;
67041
+ // unless the co-variant inference is a subtype of some contra-variant inference and not 'never'.
67042
+ inferredType = inferredCovariantType_1 && !(inferredCovariantType_1.flags & 131072 /* Never */) &&
67043
+ ts.some(inference.contraCandidates, function (t) { return isTypeSubtypeOf(inferredCovariantType_1, t); }) ?
67044
+ inferredCovariantType_1 : getContravariantInference(inference);
67013
67045
  }
67014
- else if (inferredCovariantType) {
67015
- inferredType = inferredCovariantType;
67046
+ else if (inferredCovariantType_1) {
67047
+ inferredType = inferredCovariantType_1;
67016
67048
  }
67017
67049
  else if (context.flags & 1 /* NoDefault */) {
67018
67050
  // We use silentNeverType as the wildcard that signals no inferences.
@@ -47,6 +47,7 @@
47
47
  "A_label_is_not_allowed_here_1344": "此处不允许使用 'A 标签。",
48
48
  "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086": "标记的元组元素被声明为可选,并且问号位于名称之后、冒号之前,而不是位于类型之后。",
49
49
  "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087": "标记的元组元素通过在名称之前(而不是类型之前)的 “...” 声明为 rest。",
50
+ "A_mapped_type_may_not_declare_properties_or_methods_7061": "映射的类型可能不声明属性或方法。",
50
51
  "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651": "枚举声明中的成员初始化表达式不能引用在其后声明的成员(包括在其他枚举中定义的成员)。",
51
52
  "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545": "mixin 类必须具有单个 rest 参数为类型 \"any[]\" 的构造函数。",
52
53
  "A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797": "从包含抽象构造签名的类型变量扩展的 mixin 类也必须声明为 \"abstract\"。",
@@ -47,6 +47,7 @@
47
47
  "A_label_is_not_allowed_here_1344": "此處不允許標籤。",
48
48
  "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086": "標記的元組元素已宣告為選用,並在名稱之後、冒號之前加上問號,而非加在類型之後。",
49
49
  "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087": "標記的元組元素已宣告為待用,並在名稱之前加上「...」,而非加在類型之前。",
50
+ "A_mapped_type_may_not_declare_properties_or_methods_7061": "對應型別不能宣告屬性或方法。",
50
51
  "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651": "列舉宣告中的成員初始設定式,不得參考在它之後宣告的成員,包括在其他列舉中所定義的成員。",
51
52
  "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545": "mixin 類別必須具備建構函式,且該建構函式必須指定一個類型為 'any[]' 的 rest 參數。",
52
53
  "A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797": "從包含抽象建構簽章之類型變數所延伸的 mixin 類別也必須宣告為 'abstract'。",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.5.0-dev.20211019",
5
+ "version": "4.5.0-dev.20211023",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [