import * as apid from '../../../../api' ; import * as mapid from '../../../../node_modules/mirakurun/api' ; import Reserve from '../../../db/entities/Reserve' ; export default class Tuner { private types : apid . ChannelType [ ] ; private reserves : Reserve [ ] = [ ] ; constructor ( tuner ) { this . types = tuner . types ; } return public add ( reserve ) { if ( this . types . indexOf ( < apid . ChannelType > reserve . channelType ) !== - 1 && ( this . reserves . length === 0 || this . reserves [ 0 ] . channel === reserve . channel ) ) { this . reserves . push ( reserve ) ; return true ; } return false ; } /**
     * 予約情報を全て削除
     */ public clear ( ) { this . reserves = [ ] ; } }