@@ -4716,21 +4716,26 @@ declare namespace ts.server {
47164716 interface TypesRegistryRequest {
47174717 readonly kind : "typesRegistry" ;
47184718 }
4719- interface InstallPackageRequest {
4719+ interface InstallPackageRequest extends TypingInstallerRequestWithProjectName {
47204720 readonly kind : "installPackage" ;
47214721 readonly fileName : Path ;
47224722 readonly packageName : string ;
47234723 readonly projectRootPath : Path ;
47244724 }
47254725 type ActionSet = "action::set" ;
47264726 type ActionInvalidate = "action::invalidate" ;
4727+ type ActionPackageInstalled = "action::packageInstalled" ;
47274728 type EventTypesRegistry = "event::typesRegistry" ;
4728- type EventPackageInstalled = "event::packageInstalled" ;
47294729 type EventBeginInstallTypes = "event::beginInstallTypes" ;
47304730 type EventEndInstallTypes = "event::endInstallTypes" ;
47314731 type EventInitializationFailed = "event::initializationFailed" ;
47324732 interface TypingInstallerResponse {
4733- readonly kind : ActionSet | ActionInvalidate | EventTypesRegistry | EventPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed ;
4733+ readonly kind : ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed ;
4734+ }
4735+ interface PackageInstalledResponse extends ProjectResponse {
4736+ readonly kind : ActionPackageInstalled ;
4737+ readonly success : boolean ;
4738+ readonly message : string ;
47344739 }
47354740 interface InitializationFailedResponse extends TypingInstallerResponse {
47364741 readonly kind : EventInitializationFailed ;
@@ -4766,8 +4771,8 @@ declare namespace ts.server {
47664771declare namespace ts . server {
47674772 const ActionSet : ActionSet ;
47684773 const ActionInvalidate : ActionInvalidate ;
4774+ const ActionPackageInstalled : ActionPackageInstalled ;
47694775 const EventTypesRegistry : EventTypesRegistry ;
4770- const EventPackageInstalled : EventPackageInstalled ;
47714776 const EventBeginInstallTypes : EventBeginInstallTypes ;
47724777 const EventEndInstallTypes : EventEndInstallTypes ;
47734778 const EventInitializationFailed : EventInitializationFailed ;
@@ -7125,12 +7130,13 @@ declare namespace ts.server {
71257130 }
71267131}
71277132declare namespace ts . server {
7128- interface InstallPackageOptionsWithProjectRootPath extends InstallPackageOptions {
7133+ interface InstallPackageOptionsWithProject extends InstallPackageOptions {
7134+ projectName : string ;
71297135 projectRootPath : Path ;
71307136 }
71317137 interface ITypingsInstaller {
71327138 isKnownTypesPackageName ( name : string ) : boolean ;
7133- installPackage ( options : InstallPackageOptionsWithProjectRootPath ) : Promise < ApplyCodeActionCommandResult > ;
7139+ installPackage ( options : InstallPackageOptionsWithProject ) : Promise < ApplyCodeActionCommandResult > ;
71347140 enqueueInstallTypingsRequest ( p : Project , typeAcquisition : TypeAcquisition , unresolvedImports : SortedReadonlyArray < string > ) : void ;
71357141 attach ( projectService : ProjectService ) : void ;
71367142 onProjectClosed ( p : Project ) : void ;
@@ -7142,7 +7148,7 @@ declare namespace ts.server {
71427148 private readonly perProjectCache ;
71437149 constructor ( installer : ITypingsInstaller ) ;
71447150 isKnownTypesPackageName ( name : string ) : boolean ;
7145- installPackage ( options : InstallPackageOptionsWithProjectRootPath ) : Promise < ApplyCodeActionCommandResult > ;
7151+ installPackage ( options : InstallPackageOptionsWithProject ) : Promise < ApplyCodeActionCommandResult > ;
71467152 getTypingsForProject ( project : Project , unresolvedImports : SortedReadonlyArray < string > , forceRefresh : boolean ) : SortedReadonlyArray < string > ;
71477153 updateTypingsForProject ( projectName : string , compilerOptions : CompilerOptions , typeAcquisition : TypeAcquisition , unresolvedImports : SortedReadonlyArray < string > , newTypings : string [ ] ) : void ;
71487154 deleteTypingsForProject ( projectName : string ) : void ;
@@ -7566,7 +7572,7 @@ declare namespace ts.server {
75667572 private createWatcherLog ( watchType , project ) ;
75677573 toPath ( fileName : string ) : Path ;
75687574 private loadTypesMap ( ) ;
7569- updateTypingsForProject ( response : SetTypings | InvalidateCachedTypings ) : void ;
7575+ updateTypingsForProject ( response : SetTypings | InvalidateCachedTypings | PackageInstalledResponse ) : void ;
75707576 private delayInferredProjectsRefresh ( ) ;
75717577 private delayUpdateProjectGraph ( project ) ;
75727578 private sendProjectsUpdatedInBackgroundEvent ( ) ;
0 commit comments