@typescript-deploys/pr-build 4.8.0-pr-50007-2 → 4.8.0-pr-50085-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?: 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;
@@ -4865,7 +4857,7 @@ declare namespace ts {
4865
4857
  * and files on disk, but needs to be done with a module resolution cache in scope to be performant.
4866
4858
  * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`.
4867
4859
  */
4868
- impliedNodeFormat?: ResolutionMode;
4860
+ impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
4869
4861
  /**
4870
4862
  * Controls how module-y-ness is set for the given file. Usually the result of calling
4871
4863
  * `getSetExternalModuleIndicator` on a valid `CompilerOptions` object. If not present, the default
@@ -4980,7 +4972,7 @@ declare namespace ts {
4980
4972
  * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
4981
4973
  * is assumed to be the same as root directory of the project.
4982
4974
  */
4983
- export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?: ResolutionMode): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
4975
+ export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?: SourceFile["impliedNodeFormat"]): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
4984
4976
  /**
4985
4977
  * Given a set of options, returns the set of type directive names
4986
4978
  * that should be included for this program automatically.
@@ -4992,13 +4984,12 @@ declare namespace ts {
4992
4984
  export function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
4993
4985
  export interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
4994
4986
  }
4995
- export type ResolutionMode = ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
4996
4987
  export interface ModeAwareCache<T> {
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;
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;
5002
4993
  size(): number;
5003
4994
  }
5004
4995
  /**
@@ -5006,7 +4997,6 @@ declare namespace ts {
5006
4997
  * This assumes that any module id will have the same resolution for sibling files located in the same folder.
5007
4998
  */
5008
4999
  export interface PerDirectoryResolutionCache<T> {
5009
- getFromCache(directoryName: string, name: string, mode: ResolutionMode, redirectedReference?: ResolvedProjectReference): T | undefined;
5010
5000
  getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): ModeAwareCache<T>;
5011
5001
  clear(): void;
5012
5002
  /**
@@ -5023,8 +5013,7 @@ declare namespace ts {
5023
5013
  * We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive.
5024
5014
  */
5025
5015
  export interface NonRelativeModuleNameResolutionCache extends PackageJsonInfoCache {
5026
- getFromModuleNameCache(directory: string, nonRelativeModuleName: string, mode: ResolutionMode, redirectedReference: ResolvedProjectReference | undefined): ResolvedModuleWithFailedLookupLocations | undefined;
5027
- getOrCreateCacheForModuleName(nonRelativeModuleName: string, mode: ResolutionMode, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
5016
+ getOrCreateCacheForModuleName(nonRelativeModuleName: string, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
5028
5017
  }
5029
5018
  export interface PackageJsonInfoCache {
5030
5019
  clear(): void;
@@ -5035,8 +5024,8 @@ declare namespace ts {
5035
5024
  }
5036
5025
  export function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
5037
5026
  export function createTypeReferenceDirectiveResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): TypeReferenceDirectiveResolutionCache;
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;
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;
5040
5029
  export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
5041
5030
  export function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
5042
5031
  export {};
@@ -5150,7 +5139,7 @@ declare namespace ts {
5150
5139
  * Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly
5151
5140
  * provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
5152
5141
  */
5153
- export function getModeForFileReference(ref: FileReference | string, containingFileMode: ResolutionMode): ResolutionMode;
5142
+ export function getModeForFileReference(ref: FileReference | string, containingFileMode: SourceFile["impliedNodeFormat"]): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5154
5143
  /**
5155
5144
  * Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly
5156
5145
  * 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).
@@ -5158,7 +5147,7 @@ declare namespace ts {
5158
5147
  * @param file File to fetch the resolution mode within
5159
5148
  * @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
5160
5149
  */
5161
- export function getModeForResolutionAtIndex(file: SourceFile, index: number): ResolutionMode;
5150
+ export function getModeForResolutionAtIndex(file: SourceFile, index: number): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5162
5151
  /**
5163
5152
  * Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
5164
5153
  * one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
@@ -5169,7 +5158,7 @@ declare namespace ts {
5169
5158
  * @returns The final resolution mode of the import
5170
5159
  */
5171
5160
  export function getModeForUsageLocation(file: {
5172
- impliedNodeFormat?: ResolutionMode;
5161
+ impliedNodeFormat?: SourceFile["impliedNodeFormat"];
5173
5162
  }, usage: StringLiteralLike): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
5174
5163
  export function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
5175
5164
  /**
@@ -5182,7 +5171,7 @@ declare namespace ts {
5182
5171
  * @param options The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution`
5183
5172
  * @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
5184
5173
  */
5185
- export function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode;
5174
+ export function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ModuleKind.ESNext | ModuleKind.CommonJS | undefined;
5186
5175
  /**
5187
5176
  * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
5188
5177
  * that represent a compilation unit.
@@ -5237,6 +5226,10 @@ declare namespace ts {
5237
5226
  affected: SourceFile | Program;
5238
5227
  } | undefined;
5239
5228
  interface BuilderProgramHost {
5229
+ /**
5230
+ * return true if file names are treated with case sensitivity
5231
+ */
5232
+ useCaseSensitiveFileNames(): boolean;
5240
5233
  /**
5241
5234
  * If provided this would be used this hash instead of actual file shape text for detecting changes
5242
5235
  */
@@ -5423,9 +5416,9 @@ declare namespace ts {
5423
5416
  /** If provided is used to get the environment variable */
5424
5417
  getEnvironmentVariable?(name: string): string | undefined;
5425
5418
  /** If provided, used to resolve the module names, otherwise typescript's default module resolution */
5426
- resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile, partialResolutionInfo?: PartialResolutionInfo): ResolvedModuleWithFailedLookupLocations[] | (ResolvedModule | undefined)[];
5419
+ resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
5427
5420
  /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
5428
- resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: ResolutionMode, partialResolutionInfo?: PartialResolutionInfo): ResolvedTypeReferenceDirectiveWithFailedLookupLocations[] | (ResolvedTypeReferenceDirective | undefined)[];
5421
+ resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
5429
5422
  }
