typescript 5.1.0-dev.20230426 → 5.1.0-dev.20230428
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 +261 -32
- package/lib/tsserver.js +383 -131
- package/lib/tsserverlibrary.d.ts +10 -9
- package/lib/tsserverlibrary.js +381 -132
- package/lib/typescript.d.ts +9 -6
- package/lib/typescript.js +264 -33
- package/lib/typingsInstaller.js +23 -196
- package/package.json +2 -2
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -22,8 +22,9 @@ declare namespace ts {
|
|
|
22
22
|
type EventBeginInstallTypes = "event::beginInstallTypes";
|
|
23
23
|
type EventEndInstallTypes = "event::endInstallTypes";
|
|
24
24
|
type EventInitializationFailed = "event::initializationFailed";
|
|
25
|
+
type ActionWatchTypingLocations = "action::watchTypingLocations";
|
|
25
26
|
interface TypingInstallerResponse {
|
|
26
|
-
readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
|
|
27
|
+
readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed | ActionWatchTypingLocations;
|
|
27
28
|
}
|
|
28
29
|
interface TypingInstallerRequestWithProjectName {
|
|
29
30
|
readonly projectName: string;
|
|
@@ -32,7 +33,6 @@ declare namespace ts {
|
|
|
32
33
|
readonly fileNames: string[];
|
|
33
34
|
readonly projectRootPath: Path;
|
|
34
35
|
readonly compilerOptions: CompilerOptions;
|
|
35
|
-
readonly watchOptions?: WatchOptions;
|
|
36
36
|
readonly typeAcquisition: TypeAcquisition;
|
|
37
37
|
readonly unresolvedImports: SortedReadonlyArray<string>;
|
|
38
38
|
readonly cachePath?: string;
|
|
@@ -84,8 +84,6 @@ declare namespace ts {
|
|
|
84
84
|
writeFile(path: string, content: string): void;
|
|
85
85
|
createDirectory(path: string): void;
|
|
86
86
|
getCurrentDirectory?(): string;
|
|
87
|
-
watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
|
|
88
|
-
watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
|
|
89
87
|
}
|
|
90
88
|
interface SetTypings extends ProjectResponse {
|
|
91
89
|
readonly typeAcquisition: TypeAcquisition;
|
|
@@ -94,6 +92,11 @@ declare namespace ts {
|
|
|
94
92
|
readonly unresolvedImports: SortedReadonlyArray<string>;
|
|
95
93
|
readonly kind: ActionSet;
|
|
96
94
|
}
|
|
95
|
+
interface WatchTypingLocations extends ProjectResponse {
|
|
96
|
+
/** if files is undefined, retain same set of watchers */
|
|
97
|
+
readonly files: readonly string[] | undefined;
|
|
98
|
+
readonly kind: ActionWatchTypingLocations;
|
|
99
|
+
}
|
|
97
100
|
namespace protocol {
|
|
98
101
|
enum CommandTypes {
|
|
99
102
|
JsxClosingTag = "jsxClosingTag",
|
|
@@ -3044,8 +3047,6 @@ declare namespace ts {
|
|
|
3044
3047
|
private readonly knownCachesSet;
|
|
3045
3048
|
private readonly projectWatchers;
|
|
3046
3049
|
private safeList;
|
|
3047
|
-
private readonly toCanonicalFileName;
|
|
3048
|
-
private readonly globalCachePackageJsonPath;
|
|
3049
3050
|
private installRunCount;
|
|
3050
3051
|
private inFlightRequestCount;
|
|
3051
3052
|
abstract readonly typesRegistry: Map<string, MapLike<string>>;
|
|
@@ -3064,7 +3065,7 @@ declare namespace ts {
|
|
|
3064
3065
|
private installTypingsAsync;
|
|
3065
3066
|
private executeWithThrottling;
|
|
3066
3067
|
protected abstract installWorker(requestId: number, packageNames: string[], cwd: string, onRequestCompleted: RequestCompletedAction): void;
|
|
3067
|
-
protected abstract sendResponse(response: SetTypings | InvalidateCachedTypings | BeginInstallTypes | EndInstallTypes): void;
|
|
3068
|
+
protected abstract sendResponse(response: SetTypings | InvalidateCachedTypings | BeginInstallTypes | EndInstallTypes | WatchTypingLocations): void;
|
|
3068
3069
|
protected readonly latestDistTag = "latest";
|
|
3069
3070
|
}
|
|
3070
3071
|
}
|
|
@@ -4596,7 +4597,7 @@ declare namespace ts {
|
|
|
4596
4597
|
interface FlowContainer extends Node {
|
|
4597
4598
|
_flowContainerBrand: any;
|
|
4598
4599
|
}
|
|
4599
|
-
type HasJSDoc = AccessorDeclaration | ArrowFunction | BinaryExpression | Block | BreakStatement | CallSignatureDeclaration | CaseClause | ClassLikeDeclaration | ClassStaticBlockDeclaration | ConstructorDeclaration | ConstructorTypeNode | ConstructSignatureDeclaration | ContinueStatement | DebuggerStatement | DoStatement | ElementAccessExpression | EmptyStatement | EndOfFileToken | EnumDeclaration | EnumMember | ExportAssignment | ExportDeclaration | ExportSpecifier | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | FunctionTypeNode | Identifier | IfStatement | ImportDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | InterfaceDeclaration | JSDocFunctionType | JSDocSignature | LabeledStatement | MethodDeclaration | MethodSignature | ModuleDeclaration | NamedTupleMember | NamespaceExportDeclaration | ObjectLiteralExpression | ParameterDeclaration | ParenthesizedExpression | PropertyAccessExpression | PropertyAssignment | PropertyDeclaration | PropertySignature | ReturnStatement | ShorthandPropertyAssignment | SpreadAssignment | SwitchStatement | ThrowStatement | TryStatement | TypeAliasDeclaration | TypeParameterDeclaration | VariableDeclaration | VariableStatement | WhileStatement | WithStatement;
|
|
4600
|
+
type HasJSDoc = AccessorDeclaration | ArrowFunction | BinaryExpression | Block | BreakStatement | CallSignatureDeclaration | CaseClause | ClassLikeDeclaration | ClassStaticBlockDeclaration | ConstructorDeclaration | ConstructorTypeNode | ConstructSignatureDeclaration | ContinueStatement | DebuggerStatement | DoStatement | ElementAccessExpression | EmptyStatement | EndOfFileToken | EnumDeclaration | EnumMember | ExportAssignment | ExportDeclaration | ExportSpecifier | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | FunctionTypeNode | Identifier | IfStatement | ImportDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | InterfaceDeclaration | JSDocFunctionType | JSDocSignature | LabeledStatement | MethodDeclaration | MethodSignature | ModuleDeclaration | NamedTupleMember | NamespaceExportDeclaration | ObjectLiteralExpression | ParameterDeclaration | ParenthesizedExpression | PropertyAccessExpression | PropertyAssignment | PropertyDeclaration | PropertySignature | ReturnStatement | SemicolonClassElement | ShorthandPropertyAssignment | SpreadAssignment | SwitchStatement | ThrowStatement | TryStatement | TypeAliasDeclaration | TypeParameterDeclaration | VariableDeclaration | VariableStatement | WhileStatement | WithStatement;
|
|
4600
4601
|
type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
|
|
4601
4602
|
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
|
|
4602
4603
|
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
|
|
@@ -4875,7 +4876,7 @@ declare namespace ts {
|
|
|
4875
4876
|
readonly body?: FunctionBody | undefined;
|
|
4876
4877
|
}
|
|
4877
4878
|
/** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
|
|
4878
|
-
interface SemicolonClassElement extends ClassElement {
|
|
4879
|
+
interface SemicolonClassElement extends ClassElement, JSDocContainer {
|
|
4879
4880
|
readonly kind: SyntaxKind.SemicolonClassElement;
|
|
4880
4881
|
readonly parent: ClassLikeDeclaration;
|
|
4881
4882
|
}
|