11// Type definitions for react-big-calendar 0.22
2- // Project: https://github.com/intljusticemission /react-big-calendar
2+ // Project: https://github.com/jquense /react-big-calendar
33// Definitions by: Piotr Witek <https://github.com/piotrwitek>
44// Austin Turner <https://github.com/paustint>
55// Krzysztof Bezrąk <https://github.com/pikpok>
1515// Eric Kenney <https://github.com/KenneyE>
1616// Paito Anderson <https://github.com/PaitoAnderson>
1717// Jan Michalak <https://github.com/michalak111>
18+ // Felix Hessenberger <https://github.com/fhessenberger>
1819// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
1920// TypeScript Version: 2.8
2021import { Validator } from 'prop-types' ;
2122import * as React from 'react' ;
2223
23- export type DayPropGetter = ( date : Date ) => { className ?: string , style ?: React . CSSProperties } ;
24- export type EventPropGetter < T > = ( event : T , start : stringOrDate , end : stringOrDate , isSelected : boolean ) => { className ?: string , style ?: React . CSSProperties } ;
25- export type SlotPropGetter = ( date : Date ) => { className ?: string , style ?: React . CSSProperties } ;
24+ export type DayPropGetter = ( date : Date , resourceId ?: number | string ) => React . HTMLAttributes < HTMLDivElement > ;
25+ export type EventPropGetter < T > = ( event : T , start : stringOrDate , end : stringOrDate , isSelected : boolean ) => React . HTMLAttributes < HTMLDivElement > ;
26+ export type SlotPropGetter = ( date : Date , resourceId ?: number | string ) => React . HTMLAttributes < HTMLDivElement > ;
27+ export type SlotGroupPropGetter = ( ) => React . HTMLAttributes < HTMLDivElement > ;
2628export type stringOrDate = string | Date ;
2729export type ViewKey = 'MONTH' | 'WEEK' | 'WORK_WEEK' | 'DAY' | 'AGENDA' ;
2830export type View = 'month' | 'week' | 'work_week' | 'day' | 'agenda' ;
@@ -33,6 +35,7 @@ export type ViewsProps = View[] | {
3335 month ?: boolean | React . ComponentType < any > & ViewStatic ,
3436 week ?: boolean | React . ComponentType < any > & ViewStatic
3537} ;
38+ export type DayLayoutAlgorithm = 'overlap' | 'no-overlap' ;
3639export type NavigateAction = 'PREV' | 'NEXT' | 'TODAY' | 'DATE' ;
3740export interface Event {
3841 allDay ?: boolean ;
@@ -46,8 +49,8 @@ export interface DateRange {
4649 end : Date ;
4750}
4851
49- export type DateFormatFunction = ( date : Date , culture ?: string , localizer ?: object ) => string ;
50- export type DateRangeFormatFunction = ( range : DateRange , culture ?: string , localizer ?: object ) => string ;
52+ export type DateFormatFunction = ( date : Date , culture ?: Culture , localizer ?: DateLocalizer ) => string ;
53+ export type DateRangeFormatFunction = ( range : DateRange , culture ?: Culture , localizer ?: DateLocalizer ) => string ;
5154export type DateFormat = string | DateFormatFunction ;
5255
5356export interface Formats {
@@ -228,7 +231,7 @@ export interface Messages {
228231 noEventsInRange ?: string ;
229232}
230233
231- export type Culture = string | string [ ] ;
234+ export type Culture = string ;
232235export type FormatInput = number | string | Date ;
233236
234237export interface DateLocalizerSpec {
@@ -284,6 +287,7 @@ export interface CalendarProps<TEvent extends object = Event, TResource extends
284287 rtl ?: boolean ;
285288 eventPropGetter ?: EventPropGetter < TEvent > ;
286289 slotPropGetter ?: SlotPropGetter ;
290+ slotGroupPropGetter ?: SlotGroupPropGetter ;
287291 dayPropGetter ?: DayPropGetter ;
288292 showMultiDayTimes ?: boolean ;
289293 min ?: stringOrDate ;
@@ -293,6 +297,7 @@ export interface CalendarProps<TEvent extends object = Event, TResource extends
293297 formats ?: Formats ;
294298 components ?: Components < TEvent > ;
295299 messages ?: Messages ;
300+ dayLayoutAlgorithm ?: DayLayoutAlgorithm ;
296301 titleAccessor ?: keyof TEvent | ( ( event : TEvent ) => string ) ;
297302 tooltipAccessor ?: keyof TEvent | ( ( event : TEvent ) => string ) ;
298303 allDayAccessor ?: keyof TEvent | ( ( event : TEvent ) => boolean ) ;
0 commit comments