5430
5423
  interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
5431
5424
  /** Instead of using output d.ts file from project reference, use its source file */
@@ -5501,7 +5494,6 @@ declare namespace ts {
5501
5494
  force?: boolean;
5502
5495
  verbose?: boolean;
5503
5496
  incremental?: boolean;
5504
- cacheResolutions?: boolean;
5505
5497
  assumeChangesOnlyAffectDirectDependencies?: boolean;
5506
5498
  traceResolution?: boolean;
5507
5499
  [option: string]: CompilerOptionsValue | undefined;
@@ -5820,8 +5812,9 @@ declare namespace ts {
5820
5812
  readFile(path: string, encoding?: string): string | undefined;
5821
5813
  fileExists(path: string): boolean;
5822
5814
  getTypeRootsVersion?(): number;
5823
- resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile, partialResolutionInfo?: PartialResolutionInfo): ResolvedModuleWithFailedLookupLocations[] | (ResolvedModule | undefined)[];
5824
- resolveTypeReferenceDirectives?(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: ResolutionMode, partialResolutionInfo?: PartialResolutionInfo): ResolvedTypeReferenceDirectiveWithFailedLookupLocations[] | (ResolvedTypeReferenceDirective | undefined)[];
5815
+ resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
5816
+ getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
5817
+ resolveTypeReferenceDirectives?(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
5825
5818
  getDirectories?(directoryName: string): string[];
5826
5819
  /**
5827
5820
  * Gets a set of custom transformers to use during emit.
@@ -10100,9 +10093,10 @@ declare namespace ts.server {
10100
10093
  readFile(fileName: string): string | undefined;
10101
10094
  writeFile(fileName: string, content: string): void;
10102
10095
  fileExists(file: string): boolean;
10103
- resolveModuleNames(moduleNames: string[], containingFile: string, _reusedNames?: string[], redirectedReference?: ResolvedProjectReference, _options?: CompilerOptions, containingSourceFile?: SourceFile, partialResolutionInfo?: PartialResolutionInfo): ResolvedModuleWithFailedLookupLocations[];
10096
+ resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference, _options?: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModuleFull | undefined)[];
10104
10097
  getModuleResolutionCache(): ModuleResolutionCache | undefined;
10105
- resolveTypeReferenceDirectives(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference?: ResolvedProjectReference, _options?: CompilerOptions, containingFileMode?: ResolutionMode, partialResolutionInfo?: PartialResolutionInfo): ResolvedTypeReferenceDirectiveWithFailedLookupLocations[];
10098
+ getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined;
10099
+ resolveTypeReferenceDirectives(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference?: ResolvedProjectReference, _options?: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
10106
10100
  directoryExists(path: string): boolean;
10107
10101
  getDirectories(path: string): string[];
10108
10102
  log(s: string): void;