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' ;
@@ -33,6 +34,7 @@ export type ViewsProps = View[] | {
3334 month ?: boolean | React . ComponentType < any > & ViewStatic ,
3435 week ?: boolean | React . ComponentType < any > & ViewStatic
3536} ;
37+ export type DayLayoutAlgorithm = 'overlap' | 'no-overlap' ;
3638export type NavigateAction = 'PREV' | 'NEXT' | 'TODAY' | 'DATE' ;
3739export interface Event {
3840 allDay ?: boolean ;
@@ -46,8 +48,8 @@ export interface DateRange {
4648 end : Date ;
4749}
4850
49- export type DateFormatFunction = ( date : Date , culture ?: string , localizer ?: object ) => string ;
50- export type DateRangeFormatFunction = ( range : DateRange , culture ?: string , localizer ?: object ) => string ;
51+ export type DateFormatFunction = ( date : Date , culture ?: Culture , localizer ?: DateLocalizer ) => string ;
52+ export type DateRangeFormatFunction = ( range : DateRange , culture ?: Culture , localizer ?: DateLocalizer ) => string ;
5153export type DateFormat = string | DateFormatFunction ;
5254
5355export interface Formats {
@@ -228,7 +230,7 @@ export interface Messages {
228230 noEventsInRange ?: string ;
229231}
230232
231- export type Culture = string | string [ ] ;
233+ export type Culture = string ;
232234export type FormatInput = number | string | Date ;
233235
234236export interface DateLocalizerSpec {
@@ -293,6 +295,7 @@ export interface CalendarProps<TEvent extends object = Event, TResource extends
293295 formats ?: Formats ;
294296 components ?: Components < TEvent > ;
295297 messages ?: Messages ;
298+ dayLayoutAlgorithm ?: DayLayoutAlgorithm ;
296299 titleAccessor ?: keyof TEvent | ( ( event : TEvent ) => string ) ;
297300 tooltipAccessor ?: keyof TEvent | ( ( event : TEvent ) => string ) ;
298301 allDayAccessor ?: keyof TEvent | ( ( event : TEvent ) => boolean ) ;
0 commit comments