import { DateEnv } from './datelib/env' ; import { CalendarData } from './reducers/data-types' ; export class ViewApi { constructor ( public type , private getCurrentData , private dateEnv ) { } get calendar ( ) { return this . getCurrentData ( ) . calendarApi ; } get title ( ) { return this . getCurrentData ( ) . viewTitle ; } get activeStart ( ) { return this . dateEnv . toDate ( this . getCurrentData ( ) . dateProfile . activeRange . start ) ; } get activeEnd ( ) { return this . dateEnv . toDate ( this . getCurrentData ( ) . dateProfile . activeRange . end ) ; } get currentStart ( ) { return this . dateEnv . toDate ( this . getCurrentData ( ) . dateProfile . currentRange . start ) ; } get currentEnd ( ) { return this . dateEnv . toDate ( this . getCurrentData ( ) . dateProfile . currentRange . end ) ; } getOption ( name ) { return this . getCurrentData ( ) . options [ name ] ; } }