import { MonthOrYearComponents , RangeType , State } from './store' ; import { CreateElement , CreateElementOptions , CreateElementRequiredOptions , eventHandler , PartialAtLeastOne , } from './utils' ; import { _EventListener } from './utils' ; import { PickersMap , DateType , MonthType , YearType } from './store' ; import { Sub } from './observer' ; export interface createMonthOrYearComponentsFunction { ( this , t ) : PartialAtLeastOne < CreateElementOptions > ; } export type PickerConfigMap = PickersMap < { children : ( CreateElementOptions | CreateElement ) [ ] ; watch : ( ( ) => void ) [ ] ; } > ; type EventMethod = ( this : State ) => void ; export type DayEvent = DateType < EventMethod , _EventListener [ ] > ; export type MonthEvent = MonthType < EventMethod , _EventListener [ ] > ; export type YearEvent = YearType < EventMethod , _EventListener [ ] > ; export interface RangeClickEvent { complete : { plt : keyof RangeType ; status : 'selecting' ; } ; selecting : { plt : keyof RangeType ; status : 'complete' ; } ; } interface CreateComponentsOptions { listener : ( child : MonthOrYearComponents , state : State ) => eventHandler ; children : ( idx : number ) => ( PartialAtLeastOne < CreateElementOptions > | CreateElement ) [ ] ; } export interface DateComponentsType < S = Sub < string > > { date : S ; year : S ; month : S ; } export interface ComponentsType < C = never > { month : C ; year : C ; } export type CreateMonthOrYearComponentsOptions = ComponentsType < CreateComponentsOptions > ; export interface HeaderChildrenOptions < F = ( ( state : State ) => CreateElementRequiredOptions ) [ ] > { start : F ; main : F ; end : F ; }