@typescript-deploys/pr-build 4.9.0-pr-50247-13 → 4.9.0-pr-50293-5

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.
@@ -1788,7 +1788,7 @@ declare namespace ts {
1788
1788
  }
1789
1789
  export interface FileReference extends TextRange {
1790
1790
  fileName: string;
1791
- resolutionMode?: ResolutionMode;
1791
+ resolutionMode?: SourceFile["impliedNodeFormat"];
1792
1792
  }
1793
1793
  export interface CheckJsDirective extends TextRange {
1794
1794
  enabled: boolean;
@@ -2103,7 +2103,7 @@ declare namespace ts {
2103
2103
  * of `node`). If so, this field will be unset and source files will be considered to be
2104
2104
  * CommonJS-output-format by the node module transformer and type checker, regardless of extension or context.
2105
2105
  */
2106
- impliedNodeFormat?: ResolutionMode;
2106
+ impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
2107
2107
  }
2108
2108
  export interface Bundle extends Node {
2109
2109
  readonly kind: SyntaxKind.Bundle;
@@ -3048,7 +3048,6 @@ declare namespace ts {
3048
3048
  jsxImportSource?: string;
3049
3049
  composite?: boolean;
3050
3050
  incremental?: boolean;
3051
- cacheResolutions?: boolean;
3052
3051
  tsBuildInfoFile?: string;
3053
3052
  removeComments?: boolean;
3054
3053
  rootDir?: string;
@@ -3274,7 +3273,7 @@ declare namespace ts {
3274
3273
  readonly resolvedModule: ResolvedModuleFull | undefined;
3275
3274
  }
3276
3275
  export interface ResolvedTypeReferenceDirective {
3277
- primary: boolean | undefined;
3276
+ primary: boolean;
3278
3277
  resolvedFileName: string | undefined;
3279
3278
  packageId?: PackageId;
3280
3279
  /** True if `resolvedFileName` comes from `node_modules`. */
@@ -3284,13 +3283,6 @@ declare namespace ts {
3284
3283
  readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined;
3285
3284
  readonly failedLookupLocations: string[];
3286
3285
  }
3287
- export interface PartialResolutionInfo {
3288
- reusedNames: {
3289
- name: string;
3290
- mode: ResolutionMode;
3291
- }[] | undefined;
3292
- namesIndex: readonly number[];
3293
- }
3294
3286
  export interface CompilerHost extends ModuleResolutionHost {
3295
3287
  getSourceFile(fileName: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined;
3296
3288
  getSourceFileByPath?(fileName: string, path: Path, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined;
@@ -3303,7 +3295,7 @@ declare namespace ts {
3303
3295
  useCaseSensitiveFileNames(): boolean;
3304
3296
  getNewLine(): string;
3305
3297
  readDirectory?(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): string[];
3306
- resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile, partialResolutionInfo?: PartialResolutionInfo): ResolvedModuleWithFailedLookupLocations[] | (ResolvedModule | undefined)[];
3298
+ resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
3307
3299
  /**
3308
3300
  * Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
3309
3301
  */
@@ -3311,7 +3303,7 @@ declare namespace ts {
3311
3303
  /**
3312
3304
  * This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files
3313
3305
  */
3314
- resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: ResolutionMode, partialResolutionInfo?: PartialResolutionInfo): ResolvedTypeReferenceDirectiveWithFailedLookupLocations[] | (ResolvedTypeReferenceDirective | undefined)[];
3306
+ resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
3315
3307
  getEnvironmentVariable?(name: string): string | undefined;
3316
3308
  createHash?(data: string): string;
3317
3309
  getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
@@ -4867,7 +4859,7 @@ declare namespace ts {
4867
4859
  * and files on disk, but needs to be done with a module resolution cache in scope to be performant.
4868
4860
  * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`.
4869
4861
  */
4870
- impliedNodeFormat?: ResolutionMode;
4862
+ impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
4871
4863
  /**
4872
4864
  * Controls how module-y-ness is set for the given file. Usually the result of calling
4873
4865
  * `getSetExternalModuleIndicator` on a valid `CompilerOptions` object. If not present, the default
@@ -4982,7 +4974,7 @@ declare namespace ts {
4982
4974
  * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
4983
4975
  * is assumed to be the same as root directory of the project.
4984
4976
  */
4985
- export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?: ResolutionMode): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
4977
+ export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?: SourceFile["impliedNodeFormat"]): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
4986
4978
  /**
4987
4979
  * Given a set of options, returns the set of type directive names
4988
4980
  * that should be included for this program automatically.
@@ -4994,13 +4986,12 @@ declare namespace ts {
4994
4986
  export function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
4995
4987
  export interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
4996
4988
  }
4997
- export type ResolutionMode = ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
4998
4989
  export interface ModeAwareCache<T> {
4999
- get(key: string, mode: ResolutionMode): T | undefined;
5000
- set(key: string, mode: ResolutionMode, value: T): this;
5001
- delete(key: string, mode: ResolutionMode): this;
5002
- has(key: string, mode: ResolutionMode): boolean;
5003
- forEach(cb: (elem: T, key: string, mode: ResolutionMode) => void): void;
4990
+ get(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined): T | undefined;
4991
+ set(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined, value: T): this;
4992
+ delete(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined): this;
4993
+ has(key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined): boolean;
4994
+ forEach(cb: (elem: T, key: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined) => void): void;
5004
4995
  size(): number;
5005
4996
  }
5006
4997
  /**
@@ -5008,7 +4999,6 @@ declare namespace ts {
5008
4999
  * This assumes that any module id will have the same resolution for sibling files located in the same folder.
5009
5000
  */
5010
5001
  export interface PerDirectoryResolutionCache<T> {
5011
- getFromCache(directoryName: string, name: string, mode: ResolutionMode, redirectedReference?: ResolvedProjectReference): T | undefined;
5012
5002
  getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): ModeAwareCache<T>;
5013
5003
  clear(): void;
5014
5004
  /**
@@ -5025,8 +5015,7 @@ declare namespace ts {
5025
5015
  * We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive.
5026
5016
  */
5027
5017
  export interface NonRelativeModuleNameResolutionCache extends PackageJsonInfoCache {
5028
- getFromModuleNameCache(directory: string, nonRelativeModuleName: string, mode: ResolutionMode, redirectedReference: ResolvedProjectReference | undefined): ResolvedModuleWithFailedLookupLocations | undefined;
5029
- getOrCreateCacheForModuleName(nonRelativeModuleName: string, mode: ResolutionMode, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
5018
+ getOrCreateCacheForModuleName(nonRelativeModuleName: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
5030
5019
  }
5031
5020
  export interface PackageJsonInfoCache {
5032
5021
  clear(): void;
@@ -5037,8 +5026,8 @@ declare namespace ts {
5037
5026
  }
5038
5027
  export function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
5039
5028
  export function createTypeReferenceDirectiveResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): TypeReferenceDirectiveResolutionCache;
5040
- export function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations | undefined;
5041
- export function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations;
5029
+ export function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
5030
+ export function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations;
5042
5031
  export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
5043
5032
  export function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
5044
5033
  export {};
@@ -5152,7 +5141,7 @@ declare namespace ts {
5152
5141
  * Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly
5153
5142
  * provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
5154
5143
  */
5155
- export function getModeForFileReference(ref: FileReference | string, containingFileMode: ResolutionMode): ResolutionMode;
5144
+ export function getModeForFileReference(ref: FileReference | string, containingFileMode: SourceFile["impliedNodeFormat"]): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5156
5145
  /**
5157
5146
  * Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly
5158
5147
  * defined mode of the import if provided, or, if not, the mode of the containing file (with some exceptions: import=require is always commonjs, dynamic import is always esm).
@@ -5160,7 +5149,7 @@ declare namespace ts {
5160
5149
  * @param file File to fetch the resolution mode within
5161
5150
  * @param index Index into the file's complete resolution list to get the resolution of - this is a concatenation of the file's imports and module augmentations
5162
5151
  */
5163
- export function getModeForResolutionAtIndex(file: SourceFile, index: number): ResolutionMode;
5152
+ export function getModeForResolutionAtIndex(file: SourceFile, index: number): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5164
5153
  /**
5165
5154
  * Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
5166
5155
  * one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
@@ -5171,7 +5160,7 @@ declare namespace ts {
5171
5160
  * @returns The final resolution mode of the import
5172
5161
  */
5173
5162
  export function getModeForUsageLocation(file: {
5174
- impliedNodeFormat?: ResolutionMode;
5163
+ impliedNodeFormat?: SourceFile["impliedNodeFormat"];
5175
5164
  }, usage: StringLiteralLike): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5176
5165
  export function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
5177
5166
  /**
@@ -5184,7 +5173,7 @@ declare namespace ts {
5184
5173
  * @param options The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution`
5185
5174
  * @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
5186
5175
  */
5187
- export function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode;
5176
+ export function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ModuleKind.ESNext | ModuleKind.CommonJS | undefined;
5188
5177
  /**
5189
5178
  * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
5190
5179
  * that represent a compilation unit.
@@ -5239,6 +5228,10 @@ declare namespace ts {
5239
5228
  affected: SourceFile | Program;
5240
5229
  } | undefined;
5241
5230
  interface BuilderProgramHost {
5231
+ /**
5232
+ * return true if file names are treated with case sensitivity
5233
+ */
5234
+ useCaseSensitiveFileNames(): boolean;
5242
5235
  /**
5243
5236
  * If provided this would be used this hash instead of actual file shape text for detecting changes
5244
5237
  */
@@ -5425,9 +5418,9 @@ declare namespace ts {
5425
5418
  /** If provided is used to get the environment variable */
5426
5419
  getEnvironmentVariable?(name: string): string | undefined;
5427
5420
  /** If provided, used to resolve the module names, otherwise typescript's default module resolution */
5428
- resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile, partialResolutionInfo?: PartialResolutionInfo): ResolvedModuleWithFailedLookupLocations[] | (ResolvedModule | undefined)[];
5421
+ resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
5429
5422
  /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
5430
- resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: ResolutionMode, partialResolutionInfo?: PartialResolutionInfo): ResolvedTypeReferenceDirectiveWithFailedLookupLocations[] | (ResolvedTypeReferenceDirective | undefined)[];
5423
+ resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
5431
5424
  /**
5432
5425
  * Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
5433
5426
  */
@@ -5507,7 +5500,6 @@ declare namespace ts {
5507
5500
  force?: boolean;
5508
5501
  verbose?: boolean;
5509
5502
  incremental?: boolean;
5510
- cacheResolutions?: boolean;
5511
5503
  assumeChangesOnlyAffectDirectDependencies?: boolean;
5512
5504
  traceResolution?: boolean;
5513
5505
  [option: string]: CompilerOptionsValue | undefined;
@@ -5826,8 +5818,9 @@ declare namespace ts {
5826
5818
  readFile(path: string, encoding?: string): string | undefined;
5827
5819
  fileExists(path: string): boolean;
5828
5820
  getTypeRootsVersion?(): number;
5829
- resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile, partialResolutionInfo?: PartialResolutionInfo): ResolvedModuleWithFailedLookupLocations[] | (ResolvedModule | undefined)[];
5830
- resolveTypeReferenceDirectives?(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: ResolutionMode, partialResolutionInfo?: PartialResolutionInfo): ResolvedTypeReferenceDirectiveWithFailedLookupLocations[] | (ResolvedTypeReferenceDirective | undefined)[];
5821
+ resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
5822
+ getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
5823
+ resolveTypeReferenceDirectives?(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
5831
5824
  getDirectories?(directoryName: string): string[];
5832
5825
  /**
5833
5826
  * Gets a set of custom transformers to use during emit.
@@ -6954,11 +6947,11 @@ declare namespace ts {
6954
6947
  * @param scriptKind The script kind of the file to be released
6955
6948
  * @param impliedNodeFormat The implied source file format of the file to be released
6956
6949
  */
6957
- releaseDocument(fileName: string, compilationSettings: CompilerOptions, scriptKind: ScriptKind, impliedNodeFormat: ResolutionMode): void;
6950
+ releaseDocument(fileName: string, compilationSettings: CompilerOptions, scriptKind: ScriptKind, impliedNodeFormat: SourceFile["impliedNodeFormat"]): void;
6958
6951
  /**
6959
6952
  * @deprecated pass scriptKind for and impliedNodeFormat correctness */
6960
6953
  releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind?: ScriptKind): void;
6961
- releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind: ScriptKind, impliedNodeFormat: ResolutionMode): void;
6954
+ releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind: ScriptKind, impliedNodeFormat: SourceFile["impliedNodeFormat"]): void;
6962
6955
  reportStats(): string;
6963
6956
  }
6964
6957
  type DocumentRegistryBucketKey = string & {
@@ -10108,9 +10101,10 @@ declare namespace ts.server {
10108
10101
  readFile(fileName: string): string | undefined;
10109
10102
  writeFile(fileName: string, content: string): void;
10110
10103
  fileExists(file: string): boolean;
10111
- resolveModuleNames(moduleNames: string[], containingFile: string, _reusedNames?: string[], redirectedReference?: ResolvedProjectReference, _options?: CompilerOptions, containingSourceFile?: SourceFile, partialResolutionInfo?: PartialResolutionInfo): ResolvedModuleWithFailedLookupLocations[];
10104
+ resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference, _options?: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModuleFull | undefined)[];
10112
10105
  getModuleResolutionCache(): ModuleResolutionCache | undefined;
10113
- resolveTypeReferenceDirectives(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference?: ResolvedProjectReference, _options?: CompilerOptions, containingFileMode?: ResolutionMode, partialResolutionInfo?: PartialResolutionInfo): ResolvedTypeReferenceDirectiveWithFailedLookupLocations[];
10106
+ getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
10107
+ resolveTypeReferenceDirectives(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference?: ResolvedProjectReference, _options?: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
10114
10108
  directoryExists(path: string): boolean;
10115
10109
  getDirectories(path: string): string[];
10116
10110
  log(s: string): void;