import type * as stream from 'stream' ; import { Readable } from "./readable" ; import { Writable } from "./writable" ; import { mergeFns } from '../../_internal/utils' ; type DuplexClass = new ( ) => stream . Duplex ; export const Duplex = class { allowHalfOpen : boolean = true ; private _destroy : ( error ? : Error ) => void ; constructor ( readable = new Readable ( ) , writable = new Writable ( ) ) { Object . assign ( this , readable ) ; Object . assign ( this , writable ) ; this . _destroy = mergeFns ( readable . _destroy , writable . _destroy ) ; } } as any ; Object . assign ( Duplex . prototype , Readable . prototype ) ; Object . assign ( Duplex . prototype , Writable . prototype ) ;