@typescript-deploys/pr-build 5.6.0-pr-59285-2 → 5.6.0-pr-58296-32

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.
@@ -705,13 +705,13 @@ declare namespace ts {
705
705
  command: CommandTypes.Definition;
706
706
  }
707
707
  export interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
708
- readonly command: CommandTypes.DefinitionAndBoundSpan;
708
+ command: CommandTypes.DefinitionAndBoundSpan;
709
709
  }
710
710
  export interface FindSourceDefinitionRequest extends FileLocationRequest {
711
- readonly command: CommandTypes.FindSourceDefinition;
711
+ command: CommandTypes.FindSourceDefinition;
712
712
  }
713
713
  export interface DefinitionAndBoundSpanResponse extends Response {
714
- readonly body: DefinitionInfoAndBoundSpan;
714
+ body: DefinitionInfoAndBoundSpan;
715
715
  }
716
716
  /**
717
717
  * Go to type request; value of command field is
@@ -823,23 +823,23 @@ declare namespace ts {
823
823
  openingBrace: string;
824
824
  }
825
825
  export interface JsxClosingTagRequest extends FileLocationRequest {
826
- readonly command: CommandTypes.JsxClosingTag;
827
- readonly arguments: JsxClosingTagRequestArgs;
826
+ command: CommandTypes.JsxClosingTag;
827
+ arguments: JsxClosingTagRequestArgs;
828
828
  }
829
829
  export interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {
830
830
  }
831
831
  export interface JsxClosingTagResponse extends Response {
832
- readonly body: TextInsertion;
832
+ body: TextInsertion;
833
833
  }
834
834
  export interface LinkedEditingRangeRequest extends FileLocationRequest {
835
- readonly command: CommandTypes.LinkedEditingRange;
835
+ command: CommandTypes.LinkedEditingRange;
836
836
  }
837
837
  export interface LinkedEditingRangesBody {
838
838
  ranges: TextSpan[];
839
839
  wordPattern?: string;
840
840
  }
841
841
  export interface LinkedEditingRangeResponse extends Response {
842
- readonly body: LinkedEditingRangesBody;
842
+ body: LinkedEditingRangesBody;
843
843
  }
844
844
  /**
845
845
  * Get document highlights request; value of command field is
@@ -2107,8 +2107,8 @@ declare namespace ts {
2107
2107
  }
2108
2108
  export type CreateFileWatcherEventName = "createFileWatcher";
2109
2109
  export interface CreateFileWatcherEvent extends Event {
2110
- readonly event: CreateFileWatcherEventName;
2111
- readonly body: CreateFileWatcherEventBody;
2110
+ event: CreateFileWatcherEventName;
2111
+ body: CreateFileWatcherEventBody;
2112
2112
  }
2113
2113
  export interface CreateFileWatcherEventBody {
2114
2114
  readonly id: number;
@@ -2116,8 +2116,8 @@ declare namespace ts {
2116
2116
  }
2117
2117
  export type CreateDirectoryWatcherEventName = "createDirectoryWatcher";
2118
2118
  export interface CreateDirectoryWatcherEvent extends Event {
2119
- readonly event: CreateDirectoryWatcherEventName;
2120
- readonly body: CreateDirectoryWatcherEventBody;
2119
+ event: CreateDirectoryWatcherEventName;
2120
+ body: CreateDirectoryWatcherEventBody;
2121
2121
  }
2122
2122
  export interface CreateDirectoryWatcherEventBody {
2123
2123
  readonly id: number;
@@ -2127,8 +2127,8 @@ declare namespace ts {
2127
2127
  }
2128
2128
  export type CloseFileWatcherEventName = "closeFileWatcher";
2129
2129
  export interface CloseFileWatcherEvent extends Event {
2130
- readonly event: CloseFileWatcherEventName;
2131
- readonly body: CloseFileWatcherEventBody;
2130
+ event: CloseFileWatcherEventName;
2131
+ body: CloseFileWatcherEventBody;
2132
2132
  }
2133
2133
  export interface CloseFileWatcherEventBody {
2134
2134
  readonly id: number;
@@ -2423,19 +2423,19 @@ declare namespace ts {
2423
2423
  command: CommandTypes.PrepareCallHierarchy;
2424
2424
  }
2425
2425
  export interface PrepareCallHierarchyResponse extends Response {
2426
- readonly body: CallHierarchyItem | CallHierarchyItem[];
2426
+ body: CallHierarchyItem | CallHierarchyItem[];
2427
2427
  }
2428
2428
  export interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest {
2429
2429
  command: CommandTypes.ProvideCallHierarchyIncomingCalls;
2430
2430
  }
2431
2431
  export interface ProvideCallHierarchyIncomingCallsResponse extends Response {
2432
- readonly body: CallHierarchyIncomingCall[];
2432
+ body: CallHierarchyIncomingCall[];
2433
2433
  }
2434
2434
  export interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest {
2435
2435
  command: CommandTypes.ProvideCallHierarchyOutgoingCalls;
2436
2436
  }
2437
2437
  export interface ProvideCallHierarchyOutgoingCallsResponse extends Response {
2438
- readonly body: CallHierarchyOutgoingCall[];
2438
+ body: CallHierarchyOutgoingCall[];
2439
2439
  }
2440
2440
  export enum IndentStyle {
2441
2441
  None = "None",
@@ -2839,7 +2839,7 @@ declare namespace ts {
2839
2839
  private changedFilesForExportMapCache;
2840
2840
  private moduleSpecifierCache;
2841
2841
  private symlinks;
2842
- readonly jsDocParsingMode: JSDocParsingMode | undefined;
2842
+ jsDocParsingMode: JSDocParsingMode | undefined;
2843
2843
  isKnownTypesPackageName(name: string): boolean;
2844
2844
  installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
2845
2845
  getCompilationSettings(): ts.CompilerOptions;
@@ -5991,19 +5991,67 @@ declare namespace ts {
5991
5991
  isSourceFileFromExternalLibrary(file: SourceFile): boolean;
5992
5992
  isSourceFileDefaultLibrary(file: SourceFile): boolean;
5993
5993
  /**
5994
- * Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import
5995
- * attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may
5996
- * depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other
5997
- * `module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no
5998
- * impact on module resolution, emit, or type checking.
5994
+ * Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution
5995
+ * settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes,
5996
+ * which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of
5997
+ * overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript.
5998
+ * Some examples:
5999
+ *
6000
+ * ```ts
6001
+ * // tsc foo.mts --module nodenext
6002
+ * import {} from "mod";
6003
+ * // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
6004
+ *
6005
+ * // tsc foo.cts --module nodenext
6006
+ * import {} from "mod";
6007
+ * // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
6008
+ *
6009
+ * // tsc foo.ts --module preserve --moduleResolution bundler
6010
+ * import {} from "mod";
6011
+ * // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
6012
+ * // supports conditional imports/exports
6013
+ *
6014
+ * // tsc foo.ts --module preserve --moduleResolution node10
6015
+ * import {} from "mod";
6016
+ * // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
6017
+ * // does not support conditional imports/exports
6018
+ *
6019
+ * // tsc foo.ts --module commonjs --moduleResolution node10
6020
+ * import type {} from "mod" with { "resolution-mode": "import" };
6021
+ * // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
6022
+ * ```
5999
6023
  */
