forked from wojtekmaj/react-calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
81 lines (75 loc) · 3.05 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
declare module "react-calendar" {
type CalendarType = "ISO 8601" | "US" | "Arabic" | "Hebrew"
type Detail = "month" | "year" | "decade" | "century"
type DateCallback = (date: Date) => void
type OnChangeDateCallback = (date: Date | Date[]) => void
type FormatterCallback = (locale: string, date: Date) => string
type ViewCallback = (props: ViewCallbackProperties) => void
export default function Calendar(props: CalendarProps): JSX.Element;
export interface CalendarProps {
activeStartDate?: Date;
calendarType?: CalendarType;
className?: string | string[];
formatMonth?: FormatterCallback;
formatMonthYear?: FormatterCallback;
formatShortWeekday?: FormatterCallback;
locale?: string;
maxDate?: Date;
maxDetail?: Detail;
minDate?: Date;
minDetail?: Detail;
navigationLabel?: (props: { date: Date, view: Detail, label: string }) => string | JSX.Element | null;
next2Label?: string | JSX.Element | null;
nextLabel?: string | JSX.Element;
onActiveDateChange?: ViewCallback;
onChange?: OnChangeDateCallback;
onClickDay?: DateCallback;
onClickDecade?: DateCallback;
onClickMonth?: DateCallback;
onClickWeekNumber?: DateCallback;
onClickYear?: DateCallback;
onDrillDown?: ViewCallback;
onDrillUp?: ViewCallback;
prev2Label?: string | JSX.Element | null;
prevLabel?: string | JSX.Element;
renderChildren?: (props: CalendarTileProperties) => JSX.Element | null; // For backwards compatibility
returnValue?: "start" | "end" | "range";
selectRange?: boolean;
showFixedNumberOfWeeks?: boolean;
showNavigation?: boolean;
showNeighboringMonth?: boolean;
showWeekNumbers?: boolean;
tileClassName?: string | string[] | ((props: CalendarTileProperties) => string | string[] | null);
tileContent?: JSX.Element | ((props: CalendarTileProperties) => JSX.Element | null);
tileDisabled?: (props: CalendarTileProperties & {activeStartDate: Date}) => boolean;
value?: Date | Date[];
view?: Detail;
}
export interface CalendarTileProperties {
date: Date;
view: Detail;
}
export interface ViewCallbackProperties {
activeStartDate: Date;
view: Detail;
}
export function MonthView(props: DetailViewProps): JSX.Element;
export function YearView(props: DetailViewProps): JSX.Element;
export function DecadeView(props: DetailViewProps): JSX.Element;
export function CenturyView(props: DetailViewProps): JSX.Element;
export interface DetailViewProps {
activeStartDate: Date;
calendarType?: CalendarType;
locale?: string;
hover?: Date;
maxDate?: Date;
minDate?: Date;
onClick?: DateCallback;
onMouseOver?: DateCallback;
renderChildren?: (props: CalendarTileProperties) => JSX.Element | null; // For backwards compatibility
tileClassName?: string | string[] | ((props: CalendarTileProperties) => string | string[] | null);
tileContent?: JSX.Element | ((props: CalendarTileProperties) => JSX.Element | null);
tileDisabled?: (props: CalendarTileProperties) => boolean;
value?: Date | Date[];
}
}