typescript 5.5.4 → 5.6.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/cs/diagnosticMessages.generated.json +292 -85
- package/lib/de/diagnosticMessages.generated.json +292 -85
- package/lib/es/diagnosticMessages.generated.json +290 -83
- package/lib/fr/diagnosticMessages.generated.json +292 -85
- package/lib/it/diagnosticMessages.generated.json +291 -84
- package/lib/ja/diagnosticMessages.generated.json +291 -84
- package/lib/ko/diagnosticMessages.generated.json +291 -84
- package/lib/lib.dom.asynciterable.d.ts +14 -6
- package/lib/lib.dom.d.ts +349 -858
- package/lib/lib.dom.iterable.d.ts +95 -79
- package/lib/lib.es2015.generator.d.ts +2 -2
- package/lib/lib.es2015.iterable.d.ts +100 -68
- package/lib/lib.es2017.object.d.ts +4 -4
- package/lib/lib.es2018.asyncgenerator.d.ts +2 -2
- package/lib/lib.es2018.asynciterable.d.ts +16 -6
- package/lib/lib.es2020.bigint.d.ts +8 -8
- package/lib/lib.es2020.string.d.ts +2 -2
- package/lib/lib.es2020.symbol.wellknown.d.ts +5 -1
- package/lib/lib.es2022.intl.d.ts +5 -1
- package/lib/lib.esnext.d.ts +1 -0
- package/lib/lib.esnext.disposable.d.ts +8 -0
- package/lib/lib.esnext.iterator.d.ts +148 -0
- package/lib/lib.webworker.asynciterable.d.ts +14 -6
- package/lib/lib.webworker.d.ts +79 -100
- package/lib/lib.webworker.iterable.d.ts +47 -35
- package/lib/pl/diagnosticMessages.generated.json +290 -83
- package/lib/pt-br/diagnosticMessages.generated.json +292 -85
- package/lib/ru/diagnosticMessages.generated.json +292 -85
- package/lib/tr/diagnosticMessages.generated.json +292 -85
- package/lib/tsc.js +2744 -1783
- package/lib/tsserver.js +33 -31
- package/lib/typescript.d.ts +244 -156
- package/lib/typescript.js +4460 -3392
- package/lib/typingsInstaller.js +3 -3
- package/lib/zh-cn/diagnosticMessages.generated.json +291 -84
- package/lib/zh-tw/diagnosticMessages.generated.json +290 -83
- package/package.json +36 -31
package/lib/typescript.d.ts
CHANGED
|
@@ -214,6 +214,22 @@ declare namespace ts {
|
|
|
214
214
|
* The time spent creating or updating the auto-import program, in milliseconds.
|
|
215
215
|
*/
|
|
216
216
|
createAutoImportProviderProgramDurationMs?: number;
|
|
217
|
+
/**
|
|
218
|
+
* The time spent computing diagnostics, in milliseconds.
|
|
219
|
+
*/
|
|
220
|
+
diagnosticsDuration?: FileDiagnosticPerformanceData[];
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Time spent computing each kind of diagnostics, in milliseconds.
|
|
224
|
+
*/
|
|
225
|
+
export type DiagnosticPerformanceData = {
|
|
226
|
+
[Kind in DiagnosticEventKind]?: number;
|
|
227
|
+
};
|
|
228
|
+
export interface FileDiagnosticPerformanceData extends DiagnosticPerformanceData {
|
|
229
|
+
/**
|
|
230
|
+
* The file for which the performance data is reported.
|
|
231
|
+
*/
|
|
232
|
+
file: string;
|
|
217
233
|
}
|
|
218
234
|
/**
|
|
219
235
|
* Arguments for FileRequest messages.
|
|
@@ -584,23 +600,7 @@ declare namespace ts {
|
|
|
584
600
|
}
|
|
585
601
|
export interface ApplyCodeActionCommandResponse extends Response {
|
|
586
602
|
}
|
|
587
|
-
export interface FileRangeRequestArgs extends FileRequestArgs {
|
|
588
|
-
/**
|
|
589
|
-
* The line number for the request (1-based).
|
|
590
|
-
*/
|
|
591
|
-
startLine: number;
|
|
592
|
-
/**
|
|
593
|
-
* The character offset (on the line) for the request (1-based).
|
|
594
|
-
*/
|
|
595
|
-
startOffset: number;
|
|
596
|
-
/**
|
|
597
|
-
* The line number for the request (1-based).
|
|
598
|
-
*/
|
|
599
|
-
endLine: number;
|
|
600
|
-
/**
|
|
601
|
-
* The character offset (on the line) for the request (1-based).
|
|
602
|
-
*/
|
|
603
|
-
endOffset: number;
|
|
603
|
+
export interface FileRangeRequestArgs extends FileRequestArgs, FileRange {
|
|
604
604
|
}
|
|
605
605
|
/**
|
|
606
606
|
* Instances of this interface specify errorcodes on a specific location in a sourcefile.
|
|
@@ -1866,7 +1866,7 @@ declare namespace ts {
|
|
|
1866
1866
|
* List of file names for which to compute compiler errors.
|
|
1867
1867
|
* The files will be checked in list order.
|
|
1868
1868
|
*/
|
|
1869
|
-
files: string[];
|
|
1869
|
+
files: (string | FileRangesRequestArgs)[];
|
|
1870
1870
|
/**
|
|
1871
1871
|
* Delay in milliseconds to wait before starting to compute
|
|
1872
1872
|
* errors for the files in the file list
|
|
@@ -1887,6 +1887,27 @@ declare namespace ts {
|
|
|
1887
1887
|
command: CommandTypes.Geterr;
|
|
1888
1888
|
arguments: GeterrRequestArgs;
|
|
1889
1889
|
}
|
|
1890
|
+
export interface FileRange {
|
|
1891
|
+
/**
|
|
1892
|
+
* The line number for the request (1-based).
|
|
1893
|
+
*/
|
|
1894
|
+
startLine: number;
|
|
1895
|
+
/**
|
|
1896
|
+
* The character offset (on the line) for the request (1-based).
|
|
1897
|
+
*/
|
|
1898
|
+
startOffset: number;
|
|
1899
|
+
/**
|
|
1900
|
+
* The line number for the request (1-based).
|
|
1901
|
+
*/
|
|
1902
|
+
endLine: number;
|
|
1903
|
+
/**
|
|
1904
|
+
* The character offset (on the line) for the request (1-based).
|
|
1905
|
+
*/
|
|
1906
|
+
endOffset: number;
|
|
1907
|
+
}
|
|
1908
|
+
export interface FileRangesRequestArgs extends Pick<FileRequestArgs, "file"> {
|
|
1909
|
+
ranges: FileRange[];
|
|
1910
|
+
}
|
|
1890
1911
|
export type RequestCompletedEventName = "requestCompleted";
|
|
1891
1912
|
/**
|
|
1892
1913
|
* Event that is sent when server have finished processing request with specified id.
|
|
@@ -1897,6 +1918,7 @@ declare namespace ts {
|
|
|
1897
1918
|
}
|
|
1898
1919
|
export interface RequestCompletedEventBody {
|
|
1899
1920
|
request_seq: number;
|
|
1921
|
+
performanceData?: PerformanceData;
|
|
1900
1922
|
}
|
|
1901
1923
|
/**
|
|
1902
1924
|
* Item of diagnostic information found in a DiagnosticEvent message.
|
|
@@ -1969,8 +1991,12 @@ declare namespace ts {
|
|
|
1969
1991
|
* An array of diagnostic information items.
|
|
1970
1992
|
*/
|
|
1971
1993
|
diagnostics: Diagnostic[];
|
|
1994
|
+
/**
|
|
1995
|
+
* Spans where the region diagnostic was requested, if this is a region semantic diagnostic event.
|
|
1996
|
+
*/
|
|
1997
|
+
spans?: TextSpan[];
|
|
1972
1998
|
}
|
|
1973
|
-
export type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag";
|
|
1999
|
+
export type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag" | "regionSemanticDiag";
|
|
1974
2000
|
/**
|
|
1975
2001
|
* Event message for DiagnosticEventKind event types.
|
|
1976
2002
|
* These events provide syntactic and semantic errors for a file.
|
|
@@ -2510,6 +2536,7 @@ declare namespace ts {
|
|
|
2510
2536
|
private readonly knownCachesSet;
|
|
2511
2537
|
private readonly projectWatchers;
|
|
2512
2538
|
private safeList;
|
|
2539
|
+
private pendingRunRequests;
|
|
2513
2540
|
private installRunCount;
|
|
2514
2541
|
private inFlightRequestCount;
|
|
2515
2542
|
abstract readonly typesRegistry: Map<string, MapLike<string>>;
|
|
@@ -2636,6 +2663,7 @@ declare namespace ts {
|
|
|
2636
2663
|
interface ServerHost extends System {
|
|
2637
2664
|
watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
|
|
2638
2665
|
watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
|
|
2666
|
+
preferNonRecursiveWatch?: boolean;
|
|
2639
2667
|
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
|
|
2640
2668
|
clearTimeout(timeoutId: any): void;
|
|
2641
2669
|
setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
|
|
@@ -2644,6 +2672,18 @@ declare namespace ts {
|
|
|
2644
2672
|
trace?(s: string): void;
|
|
2645
2673
|
require?(initialPath: string, moduleName: string): ModuleImportResult;
|
|
2646
2674
|
}
|
|
2675
|
+
interface InstallPackageOptionsWithProject extends InstallPackageOptions {
|
|
2676
|
+
projectName: string;
|
|
2677
|
+
projectRootPath: Path;
|
|
2678
|
+
}
|
|
2679
|
+
interface ITypingsInstaller {
|
|
2680
|
+
isKnownTypesPackageName(name: string): boolean;
|
|
2681
|
+
installPackage(options: InstallPackageOptionsWithProject): Promise<ApplyCodeActionCommandResult>;
|
|
2682
|
+
enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string> | undefined): void;
|
|
2683
|
+
attach(projectService: ProjectService): void;
|
|
2684
|
+
onProjectClosed(p: Project): void;
|
|
2685
|
+
readonly globalTypingsCacheLocation: string | undefined;
|
|
2686
|
+
}
|
|
2647
2687
|
function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>, cachePath?: string): DiscoverTypings;
|
|
2648
2688
|
function toNormalizedPath(fileName: string): NormalizedPath;
|
|
2649
2689
|
function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path;
|
|
@@ -2702,6 +2742,7 @@ declare namespace ts {
|
|
|
2702
2742
|
readonly containingProjects: Project[];
|
|
2703
2743
|
private formatSettings;
|
|
2704
2744
|
private preferences;
|
|
2745
|
+
private realpath;
|
|
2705
2746
|
constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: number);
|
|
2706
2747
|
isScriptOpen(): boolean;
|
|
2707
2748
|
open(newText: string | undefined): void;
|
|
@@ -2735,19 +2776,6 @@ declare namespace ts {
|
|
|
2735
2776
|
positionToLineOffset(position: number): protocol.Location;
|
|
2736
2777
|
isJavaScript(): boolean;
|
|
2737
2778
|
}
|
|
2738
|
-
interface InstallPackageOptionsWithProject extends InstallPackageOptions {
|
|
2739
|
-
projectName: string;
|
|
2740
|
-
projectRootPath: Path;
|
|
2741
|
-
}
|
|
2742
|
-
interface ITypingsInstaller {
|
|
2743
|
-
isKnownTypesPackageName(name: string): boolean;
|
|
2744
|
-
installPackage(options: InstallPackageOptionsWithProject): Promise<ApplyCodeActionCommandResult>;
|
|
2745
|
-
enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string> | undefined): void;
|
|
2746
|
-
attach(projectService: ProjectService): void;
|
|
2747
|
-
onProjectClosed(p: Project): void;
|
|
2748
|
-
readonly globalTypingsCacheLocation: string | undefined;
|
|
2749
|
-
}
|
|
2750
|
-
const nullTypingsInstaller: ITypingsInstaller;
|
|
2751
2779
|
function allRootFilesAreJsOrDts(project: Project): boolean;
|
|
2752
2780
|
function allFilesAreJsOrDts(project: Project): boolean;
|
|
2753
2781
|
enum ProjectKind {
|
|
@@ -2789,33 +2817,31 @@ declare namespace ts {
|
|
|
2789
2817
|
private externalFiles;
|
|
2790
2818
|
private missingFilesMap;
|
|
2791
2819
|
private generatedFilesMap;
|
|
2820
|
+
private hasAddedorRemovedFiles;
|
|
2821
|
+
private hasAddedOrRemovedSymlinks;
|
|
2792
2822
|
protected languageService: LanguageService;
|
|
2793
2823
|
languageServiceEnabled: boolean;
|
|
2794
2824
|
readonly trace?: (s: string) => void;
|
|
2795
2825
|
readonly realpath?: (path: string) => string;
|
|
2796
2826
|
private builderState;
|
|
2797
|
-
/**
|
|
2798
|
-
* Set of files names that were updated since the last call to getChangesSinceVersion.
|
|
2799
|
-
*/
|
|
2800
2827
|
private updatedFileNames;
|
|
2801
|
-
/**
|
|
2802
|
-
* Set of files that was returned from the last call to getChangesSinceVersion.
|
|
2803
|
-
*/
|
|
2804
2828
|
private lastReportedFileNames;
|
|
2805
|
-
/**
|
|
2806
|
-
* Last version that was reported.
|
|
2807
|
-
*/
|
|
2808
2829
|
private lastReportedVersion;
|
|
2809
2830
|
protected projectErrors: Diagnostic[] | undefined;
|
|
2810
2831
|
protected isInitialLoadPending: () => boolean;
|
|
2832
|
+
private typingsCache;
|
|
2833
|
+
private typingWatchers;
|
|
2811
2834
|
private readonly cancellationToken;
|
|
2812
2835
|
isNonTsProject(): boolean;
|
|
2813
2836
|
isJsOnlyProject(): boolean;
|
|
2814
2837
|
static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {} | undefined;
|
|
2838
|
+
private exportMapCache;
|
|
2839
|
+
private changedFilesForExportMapCache;
|
|
2840
|
+
private moduleSpecifierCache;
|
|
2841
|
+
private symlinks;
|
|
2815
2842
|
readonly jsDocParsingMode: JSDocParsingMode | undefined;
|
|
2816
2843
|
isKnownTypesPackageName(name: string): boolean;
|
|
2817
2844
|
installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
|
|
2818
|
-
private get typingsCache();
|
|
2819
2845
|
getCompilationSettings(): ts.CompilerOptions;
|
|
2820
2846
|
getCompilerOptions(): ts.CompilerOptions;
|
|
2821
2847
|
getNewLine(): string;
|
|
@@ -2882,6 +2908,8 @@ declare namespace ts {
|
|
|
2882
2908
|
* @returns: true if set of files in the project stays the same and false - otherwise.
|
|
2883
2909
|
*/
|
|
2884
2910
|
updateGraph(): boolean;
|
|
2911
|
+
private closeWatchingTypingLocations;
|
|
2912
|
+
private onTypingInstallerWatchInvoke;
|
|
2885
2913
|
protected removeExistingTypings(include: string[]): string[];
|
|
2886
2914
|
private updateGraphWorker;
|
|
2887
2915
|
private detachScriptInfoFromProject;
|
|
@@ -2893,6 +2921,7 @@ declare namespace ts {
|
|
|
2893
2921
|
getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined;
|
|
2894
2922
|
getScriptInfo(uncheckedFileName: string): ts.server.ScriptInfo | undefined;
|
|
2895
2923
|
filesToString(writeProjectFileNames: boolean): string;
|
|
2924
|
+
private filesToStringWorker;
|
|
2896
2925
|
setCompilerOptions(compilerOptions: CompilerOptions): void;
|
|
2897
2926
|
setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void;
|
|
2898
2927
|
getTypeAcquisition(): ts.TypeAcquisition;
|
|
@@ -2901,6 +2930,8 @@ declare namespace ts {
|
|
|
2901
2930
|
protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[]): void;
|
|
2902
2931
|
/** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */
|
|
2903
2932
|
refreshDiagnostics(): void;
|
|
2933
|
+
private isDefaultProjectForOpenFiles;
|
|
2934
|
+
private getCompilerOptionsForNoDtsResolutionProject;
|
|
2904
2935
|
}
|
|
2905
2936
|
/**
|
|
2906
2937
|
* If a file is opened and no tsconfig (or jsconfig) is found,
|
|
@@ -2920,6 +2951,7 @@ declare namespace ts {
|
|
|
2920
2951
|
}
|
|
2921
2952
|
class AutoImportProviderProject extends Project {
|
|
2922
2953
|
private hostProject;
|
|
2954
|
+
private static readonly maxDependencies;
|
|
2923
2955
|
private rootFileNames;
|
|
2924
2956
|
updateGraph(): boolean;
|
|
2925
2957
|
hasRoots(): boolean;
|
|
@@ -2936,6 +2968,8 @@ declare namespace ts {
|
|
|
2936
2968
|
class ConfiguredProject extends Project {
|
|
2937
2969
|
readonly canonicalConfigFilePath: NormalizedPath;
|
|
2938
2970
|
private projectReferences;
|
|
2971
|
+
private compilerHost?;
|
|
2972
|
+
private releaseParsedConfig;
|
|
2939
2973
|
/**
|
|
2940
2974
|
* If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
|
|
2941
2975
|
* @returns: true if set of files in the project stays the same and false - otherwise.
|
|
@@ -3126,6 +3160,7 @@ declare namespace ts {
|
|
|
3126
3160
|
configFileName?: NormalizedPath;
|
|
3127
3161
|
configFileErrors?: readonly Diagnostic[];
|
|
3128
3162
|
}
|
|
3163
|
+
const nullTypingsInstaller: ITypingsInstaller;
|
|
3129
3164
|
interface ProjectServiceOptions {
|
|
3130
3165
|
host: ServerHost;
|
|
3131
3166
|
logger: Logger;
|
|
@@ -3151,16 +3186,8 @@ declare namespace ts {
|
|
|
3151
3186
|
}
|
|
3152
3187
|
class ProjectService {
|
|
3153
3188
|
private readonly nodeModulesWatchers;
|
|
3154
|
-
/**
|
|
3155
|
-
* Contains all the deleted script info's version information so that
|
|
3156
|
-
* it does not reset when creating script info again
|
|
3157
|
-
* (and could have potentially collided with version where contents mismatch)
|
|
3158
|
-
*/
|
|
3159
3189
|
private readonly filenameToScriptInfoVersion;
|
|
3160
3190
|
private readonly allJsFilesForOpenFileTelemetry;
|
|
3161
|
-
/**
|
|
3162
|
-
* maps external project file name to list of config files that were the part of this project
|
|
3163
|
-
*/
|
|
3164
3191
|
private readonly externalProjectToConfiguredProjectMap;
|
|
3165
3192
|
/**
|
|
3166
3193
|
* external projects (configuration and list of root files is not controlled by tsserver)
|
|
@@ -3178,13 +3205,8 @@ declare namespace ts {
|
|
|
3178
3205
|
* Open files: with value being project root path, and key being Path of the file that is open
|
|
3179
3206
|
*/
|
|
3180
3207
|
readonly openFiles: Map<Path, NormalizedPath | undefined>;
|
|
3181
|
-
/** Config files looked up and cached config files for open script info */
|
|
3182
3208
|
private readonly configFileForOpenFiles;
|
|
3183
|
-
/** Set of open script infos that are root of inferred project */
|
|
3184
3209
|
private rootOfInferredProjects;
|
|
3185
|
-
/**
|
|
3186
|
-
* Map of open files that are opened without complete path but have projectRoot as current directory
|
|
3187
|
-
*/
|
|
3188
3210
|
private readonly openFilesWithNonRootedDiskPath;
|
|
3189
3211
|
private compilerOptionsForInferredProjects;
|
|
3190
3212
|
private compilerOptionsForInferredProjectsPerProjectRoot;
|
|
@@ -3192,18 +3214,11 @@ declare namespace ts {
|
|
|
3192
3214
|
private watchOptionsForInferredProjectsPerProjectRoot;
|
|
3193
3215
|
private typeAcquisitionForInferredProjects;
|
|
3194
3216
|
private typeAcquisitionForInferredProjectsPerProjectRoot;
|
|
3195
|
-
/**
|
|
3196
|
-
* Project size for configured or external projects
|
|
3197
|
-
*/
|
|
3198
3217
|
private readonly projectToSizeMap;
|
|
3199
3218
|
private readonly hostConfiguration;
|
|
3200
3219
|
private safelist;
|
|
3201
3220
|
private readonly legacySafelist;
|
|
3202
3221
|
private pendingProjectUpdates;
|
|
3203
|
-
/**
|
|
3204
|
-
* All the open script info that needs recalculation of the default project,
|
|
3205
|
-
* this also caches config file info before config file change was detected to use it in case projects are not updated yet
|
|
3206
|
-
*/
|
|
3207
3222
|
private pendingOpenFileProjectUpdates?;
|
|
3208
3223
|
readonly currentDirectory: NormalizedPath;
|
|
3209
3224
|
readonly toCanonicalFileName: (f: string) => string;
|
|
@@ -3221,8 +3236,11 @@ declare namespace ts {
|
|
|
3221
3236
|
readonly allowLocalPluginLoads: boolean;
|
|
3222
3237
|
readonly typesMapLocation: string | undefined;
|
|
3223
3238
|
readonly serverMode: LanguageServiceMode;
|
|
3224
|
-
/** Tracks projects that we have already sent telemetry for. */
|
|
3225
3239
|
private readonly seenProjects;
|
|
3240
|
+
private readonly sharedExtendedConfigFileWatchers;
|
|
3241
|
+
private readonly extendedConfigCache;
|
|
3242
|
+
private packageJsonFilesMap;
|
|
3243
|
+
private incompleteCompletionsCache;
|
|
3226
3244
|
private performanceEventHandler?;
|
|
3227
3245
|
private pendingPluginEnablements?;
|
|
3228
3246
|
private currentPluginEnablementPromise?;
|
|
@@ -3236,20 +3254,9 @@ declare namespace ts {
|
|
|
3236
3254
|
setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void;
|
|
3237
3255
|
findProject(projectName: string): Project | undefined;
|
|
3238
3256
|
getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined;
|
|
3239
|
-
/**
|
|
3240
|
-
* If there is default project calculation pending for this file,
|
|
3241
|
-
* then it completes that calculation so that correct default project is used for the project
|
|
3242
|
-
*/
|
|
3243
3257
|
private tryGetDefaultProjectForEnsuringConfiguredProjectForFile;
|
|
3244
3258
|
private doEnsureDefaultProjectForFile;
|
|
3245
3259
|
getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined;
|
|
3246
|
-
/**
|
|
3247
|
-
* Ensures the project structures are upto date
|
|
3248
|
-
* This means,
|
|
3249
|
-
* - we go through all the projects and update them if they are dirty
|
|
3250
|
-
* - if updates reflect some change in structure or there was pending request to ensure projects for open files
|
|
3251
|
-
* ensure that each open script info has project
|
|
3252
|
-
*/
|
|
3253
3260
|
private ensureProjectStructuresUptoDate;
|
|
3254
3261
|
getFormatCodeOptions(file: NormalizedPath): FormatCodeSettings;
|
|
3255
3262
|
getPreferences(file: NormalizedPath): protocol.UserPreferences;
|
|
@@ -3260,37 +3267,30 @@ declare namespace ts {
|
|
|
3260
3267
|
private delayUpdateSourceInfoProjects;
|
|
3261
3268
|
private delayUpdateProjectsOfScriptInfoPath;
|
|
3262
3269
|
private handleDeletedFile;
|
|
3270
|
+
private watchWildcardDirectory;
|
|
3271
|
+
private onWildCardDirectoryWatcherInvoke;
|
|
3272
|
+
private delayUpdateProjectsFromParsedConfigOnConfigFileChange;
|
|
3273
|
+
private onConfigFileChanged;
|
|
3263
3274
|
private removeProject;
|
|
3264
3275
|
private assignOrphanScriptInfosToInferredProject;
|
|
3265
|
-
/**
|
|
3266
|
-
* Remove this file from the set of open, non-configured files.
|
|
3267
|
-
* @param info The file that has been closed or newly configured
|
|
3268
|
-
*/
|
|
3269
3276
|
private closeOpenFile;
|
|
3270
3277
|
private deleteScriptInfo;
|
|
3271
3278
|
private configFileExists;
|
|
3272
|
-
|
|
3273
|
-
* This function tries to search for a tsconfig.json for the given file.
|
|
3274
|
-
* This is different from the method the compiler uses because
|
|
3275
|
-
* the compiler can assume it will always start searching in the
|
|
3276
|
-
* current directory (the directory in which tsc was invoked).
|
|
3277
|
-
* The server must start searching from the directory containing
|
|
3278
|
-
* the newly opened file.
|
|
3279
|
-
*/
|
|
3279
|
+
private createConfigFileWatcherForParsedConfig;
|
|
3280
3280
|
private forEachConfigFileLocation;
|
|
3281
|
-
/** Get cached configFileName for scriptInfo or ancestor of open script info */
|
|
3282
3281
|
private getConfigFileNameForFileFromCache;
|
|
3283
|
-
/** Caches the configFilename for script info or ancestor of open script info */
|
|
3284
3282
|
private setConfigFileNameForFileInCache;
|
|
3285
3283
|
private printProjects;
|
|
3286
3284
|
private getConfiguredProjectByCanonicalConfigFilePath;
|
|
3287
3285
|
private findExternalProjectByProjectName;
|
|
3288
|
-
/** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */
|
|
3289
3286
|
private getFilenameForExceededTotalSizeLimitForNonTsFiles;
|
|
3290
3287
|
private createExternalProject;
|
|
3291
3288
|
private addFilesToNonInferredProject;
|
|
3289
|
+
private loadConfiguredProject;
|
|
3292
3290
|
private updateNonInferredProjectFiles;
|
|
3293
3291
|
private updateRootAndOptionsOfNonInferredProject;
|
|
3292
|
+
private reloadFileNamesOfParsedConfig;
|
|
3293
|
+
private clearSemanticCache;
|
|
3294
3294
|
private getOrCreateInferredProjectForProjectRootPathIfEnabled;
|
|
3295
3295
|
private getOrCreateSingleInferredProjectIfEnabled;
|
|
3296
3296
|
private getOrCreateSingleInferredWithoutProjectRoot;
|
|
@@ -3316,23 +3316,15 @@ declare namespace ts {
|
|
|
3316
3316
|
private addSourceInfoToSourceMap;
|
|
3317
3317
|
private addMissingSourceMapFile;
|
|
3318
3318
|
setHostConfiguration(args: protocol.ConfigureRequestArguments): void;
|
|
3319
|
+
private getWatchOptionsFromProjectWatchOptions;
|
|
3319
3320
|
closeLog(): void;
|
|
3321
|
+
private sendSourceFileChange;
|
|
3320
3322
|
/**
|
|
3321
3323
|
* This function rebuilds the project for every file opened by the client
|
|
3322
3324
|
* This does not reload contents of open files from disk. But we could do that if needed
|
|
3323
3325
|
*/
|
|
3324
3326
|
reloadProjects(): void;
|
|
3325
|
-
/**
|
|
3326
|
-
* Remove the root of inferred project if script info is part of another project
|
|
3327
|
-
*/
|
|
3328
3327
|
private removeRootOfInferredProjectIfNowPartOfOtherProject;
|
|
3329
|
-
/**
|
|
3330
|
-
* This function is to update the project structure for every inferred project.
|
|
3331
|
-
* It is called on the premise that all the configured projects are
|
|
3332
|
-
* up to date.
|
|
3333
|
-
* This will go through open files and assign them to inferred project if open file is not part of any other project
|
|
3334
|
-
* After that all the inferred project graphs are updated
|
|
3335
|
-
*/
|
|
3336
3328
|
private ensureProjectForOpenFiles;
|
|
3337
3329
|
/**
|
|
3338
3330
|
* Open file whose contents is managed by the client
|
|
@@ -3343,20 +3335,12 @@ declare namespace ts {
|
|
|
3343
3335
|
private findExternalProjectContainingOpenScriptInfo;
|
|
3344
3336
|
private getOrCreateOpenScriptInfo;
|
|
3345
3337
|
private assignProjectToOpenedScriptInfo;
|
|
3346
|
-
/**
|
|
3347
|
-
* Finds the default configured project for given info
|
|
3348
|
-
* For any tsconfig found, it looks into that project, if not then all its references,
|
|
3349
|
-
* The search happens for all tsconfigs till projectRootPath
|
|
3350
|
-
*/
|
|
3351
3338
|
private tryFindDefaultConfiguredProjectForOpenScriptInfo;
|
|
3352
|
-
/**
|
|
3353
|
-
* Finds the default configured project, if found, it creates the solution projects (does not load them right away)
|
|
3354
|
-
* with Find: finds the projects even if the project is deferredClosed
|
|
3355
|
-
*/
|
|
3356
3339
|
private tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo;
|
|
3357
3340
|
private ensureProjectChildren;
|
|
3358
3341
|
private cleanupConfiguredProjects;
|
|
3359
3342
|
private cleanupProjectsAndScriptInfos;
|
|
3343
|
+
private tryInvokeWildCardDirectories;
|
|
3360
3344
|
openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
|
|
3361
3345
|
private removeOrphanScriptInfos;
|
|
3362
3346
|
private telemetryOnOpenFile;
|
|
@@ -3368,7 +3352,6 @@ declare namespace ts {
|
|
|
3368
3352
|
private collectChanges;
|
|
3369
3353
|
closeExternalProject(uncheckedFileName: string): void;
|
|
3370
3354
|
openExternalProjects(projects: protocol.ExternalProject[]): void;
|
|
3371
|
-
/** Makes a filename safe to insert in a RegExp */
|
|
3372
3355
|
private static readonly filenameEscapeRegexp;
|
|
3373
3356
|
private static escapeFilenameForRegex;
|
|
3374
3357
|
resetSafeList(): void;
|
|
@@ -3376,9 +3359,12 @@ declare namespace ts {
|
|
|
3376
3359
|
private applySafeListWorker;
|
|
3377
3360
|
openExternalProject(proj: protocol.ExternalProject): void;
|
|
3378
3361
|
hasDeferredExtension(): boolean;
|
|
3362
|
+
private endEnablePlugin;
|
|
3379
3363
|
private enableRequestedPluginsAsync;
|
|
3380
3364
|
private enableRequestedPluginsWorker;
|
|
3381
3365
|
configurePlugin(args: protocol.ConfigurePluginRequestArguments): void;
|
|
3366
|
+
private watchPackageJsonFile;
|
|
3367
|
+
private onPackageJsonChange;
|
|
3382
3368
|
}
|
|
3383
3369
|
function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: BufferEncoding) => number, newLine: string): string;
|
|
3384
3370
|
interface ServerCancellationToken extends HostCancellationToken {
|
|
@@ -3386,10 +3372,6 @@ declare namespace ts {
|
|
|
3386
3372
|
resetRequest(requestId: number): void;
|
|
3387
3373
|
}
|
|
3388
3374
|
const nullCancellationToken: ServerCancellationToken;
|
|
3389
|
-
interface PendingErrorCheck {
|
|
3390
|
-
fileName: NormalizedPath;
|
|
3391
|
-
project: Project;
|
|
3392
|
-
}
|
|
3393
3375
|
/** @deprecated use ts.server.protocol.CommandTypes */
|
|
3394
3376
|
type CommandNames = protocol.CommandTypes;
|
|
3395
3377
|
/** @deprecated use ts.server.protocol.CommandTypes */
|
|
@@ -3449,6 +3431,7 @@ declare namespace ts {
|
|
|
3449
3431
|
constructor(opts: SessionOptions);
|
|
3450
3432
|
private sendRequestCompletedEvent;
|
|
3451
3433
|
private addPerformanceData;
|
|
3434
|
+
private addDiagnosticsPerformanceData;
|
|
3452
3435
|
private performanceEventHandler;
|
|
3453
3436
|
private defaultEventHandler;
|
|
3454
3437
|
private projectsUpdatedInBackgroundEvent;
|
|
@@ -3460,8 +3443,8 @@ declare namespace ts {
|
|
|
3460
3443
|
private semanticCheck;
|
|
3461
3444
|
private syntacticCheck;
|
|
3462
3445
|
private suggestionCheck;
|
|
3446
|
+
private regionSemanticCheck;
|
|
3463
3447
|
private sendDiagnosticsEvent;
|
|
3464
|
-
/** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */
|
|
3465
3448
|
private updateErrorCheck;
|
|
3466
3449
|
private cleanProjects;
|
|
3467
3450
|
private cleanup;
|
|
@@ -3508,10 +3491,6 @@ declare namespace ts {
|
|
|
3508
3491
|
private toSpanGroups;
|
|
3509
3492
|
private getReferences;
|
|
3510
3493
|
private getFileReferences;
|
|
3511
|
-
/**
|
|
3512
|
-
* @param fileName is the name of the file to be opened
|
|
3513
|
-
* @param fileContent is a version of the file content that is known to be more up to date than the one on disk
|
|
3514
|
-
*/
|
|
3515
3494
|
private openClientFile;
|
|
3516
3495
|
private getPosition;
|
|
3517
3496
|
private getPositionInFile;
|
|
@@ -3616,7 +3595,7 @@ declare namespace ts {
|
|
|
3616
3595
|
readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[];
|
|
3617
3596
|
}
|
|
3618
3597
|
}
|
|
3619
|
-
const versionMajorMinor = "5.
|
|
3598
|
+
const versionMajorMinor = "5.6";
|
|
3620
3599
|
/** The version of the TypeScript compiler release */
|
|
3621
3600
|
const version: string;
|
|
3622
3601
|
/**
|
|
@@ -4446,7 +4425,7 @@ declare namespace ts {
|
|
|
4446
4425
|
readonly right: Identifier;
|
|
4447
4426
|
}
|
|
4448
4427
|
type EntityName = Identifier | QualifiedName;
|
|
4449
|
-
type PropertyName = Identifier | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier;
|
|
4428
|
+
type PropertyName = Identifier | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier | BigIntLiteral;
|
|
4450
4429
|
type MemberName = Identifier | PrivateIdentifier;
|
|
4451
4430
|
type DeclarationName = PropertyName | JsxAttributeName | StringLiteralLike | ElementAccessExpression | BindingPattern | EntityNameExpression;
|
|
4452
4431
|
interface Declaration extends Node {
|
|
@@ -4797,7 +4776,7 @@ declare namespace ts {
|
|
|
4797
4776
|
readonly kind: SyntaxKind.StringLiteral;
|
|
4798
4777
|
}
|
|
4799
4778
|
type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral;
|
|
4800
|
-
type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral | JsxNamespacedName;
|
|
4779
|
+
type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral | JsxNamespacedName | BigIntLiteral;
|
|
4801
4780
|
interface TemplateLiteralTypeNode extends TypeNode {
|
|
4802
4781
|
kind: SyntaxKind.TemplateLiteralType;
|
|
4803
4782
|
readonly head: TemplateHead;
|
|
@@ -5517,7 +5496,7 @@ declare namespace ts {
|
|
|
5517
5496
|
interface NamespaceExport extends NamedDeclaration {
|
|
5518
5497
|
readonly kind: SyntaxKind.NamespaceExport;
|
|
5519
5498
|
readonly parent: ExportDeclaration;
|
|
5520
|
-
readonly name:
|
|
5499
|
+
readonly name: ModuleExportName;
|
|
5521
5500
|
}
|
|
5522
5501
|
interface NamespaceExportDeclaration extends DeclarationStatement, JSDocContainer {
|
|
5523
5502
|
readonly kind: SyntaxKind.NamespaceExportDeclaration;
|
|
@@ -5549,7 +5528,7 @@ declare namespace ts {
|
|
|
5549
5528
|
interface ImportSpecifier extends NamedDeclaration {
|
|
5550
5529
|
readonly kind: SyntaxKind.ImportSpecifier;
|
|
5551
5530
|
readonly parent: NamedImports;
|
|
5552
|
-
readonly propertyName?:
|
|
5531
|
+
readonly propertyName?: ModuleExportName;
|
|
5553
5532
|
readonly name: Identifier;
|
|
5554
5533
|
readonly isTypeOnly: boolean;
|
|
5555
5534
|
}
|
|
@@ -5557,9 +5536,10 @@ declare namespace ts {
|
|
|
5557
5536
|
readonly kind: SyntaxKind.ExportSpecifier;
|
|
5558
5537
|
readonly parent: NamedExports;
|
|
5559
5538
|
readonly isTypeOnly: boolean;
|
|
5560
|
-
readonly propertyName?:
|
|
5561
|
-
readonly name:
|
|
5539
|
+
readonly propertyName?: ModuleExportName;
|
|
5540
|
+
readonly name: ModuleExportName;
|
|
5562
5541
|
}
|
|
5542
|
+
type ModuleExportName = Identifier | StringLiteral;
|
|
5563
5543
|
type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier;
|
|
5564
5544
|
type TypeOnlyCompatibleAliasDeclaration = ImportClause | ImportEqualsDeclaration | NamespaceImport | ImportOrExportSpecifier | ExportDeclaration | NamespaceExport;
|
|
5565
5545
|
type TypeOnlyImportDeclaration =
|
|
@@ -6014,19 +5994,67 @@ declare namespace ts {
|
|
|
6014
5994
|
isSourceFileFromExternalLibrary(file: SourceFile): boolean;
|
|
6015
5995
|
isSourceFileDefaultLibrary(file: SourceFile): boolean;
|
|
6016
5996
|
/**
|
|
6017
|
-
* Calculates the final resolution mode for a given module reference node. This
|
|
6018
|
-
*
|
|
6019
|
-
*
|
|
6020
|
-
*
|
|
6021
|
-
*
|
|
5997
|
+
* Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution
|
|
5998
|
+
* settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes,
|
|
5999
|
+
* which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of
|
|
6000
|
+
* overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript.
|
|
6001
|
+
* Some examples:
|
|
6002
|
+
*
|
|
6003
|
+
* ```ts
|
|
6004
|
+
* // tsc foo.mts --module nodenext
|
|
6005
|
+
* import {} from "mod";
|
|
6006
|
+
* // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
|
|
6007
|
+
*
|
|
6008
|
+
* // tsc foo.cts --module nodenext
|
|
6009
|
+
* import {} from "mod";
|
|
6010
|
+
* // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
|
|
6011
|
+
*
|
|
6012
|
+
* // tsc foo.ts --module preserve --moduleResolution bundler
|
|
6013
|
+
* import {} from "mod";
|
|
6014
|
+
* // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
|
|
6015
|
+
* // supports conditional imports/exports
|
|
6016
|
+
*
|
|
6017
|
+
* // tsc foo.ts --module preserve --moduleResolution node10
|
|
6018
|
+
* import {} from "mod";
|
|
6019
|
+
* // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
|
|
6020
|
+
* // does not support conditional imports/exports
|
|
6021
|
+
*
|
|
6022
|
+
* // tsc foo.ts --module commonjs --moduleResolution node10
|
|
6023
|
+
* import type {} from "mod" with { "resolution-mode": "import" };
|
|
6024
|
+
* // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
|
|
6025
|
+
* ```
|
|
6022
6026
|
*/
|
|
6023
6027
|
getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike): ResolutionMode;
|
|
6024
6028
|
/**
|
|
6025
|
-
* Calculates the final resolution mode for an import at some index within a file's `imports` list. This
|
|
6026
|
-
*
|
|
6027
|
-
*
|
|
6028
|
-
*
|
|
6029
|
-
*
|
|
6029
|
+
* Calculates the final resolution mode for an import at some index within a file's `imports` list. This function only returns a result
|
|
6030
|
+
* when module resolution settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided
|
|
6031
|
+
* via import attributes, which cause an `import` or `require` condition to be used during resolution regardless of module resolution
|
|
6032
|
+
* settings. In absence of overriding attributes, and in modes that support differing resolution, the result indicates the syntax the
|
|
6033
|
+
* usage would emit to JavaScript. Some examples:
|
|
6034
|
+
*
|
|
6035
|
+
* ```ts
|
|
6036
|
+
* // tsc foo.mts --module nodenext
|
|
6037
|
+
* import {} from "mod";
|
|
6038
|
+
* // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
|
|
6039
|
+
*
|
|
6040
|
+
* // tsc foo.cts --module nodenext
|
|
6041
|
+
* import {} from "mod";
|
|
6042
|
+
* // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
|
|
6043
|
+
*
|
|
6044
|
+
* // tsc foo.ts --module preserve --moduleResolution bundler
|
|
6045
|
+
* import {} from "mod";
|
|
6046
|
+
* // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
|
|
6047
|
+
* // supports conditional imports/exports
|
|
6048
|
+
*
|
|
6049
|
+
* // tsc foo.ts --module preserve --moduleResolution node10
|
|
6050
|
+
* import {} from "mod";
|
|
6051
|
+
* // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
|
|
6052
|
+
* // does not support conditional imports/exports
|
|
6053
|
+
*
|
|
6054
|
+
* // tsc foo.ts --module commonjs --moduleResolution node10
|
|
6055
|
+
* import type {} from "mod" with { "resolution-mode": "import" };
|
|
6056
|
+
* // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
|
|
6057
|
+
* ```
|
|
6030
6058
|
*/
|
|
6031
6059
|
getModeForResolutionAtIndex(file: SourceFile, index: number): ResolutionMode;
|
|
6032
6060
|
getProjectReferences(): readonly ProjectReference[] | undefined;
|
|
@@ -6093,6 +6121,27 @@ declare namespace ts {
|
|
|
6093
6121
|
getBaseTypes(type: InterfaceType): BaseType[];
|
|
6094
6122
|
getBaseTypeOfLiteralType(type: Type): Type;
|
|
6095
6123
|
getWidenedType(type: Type): Type;
|
|
6124
|
+
/**
|
|
6125
|
+
* Gets the "awaited type" of a type.
|
|
6126
|
+
*
|
|
6127
|
+
* If an expression has a Promise-like type, the "awaited type" of the expression is
|
|
6128
|
+
* derived from the type of the first argument of the fulfillment callback for that
|
|
6129
|
+
* Promise's `then` method. If the "awaited type" is itself a Promise-like, it is
|
|
6130
|
+
* recursively unwrapped in the same manner until a non-promise type is found.
|
|
6131
|
+
*
|
|
6132
|
+
* If an expression does not have a Promise-like type, its "awaited type" is the type
|
|
6133
|
+
* of the expression.
|
|
6134
|
+
*
|
|
6135
|
+
* If the resulting "awaited type" is a generic object type, then it is wrapped in
|
|
6136
|
+
* an `Awaited<T>`.
|
|
6137
|
+
*
|
|
6138
|
+
* In the event the "awaited type" circularly references itself, or is a non-Promise
|
|
6139
|
+
* object-type with a callable `then()` method, an "awaited type" cannot be determined
|
|
6140
|
+
* and the value `undefined` will be returned.
|
|
6141
|
+
*
|
|
6142
|
+
* This is used to reflect the runtime behavior of the `await` keyword.
|
|
6143
|
+
*/
|
|
6144
|
+
getAwaitedType(type: Type): Type | undefined;
|
|
6096
6145
|
getReturnTypeOfSignature(signature: Signature): Type;
|
|
6097
6146
|
getNullableType(type: Type, flags: TypeFlags): Type;
|
|
6098
6147
|
getNonNullableType(type: Type): Type;
|
|
@@ -6185,6 +6234,7 @@ declare namespace ts {
|
|
|
6185
6234
|
getNumberType(): Type;
|
|
6186
6235
|
getNumberLiteralType(value: number): NumberLiteralType;
|
|
6187
6236
|
getBigIntType(): Type;
|
|
6237
|
+
getBigIntLiteralType(value: PseudoBigInt): BigIntLiteralType;
|
|
6188
6238
|
getBooleanType(): Type;
|
|
6189
6239
|
getFalseType(): Type;
|
|
6190
6240
|
getTrueType(): Type;
|
|
@@ -6654,7 +6704,11 @@ declare namespace ts {
|
|
|
6654
6704
|
minLength: number;
|
|
6655
6705
|
/** Number of initial required or optional elements */
|
|
6656
6706
|
fixedLength: number;
|
|
6657
|
-
/**
|
|
6707
|
+
/**
|
|
6708
|
+
* True if tuple has any rest or variadic elements
|
|
6709
|
+
*
|
|
6710
|
+
* @deprecated Use `.combinedFlags & ElementFlags.Variable` instead
|
|
6711
|
+
*/
|
|
6658
6712
|
hasRestElement: boolean;
|
|
6659
6713
|
combinedFlags: ElementFlags;
|
|
6660
6714
|
readonly: boolean;
|
|
@@ -6978,6 +7032,7 @@ declare namespace ts {
|
|
|
6978
7032
|
strictBindCallApply?: boolean;
|
|
6979
7033
|
strictNullChecks?: boolean;
|
|
6980
7034
|
strictPropertyInitialization?: boolean;
|
|
7035
|
+
strictBuiltinIteratorReturn?: boolean;
|
|
6981
7036
|
stripInternal?: boolean;
|
|
6982
7037
|
/** @deprecated */
|
|
6983
7038
|
suppressExcessPropertyErrors?: boolean;
|
|
@@ -6986,6 +7041,7 @@ declare namespace ts {
|
|
|
6986
7041
|
target?: ScriptTarget;
|
|
6987
7042
|
traceResolution?: boolean;
|
|
6988
7043
|
useUnknownInCatchVariables?: boolean;
|
|
7044
|
+
noUncheckedSideEffectImports?: boolean;
|
|
6989
7045
|
resolveJsonModule?: boolean;
|
|
6990
7046
|
types?: string[];
|
|
6991
7047
|
/** Paths used to compute primary types search locations */
|
|
@@ -7312,9 +7368,10 @@ declare namespace ts {
|
|
|
7312
7368
|
TypeAssertions = 2,
|
|
7313
7369
|
NonNullAssertions = 4,
|
|
7314
7370
|
PartiallyEmittedExpressions = 8,
|
|
7371
|
+
ExpressionsWithTypeArguments = 16,
|
|
7315
7372
|
Assertions = 6,
|
|
7316
|
-
All =
|
|
7317
|
-
ExcludeJSDocTypeAssertion =
|
|
7373
|
+
All = 31,
|
|
7374
|
+
ExcludeJSDocTypeAssertion = -2147483648,
|
|
7318
7375
|
}
|
|
7319
7376
|
type ImmediatelyInvokedFunctionExpression = CallExpression & {
|
|
7320
7377
|
readonly expression: FunctionExpression;
|
|
@@ -7613,20 +7670,20 @@ declare namespace ts {
|
|
|
7613
7670
|
updateImportAttribute(node: ImportAttribute, name: ImportAttributeName, value: Expression): ImportAttribute;
|
|
7614
7671
|
createNamespaceImport(name: Identifier): NamespaceImport;
|
|
7615
7672
|
updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport;
|
|
7616
|
-
createNamespaceExport(name:
|
|
7617
|
-
updateNamespaceExport(node: NamespaceExport, name:
|
|
7673
|
+
createNamespaceExport(name: ModuleExportName): NamespaceExport;
|
|
7674
|
+
updateNamespaceExport(node: NamespaceExport, name: ModuleExportName): NamespaceExport;
|
|
7618
7675
|
createNamedImports(elements: readonly ImportSpecifier[]): NamedImports;
|
|
7619
7676
|
updateNamedImports(node: NamedImports, elements: readonly ImportSpecifier[]): NamedImports;
|
|
7620
|
-
createImportSpecifier(isTypeOnly: boolean, propertyName:
|
|
7621
|
-
updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName:
|
|
7677
|
+
createImportSpecifier(isTypeOnly: boolean, propertyName: ModuleExportName | undefined, name: Identifier): ImportSpecifier;
|
|
7678
|
+
updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName: ModuleExportName | undefined, name: Identifier): ImportSpecifier;
|
|
7622
7679
|
createExportAssignment(modifiers: readonly ModifierLike[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
|
|
7623
7680
|
updateExportAssignment(node: ExportAssignment, modifiers: readonly ModifierLike[] | undefined, expression: Expression): ExportAssignment;
|
|
7624
7681
|
createExportDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, attributes?: ImportAttributes): ExportDeclaration;
|
|
7625
7682
|
updateExportDeclaration(node: ExportDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, attributes: ImportAttributes | undefined): ExportDeclaration;
|
|
7626
7683
|
createNamedExports(elements: readonly ExportSpecifier[]): NamedExports;
|
|
7627
7684
|
updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports;
|
|
7628
|
-
createExportSpecifier(isTypeOnly: boolean, propertyName: string |
|
|
7629
|
-
updateExportSpecifier(node: ExportSpecifier, isTypeOnly: boolean, propertyName:
|
|
7685
|
+
createExportSpecifier(isTypeOnly: boolean, propertyName: string | ModuleExportName | undefined, name: string | ModuleExportName): ExportSpecifier;
|
|
7686
|
+
updateExportSpecifier(node: ExportSpecifier, isTypeOnly: boolean, propertyName: ModuleExportName | undefined, name: ModuleExportName): ExportSpecifier;
|
|
7630
7687
|
createExternalModuleReference(expression: Expression): ExternalModuleReference;
|
|
7631
7688
|
updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference;
|
|
7632
7689
|
createJSDocAllType(): JSDocAllType;
|
|
@@ -8206,6 +8263,7 @@ declare namespace ts {
|
|
|
8206
8263
|
readonly interactiveInlayHints?: boolean;
|
|
8207
8264
|
readonly allowRenameOfImportPath?: boolean;
|
|
8208
8265
|
readonly autoImportFileExcludePatterns?: string[];
|
|
8266
|
+
readonly autoImportSpecifierExcludeRegexes?: string[];
|
|
8209
8267
|
readonly preferTypeOnlyAutoImports?: boolean;
|
|
8210
8268
|
/**
|
|
8211
8269
|
* Indicates whether imports should be organized in a case-insensitive manner.
|
|
@@ -8944,6 +9002,7 @@ declare namespace ts {
|
|
|
8944
9002
|
function isExportDeclaration(node: Node): node is ExportDeclaration;
|
|
8945
9003
|
function isNamedExports(node: Node): node is NamedExports;
|
|
8946
9004
|
function isExportSpecifier(node: Node): node is ExportSpecifier;
|
|
9005
|
+
function isModuleExportName(node: Node): node is ModuleExportName;
|
|
8947
9006
|
function isMissingDeclaration(node: Node): node is MissingDeclaration;
|
|
8948
9007
|
function isNotEmittedStatement(node: Node): node is NotEmittedStatement;
|
|
8949
9008
|
function isExternalModuleReference(node: Node): node is ExternalModuleReference;
|
|
@@ -9379,24 +9438,43 @@ declare namespace ts {
|
|
|
9379
9438
|
function getModeForResolutionAtIndex(file: SourceFile, index: number, compilerOptions: CompilerOptions): ResolutionMode;
|
|
9380
9439
|
/**
|
|
9381
9440
|
* Use `program.getModeForUsageLocation`, which retrieves the correct `compilerOptions`, instead of this function whenever possible.
|
|
9382
|
-
* Calculates the final resolution mode for a given module reference node. This
|
|
9383
|
-
*
|
|
9384
|
-
*
|
|
9385
|
-
*
|
|
9386
|
-
*
|
|
9441
|
+
* Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution
|
|
9442
|
+
* settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes,
|
|
9443
|
+
* which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of
|
|
9444
|
+
* overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript.
|
|
9445
|
+
* Some examples:
|
|
9446
|
+
*
|
|
9447
|
+
* ```ts
|
|
9448
|
+
* // tsc foo.mts --module nodenext
|
|
9449
|
+
* import {} from "mod";
|
|
9450
|
+
* // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
|
|
9451
|
+
*
|
|
9452
|
+
* // tsc foo.cts --module nodenext
|
|
9453
|
+
* import {} from "mod";
|
|
9454
|
+
* // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
|
|
9455
|
+
*
|
|
9456
|
+
* // tsc foo.ts --module preserve --moduleResolution bundler
|
|
9457
|
+
* import {} from "mod";
|
|
9458
|
+
* // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
|
|
9459
|
+
* // supports conditional imports/exports
|
|
9460
|
+
*
|
|
9461
|
+
* // tsc foo.ts --module preserve --moduleResolution node10
|
|
9462
|
+
* import {} from "mod";
|
|
9463
|
+
* // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
|
|
9464
|
+
* // does not support conditional imports/exports
|
|
9465
|
+
*
|
|
9466
|
+
* // tsc foo.ts --module commonjs --moduleResolution node10
|
|
9467
|
+
* import type {} from "mod" with { "resolution-mode": "import" };
|
|
9468
|
+
* // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
|
|
9469
|
+
* ```
|
|
9470
|
+
*
|
|
9387
9471
|
* @param file The file the import or import-like reference is contained within
|
|
9388
9472
|
* @param usage The module reference string
|
|
9389
9473
|
* @param compilerOptions The compiler options for the program that owns the file. If the file belongs to a referenced project, the compiler options
|
|
9390
9474
|
* should be the options of the referenced project, not the referencing project.
|
|
9391
9475
|
* @returns The final resolution mode of the import
|
|
9392
9476
|
*/
|
|
9393
|
-
function getModeForUsageLocation(
|
|
9394
|
-
file: {
|
|
9395
|
-
impliedNodeFormat?: ResolutionMode;
|
|
9396
|
-
},
|
|
9397
|
-
usage: StringLiteralLike,
|
|
9398
|
-
compilerOptions: CompilerOptions,
|
|
9399
|
-
): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
|
|
9477
|
+
function getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike, compilerOptions: CompilerOptions): ResolutionMode;
|
|
9400
9478
|
function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
|
|
9401
9479
|
/**
|
|
9402
9480
|
* A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
|
|
@@ -9622,6 +9700,7 @@ declare namespace ts {
|
|
|
9622
9700
|
setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
|
|
9623
9701
|
/** If provided, will be used to reset existing delayed compilation */
|
|
9624
9702
|
clearTimeout?(timeoutId: any): void;
|
|
9703
|
+
preferNonRecursiveWatch?: boolean;
|
|
9625
9704
|
}
|
|
9626
9705
|
interface ProgramHost<T extends BuilderProgram> {
|
|
9627
9706
|
/**
|
|
@@ -9744,6 +9823,7 @@ declare namespace ts {
|
|
|
9744
9823
|
dry?: boolean;
|
|
9745
9824
|
force?: boolean;
|
|
9746
9825
|
verbose?: boolean;
|
|
9826
|
+
stopBuildOnErrors?: boolean;
|
|
9747
9827
|
incremental?: boolean;
|
|
9748
9828
|
assumeChangesOnlyAffectDirectDependencies?: boolean;
|
|
9749
9829
|
declaration?: boolean;
|
|
@@ -10711,6 +10791,10 @@ declare namespace ts {
|
|
|
10711
10791
|
*/
|
|
10712
10792
|
isIncomplete?: true;
|
|
10713
10793
|
entries: CompletionEntry[];
|
|
10794
|
+
/**
|
|
10795
|
+
* Default commit characters for the completion entries.
|
|
10796
|
+
*/
|
|
10797
|
+
defaultCommitCharacters?: string[];
|
|
10714
10798
|
}
|
|
10715
10799
|
interface CompletionEntryDataAutoImport {
|
|
10716
10800
|
/**
|
|
@@ -10817,6 +10901,10 @@ declare namespace ts {
|
|
|
10817
10901
|
* is an auto-import.
|
|
10818
10902
|
*/
|
|
10819
10903
|
data?: CompletionEntryData;
|
|
10904
|
+
/**
|
|
10905
|
+
* If this completion entry is selected, typing a commit character will cause the entry to be accepted.
|
|
10906
|
+
*/
|
|
10907
|
+
commitCharacters?: string[];
|
|
10820
10908
|
}
|
|
10821
10909
|
interface CompletionEntryLabelDetails {
|
|
10822
10910
|
/**
|