import { PassThrough , TransformOptions } from 'stream' ; export interface IReadTarball { abort ? : ( ) => void ; } export interface IUploadTarball { done ? : ( ) => void ; abort ? : ( ) => void ; } param { * } options return { Stream } class ReadTarball extends PassThrough implements IReadTarball { param { Object } options public constructor ( options ) { super ( options ) ; addAbstractMethods ( this , 'abort' ) ; } public abort ( ) { } } param { * } options return { Stream } class UploadTarball extends PassThrough implements IUploadTarball { param { Object } options public constructor ( options ) { super ( options ) ; addAbstractMethods ( this , 'abort' ) ; addAbstractMethods ( this , 'done' ) ; } public abort ( ) { } public done ( ) { } } param { * } self param { * } name function addAbstractMethods ( self , name ) { self . _called_methods = self . _called_methods || { } ; self . __defineGetter__ ( name , function ( ) { return function ( ) : void { self . _called_methods [ name ] = true ; } ; } ) ; self . __defineSetter__ ( name , function ( fn ) { delete self [ name ] ; self [ name ] = fn ; if ( self . _called_methods && self . _called_methods [ name ] ) { delete self . _called_methods [ name ] ; self [ name ] ( ) ; } } ) ; } export { ReadTarball , UploadTarball } ;