1
1
import { Event } from "@coder/events" ;
2
2
import { field , logger , time , Time } from "@coder/logger" ;
3
3
import { InitData , ISharedProcessData } from "@coder/protocol" ;
4
- import { retry , Retry } from "./retry" ;
4
+ import { retry } from "./retry" ;
5
+ import { Upload } from "./upload" ;
5
6
import { client } from "./fill/client" ;
6
7
import { Clipboard , clipboard } from "./fill/clipboard" ;
7
-
8
- export interface IURI {
9
-
10
- readonly path : string ;
11
- readonly fsPath : string ;
12
- readonly scheme : string ;
13
-
14
- }
15
-
16
- export interface IURIFactory {
17
-
18
- /**
19
- * Convert the object to an instance of a real URI.
20
- */
21
- create < T extends IURI > ( uri : IURI ) : T ;
22
- file ( path : string ) : IURI ;
23
- parse ( raw : string ) : IURI ;
24
-
25
- }
8
+ import { INotificationService , NotificationService , IProgressService , ProgressService } from "./fill/notification" ;
9
+ import { IURIFactory } from "./fill/uri" ;
26
10
27
11
/**
28
12
* A general abstraction of an IDE client.
@@ -34,9 +18,10 @@ export interface IURIFactory {
34
18
*/
35
19
export abstract class Client {
36
20
37
- public readonly retry : Retry = retry ;
21
+ public readonly retry = retry ;
38
22
public readonly clipboard : Clipboard = clipboard ;
39
23
public readonly uriFactory : IURIFactory ;
24
+ public readonly upload = new Upload ( new NotificationService ( ) , new ProgressService ( ) ) ;
40
25
private start : Time | undefined ;
41
26
private readonly progressElement : HTMLElement | undefined ;
42
27
private tasks : string [ ] = [ ] ;
@@ -187,6 +172,15 @@ export abstract class Client {
187
172
return this . sharedProcessDataPromise ;
188
173
}
189
174
175
+ public set notificationService ( service : INotificationService ) {
176
+ this . retry . notificationService = service ;
177
+ this . upload . notificationService = service ;
178
+ }
179
+
180
+ public set progressService ( service : IProgressService ) {
181
+ this . upload . progressService = service ;
182
+ }
183
+
190
184
/**
191
185
* Initialize the IDE.
192
186
*/
0 commit comments