import * as apid from '../../../api' ; import * as mapid from '../../../node_modules/mirakurun/api' ; import Program from '../../db/entities/Program' ; import IChannelTypeIndex from './IChannelTypeHash' ; export interface ProgramWithOverlap extends Program { overlap : boolean ; } export interface ProgramUpdateValues { insert : mapid . Program [ ] ; update : mapid . Program [ ] ; delete : mapid . ProgramId [ ] ; } /**
 * ルール検索オプション
 */ export interface FindRuleOption { searchOption : apid . RuleSearchOption ; reserveOption ? : apid . RuleReserveOption ; limit ? : number ; } /**
 * 番組情報取得ベースオプション
 */ export interface FindScheduleBaseOption { startAt : apid . UnixtimeMS ; endAt : apid . UnixtimeMS ; isHalfWidth : boolean ; isFree ? : boolean ; } /**
 * 放送波指定の番組表情報取得オプション
 */ export interface FindScheduleIdOption extends FindScheduleBaseOption { channelId : apid . ChannelId ; } /**
 * 放送局指定の番組情報取得オプション
 */ export interface FindScheduleOption extends FindScheduleBaseOption { types : apid . ChannelType [ ] ; } export default interface IProgramDB { insert ( channelTypes , programs ) : Promise < void > ; update ( channelTypes , values ) : Promise < void > ; deleteOld ( time ) : Promise < void > ; findId ( programId ) : Promise < Program | null > ; findRule ( option ) : Promise < ProgramWithOverlap [ ] > ; findChannelIdAndTime ( channelId , startAt ) : Promise < Program | null > ; findAll ( ) : Promise < Program [ ] > ; findSchedule ( option ) : Promise < Program [ ] > ; findBroadcasting ( option ) : Promise < Program [ ] > ; }