typescript 5.4.0-dev.20240115 → 5.4.0-dev.20240117

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.
@@ -127,6 +127,7 @@ interface SubtleCrypto {
127
127
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
128
128
  deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
129
129
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
130
+ generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
130
131
  generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
131
132
  generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
132
133
  generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
@@ -154,22 +155,22 @@ interface WEBGL_draw_buffers {
154
155
 
155
156
  interface WEBGL_multi_draw {
156
157
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL) */
157
- multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
158
+ multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: number, countsList: Int32Array | Iterable<GLsizei>, countsOffset: number, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: number, drawcount: GLsizei): void;
158
159
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL) */
159
- multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, drawcount: GLsizei): void;
160
+ multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: number, countsList: Int32Array | Iterable<GLsizei>, countsOffset: number, drawcount: GLsizei): void;
160
161
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL) */
161
- multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
162
+ multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: number, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: number, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: number, drawcount: GLsizei): void;
162
163
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL) */
163
- multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
164
+ multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: number, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: number, drawcount: GLsizei): void;
164
165
  }
165
166
 
166
167
  interface WebGL2RenderingContextBase {
167
168
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/clearBuffer) */
168
- clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
169
+ clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: number): void;
169
170
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/clearBuffer) */
170
- clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;
171
+ clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: number): void;
171
172
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/clearBuffer) */
172
- clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: GLuint): void;
173
+ clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: number): void;
173
174
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/drawBuffers) */
174
175
  drawBuffers(buffers: Iterable<GLenum>): void;
175
176
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/getActiveUniforms) */
@@ -183,25 +184,25 @@ interface WebGL2RenderingContextBase {
183
184
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/transformFeedbackVaryings) */
184
185
  transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable<string>, bufferMode: GLenum): void;
185
186
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniform) */
186
- uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
187
+ uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: number, srcLength?: GLuint): void;
187
188
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniform) */
188
- uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
189
+ uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: number, srcLength?: GLuint): void;
189
190
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniform) */
190
- uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
191
+ uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: number, srcLength?: GLuint): void;
191
192
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniform) */
192
- uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
193
+ uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: number, srcLength?: GLuint): void;
193
194
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
194
- uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
195
+ uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
195
196
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
196
- uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
197
+ uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
197
198
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
198
- uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
199
+ uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
199
200
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
200
- uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
201
+ uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
201
202
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
202
- uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
203
+ uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
203
204
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
204
- uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
205
+ uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
205
206
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/vertexAttribI) */
206
207
  vertexAttribI4iv(index: GLuint, values: Iterable<GLint>): void;
207
208
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/vertexAttribI) */
@@ -210,27 +211,27 @@ interface WebGL2RenderingContextBase {
210
211
 
211
212
  interface WebGL2RenderingContextOverloads {
212
213
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
213
- uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
214
+ uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
214
215
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
215
- uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
216
+ uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: number, srcLength?: GLuint): void;
216
217
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
217
- uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
218
+ uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
218
219
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
219
- uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
220
+ uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: number, srcLength?: GLuint): void;
220
221
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
221
- uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
222
+ uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
222
223
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
223
- uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
224
+ uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: number, srcLength?: GLuint): void;
224
225
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
225
- uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
226
+ uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
226
227
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
227
- uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
228
+ uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: number, srcLength?: GLuint): void;
228
229
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniformMatrix) */
229
- uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
230
+ uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
230
231
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniformMatrix) */
231
- uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
232
+ uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
232
233
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniformMatrix) */
233
- uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
234
+ uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
234
235
  }
235
236
 
