typescript 5.8.0-dev.20250122 → 5.8.0-dev.20250124

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.
@@ -20,11 +20,6 @@ and limitations under the License.
20
20
  /// Worker Iterable APIs
21
21
  /////////////////////////////
22
22
 
23
- interface AbortSignal {
24
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */
25
- any(signals: Iterable<AbortSignal>): AbortSignal;
26
- }
27
-
28
23
  interface CSSNumericArray {
29
24
  [Symbol.iterator](): ArrayIterator<CSSNumericValue>;
30
25
  entries(): ArrayIterator<[number, CSSNumericValue]>;
@@ -120,6 +115,10 @@ interface IDBObjectStore {
120
115
  createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
121
116
  }
122
117
 
118
+ interface ImageTrackList {
119
+ [Symbol.iterator](): ArrayIterator<ImageTrack>;
120
+ }
121
+
123
122
  interface MessageEvent<T = any> {
124
123
  /** @deprecated */
125
124
  initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
@@ -140,7 +139,7 @@ interface SubtleCrypto {
140
139
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
141
140
  deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
142
141
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
143
- generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
142
+ generateKey(algorithm: "Ed25519" | { name: "Ed25519" }, extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
144
143
  generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
145
144
  generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
146
145
  generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
@@ -243,7 +242,7 @@ interface WebGL2RenderingContextOverloads {
243
242
  uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
244
243
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
245
244
  uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: number, srcLength?: GLuint): void;
246
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniformMatrix) */
245
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
247
246
  uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
248
247
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniformMatrix) */
249
248
  uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
@@ -6348,6 +6348,7 @@ declare namespace ts {
6348
6348
  * and the operation is cancelled, then it should be discarded, otherwise it is safe to keep.
6349
6349
  */
6350
6350
  runWithCancellationToken<T>(token: CancellationToken, cb: (checker: TypeChecker) => T): T;
6351
+ getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined;
6351
6352
  }
6352
6353
  enum NodeBuilderFlags {
6353
6354
  None = 0,
@@ -7026,6 +7027,7 @@ declare namespace ts {
7026
7027
  /** @deprecated */
7027
7028
  keyofStringsOnly?: boolean;
7028
7029
  lib?: string[];
7030
+ libReplacement?: boolean;
7029
7031
  locale?: string;
7030
7032
  mapRoot?: string;
7031
7033
  maxNodeModuleJsDepth?: number;
@@ -7102,6 +7104,7 @@ declare namespace ts {
7102
7104
  /** Paths used to compute primary types search locations */
7103
7105
  typeRoots?: string[];
7104
7106
  verbatimModuleSyntax?: boolean;
7107
+ erasableSyntaxOnly?: boolean;
7105
7108
  esModuleInterop?: boolean;
7106
7109
  useDefineForClassFields?: boolean;
7107
7110
  [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
package/lib/typescript.js CHANGED
@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
2285
2285
 
2286
2286
  // src/compiler/corePublic.ts
2287
2287
  var versionMajorMinor = "5.8";
2288
- var version = `${versionMajorMinor}.0-dev.20250122`;
2288
+ var version = `${versionMajorMinor}.0-dev.20250124`;
2289
2289
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2290
2290
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2291
2291
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9407,6 +9407,7 @@ var Diagnostics = {
9407
9407
  _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
9408
9408
  _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
9409
9409
  ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
9410
+ This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled: diag(1294, 1 /* Error */, "This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294", "This syntax is not allowed when 'erasableSyntaxOnly' is enabled."),
9410
9411
  with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
9411
9412
  await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
9412
9413
  The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
@@ -10210,6 +10211,7 @@ var Diagnostics = {
10210
10211
  This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path: diag(2877, 1 /* Error */, "This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877", "This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),
10211
10212
  This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
10212
10213
  Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1 /* Error */, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),
10214
+ Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'asserts'."),
10213
10215
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
10214
10216
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
10215
10217
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -10893,11 +10895,13 @@ var Diagnostics = {
10893
10895
  Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
10894
10896
  Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3 /* Message */, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
10895
10897
  Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any: diag(6720, 3 /* Message */, "Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720", "Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),
10898
+ Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript: diag(6721, 3 /* Message */, "Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721", "Do not allow runtime constructs that are not part of ECMAScript."),
10896
10899
  Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
10897
10900
  Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
10898
10901
  Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported: diag(6805, 3 /* Message */, "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805", "Disable full type checking (only critical parse and emit errors will be reported)."),
10899
10902
  Check_side_effect_imports: diag(6806, 3 /* Message */, "Check_side_effect_imports_6806", "Check side effect imports."),
10900
10903
  This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2: diag(6807, 1 /* Error */, "This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807", "This operation can be simplified. This shift is identical to `{0} {1} {2}`."),
10904
+ Enable_lib_replacement: diag(6808, 3 /* Message */, "Enable_lib_replacement_6808", "Enable lib replacement."),
10901
10905
  one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
10902
10906
  one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"),
10903
10907
  type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"),
@@ -41106,6 +41110,23 @@ var commandOptionsWithoutBuild = [
41106
41110
  affectsBuildInfo: true,
41107
41111
  affectsSemanticDiagnostics: true
41108
41112
  },
41113
+ {
41114
+ name: "erasableSyntaxOnly",
41115
+ type: "boolean",
41116
+ category: Diagnostics.Interop_Constraints,
41117
+ description: Diagnostics.Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript,
41118
+ defaultValueDescription: false,
41119
+ affectsBuildInfo: true,
41120
+ affectsSemanticDiagnostics: true
41121
+ },
41122
+ {
41123
+ name: "libReplacement",
41124
+ type: "boolean",
41125
+ affectsProgramStructure: true,
41126
+ category: Diagnostics.Language_and_Environment,
41127
+ description: Diagnostics.Enable_lib_replacement,
41128
+ defaultValueDescription: true
41129
+ },
41109
41130
  // Strict Type Checks
41110
41131
  {
41111
41132
  name: "strict",
@@ -45794,6 +45815,7 @@ function hasOneAsterisk(patternKey) {
45794
45815
  function getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirectedReference, moduleName, scope, isImports) {
45795
45816
  return loadModuleFromTargetExportOrImport;
45796
45817
  function loadModuleFromTargetExportOrImport(target, subpath, pattern, key) {
45818
+ var _a, _b;
45797
45819
  if (typeof target === "string") {
45798
45820
  if (!pattern && subpath.length > 0 && !endsWith(target, "/")) {
45799
45821
  if (state.traceEnabled) {
@@ -45822,6 +45844,8 @@ function getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirec
45822
45844
  redirectedReference,
45823
45845
  state.conditions
45824
45846
  );
45847
+ (_a = state.failedLookupLocations) == null ? void 0 : _a.push(...result.failedLookupLocations ?? emptyArray);
45848
+ (_b = state.affectingLocations) == null ? void 0 : _b.push(...result.affectingLocations ?? emptyArray);
45825
45849
  return toSearchResult(
45826
45850
  result.resolvedModule ? {
45827
45851
  path: result.resolvedModule.resolvedFileName,
@@ -45931,20 +45955,20 @@ function getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirec
45931
45955
  void 0
45932
45956
  );
45933
45957
  function toAbsolutePath(path) {
45934
- var _a, _b;
45958
+ var _a2, _b2;
45935
45959
  if (path === void 0) return path;
45936
- return getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a));
45960
+ return getNormalizedAbsolutePath(path, (_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2));
45937
45961
  }
45938
45962
  function combineDirectoryPath(root, dir) {
45939
45963
  return ensureTrailingDirectorySeparator(combinePaths(root, dir));
45940
45964
  }
45941
45965
  function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
45942
- var _a, _b, _c, _d;
45966
+ var _a2, _b2, _c, _d;
45943
45967
  if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && !finalPath.includes("/node_modules/") && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
45944
45968
  const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
45945
45969
  const commonSourceDirGuesses = [];
45946
45970
  if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
45947
- const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)) || "", getCanonicalFileName));
45971
+ const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2)) || "", getCanonicalFileName));
45948
45972
  commonSourceDirGuesses.push(commonDir);
45949
45973
  } else if (state.requestContainingDirectory) {
45950
45974
  const requestingFile = toAbsolutePath(combinePaths(state.requestContainingDirectory, "index.ts"));
@@ -46000,8 +46024,8 @@ function getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirec
46000
46024
  }
46001
46025
  return void 0;
46002
46026
  function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess) {
46003
- var _a2, _b2;
46004
- const currentDir = state.compilerOptions.configFile ? ((_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2)) || "" : commonSourceDirGuess;
46027
+ var _a3, _b3;
46028
+ const currentDir = state.compilerOptions.configFile ? ((_b3 = (_a3 = state.host).getCurrentDirectory) == null ? void 0 : _b3.call(_a3)) || "" : commonSourceDirGuess;
46005
46029
  const candidateDirectories = [];
46006
46030
  if (state.compilerOptions.declarationDir) {
46007
46031
  candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir)));
@@ -47387,13 +47411,16 @@ function createBinder() {
47387
47411
  function bindForStatement(node) {
47388
47412
  const preLoopLabel = setContinueTarget(node, createLoopLabel());
47389
47413
  const preBodyLabel = createBranchLabel();
47414
+ const preIncrementorLabel = createBranchLabel();
47390
47415
  const postLoopLabel = createBranchLabel();
47391
47416
  bind(node.initializer);
47392
47417
  addAntecedent(preLoopLabel, currentFlow);
47393
47418
  currentFlow = preLoopLabel;
47394
47419
  bindCondition(node.condition, preBodyLabel, postLoopLabel);
47395
47420
  currentFlow = finishFlowLabel(preBodyLabel);
47396
- bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
47421
+ bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel);
47422
+ addAntecedent(preIncrementorLabel, currentFlow);
47423
+ currentFlow = finishFlowLabel(preIncrementorLabel);
47397
47424
  bind(node.incrementor);
47398
47425
  addAntecedent(preLoopLabel, currentFlow);
47399
47426
  currentFlow = finishFlowLabel(postLoopLabel);
@@ -51194,8 +51221,13 @@ function createTypeChecker(host) {
51194
51221
  getMemberOverrideModifierStatus,
51195
51222
  isTypeParameterPossiblyReferenced,
51196
51223
  typeHasCallOrConstructSignatures,
51197
- getSymbolFlags
51224
+ getSymbolFlags,
51225
+ getTypeArgumentsForResolvedSignature
51198
51226
  };
51227
+ function getTypeArgumentsForResolvedSignature(signature) {
51228
+ if (signature.mapper === void 0) return void 0;
51229
+ return instantiateTypes((signature.target || signature).typeParameters, signature.mapper);
51230
+ }
51199
51231
  function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
51200
51232
  const candidatesSet = /* @__PURE__ */ new Set();
51201
51233
  const candidates = [];
@@ -53796,7 +53828,7 @@ function createTypeChecker(host) {
53796
53828
  moduleReference
53797
53829
  );
53798
53830
  }
53799
- if (errorNode && (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */)) {
53831
+ if (errorNode && (moduleKind === 100 /* Node16 */ || moduleKind === 101 /* Node18 */)) {
53800
53832
  const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
53801
53833
  const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l) || isJSDocImportTag(l));
53802
53834
  if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
@@ -64195,6 +64227,9 @@ function createTypeChecker(host) {
64195
64227
  case "Number":
64196
64228
  checkNoTypeArguments(node);
64197
64229
  return numberType;
64230
+ case "BigInt":
64231
+ checkNoTypeArguments(node);
64232
+ return bigintType;
64198
64233
  case "Boolean":
64199
64234
  checkNoTypeArguments(node);
64200
64235
  return booleanType;
@@ -73114,6 +73149,7 @@ function createTypeChecker(host) {
73114
73149
  return target.kind === 108 /* SuperKeyword */;
73115
73150
  case 235 /* NonNullExpression */:
73116
73151
  case 217 /* ParenthesizedExpression */:
73152
+ case 238 /* SatisfiesExpression */:
73117
73153
  return isMatchingReference(source.expression, target);
73118
73154
  case 211 /* PropertyAccessExpression */:
73119
73155
  case 212 /* ElementAccessExpression */:
@@ -75083,6 +75119,7 @@ function createTypeChecker(host) {
75083
75119
  return narrowTypeByCallExpression(type, expr, assumeTrue);
75084
75120
  case 217 /* ParenthesizedExpression */:
75085
75121
  case 235 /* NonNullExpression */:
75122
+ case 238 /* SatisfiesExpression */:
75086
75123
  return narrowType(type, expr.expression, assumeTrue);
75087
75124
  case 226 /* BinaryExpression */:
75088
75125
  return narrowTypeByBinaryExpression(type, expr, assumeTrue);
@@ -78264,6 +78301,9 @@ function createTypeChecker(host) {
78264
78301
  return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace);
78265
78302
  }
78266
78303
  function getJsxElementChildrenPropertyName(jsxNamespace) {
78304
+ if (compilerOptions.jsx === 4 /* ReactJSX */ || compilerOptions.jsx === 5 /* ReactJSXDev */) {
78305
+ return "children";
78306
+ }
78267
78307
  return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace);
78268
78308
  }
78269
78309
  function getUninstantiatedJsxSignaturesOfType(elementType, caller) {
@@ -84775,6 +84815,9 @@ function createTypeChecker(host) {
84775
84815
  checkVariableLikeDeclaration(node);
84776
84816
  const func = getContainingFunction(node);
84777
84817
  if (hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) {
84818
+ if (compilerOptions.erasableSyntaxOnly) {
84819
+ error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
84820
+ }
84778
84821
  if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) {
84779
84822
  error2(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
84780
84823
  }
@@ -89479,6 +89522,9 @@ function createTypeChecker(host) {
89479
89522
  checkCollisionsForDeclarationName(node, node.name);
89480
89523
  checkExportsOnMergedDeclarations(node);
89481
89524
  node.members.forEach(checkEnumMember);
89525
+ if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) {
89526
+ error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
89527
+ }
89482
89528
  computeEnumMemberValues(node);
89483
89529
  const enumSymbol = getSymbolOfDeclaration(node);
89484
89530
  const firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind);
@@ -89580,6 +89626,9 @@ function createTypeChecker(host) {
89580
89626
  checkExportsOnMergedDeclarations(node);
89581
89627
  const symbol = getSymbolOfDeclaration(node);
89582
89628
  if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) {
89629
+ if (compilerOptions.erasableSyntaxOnly) {
89630
+ error2(node.name, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
89631
+ }
89583
89632
  if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) {
89584
89633
  error2(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName);
89585
89634
  }
@@ -89899,6 +89948,9 @@ function createTypeChecker(host) {
89899
89948
  isImportAttributes2 ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve
89900
89949
  );
89901
89950
  }
89951
+ if (moduleKind === 199 /* NodeNext */ && !isImportAttributes2) {
89952
+ return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts);
89953
+ }
89902
89954
  if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1 /* CommonJS */) {
89903
89955
  return grammarErrorOnNode(
89904
89956
  node,
@@ -89964,7 +90016,11 @@ function createTypeChecker(host) {
89964
90016
  return;
89965
90017
  }
89966
90018
  checkGrammarModifiers(node);
89967
- if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
90019
+ const isImportEquals = isInternalModuleImportEqualsDeclaration(node);
90020
+ if (compilerOptions.erasableSyntaxOnly && isImportEquals && !(node.flags & 33554432 /* Ambient */)) {
90021
+ error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
90022
+ }
90023
+ if (isImportEquals || checkExternalImportOrExportDeclaration(node)) {
89968
90024
  checkImportBinding(node);
89969
90025
  markLinkedReferences(node, 6 /* ExportImportEquals */);
89970
90026
  if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
@@ -126104,11 +126160,13 @@ function createCreateProgramOptions(rootNames, options, host, oldProgram, config
126104
126160
  typeScriptVersion: typeScriptVersion3
126105
126161
  };
126106
126162
  }
126107
- function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
126163
+ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
126108
126164
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
126109
- const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
126110
- const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } = createProgramOptions;
126111
- let { oldProgram } = createProgramOptions;
126165
+ let _createProgramOptions = isArray(_rootNamesOrOptions) ? createCreateProgramOptions(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : _rootNamesOrOptions;
126166
+ const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3, host: createProgramOptionsHost } = _createProgramOptions;
126167
+ let { oldProgram } = _createProgramOptions;
126168
+ _createProgramOptions = void 0;
126169
+ _rootNamesOrOptions = void 0;
126112
126170
  for (const option of commandLineOptionOfCustomType) {
126113
126171
  if (hasProperty(options, option.name)) {
126114
126172
  if (typeof options[option.name] === "string") {
@@ -126148,7 +126206,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
126148
126206
  true
126149
126207
  );
126150
126208
  mark("beforeProgram");
126151
- const host = createProgramOptions.host || createCompilerHost(options);
126209
+ const host = createProgramOptionsHost || createCompilerHost(options);
126152
126210
  const configParsingHost = parseConfigHostFromCompilerHostLike(host);
126153
126211
  let skipDefaultLib = options.noLib;
126154
126212
  const getDefaultLibraryFileName = memoize(() => host.getDefaultLibFileName(options));
@@ -128089,6 +128147,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
128089
128147
  var _a2, _b2, _c2, _d2, _e2;
128090
128148
  const existing = resolvedLibProcessing == null ? void 0 : resolvedLibProcessing.get(libFileName);
128091
128149
  if (existing) return existing;
128150
+ if (options.libReplacement === false) {
128151
+ const result2 = {
128152
+ resolution: {
128153
+ resolvedModule: void 0
128154
+ },
128155
+ actual: combinePaths(defaultLibraryPath, libFileName)
128156
+ };
128157
+ (resolvedLibProcessing ?? (resolvedLibProcessing = /* @__PURE__ */ new Map())).set(libFileName, result2);
128158
+ return result2;
128159
+ }
128092
128160
  if (structureIsReused !== 0 /* Not */ && oldProgram && !hasInvalidatedLibResolutions(libFileName)) {
128093
128161
  const oldResolution = (_a2 = oldProgram.resolvedLibReferences) == null ? void 0 : _a2.get(libFileName);
128094
128162
  if (oldResolution) {
@@ -173576,7 +173644,10 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
173576
173644
  const { parent: parent2 } = node;
173577
173645
  const typeChecker = program.getTypeChecker();
173578
173646
  if (node.kind === 164 /* OverrideKeyword */ || isIdentifier(node) && isJSDocOverrideTag(parent2) && parent2.tagName === node) {
173579
- return getDefinitionFromOverriddenMember(typeChecker, node) || emptyArray;
173647
+ const def = getDefinitionFromOverriddenMember(typeChecker, node);
173648
+ if (def !== void 0 || node.kind !== 164 /* OverrideKeyword */) {
173649
+ return def || emptyArray;
173650
+ }
173580
173651
  }
173581
173652
  if (isJumpStatementTarget(node)) {
173582
173653
  const label = getTargetLabel(node.parent, node.text);
@@ -173590,9 +173661,6 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
173590
173661
  )] : void 0;
173591
173662
  }
173592
173663
  switch (node.kind) {
173593
- case 107 /* ReturnKeyword */:
173594
- const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
173595
- return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
173596
173664
  case 90 /* DefaultKeyword */:
173597
173665
  if (!isDefaultClause(node.parent)) {
173598
173666
  break;
@@ -173605,15 +173673,14 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
173605
173673
  }
173606
173674
  break;
173607
173675
  }
173608
- if (node.kind === 135 /* AwaitKeyword */) {
173609
- const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
173610
- const isAsyncFunction2 = functionDeclaration && some(functionDeclaration.modifiers, (node2) => node2.kind === 134 /* AsyncKeyword */);
173611
- return isAsyncFunction2 ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
173612
- }
173613
- if (node.kind === 127 /* YieldKeyword */) {
173614
- const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
173615
- const isGeneratorFunction = functionDeclaration && functionDeclaration.asteriskToken;
173616
- return isGeneratorFunction ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
173676
+ let findFunctionDecl;
173677
+ switch (node.kind) {
173678
+ case 107 /* ReturnKeyword */:
173679
+ case 135 /* AwaitKeyword */:
173680
+ case 127 /* YieldKeyword */:
173681
+ findFunctionDecl = isFunctionLikeDeclaration;
173682
+ const functionDeclaration = findAncestor(node, findFunctionDecl);
173683
+ return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
173617
173684
  }
173618
173685
  if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) {
173619
173686
  const classDecl = node.parent.parent;
@@ -173663,6 +173730,9 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
173663
173730
  }];
173664
173731
  }
173665
173732
  }
173733
+ if (isModifier(node) && (isClassElement(parent2) || isNamedDeclaration(parent2))) {
173734
+ symbol = parent2.symbol;
173735
+ }
173666
173736
  if (!symbol) {
173667
173737
  return concatenate(fileReferenceDefinition, getDefinitionInfoForIndexSignatures(node, typeChecker));
173668
173738
  }
@@ -173859,12 +173929,16 @@ function getTypeDefinitionAtPosition(typeChecker, sourceFile, position) {
173859
173929
  false
173860
173930
  );
173861
173931
  }
173862
- const { symbol, failedAliasResolution } = getSymbol(
173932
+ let { symbol, failedAliasResolution } = getSymbol(
173863
173933
  node,
173864
173934
  typeChecker,
173865
173935
  /*stopAtAlias*/
173866
173936
  false
173867
173937
  );
173938
+ if (isModifier(node) && (isClassElement(node.parent) || isNamedDeclaration(node.parent))) {
173939
+ symbol = node.parent.symbol;
173940
+ failedAliasResolution = false;
173941
+ }
173868
173942
  if (!symbol) return void 0;
173869
173943
  const typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node);
173870
173944
  const returnType = tryGetReturnTypeOfFunction(symbol, typeAtLocation, typeChecker);
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": "5.8.0-dev.20250122",
5
+ "version": "5.8.0-dev.20250124",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -116,5 +116,5 @@
116
116
  "node": "20.1.0",
117
117
  "npm": "8.19.4"
118
118
  },
119
- "gitHead": "1c4083f4edc71cb1744a62013732e3c95d05a035"
119
+ "gitHead": "220706eb0320ff46fad8bf80a5e99db624ee7dfb"
120
120
  }