typescript 5.1.0-dev.20230420 → 5.1.0-dev.20230422
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 +479 -368
- package/lib/tsserver.js +26640 -26297
- package/lib/tsserverlibrary.d.ts +41 -14
- package/lib/tsserverlibrary.js +27789 -27431
- package/lib/typescript.d.ts +15 -9
- package/lib/typescript.js +27680 -27336
- package/lib/typingsInstaller.js +14 -28
- package/package.json +5 -3
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -155,6 +155,7 @@ declare namespace ts {
|
|
|
155
155
|
GetSupportedCodeFixes = "getSupportedCodeFixes",
|
|
156
156
|
GetApplicableRefactors = "getApplicableRefactors",
|
|
157
157
|
GetEditsForRefactor = "getEditsForRefactor",
|
|
158
|
+
GetMoveToRefactoringFileSuggestions = "getMoveToRefactoringFileSuggestions",
|
|
158
159
|
OrganizeImports = "organizeImports",
|
|
159
160
|
GetEditsForFileRename = "getEditsForFileRename",
|
|
160
161
|
ConfigurePlugin = "configurePlugin",
|
|
@@ -518,6 +519,26 @@ declare namespace ts {
|
|
|
518
519
|
interface GetApplicableRefactorsResponse extends Response {
|
|
519
520
|
body?: ApplicableRefactorInfo[];
|
|
520
521
|
}
|
|
522
|
+
/**
|
|
523
|
+
* Request refactorings at a given position or selection area to move to an existing file.
|
|
524
|
+
*/
|
|
525
|
+
interface GetMoveToRefactoringFileSuggestionsRequest extends Request {
|
|
526
|
+
command: CommandTypes.GetMoveToRefactoringFileSuggestions;
|
|
527
|
+
arguments: GetMoveToRefactoringFileSuggestionsRequestArgs;
|
|
528
|
+
}
|
|
529
|
+
type GetMoveToRefactoringFileSuggestionsRequestArgs = FileLocationOrRangeRequestArgs & {
|
|
530
|
+
kind?: string;
|
|
531
|
+
};
|
|
532
|
+
/**
|
|
533
|
+
* Response is a list of available files.
|
|
534
|
+
* Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
|
|
535
|
+
*/
|
|
536
|
+
interface GetMoveToRefactoringFileSuggestions extends Response {
|
|
537
|
+
body: {
|
|
538
|
+
newFileName: string;
|
|
539
|
+
files: string[];
|
|
540
|
+
};
|
|
541
|
+
}
|
|
521
542
|
/**
|
|
522
543
|
* A set of one or more available refactoring actions, grouped under a parent refactoring.
|
|
523
544
|
*/
|
|
@@ -582,6 +603,7 @@ declare namespace ts {
|
|
|
582
603
|
type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & {
|
|
583
604
|
refactor: string;
|
|
584
605
|
action: string;
|
|
606
|
+
interactiveRefactorArguments?: InteractiveRefactorArguments;
|
|
585
607
|
};
|
|
586
608
|
interface GetEditsForRefactorResponse extends Response {
|
|
587
609
|
body?: RefactorEditInfo;
|
|
@@ -3254,7 +3276,7 @@ declare namespace ts {
|
|
|
3254
3276
|
private readonly cancellationToken;
|
|
3255
3277
|
isNonTsProject(): boolean;
|
|
3256
3278
|
isJsOnlyProject(): boolean;
|
|
3257
|
-
static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void
|
|
3279
|
+
static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {} | undefined;
|
|
3258
3280
|
isKnownTypesPackageName(name: string): boolean;
|
|
3259
3281
|
installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
|
|
3260
3282
|
private get typingsCache();
|
|
@@ -3341,9 +3363,8 @@ declare namespace ts {
|
|
|
3341
3363
|
setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void;
|
|
3342
3364
|
getTypeAcquisition(): ts.TypeAcquisition;
|
|
3343
3365
|
protected removeRoot(info: ScriptInfo): void;
|
|
3344
|
-
protected enableGlobalPlugins(options: CompilerOptions
|
|
3345
|
-
protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[]
|
|
3346
|
-
private enableProxy;
|
|
3366
|
+
protected enableGlobalPlugins(options: CompilerOptions): void;
|
|
3367
|
+
protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[]): void;
|
|
3347
3368
|
/** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */
|
|
3348
3369
|
refreshDiagnostics(): void;
|
|
3349
3370
|
}
|
|
@@ -3644,7 +3665,6 @@ declare namespace ts {
|
|
|
3644
3665
|
readonly globalPlugins: readonly string[];
|
|
3645
3666
|
readonly pluginProbeLocations: readonly string[];
|
|
3646
3667
|
readonly allowLocalPluginLoads: boolean;
|
|
3647
|
-
private currentPluginConfigOverrides;
|
|
3648
3668
|
readonly typesMapLocation: string | undefined;
|
|
3649
3669
|
readonly serverMode: LanguageServiceMode;
|
|
3650
3670
|
/** Tracks projects that we have already sent telemetry for. */
|
|
@@ -3989,6 +4009,7 @@ declare namespace ts {
|
|
|
3989
4009
|
private getRange;
|
|
3990
4010
|
private getApplicableRefactors;
|
|
3991
4011
|
private getEditsForRefactor;
|
|
4012
|
+
private getMoveToRefactoringFileSuggestions;
|
|
3992
4013
|
private organizeImports;
|
|
3993
4014
|
private getEditsForFileRename;
|
|
3994
4015
|
private getCodeFixes;
|
|
@@ -4432,10 +4453,8 @@ declare namespace ts {
|
|
|
4432
4453
|
NotEmittedStatement = 358,
|
|
4433
4454
|
PartiallyEmittedExpression = 359,
|
|
4434
4455
|
CommaListExpression = 360,
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
SyntheticReferenceExpression = 363,
|
|
4438
|
-
Count = 364,
|
|
4456
|
+
SyntheticReferenceExpression = 361,
|
|
4457
|
+
Count = 362,
|
|
4439
4458
|
FirstAssignment = 64,
|
|
4440
4459
|
LastAssignment = 79,
|
|
4441
4460
|
FirstCompoundAssignment = 65,
|
|
@@ -7526,9 +7545,8 @@ declare namespace ts {
|
|
|
7526
7545
|
ReuseTempVariableScope = 1048576,
|
|
7527
7546
|
CustomPrologue = 2097152,
|
|
7528
7547
|
NoHoisting = 4194304,
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
NoAsciiEscaping = 33554432
|
|
7548
|
+
Iterator = 8388608,
|
|
7549
|
+
NoAsciiEscaping = 16777216
|
|
7532
7550
|
}
|
|
7533
7551
|
interface EmitHelperBase {
|
|
7534
7552
|
readonly name: string;
|
|
@@ -9247,7 +9265,7 @@ declare namespace ts {
|
|
|
9247
9265
|
* this list is only the set of defaults that are implicitly included.
|
|
9248
9266
|
*/
|
|
9249
9267
|
function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
|
|
9250
|
-
function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
|
|
9268
|
+
function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): ModuleResolutionCache;
|
|
9251
9269
|
function createTypeReferenceDirectiveResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): TypeReferenceDirectiveResolutionCache;
|
|
9252
9270
|
function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations | undefined;
|
|
9253
9271
|
function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations;
|
|
@@ -10097,6 +10115,8 @@ declare namespace ts {
|
|
|
10097
10115
|
getRenameInfo(fileName: string, position: number, preferences: UserPreferences): RenameInfo;
|
|
10098
10116
|
/** @deprecated Use the signature with `UserPreferences` instead. */
|
|
10099
10117
|
getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo;
|
|
10118
|
+
findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, preferences: UserPreferences): readonly RenameLocation[] | undefined;
|
|
10119
|
+
/** @deprecated Pass `providePrefixAndSuffixTextForRename` as part of a `UserPreferences` parameter. */
|
|
10100
10120
|
findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined;
|
|
10101
10121
|
getSmartSelectionRange(fileName: string, position: number): SelectionRange;
|
|
10102
10122
|
getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined;
|
|
@@ -10149,7 +10169,11 @@ declare namespace ts {
|
|
|
10149
10169
|
* arguments for any interactive action before offering it.
|
|
10150
10170
|
*/
|
|
10151
10171
|
getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string, includeInteractiveActions?: boolean): ApplicableRefactorInfo[];
|
|
10152
|
-
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
|
|
10172
|
+
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined, includeInteractiveActions?: InteractiveRefactorArguments): RefactorEditInfo | undefined;
|
|
10173
|
+
getMoveToRefactoringFileSuggestions(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined, triggerReason?: RefactorTriggerReason, kind?: string): {
|
|
10174
|
+
newFileName: string;
|
|
10175
|
+
files: string[];
|
|
10176
|
+
};
|
|
10153
10177
|
organizeImports(args: OrganizeImportsArgs, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
|
|
10154
10178
|
getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): readonly FileTextChanges[];
|
|
10155
10179
|
getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, forceDtsEmit?: boolean): EmitOutput;
|
|
@@ -10657,6 +10681,9 @@ declare namespace ts {
|
|
|
10657
10681
|
interface DocCommentTemplateOptions {
|
|
10658
10682
|
readonly generateReturnInDocTemplate?: boolean;
|
|
10659
10683
|
}
|
|
10684
|
+
interface InteractiveRefactorArguments {
|
|
10685
|
+
targetFile: string;
|
|
10686
|
+
}
|
|
10660
10687
|
interface SignatureHelpParameter {
|
|
10661
10688
|
name: string;
|
|
10662
10689
|
documentation: SymbolDisplayPart[];
|