@typescript-deploys/pr-build 4.9.0-pr-50293-2 → 4.9.0-pr-50294-2

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