typescript 5.6.0-dev.20240617 → 5.6.0-dev.20240619
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 +87 -79
- package/lib/typescript.d.ts +38 -82
- package/lib/typescript.js +164 -177
- package/package.json +11 -11
package/lib/typescript.d.ts
CHANGED
|
@@ -2523,6 +2523,7 @@ declare namespace ts {
|
|
|
2523
2523
|
private readonly knownCachesSet;
|
|
2524
2524
|
private readonly projectWatchers;
|
|
2525
2525
|
private safeList;
|
|
2526
|
+
private pendingRunRequests;
|
|
2526
2527
|
private installRunCount;
|
|
2527
2528
|
private inFlightRequestCount;
|
|
2528
2529
|
abstract readonly typesRegistry: Map<string, MapLike<string>>;
|
|
@@ -2715,6 +2716,7 @@ declare namespace ts {
|
|
|
2715
2716
|
readonly containingProjects: Project[];
|
|
2716
2717
|
private formatSettings;
|
|
2717
2718
|
private preferences;
|
|
2719
|
+
private realpath;
|
|
2718
2720
|
constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: number);
|
|
2719
2721
|
isScriptOpen(): boolean;
|
|
2720
2722
|
open(newText: string | undefined): void;
|
|
@@ -2802,29 +2804,27 @@ declare namespace ts {
|
|
|
2802
2804
|
private externalFiles;
|
|
2803
2805
|
private missingFilesMap;
|
|
2804
2806
|
private generatedFilesMap;
|
|
2807
|
+
private hasAddedorRemovedFiles;
|
|
2808
|
+
private hasAddedOrRemovedSymlinks;
|
|
2805
2809
|
protected languageService: LanguageService;
|
|
2806
2810
|
languageServiceEnabled: boolean;
|
|
2807
2811
|
readonly trace?: (s: string) => void;
|
|
2808
2812
|
readonly realpath?: (path: string) => string;
|
|
2809
2813
|
private builderState;
|
|
2810
|
-
/**
|
|
2811
|
-
* Set of files names that were updated since the last call to getChangesSinceVersion.
|
|
2812
|
-
*/
|
|
2813
2814
|
private updatedFileNames;
|
|
2814
|
-
/**
|
|
2815
|
-
* Set of files that was returned from the last call to getChangesSinceVersion.
|
|
2816
|
-
*/
|
|
2817
2815
|
private lastReportedFileNames;
|
|
2818
|
-
/**
|
|
2819
|
-
* Last version that was reported.
|
|
2820
|
-
*/
|
|
2821
2816
|
private lastReportedVersion;
|
|
2822
2817
|
protected projectErrors: Diagnostic[] | undefined;
|
|
2823
2818
|
protected isInitialLoadPending: () => boolean;
|
|
2819
|
+
private typingWatchers;
|
|
2824
2820
|
private readonly cancellationToken;
|
|
2825
2821
|
isNonTsProject(): boolean;
|
|
2826
2822
|
isJsOnlyProject(): boolean;
|
|
2827
2823
|
static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {} | undefined;
|
|
2824
|
+
private exportMapCache;
|
|
2825
|
+
private changedFilesForExportMapCache;
|
|
2826
|
+
private moduleSpecifierCache;
|
|
2827
|
+
private symlinks;
|
|
2828
2828
|
readonly jsDocParsingMode: JSDocParsingMode | undefined;
|
|
2829
2829
|
isKnownTypesPackageName(name: string): boolean;
|
|
2830
2830
|
installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
|
|
@@ -2895,6 +2895,8 @@ declare namespace ts {
|
|
|
2895
2895
|
* @returns: true if set of files in the project stays the same and false - otherwise.
|
|
2896
2896
|
*/
|
|
2897
2897
|
updateGraph(): boolean;
|
|
2898
|
+
private closeWatchingTypingLocations;
|
|
2899
|
+
private onTypingInstallerWatchInvoke;
|
|
2898
2900
|
protected removeExistingTypings(include: string[]): string[];
|
|
2899
2901
|
private updateGraphWorker;
|
|
2900
2902
|
private detachScriptInfoFromProject;
|
|
@@ -2906,6 +2908,7 @@ declare namespace ts {
|
|
|
2906
2908
|
getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined;
|
|
2907
2909
|
getScriptInfo(uncheckedFileName: string): ts.server.ScriptInfo | undefined;
|
|
2908
2910
|
filesToString(writeProjectFileNames: boolean): string;
|
|
2911
|
+
private filesToStringWorker;
|
|
2909
2912
|
setCompilerOptions(compilerOptions: CompilerOptions): void;
|
|
2910
2913
|
setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void;
|
|
2911
2914
|
getTypeAcquisition(): ts.TypeAcquisition;
|
|
@@ -2914,6 +2917,8 @@ declare namespace ts {
|
|
|
2914
2917
|
protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[]): void;
|
|
2915
2918
|
/** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */
|
|
2916
2919
|
refreshDiagnostics(): void;
|
|
2920
|
+
private isDefaultProjectForOpenFiles;
|
|
2921
|
+
private getCompilerOptionsForNoDtsResolutionProject;
|
|
2917
2922
|
}
|
|
2918
2923
|
/**
|
|
2919
2924
|
* If a file is opened and no tsconfig (or jsconfig) is found,
|
|
@@ -2933,6 +2938,7 @@ declare namespace ts {
|
|
|
2933
2938
|
}
|
|
2934
2939
|
class AutoImportProviderProject extends Project {
|
|
2935
2940
|
private hostProject;
|
|
2941
|
+
private static readonly maxDependencies;
|
|
2936
2942
|
private rootFileNames;
|
|
2937
2943
|
updateGraph(): boolean;
|
|
2938
2944
|
hasRoots(): boolean;
|
|
@@ -2949,6 +2955,8 @@ declare namespace ts {
|
|
|
2949
2955
|
class ConfiguredProject extends Project {
|
|
2950
2956
|
readonly canonicalConfigFilePath: NormalizedPath;
|
|
2951
2957
|
private projectReferences;
|
|
2958
|
+
private compilerHost?;
|
|
2959
|
+
private releaseParsedConfig;
|
|
2952
2960
|
/**
|
|
2953
2961
|
* If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
|
|
2954
2962
|
* @returns: true if set of files in the project stays the same and false - otherwise.
|
|
@@ -3164,16 +3172,8 @@ declare namespace ts {
|
|
|
3164
3172
|
}
|
|
3165
3173
|
class ProjectService {
|
|
3166
3174
|
private readonly nodeModulesWatchers;
|
|
3167
|
-
/**
|
|
3168
|
-
* Contains all the deleted script info's version information so that
|
|
3169
|
-
* it does not reset when creating script info again
|
|
3170
|
-
* (and could have potentially collided with version where contents mismatch)
|
|
3171
|
-
*/
|
|
3172
3175
|
private readonly filenameToScriptInfoVersion;
|
|
3173
3176
|
private readonly allJsFilesForOpenFileTelemetry;
|
|
3174
|
-
/**
|
|
3175
|
-
* maps external project file name to list of config files that were the part of this project
|
|
3176
|
-
*/
|
|
3177
3177
|
private readonly externalProjectToConfiguredProjectMap;
|
|
3178
3178
|
/**
|
|
3179
3179
|
* external projects (configuration and list of root files is not controlled by tsserver)
|
|
@@ -3191,13 +3191,8 @@ declare namespace ts {
|
|
|
3191
3191
|
* Open files: with value being project root path, and key being Path of the file that is open
|
|
3192
3192
|
*/
|
|
3193
3193
|
readonly openFiles: Map<Path, NormalizedPath | undefined>;
|
|
3194
|
-
/** Config files looked up and cached config files for open script info */
|
|
3195
3194
|
private readonly configFileForOpenFiles;
|
|
3196
|
-
/** Set of open script infos that are root of inferred project */
|
|
3197
3195
|
private rootOfInferredProjects;
|
|
3198
|
-
/**
|
|
3199
|
-
* Map of open files that are opened without complete path but have projectRoot as current directory
|
|
3200
|
-
*/
|
|
3201
3196
|
private readonly openFilesWithNonRootedDiskPath;
|
|
3202
3197
|
private compilerOptionsForInferredProjects;
|
|
3203
3198
|
private compilerOptionsForInferredProjectsPerProjectRoot;
|
|
@@ -3205,18 +3200,11 @@ declare namespace ts {
|
|
|
3205
3200
|
private watchOptionsForInferredProjectsPerProjectRoot;
|
|
3206
3201
|
private typeAcquisitionForInferredProjects;
|
|
3207
3202
|
private typeAcquisitionForInferredProjectsPerProjectRoot;
|
|
3208
|
-
/**
|
|
3209
|
-
* Project size for configured or external projects
|
|
3210
|
-
*/
|
|
3211
3203
|
private readonly projectToSizeMap;
|
|
3212
3204
|
private readonly hostConfiguration;
|
|
3213
3205
|
private safelist;
|
|
3214
3206
|
private readonly legacySafelist;
|
|
3215
3207
|
private pendingProjectUpdates;
|
|
3216
|
-
/**
|
|
3217
|
-
* All the open script info that needs recalculation of the default project,
|
|
3218
|
-
* this also caches config file info before config file change was detected to use it in case projects are not updated yet
|
|
3219
|
-
*/
|
|
3220
3208
|
private pendingOpenFileProjectUpdates?;
|
|
3221
3209
|
readonly currentDirectory: NormalizedPath;
|
|
3222
3210
|
readonly toCanonicalFileName: (f: string) => string;
|
|
@@ -3234,8 +3222,11 @@ declare namespace ts {
|
|
|
3234
3222
|
readonly allowLocalPluginLoads: boolean;
|
|
3235
3223
|
readonly typesMapLocation: string | undefined;
|
|
3236
3224
|
readonly serverMode: LanguageServiceMode;
|
|
3237
|
-
/** Tracks projects that we have already sent telemetry for. */
|
|
3238
3225
|
private readonly seenProjects;
|
|
3226
|
+
private readonly sharedExtendedConfigFileWatchers;
|
|
3227
|
+
private readonly extendedConfigCache;
|
|
3228
|
+
private packageJsonFilesMap;
|
|
3229
|
+
private incompleteCompletionsCache;
|
|
3239
3230
|
private performanceEventHandler?;
|
|
3240
3231
|
private pendingPluginEnablements?;
|
|
3241
3232
|
private currentPluginEnablementPromise?;
|
|
@@ -3249,20 +3240,9 @@ declare namespace ts {
|
|
|
3249
3240
|
setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void;
|
|
3250
3241
|
findProject(projectName: string): Project | undefined;
|
|
3251
3242
|
getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined;
|
|
3252
|
-
/**
|
|
3253
|
-
* If there is default project calculation pending for this file,
|
|
3254
|
-
* then it completes that calculation so that correct default project is used for the project
|
|
3255
|
-
*/
|
|
3256
3243
|
private tryGetDefaultProjectForEnsuringConfiguredProjectForFile;
|
|
3257
3244
|
private doEnsureDefaultProjectForFile;
|
|
3258
3245
|
getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined;
|
|
3259
|
-
/**
|
|
3260
|
-
* Ensures the project structures are upto date
|
|
3261
|
-
* This means,
|
|
3262
|
-
* - we go through all the projects and update them if they are dirty
|
|
3263
|
-
* - if updates reflect some change in structure or there was pending request to ensure projects for open files
|
|
3264
|
-
* ensure that each open script info has project
|
|
3265
|
-
*/
|
|
3266
3246
|
private ensureProjectStructuresUptoDate;
|
|
3267
3247
|
getFormatCodeOptions(file: NormalizedPath): FormatCodeSettings;
|
|
3268
3248
|
getPreferences(file: NormalizedPath): protocol.UserPreferences;
|
|
@@ -3273,37 +3253,29 @@ declare namespace ts {
|
|
|
3273
3253
|
private delayUpdateSourceInfoProjects;
|
|
3274
3254
|
private delayUpdateProjectsOfScriptInfoPath;
|
|
3275
3255
|
private handleDeletedFile;
|
|
3256
|
+
private watchWildcardDirectory;
|
|
3257
|
+
private delayUpdateProjectsFromParsedConfigOnConfigFileChange;
|
|
3258
|
+
private onConfigFileChanged;
|
|
3276
3259
|
private removeProject;
|
|
3277
3260
|
private assignOrphanScriptInfosToInferredProject;
|
|
3278
|
-
/**
|
|
3279
|
-
* Remove this file from the set of open, non-configured files.
|
|
3280
|
-
* @param info The file that has been closed or newly configured
|
|
3281
|
-
*/
|
|
3282
3261
|
private closeOpenFile;
|
|
3283
3262
|
private deleteScriptInfo;
|
|
3284
3263
|
private configFileExists;
|
|
3285
|
-
|
|
3286
|
-
* This function tries to search for a tsconfig.json for the given file.
|
|
3287
|
-
* This is different from the method the compiler uses because
|
|
3288
|
-
* the compiler can assume it will always start searching in the
|
|
3289
|
-
* current directory (the directory in which tsc was invoked).
|
|
3290
|
-
* The server must start searching from the directory containing
|
|
3291
|
-
* the newly opened file.
|
|
3292
|
-
*/
|
|
3264
|
+
private createConfigFileWatcherForParsedConfig;
|
|
3293
3265
|
private forEachConfigFileLocation;
|
|
3294
|
-
/** Get cached configFileName for scriptInfo or ancestor of open script info */
|
|
3295
3266
|
private getConfigFileNameForFileFromCache;
|
|
3296
|
-
/** Caches the configFilename for script info or ancestor of open script info */
|
|
3297
3267
|
private setConfigFileNameForFileInCache;
|
|
3298
3268
|
private printProjects;
|
|
3299
3269
|
private getConfiguredProjectByCanonicalConfigFilePath;
|
|
3300
3270
|
private findExternalProjectByProjectName;
|
|
3301
|
-
/** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */
|
|
3302
3271
|
private getFilenameForExceededTotalSizeLimitForNonTsFiles;
|
|
3303
3272
|
private createExternalProject;
|
|
3304
3273
|
private addFilesToNonInferredProject;
|
|
3274
|
+
private loadConfiguredProject;
|
|
3305
3275
|
private updateNonInferredProjectFiles;
|
|
3306
3276
|
private updateRootAndOptionsOfNonInferredProject;
|
|
3277
|
+
private reloadFileNamesOfParsedConfig;
|
|
3278
|
+
private clearSemanticCache;
|
|
3307
3279
|
private getOrCreateInferredProjectForProjectRootPathIfEnabled;
|
|
3308
3280
|
private getOrCreateSingleInferredProjectIfEnabled;
|
|
3309
3281
|
private getOrCreateSingleInferredWithoutProjectRoot;
|
|
@@ -3329,23 +3301,14 @@ declare namespace ts {
|
|
|
3329
3301
|
private addSourceInfoToSourceMap;
|
|
3330
3302
|
private addMissingSourceMapFile;
|
|
3331
3303
|
setHostConfiguration(args: protocol.ConfigureRequestArguments): void;
|
|
3304
|
+
private getWatchOptionsFromProjectWatchOptions;
|
|
3332
3305
|
closeLog(): void;
|
|
3333
3306
|
/**
|
|
3334
3307
|
* This function rebuilds the project for every file opened by the client
|
|
3335
3308
|
* This does not reload contents of open files from disk. But we could do that if needed
|
|
3336
3309
|
*/
|
|
3337
3310
|
reloadProjects(): void;
|
|
3338
|
-
/**
|
|
3339
|
-
* Remove the root of inferred project if script info is part of another project
|
|
3340
|
-
*/
|
|
3341
3311
|
private removeRootOfInferredProjectIfNowPartOfOtherProject;
|
|
3342
|
-
/**
|
|
3343
|
-
* This function is to update the project structure for every inferred project.
|
|
3344
|
-
* It is called on the premise that all the configured projects are
|
|
3345
|
-
* up to date.
|
|
3346
|
-
* This will go through open files and assign them to inferred project if open file is not part of any other project
|
|
3347
|
-
* After that all the inferred project graphs are updated
|
|
3348
|
-
*/
|
|
3349
3312
|
private ensureProjectForOpenFiles;
|
|
3350
3313
|
/**
|
|
3351
3314
|
* Open file whose contents is managed by the client
|
|
@@ -3356,16 +3319,7 @@ declare namespace ts {
|
|
|
3356
3319
|
private findExternalProjectContainingOpenScriptInfo;
|
|
3357
3320
|
private getOrCreateOpenScriptInfo;
|
|
3358
3321
|
private assignProjectToOpenedScriptInfo;
|
|
3359
|
-
/**
|
|
3360
|
-
* Finds the default configured project for given info
|
|
3361
|
-
* For any tsconfig found, it looks into that project, if not then all its references,
|
|
3362
|
-
* The search happens for all tsconfigs till projectRootPath
|
|
3363
|
-
*/
|
|
3364
3322
|
private tryFindDefaultConfiguredProjectForOpenScriptInfo;
|
|
3365
|
-
/**
|
|
3366
|
-
* Finds the default configured project, if found, it creates the solution projects (does not load them right away)
|
|
3367
|
-
* with Find: finds the projects even if the project is deferredClosed
|
|
3368
|
-
*/
|
|
3369
3323
|
private tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo;
|
|
3370
3324
|
private ensureProjectChildren;
|
|
3371
3325
|
private cleanupConfiguredProjects;
|
|
@@ -3381,7 +3335,6 @@ declare namespace ts {
|
|
|
3381
3335
|
private collectChanges;
|
|
3382
3336
|
closeExternalProject(uncheckedFileName: string): void;
|
|
3383
3337
|
openExternalProjects(projects: protocol.ExternalProject[]): void;
|
|
3384
|
-
/** Makes a filename safe to insert in a RegExp */
|
|
3385
3338
|
private static readonly filenameEscapeRegexp;
|
|
3386
3339
|
private static escapeFilenameForRegex;
|
|
3387
3340
|
resetSafeList(): void;
|
|
@@ -3389,9 +3342,12 @@ declare namespace ts {
|
|
|
3389
3342
|
private applySafeListWorker;
|
|
3390
3343
|
openExternalProject(proj: protocol.ExternalProject): void;
|
|
3391
3344
|
hasDeferredExtension(): boolean;
|
|
3345
|
+
private endEnablePlugin;
|
|
3392
3346
|
private enableRequestedPluginsAsync;
|
|
3393
3347
|
private enableRequestedPluginsWorker;
|
|
3394
3348
|
configurePlugin(args: protocol.ConfigurePluginRequestArguments): void;
|
|
3349
|
+
private watchPackageJsonFile;
|
|
3350
|
+
private onPackageJsonChange;
|
|
3395
3351
|
}
|
|
3396
3352
|
function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: BufferEncoding) => number, newLine: string): string;
|
|
3397
3353
|
interface ServerCancellationToken extends HostCancellationToken {
|
|
@@ -3471,7 +3427,6 @@ declare namespace ts {
|
|
|
3471
3427
|
private suggestionCheck;
|
|
3472
3428
|
private regionSemanticCheck;
|
|
3473
3429
|
private sendDiagnosticsEvent;
|
|
3474
|
-
/** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */
|
|
3475
3430
|
private updateErrorCheck;
|
|
3476
3431
|
private cleanProjects;
|
|
3477
3432
|
private cleanup;
|
|
@@ -3518,10 +3473,6 @@ declare namespace ts {
|
|
|
3518
3473
|
private toSpanGroups;
|
|
3519
3474
|
private getReferences;
|
|
3520
3475
|
private getFileReferences;
|
|
3521
|
-
/**
|
|
3522
|
-
* @param fileName is the name of the file to be opened
|
|
3523
|
-
* @param fileContent is a version of the file content that is known to be more up to date than the one on disk
|
|
3524
|
-
*/
|
|
3525
3476
|
private openClientFile;
|
|
3526
3477
|
private getPosition;
|
|
3527
3478
|
private getPositionInFile;
|
|
@@ -6196,6 +6147,7 @@ declare namespace ts {
|
|
|
6196
6147
|
getNumberType(): Type;
|
|
6197
6148
|
getNumberLiteralType(value: number): NumberLiteralType;
|
|
6198
6149
|
getBigIntType(): Type;
|
|
6150
|
+
getBigIntLiteralType(value: PseudoBigInt): BigIntLiteralType;
|
|
6199
6151
|
getBooleanType(): Type;
|
|
6200
6152
|
getFalseType(): Type;
|
|
6201
6153
|
getTrueType(): Type;
|
|
@@ -6665,7 +6617,11 @@ declare namespace ts {
|
|
|
6665
6617
|
minLength: number;
|
|
6666
6618
|
/** Number of initial required or optional elements */
|
|
6667
6619
|
fixedLength: number;
|
|
6668
|
-
/**
|
|
6620
|
+
/**
|
|
6621
|
+
* True if tuple has any rest or variadic elements
|
|
6622
|
+
*
|
|
6623
|
+
* @deprecated Use `.combinedFlags & ElementFlags.Variable` instead
|
|
6624
|
+
*/
|
|
6669
6625
|
hasRestElement: boolean;
|
|
6670
6626
|
combinedFlags: ElementFlags;
|
|
6671
6627
|
readonly: boolean;
|