236
237
  interface WebGLRenderingContextBase {
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.4";
21
- var version = `${versionMajorMinor}.0-dev.20240115`;
21
+ var version = `${versionMajorMinor}.0-dev.20240117`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -7142,6 +7142,8 @@ var Diagnostics = {
7142
7142
  Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."),
7143
7143
  Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),
7144
7144
  There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
7145
+ Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update: diag(6279, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."),
7146
+ There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler: diag(6280, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280", "There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."),
7145
7147
  Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
7146
7148
  Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
7147
7149
  Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
@@ -9108,7 +9110,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9108
9110
  }
9109
9111
  const ch = codePointAt(text, pos);
9110
9112
  if (pos === 0) {
9111
- if (ch === 65533 /* replacementCharacter */) {
9113
+ if (text.slice(0, 256).includes("\uFFFD")) {
9112
9114
  error(Diagnostics.File_appears_to_be_binary);
9113
9115
  pos = end;
9114
9116
  return token = 8 /* NonTextFileMarkerTrivia */;
@@ -11532,17 +11534,20 @@ function projectReferenceIsEqualTo(oldRef, newRef) {
11532
11534
  return oldRef.path === newRef.path && !oldRef.prepend === !newRef.prepend && !oldRef.circular === !newRef.circular;
11533
11535
  }
11534
11536
  function moduleResolutionIsEqualTo(oldResolution, newResolution) {
11535
- return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.node10Result === newResolution.node10Result;
11537
+ return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.alternateResult === newResolution.alternateResult;
11536
11538
  }
11537
11539
  function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
11538
11540
  var _a;
11539
- const node10Result = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.node10Result;
11540
- const result = node10Result ? chainDiagnosticMessages(
11541
+ const alternateResult = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.alternateResult;
11542
+ const alternateResultMessage = alternateResult && (getEmitModuleResolutionKind(host.getCompilerOptions()) === 2 /* Node10 */ ? [Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler, [alternateResult]] : [
11543
+ Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
11544
+ [alternateResult, alternateResult.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName]
11545
+ ]);
11546
+ const result = alternateResultMessage ? chainDiagnosticMessages(
11541
11547
  /*details*/
11542
11548
  void 0,
11543
- Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
11544
- node10Result,
11545
- node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
11549
+ alternateResultMessage[0],
11550
+ ...alternateResultMessage[1]
11546
11551
  ) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
11547
11552
  /*details*/
11548
11553
  void 0,
@@ -37199,7 +37204,7 @@ function resolvedTypeScriptOnly(resolved) {
37199
37204
  Debug.assert(extensionIsTS(resolved.extension));
37200
37205
  return { fileName: resolved.path, packageId: resolved.packageId };
37201
37206
  }
37202
- function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, cache, legacyResult) {
37207
+ function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, cache, alternateResult) {
37203
37208
  if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) {
37204
37209
  const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled);
37205
37210
  if (originalPath)
@@ -37213,10 +37218,10 @@ function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName
37213
37218
  diagnostics,
37214
37219
  state.resultFromCache,
37215
37220
  cache,
37216
- legacyResult
37221
+ alternateResult
37217
37222
  );
37218
37223
  }
37219
- function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache, legacyResult) {
37224
+ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache, alternateResult) {
37220
37225
  if (resultFromCache) {
37221
37226
  if (!(cache == null ? void 0 : cache.isReadonly)) {
37222
37227
  resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
@@ -37244,7 +37249,7 @@ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibra
37244
37249
  failedLookupLocations: initializeResolutionField(failedLookupLocations),
37245
37250
  affectingLocations: initializeResolutionField(affectingLocations),
37246
37251
  resolutionDiagnostics: initializeResolutionField(diagnostics),
37247
- node10Result: legacyResult
37252
+ alternateResult
37248
37253
  };
37249
37254
  }
37250
37255
  function initializeResolutionField(value) {
@@ -37463,7 +37468,8 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
37463
37468
  requestContainingDirectory: containingDirectory,
37464
37469
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
37465
37470
  isConfigLookup: false,
37466
- candidateIsFromPackageJsonField: false
37471
+ candidateIsFromPackageJsonField: false,
37472
+ resolvedPackageDirectory: false
37467
37473
  };
37468
37474
  let resolved = primaryLookup();
37469
37475
  let primary = true;
@@ -38316,7 +38322,7 @@ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
38316
38322
  );
38317
38323
  }
38318
38324
  function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference, conditions) {
38319
- var _a, _b, _c, _d;
38325
+ var _a, _b, _c, _d, _e;
38320
38326
  const traceEnabled = isTraceEnabled(compilerOptions, host);
38321
38327
  const failedLookupLocations = [];
38322
38328
  const affectingLocations = [];
@@ -38338,7 +38344,8 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
38338
38344
  requestContainingDirectory: containingDirectory,
38339
38345
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
38340
38346
  isConfigLookup,
38341
- candidateIsFromPackageJsonField: false
38347
+ candidateIsFromPackageJsonField: false,
38348
+ resolvedPackageDirectory: false
38342
38349
  };
38343
38350
  if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
38344
38351
  trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", state.conditions.map((c) => `'${c}'`).join(", "));
@@ -38351,29 +38358,46 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
38351
38358
  } else {
38352
38359
  result = tryResolve(extensions, state);
38353
38360
  }
