import type { IForEachAble } from '../internal' ; import Column from './Column' ; import type { IColumnDesc , IDataRow } from './interfaces' ; import type { INumberFilter } from './INumberColumn' ; import type { IArrayColumn } from './IArrayColumn' ; export interface IDateColumn extends Column { getFormatter ( ) : ( v : Date | null ) => string ; getDate ( row ) : Date | null ; iterDate ( row ) : IForEachAble < Date | null > ; getFilter ( ) : IDateFilter ; setFilter ( value ) : void ; } export interface IDatesColumn extends IDateColumn , IArrayColumn < Date | null > { getDates ( row ) : ( Date | null ) [ ] ; } export interface IDateDesc { default dateFormat ? : string ; dfeault dateParse ? : string ; } param col returns { boolean } export function isDateColumn ( col ) ; export function isDateColumn ( col ) ; export function isDateColumn ( col ) { return ( ( col instanceof Column && typeof ( col as IDateColumn ) . getDate === 'function' ) || ( ! ( col instanceof Column ) && ( col as IColumnDesc ) . type . startsWith ( 'date' ) ) ) ; } export function isDatesColumn ( col ) { return typeof ( col as IDatesColumn ) . getDates === 'function' ; } export declare type IDateFilter = INumberFilter ; export declare type IDateGranularity = 'century' | 'decade' | 'year' | 'month' | 'week' | 'day_of_week' | 'day_of_month' | 'day_of_year' | 'hour' | 'minute' | 'second' ; export interface IDateGrouper { /**
     * granularity level for the grouping
     */ granularity : IDateGranularity ; /**
     * whether circular occurrences should be in the same bin
     * e.g. granularity = month
     * circular: 01.2018 == 01.2017
     * not circular: 01.2018 != 01.2017
     */ circular : boolean ; }