import { ISendQueue } from '../interface' ; export class BaseSendQueue implements ISendQueue { param sendNow param canSend note constructor ( sendNow ? , canSend ? ) { if ( sendNow && canSend ) { this . initialize ( sendNow , canSend ) ; } else if ( sendNow || canSend ) { throw new Error ( 'Both sendNow and canSend must be provided, or neither must.' ) ; } } public sendNow : ( bytes : string ) => number = ( bytes ) => - 1 ; public canSend : ( ) => boolean = ( ) => false ; param sendNow param canSend public initialize ( sendNow , canSend ) { this . sendNow = sendNow ; this . canSend = canSend ; } public send ( bytes ) { throw new Error ( 'not implemented' ) ; } public queueMessage ( bytes ) { throw new Error ( 'not implemented' ) ; } public processQueue ( ) { throw new Error ( 'not implemented' ) ; } } export default BaseSendQueue ;