6000
6024
  getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike): ResolutionMode;
6001
6025
  /**
6002
- * Calculates the final resolution mode for an import at some index within a file's `imports` list. This is the resolution mode
6003
- * explicitly provided via import attributes, if present, or the syntax the usage would have if emitted to JavaScript. In
6004
- * `--module node16` or `nodenext`, this may depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the
6005
- * input syntax of the reference. In other `module` modes, when overriding import attributes are not provided, this function returns
6006
- * `undefined`, as the result would have no impact on module resolution, emit, or type checking.
6026
+ * Calculates the final resolution mode for an import at some index within a file's `imports` list. This function only returns a result
6027
+ * when module resolution settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided
6028
+ * via import attributes, which cause an `import` or `require` condition to be used during resolution regardless of module resolution
6029
+ * settings. In absence of overriding attributes, and in modes that support differing resolution, the result indicates the syntax the
6030
+ * usage would emit to JavaScript. Some examples:
6031
+ *
6032
+ * ```ts
6033
+ * // tsc foo.mts --module nodenext
6034
+ * import {} from "mod";
6035
+ * // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
6036
+ *
6037
+ * // tsc foo.cts --module nodenext
6038
+ * import {} from "mod";
6039
+ * // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
6040
+ *
6041
+ * // tsc foo.ts --module preserve --moduleResolution bundler
6042
+ * import {} from "mod";
6043
+ * // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
6044
+ * // supports conditional imports/exports
6045
+ *
6046
+ * // tsc foo.ts --module preserve --moduleResolution node10
6047
+ * import {} from "mod";
6048
+ * // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
6049
+ * // does not support conditional imports/exports
6050
+ *
6051
+ * // tsc foo.ts --module commonjs --moduleResolution node10
6052
+ * import type {} from "mod" with { "resolution-mode": "import" };
6053
+ * // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
6054
+ * ```
6007
6055
  */
