@@ -2159,7 +2159,7 @@ declare module "stream" {
2159
2159
}
2160
2160
2161
2161
// Note: Duplex extends both Readable and Writable.
2162
- export class Duplex extends Readable implements NodeJS . ReadWriteStream {
2162
+ export class Duplex extends Readable implements Writable {
2163
2163
writable : boolean ;
2164
2164
constructor ( opts ?: DuplexOptions ) ;
2165
2165
_write ( data : Buffer , encoding : string , callback : Function ) : void ;
@@ -2175,31 +2175,9 @@ declare module "stream" {
2175
2175
2176
2176
export interface TransformOptions extends ReadableOptions , WritableOptions { }
2177
2177
2178
- // Note: Transform lacks the _read and _write methods of Readable/Writable.
2179
- export class Transform extends events . EventEmitter implements NodeJS . ReadWriteStream {
2180
- readable : boolean ;
2181
- writable : boolean ;
2178
+ export class Transform extends Duplex {
2182
2179
constructor ( opts ?: TransformOptions ) ;
2183
- _transform ( chunk : Buffer , encoding : string , callback : Function ) : void ;
2184
- _transform ( chunk : string , encoding : string , callback : Function ) : void ;
2185
- _flush ( callback : Function ) : void ;
2186
- read ( size ?: number ) : any ;
2187
- setEncoding ( encoding : string ) : void ;
2188
- pause ( ) : void ;
2189
- resume ( ) : void ;
2190
- pipe < T extends NodeJS . WritableStream > ( destination : T , options ?: { end ?: boolean ; } ) : T ;
2191
- unpipe < T extends NodeJS . WritableStream > ( destination ?: T ) : void ;
2192
- unshift ( chunk : string ) : void ;
2193
- unshift ( chunk : Buffer ) : void ;
2194
- wrap ( oldStream : NodeJS . ReadableStream ) : NodeJS . ReadableStream ;
2195
- push ( chunk : any , encoding ?: string ) : boolean ;
2196
- write ( buffer : Buffer , cb ?: Function ) : boolean ;
2197
- write ( str : string , cb ?: Function ) : boolean ;
2198
- write ( str : string , encoding ?: string , cb ?: Function ) : boolean ;
2199
- end ( ) : void ;
2200
- end ( buffer : Buffer , cb ?: Function ) : void ;
2201
- end ( str : string , cb ?: Function ) : void ;
2202
- end ( str : string , encoding ?: string , cb ?: Function ) : void ;
2180
+ _transform ( chunk : any , encoding : string , callback : Function ) : void ;
2203
2181
}
2204
2182
2205
2183
export class PassThrough extends Transform { }
0 commit comments