@@ -36,17 +36,17 @@ export interface IntermediateObjectWritable<T> extends Writable {
36
36
write ( chunk : any & T , cb ?: WriteCallback ) : boolean ;
37
37
write ( chunk : any & T , encoding ?: any , cb ?: WriteCallback ) : boolean ;
38
38
setDefaultEncoding ( encoding : string ) : this;
39
- end ( ) : this;
40
- end ( chunk : any & T , cb ?: Function ) : this;
41
- end ( chunk : any & T , encoding ?: any , cb ?: Function ) : this;
39
+ end ( ) : ReturnType < Writable [ 'end' ] > extends Writable ? this : void ;
40
+ end ( chunk : any & T , cb ?: Function ) : ReturnType < Writable [ 'end' ] > extends Writable ? this : void ;
41
+ end ( chunk : any & T , encoding ?: any , cb ?: Function ) : ReturnType < Writable [ 'end' ] > extends Writable ? this : void ;
42
42
}
43
43
44
44
export interface ObjectWritable < T > extends IntermediateObjectWritable < T > {
45
45
_write ( chunk : T , encoding : string , callback : Function ) : void ;
46
46
write ( chunk : T , cb ?: Function ) : boolean ;
47
47
write ( chunk : T , encoding ?: any , cb ?: Function ) : boolean ;
48
48
setDefaultEncoding ( encoding : string ) : this;
49
- end ( ) : this;
50
- end ( chunk : T , cb ?: Function ) : this;
51
- end ( chunk : T , encoding ?: any , cb ?: Function ) : this;
49
+ end ( ) : ReturnType < Writable [ 'end' ] > extends Writable ? this : void ;
50
+ end ( chunk : T , cb ?: Function ) : ReturnType < Writable [ 'end' ] > extends Writable ? this : void ;
51
+ end ( chunk : T , encoding ?: any , cb ?: Function ) : ReturnType < Writable [ 'end' ] > extends Writable ? this : void ;
52
52
}
0 commit comments