6008
6056
  getModeForResolutionAtIndex(file: SourceFile, index: number): ResolutionMode;
6009
6057
  getProjectReferences(): readonly ProjectReference[] | undefined;
@@ -6886,6 +6934,7 @@ declare namespace ts {
6886
6934
  downlevelIteration?: boolean;
6887
6935
  emitBOM?: boolean;
6888
6936
  emitDecoratorMetadata?: boolean;
6937
+ enforceReadonly?: boolean;
6889
6938
  exactOptionalPropertyTypes?: boolean;
6890
6939
  experimentalDecorators?: boolean;
6891
6940
  forceConsistentCasingInFileNames?: boolean;
@@ -9362,24 +9411,43 @@ declare namespace ts {
9362
9411
  function getModeForResolutionAtIndex(file: SourceFile, index: number, compilerOptions: CompilerOptions): ResolutionMode;
9363
9412
  /**
9364
9413
  * Use `program.getModeForUsageLocation`, which retrieves the correct `compilerOptions`, instead of this function whenever possible.
9365
- * Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import
9366
- * attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may
9367
- * depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other
9368
- * `module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no
9369
- * impact on module resolution, emit, or type checking.
9414
+ * Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution
9415
+ * settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes,
9416
+ * which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of
9417
+ * overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript.
9418
+ * Some examples:
9419
+ *
9420
+ * ```ts
9421
+ * // tsc foo.mts --module nodenext
9422
+ * import {} from "mod";
9423
+ * // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
9424
+ *
9425
+ * // tsc foo.cts --module nodenext
9426
+ * import {} from "mod";
9427
+ * // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
9428
+ *
9429
+ * // tsc foo.ts --module preserve --moduleResolution bundler
9430
+ * import {} from "mod";
9431
+ * // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
9432
+ * // supports conditional imports/exports
9433
+ *
9434
+ * // tsc foo.ts --module preserve --moduleResolution node10
9435
+ * import {} from "mod";
9436
+ * // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
9437
+ * // does not support conditional imports/exports
9438
+ *
9439
+ * // tsc foo.ts --module commonjs --moduleResolution node10
9440
+ * import type {} from "mod" with { "resolution-mode": "import" };
9441
+ * // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
9442
+ * ```
9443
+ *
9370
9444
  * @param file The file the import or import-like reference is contained within
9371
9445
  * @param usage The module reference string
9372
9446
  * @param compilerOptions The compiler options for the program that owns the file. If the file belongs to a referenced project, the compiler options
9373
9447
  * should be the options of the referenced project, not the referencing project.
9374
9448
  * @returns The final resolution mode of the import
9375
9449
  */
9376
- function getModeForUsageLocation(
9377
- file: {
9378
- impliedNodeFormat?: ResolutionMode;
9379
- },
9380
- usage: StringLiteralLike,
9381
- compilerOptions: CompilerOptions,
9382
- ): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
9450
+ function getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike, compilerOptions: CompilerOptions): ResolutionMode;
9383
9451
  function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
9384
9452
  /**
9385
9453
  * A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the