38354
- let legacyResult;
38355
- if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && (conditions == null ? void 0 : conditions.includes("import"))) {
38356
- traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
38357
- const diagnosticState = {
38358
- ...state,
38359
- features: state.features & ~8 /* Exports */,
38360
- reportDiagnostic: noop
38361
- };
38362
- const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
38363
- if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) {
38364
- legacyResult = diagnosticResult.value.resolved.path;
38361
+ let alternateResult;
38362
+ if (state.resolvedPackageDirectory && !isConfigLookup && !isExternalModuleNameRelative(moduleName)) {
38363
+ const wantedTypesButGotJs = (result == null ? void 0 : result.value) && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension);
38364
+ if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && wantedTypesButGotJs && features & 8 /* Exports */ && (conditions == null ? void 0 : conditions.includes("import"))) {
38365
+ traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
38366
+ const diagnosticState = {
38367
+ ...state,
38368
+ features: state.features & ~8 /* Exports */,
38369
+ reportDiagnostic: noop
38370
+ };
38371
+ const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
38372
+ if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) {
38373
+ alternateResult = diagnosticResult.value.resolved.path;
38374
+ }
38375
+ } else if ((!(result == null ? void 0 : result.value) || wantedTypesButGotJs) && moduleResolution === 2 /* Node10 */) {
38376
+ traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update);
38377
+ const diagnosticsCompilerOptions = { ...state.compilerOptions, moduleResolution: 100 /* Bundler */ };
38378
+ const diagnosticState = {
38379
+ ...state,
38380
+ compilerOptions: diagnosticsCompilerOptions,
38381
+ features: 30 /* BundlerDefault */,
38382
+ conditions: getConditions(diagnosticsCompilerOptions),
38383
+ reportDiagnostic: noop
38384
+ };
38385
+ const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
38386
+ if ((_c = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _c.isExternalLibraryImport) {
38387
+ alternateResult = diagnosticResult.value.resolved.path;
38388
+ }
38365
38389
  }
38366
38390
  }
38367
38391
  return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
38368
38392
  moduleName,
38369
- (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved,
38370
- (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport,
38393
+ (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.resolved,
38394
+ (_e = result == null ? void 0 : result.value) == null ? void 0 : _e.isExternalLibraryImport,
38371
38395
  failedLookupLocations,
38372
38396
  affectingLocations,
38373
38397
  diagnostics,
38374
38398
  state,
38375
38399
  cache,
38376
- legacyResult
38400
+ alternateResult
38377
38401
  );
38378
38402
  function tryResolve(extensions2, state2) {
38379
38403
  const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName(
@@ -38625,7 +38649,8 @@ function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options)
38625
38649
  requestContainingDirectory: void 0,
38626
38650
  reportDiagnostic: noop,
38627
38651
  isConfigLookup: false,
38628
- candidateIsFromPackageJsonField: false
38652
+ candidateIsFromPackageJsonField: false,
38653
+ resolvedPackageDirectory: false
38629
38654
  };
38630
38655
  }
38631
38656
  function getPackageScopeForPath(fileName, state) {
@@ -39351,6 +39376,9 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
39351
39376
  if (rest !== "") {
39352
39377
  packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
39353
39378
  }
39379
+ if (packageInfo) {
39380
+ state.resolvedPackageDirectory = true;
39381
+ }
39354
39382
  if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & 8 /* Exports */) {
39355
39383
  return (_b = loadModuleFromExports(packageInfo, extensions, combinePaths(".", rest), state, cache, redirectedReference)) == null ? void 0 : _b.value;
39356
39384
  }
@@ -39470,7 +39498,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
39470
39498
  requestContainingDirectory: containingDirectory,
39471
39499
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
39472
39500
  isConfigLookup: false,
39473
- candidateIsFromPackageJsonField: false
39501
+ candidateIsFromPackageJsonField: false,
39502
+ resolvedPackageDirectory: false
39474
39503
  };
39475
39504
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
39476
39505
  return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(
@@ -39579,7 +39608,8 @@ function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, hos
39579
39608
  requestContainingDirectory: void 0,
39580
39609
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
39581
39610
  isConfigLookup: false,
39582
- candidateIsFromPackageJsonField: false
39611
+ candidateIsFromPackageJsonField: false,
39612
+ resolvedPackageDirectory: false
39583
39613
  };
39584
39614
  const resolved = loadModuleFromImmediateNodeModulesDirectory(
39585
39615
  4 /* Declaration */,
@@ -46882,7 +46912,7 @@ function createTypeChecker(host) {
46882
46912
  return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
46883
46913
  }
46884
46914
  function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
46885
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
46915
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
46886
46916
  if (startsWith(moduleReference, "@types/")) {
46887
46917
  const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
46888
46918
  const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
@@ -47051,7 +47081,17 @@ function createTypeChecker(host) {
47051
47081
  error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
47052
47082
  }
47053
47083
  } else {
47054
- error(errorNode, moduleNotFoundError, moduleReference);
47084
+ if ((_k = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _k.alternateResult) {
47085
+ const errorInfo = createModuleNotFoundChain(currentSourceFile, host, moduleReference, mode, moduleReference);
47086
+ errorOrSuggestion(
47087
+ /*isError*/
47088
+ true,
47089
+ errorNode,
47090
+ chainDiagnosticMessages(errorInfo, moduleNotFoundError, moduleReference)
47091
+ );
47092
+ } else {
47093
+ error(errorNode, moduleNotFoundError, moduleReference);
47094
+ }
47055
47095
  }
47056
47096
  }
47057
47097
  }
