1
1
import * as fs from "fs" ;
2
2
import { callbackify } from "util" ;
3
- import { Batch , ClientProxy , Module } from "../../common/proxy" ;
3
+ import { Batch , ClientProxy , ClientServerProxy } from "../../common/proxy" ;
4
4
import { IEncodingOptions , IEncodingOptionsCallback } from "../../common/util" ;
5
5
import { FsModuleProxy , ReadStreamProxy , Stats as IStats , WatcherProxy , WriteStreamProxy } from "../../node/modules/fs" ;
6
6
import { Readable , Writable } from "./stream" ;
@@ -38,9 +38,7 @@ class ReaddirBatch extends Batch<Buffer[] | fs.Dirent[] | string[], { path: fs.P
38
38
}
39
39
}
40
40
41
- interface ClientWatcherProxy extends WatcherProxy {
42
- proxyId : number | Module ;
43
- }
41
+ interface ClientWatcherProxy extends WatcherProxy , ClientServerProxy { }
44
42
45
43
class Watcher extends ClientProxy < ClientWatcherProxy > implements fs . FSWatcher {
46
44
public close ( ) : void {
@@ -52,9 +50,7 @@ class Watcher extends ClientProxy<ClientWatcherProxy> implements fs.FSWatcher {
52
50
}
53
51
}
54
52
55
- interface ClientReadStreamProxy extends ReadStreamProxy {
56
- proxyId : number | Module ;
57
- }
53
+ interface ClientReadStreamProxy extends ReadStreamProxy , ClientServerProxy { }
58
54
59
55
class ReadStream extends Readable < ClientReadStreamProxy > implements fs . ReadStream {
60
56
public get bytesRead ( ) : number {
@@ -70,9 +66,7 @@ class ReadStream extends Readable<ClientReadStreamProxy> implements fs.ReadStrea
70
66
}
71
67
}
72
68
73
- interface ClientWriteStreamProxy extends WriteStreamProxy {
74
- proxyId : number | Module ;
75
- }
69
+ interface ClientWriteStreamProxy extends WriteStreamProxy , ClientServerProxy { }
76
70
77
71
class WriteStream extends Writable < ClientWriteStreamProxy > implements fs . WriteStream {
78
72
public get bytesWritten ( ) : number {
@@ -88,8 +82,7 @@ class WriteStream extends Writable<ClientWriteStreamProxy> implements fs.WriteSt
88
82
}
89
83
}
90
84
91
- interface ClientFsModuleProxy extends FsModuleProxy {
92
- proxyId : number | Module ;
85
+ interface ClientFsModuleProxy extends FsModuleProxy , ClientServerProxy {
93
86
createReadStream ( path : fs . PathLike , options ?: any ) : Promise < ClientReadStreamProxy > ;
94
87
createWriteStream ( path : fs . PathLike , options ?: any ) : Promise < ClientWriteStreamProxy > ;
95
88
watch ( filename : fs . PathLike , options ?: IEncodingOptions ) : Promise < ClientWatcherProxy > ;
0 commit comments