@typescript-deploys/pr-build 5.0.0-pr-50996-2 → 5.0.0-pr-51492-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.
- package/lib/tsc.js +47 -55
- package/lib/tsserver.js +64 -311
- package/lib/tsserverlibrary.d.ts +25 -24
- package/lib/tsserverlibrary.js +65 -312
- package/lib/typescript.d.ts +23 -22
- package/lib/typescript.js +52 -295
- package/package.json +1 -1
package/lib/typescript.d.ts
CHANGED
|
@@ -1825,7 +1825,7 @@ declare namespace ts {
|
|
|
1825
1825
|
}
|
|
1826
1826
|
interface FileReference extends TextRange {
|
|
1827
1827
|
fileName: string;
|
|
1828
|
-
resolutionMode?:
|
|
1828
|
+
resolutionMode?: ResolutionMode;
|
|
1829
1829
|
}
|
|
1830
1830
|
interface CheckJsDirective extends TextRange {
|
|
1831
1831
|
enabled: boolean;
|
|
@@ -2103,6 +2103,7 @@ declare namespace ts {
|
|
|
2103
2103
|
interface SourceFileLike {
|
|
2104
2104
|
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
|
|
2105
2105
|
}
|
|
2106
|
+
type ResolutionMode = ModuleKind.ESNext | ModuleKind.CommonJS | undefined;
|
|
2106
2107
|
interface SourceFile extends Declaration {
|
|
2107
2108
|
readonly kind: SyntaxKind.SourceFile;
|
|
2108
2109
|
readonly statements: NodeArray<Statement>;
|
|
@@ -2143,7 +2144,7 @@ declare namespace ts {
|
|
|
2143
2144
|
* of `node`). If so, this field will be unset and source files will be considered to be
|
|
2144
2145
|
* CommonJS-output-format by the node module transformer and type checker, regardless of extension or context.
|
|
2145
2146
|
*/
|
|
2146
|
-
impliedNodeFormat?:
|
|
2147
|
+
impliedNodeFormat?: ResolutionMode;
|
|
2147
2148
|
}
|
|
2148
2149
|
interface SourceFile {
|
|
2149
2150
|
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
|
|
@@ -3407,7 +3408,7 @@ declare namespace ts {
|
|
|
3407
3408
|
/**
|
|
3408
3409
|
* This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files
|
|
3409
3410
|
*/
|
|
3410
|
-
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?:
|
|
3411
|
+
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: ResolutionMode | undefined, resolutionInfo?: TypeReferenceDirectiveResolutionInfo): (ResolvedTypeReferenceDirective | undefined)[];
|
|
3411
3412
|
getEnvironmentVariable?(name: string): string | undefined;
|
|
3412
3413
|
/** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
|
|
3413
3414
|
hasInvalidatedResolutions?(filePath: Path): boolean;
|
|
@@ -5137,7 +5138,7 @@ declare namespace ts {
|
|
|
5137
5138
|
* and files on disk, but needs to be done with a module resolution cache in scope to be performant.
|
|
5138
5139
|
* This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`.
|
|
5139
5140
|
*/
|
|
5140
|
-
impliedNodeFormat?:
|
|
5141
|
+
impliedNodeFormat?: ResolutionMode;
|
|
5141
5142
|
/**
|
|
5142
5143
|
* Controls how module-y-ness is set for the given file. Usually the result of calling
|
|
5143
5144
|
* `getSetExternalModuleIndicator` on a valid `CompilerOptions` object. If not present, the default
|
|
@@ -5236,7 +5237,7 @@ declare namespace ts {
|
|
|
5236
5237
|
* This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
|
|
5237
5238
|
* is assumed to be the same as root directory of the project.
|
|
5238
5239
|
*/
|
|
5239
|
-
function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?:
|
|
5240
|
+
function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?: ResolutionMode): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
|
|
5240
5241
|
/**
|
|
5241
5242
|
* Given a set of options, returns the set of type directive names
|
|
5242
5243
|
* that should be included for this program automatically.
|
|
@@ -5248,18 +5249,18 @@ declare namespace ts {
|
|
|
5248
5249
|
function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
|
|
5249
5250
|
function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
|
|
5250
5251
|
function createTypeReferenceDirectiveResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): TypeReferenceDirectiveResolutionCache;
|
|
5251
|
-
function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?:
|
|
5252
|
-
function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?:
|
|
5252
|
+
function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations | undefined;
|
|
5253
|
+
function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations;
|
|
5253
5254
|
function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
|
5254
5255
|
function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
|
5255
5256
|
interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
|
|
5256
5257
|
}
|
|
5257
5258
|
interface ModeAwareCache<T> {
|
|
5258
|
-
get(key: string, mode:
|
|
5259
|
-
set(key: string, mode:
|
|
5260
|
-
delete(key: string, mode:
|
|
5261
|
-
has(key: string, mode:
|
|
5262
|
-
forEach(cb: (elem: T, key: string, mode:
|
|
5259
|
+
get(key: string, mode: ResolutionMode): T | undefined;
|
|
5260
|
+
set(key: string, mode: ResolutionMode, value: T): this;
|
|
5261
|
+
delete(key: string, mode: ResolutionMode): this;
|
|
5262
|
+
has(key: string, mode: ResolutionMode): boolean;
|
|
5263
|
+
forEach(cb: (elem: T, key: string, mode: ResolutionMode) => void): void;
|
|
5263
5264
|
size(): number;
|
|
5264
5265
|
}
|
|
5265
5266
|
/**
|
|
@@ -5283,7 +5284,7 @@ declare namespace ts {
|
|
|
5283
5284
|
* We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive.
|
|
5284
5285
|
*/
|
|
5285
5286
|
interface NonRelativeModuleNameResolutionCache extends PackageJsonInfoCache {
|
|
5286
|
-
getOrCreateCacheForModuleName(nonRelativeModuleName: string, mode:
|
|
5287
|
+
getOrCreateCacheForModuleName(nonRelativeModuleName: string, mode: ResolutionMode, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
|
|
5287
5288
|
}
|
|
5288
5289
|
interface PackageJsonInfoCache {
|
|
5289
5290
|
clear(): void;
|
|
@@ -5391,7 +5392,7 @@ declare namespace ts {
|
|
|
5391
5392
|
* Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly
|
|
5392
5393
|
* provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
|
|
5393
5394
|
*/
|
|
5394
|
-
function getModeForFileReference(ref: FileReference | string, containingFileMode:
|
|
5395
|
+
function getModeForFileReference(ref: FileReference | string, containingFileMode: ResolutionMode): ts.ResolutionMode;
|
|
5395
5396
|
/**
|
|
5396
5397
|
* Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly
|
|
5397
5398
|
* 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).
|
|
@@ -5399,7 +5400,7 @@ declare namespace ts {
|
|
|
5399
5400
|
* @param file File to fetch the resolution mode within
|
|
5400
5401
|
* @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
|
|
5401
5402
|
*/
|
|
5402
|
-
function getModeForResolutionAtIndex(file: SourceFile, index: number):
|
|
5403
|
+
function getModeForResolutionAtIndex(file: SourceFile, index: number): ResolutionMode;
|
|
5403
5404
|
/**
|
|
5404
5405
|
* Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
|
|
5405
5406
|
* one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
|
|
@@ -5410,7 +5411,7 @@ declare namespace ts {
|
|
|
5410
5411
|
* @returns The final resolution mode of the import
|
|
5411
5412
|
*/
|
|
5412
5413
|
function getModeForUsageLocation(file: {
|
|
5413
|
-
impliedNodeFormat?:
|
|
5414
|
+
impliedNodeFormat?: ResolutionMode;
|
|
5414
5415
|
}, usage: StringLiteralLike): ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined;
|
|
5415
5416
|
function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
|
|
5416
5417
|
/**
|
|
@@ -5423,7 +5424,7 @@ declare namespace ts {
|
|
|
5423
5424
|
* @param options The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution`
|
|
5424
5425
|
* @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
|
|
5425
5426
|
*/
|
|
5426
|
-
function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions):
|
|
5427
|
+
function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode;
|
|
5427
5428
|
/**
|
|
5428
5429
|
* Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
|
|
5429
5430
|
* that represent a compilation unit.
|
|
@@ -5681,7 +5682,7 @@ declare namespace ts {
|
|
|
5681
5682
|
/** If provided, used to resolve the module names, otherwise typescript's default module resolution */
|
|
5682
5683
|
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile, resolutionInfo?: ModuleResolutionInfo): (ResolvedModule | undefined)[];
|
|
5683
5684
|
/** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
|
|
5684
|
-
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?:
|
|
5685
|
+
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: ResolutionMode, resolutionInfo?: TypeReferenceDirectiveResolutionInfo): (ResolvedTypeReferenceDirective | undefined)[];
|
|
5685
5686
|
/** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
|
|
5686
5687
|
hasInvalidatedResolutions?(filePath: Path): boolean;
|
|
5687
5688
|
/**
|
|
@@ -5987,8 +5988,8 @@ declare namespace ts {
|
|
|
5987
5988
|
fileExists(path: string): boolean;
|
|
5988
5989
|
getTypeRootsVersion?(): number;
|
|
5989
5990
|
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile, resolutionInfo?: ModuleResolutionInfo): (ResolvedModule | undefined)[];
|
|
5990
|
-
getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string, resolutionMode?:
|
|
5991
|
-
resolveTypeReferenceDirectives?(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?:
|
|
5991
|
+
getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string, resolutionMode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations | undefined;
|
|
5992
|
+
resolveTypeReferenceDirectives?(typeDirectiveNames: string[] | FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: ResolutionMode, resolutionInfo?: TypeReferenceDirectiveResolutionInfo): (ResolvedTypeReferenceDirective | undefined)[];
|
|
5992
5993
|
getDirectories?(directoryName: string): string[];
|
|
5993
5994
|
/**
|
|
5994
5995
|
* Gets a set of custom transformers to use during emit.
|
|
@@ -7119,11 +7120,11 @@ declare namespace ts {
|
|
|
7119
7120
|
* @param scriptKind The script kind of the file to be released
|
|
7120
7121
|
* @param impliedNodeFormat The implied source file format of the file to be released
|
|
7121
7122
|
*/
|
|
7122
|
-
releaseDocument(fileName: string, compilationSettings: CompilerOptions, scriptKind: ScriptKind, impliedNodeFormat:
|
|
7123
|
+
releaseDocument(fileName: string, compilationSettings: CompilerOptions, scriptKind: ScriptKind, impliedNodeFormat: ResolutionMode): void;
|
|
7123
7124
|
/**
|
|
7124
7125
|
* @deprecated pass scriptKind for and impliedNodeFormat correctness */
|
|
7125
7126
|
releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind?: ScriptKind): void;
|
|
7126
|
-
releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind: ScriptKind, impliedNodeFormat:
|
|
7127
|
+
releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey, scriptKind: ScriptKind, impliedNodeFormat: ResolutionMode): void;
|
|
7127
7128
|
reportStats(): string;
|
|
7128
7129
|
}
|
|
7129
7130
|
type DocumentRegistryBucketKey = string & {
|