@@ -123051,10 +123091,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123051
123091
  }
123052
123092
  function watchFailedLookupLocationOfResolution(resolution) {
123053
123093
  Debug.assert(!!resolution.refCount);
123054
- const { failedLookupLocations, affectingLocations, node10Result } = resolution;
123055
- if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length) && !node10Result)
123094
+ const { failedLookupLocations, affectingLocations, alternateResult } = resolution;
123095
+ if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length) && !alternateResult)
123056
123096
  return;
123057
- if ((failedLookupLocations == null ? void 0 : failedLookupLocations.length) || node10Result)
123097
+ if ((failedLookupLocations == null ? void 0 : failedLookupLocations.length) || alternateResult)
123058
123098
  resolutionsWithFailedLookups.add(resolution);
123059
123099
  let setAtRoot = false;
123060
123100
  if (failedLookupLocations) {
@@ -123062,8 +123102,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123062
123102
  setAtRoot = watchFailedLookupLocation(failedLookupLocation, setAtRoot);
123063
123103
  }
123064
123104
  }
123065
- if (node10Result)
123066
- setAtRoot = watchFailedLookupLocation(node10Result, setAtRoot);
123105
+ if (alternateResult)
123106
+ setAtRoot = watchFailedLookupLocation(alternateResult, setAtRoot);
123067
123107
  if (setAtRoot) {
123068
123108
  setDirectoryWatcher(
123069
123109
  rootDir,
@@ -123072,7 +123112,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123072
123112
  true
123073
123113
  );
123074
123114
  }
123075
- watchAffectingLocationsOfResolution(resolution, !(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !node10Result);
123115
+ watchAffectingLocationsOfResolution(resolution, !(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !alternateResult);
123076
123116
  }
123077
123117
  function watchAffectingLocationsOfResolution(resolution, addToResolutionsWithOnlyAffectingLocations) {
123078
123118
  Debug.assert(!!resolution.refCount);
@@ -123210,7 +123250,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123210
123250
  if ((resolutions == null ? void 0 : resolutions.delete(resolution)) && !resolutions.size)
123211
123251
  resolvedFileToResolution.delete(key);
123212
123252
  }
123213
- const { failedLookupLocations, affectingLocations, node10Result } = resolution;
123253
+ const { failedLookupLocations, affectingLocations, alternateResult } = resolution;
123214
123254
  if (resolutionsWithFailedLookups.delete(resolution)) {
123215
123255
  let removeAtRoot = false;
123216
123256
  if (failedLookupLocations) {
@@ -123218,8 +123258,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123218
123258
  removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
123219
123259
  }
123220
123260
  }
123221
- if (node10Result)
123222
- removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot, syncDirWatcherRemove);
123261
+ if (alternateResult)
123262
+ removeAtRoot = stopWatchFailedLookupLocation(alternateResult, removeAtRoot, syncDirWatcherRemove);
123223
123263
  if (removeAtRoot)
123224
123264
  removeDirectoryWatcher(rootPath, syncDirWatcherRemove);
123225
123265
  } else if (affectingLocations == null ? void 0 : affectingLocations.length) {
@@ -123386,7 +123426,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
123386
123426
  return true;
123387
123427
  if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks)
123388
123428
  return false;
123389
- return ((_a = resolution.failedLookupLocations) == null ? void 0 : _a.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)))) || !!resolution.node10Result && isInvalidatedFailedLookup(resolutionHost.toPath(resolution.node10Result));
123429
+ return ((_a = resolution.failedLookupLocations) == null ? void 0 : _a.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)))) || !!resolution.alternateResult && isInvalidatedFailedLookup(resolutionHost.toPath(resolution.alternateResult));
123390
123430
  }
123391
123431
  function isInvalidatedFailedLookup(locationPath) {
123392
123432
  return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) || [], (fileOrDirectoryPath) => startsWith(locationPath, fileOrDirectoryPath) ? true : void 0) || firstDefinedIterator((isInDirectoryChecks == null ? void 0 : isInDirectoryChecks.keys()) || [], (dirPath) => locationPath.length > dirPath.length && startsWith(locationPath, dirPath) && (isDiskPathRoot(dirPath) || locationPath[dirPath.length] === directorySeparator) ? true : void 0);