forked from Hacker0x01/react-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
161 lines (155 loc) · 5.42 KB
/
index.d.ts
File metadata and controls
161 lines (155 loc) · 5.42 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// Type definitions for react-datepicker 2.8
// Project: https://github.com/Hacker0x01/react-datepicker
// Definitions by: Rajab Shakirov <https://github.com/radziksh>,
// Andrey Balokha <https://github.com/andrewBalekha>,
// Greg Smith <https://github.com/smrq>,
// Platon Pronko <https://github.com/Rogach>
// Roy Xue <https://github.com/royxue>
// Koala Human <https://github.com/KoalaHuman>
// Sean Kelley <https://github.com/seansfkelley>
// Justin Grant <https://github.com/justingrant>
// Jake Boone <https://github.com/jakeboone02>
// Roman Nuritdinov <https://github.com/Ky6uk>
// Avi Klaiman <https://github.com/aviklai>
// Naoki Sekiguchi <https://github.com/seckie>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from "react";
import * as Popper from "popper.js";
import { Locale } from "date-fns";
export function registerLocale(localeName: string, localeData: {}): void;
export function setDefaultLocale(localeName: string): void;
export function getDefaultLocale(): string;
interface HighlightDates {
[className: string]: Date[];
}
export interface ReactDatePickerProps {
adjustDateOnChange?: boolean;
allowSameDay?: boolean;
autoComplete?: string;
autoFocus?: boolean;
calendarClassName?: string;
calendarContainer?(props: { children: React.ReactNode[] }): React.ReactNode;
children?: React.ReactNode;
className?: string;
clearButtonTitle?: string;
customInput?: React.ReactNode;
customInputRef?: string;
dateFormat?: string | string[];
dateFormatCalendar?: string;
dayClassName?(date: Date): string | null;
disabled?: boolean;
disabledKeyboardNavigation?: boolean;
dropdownMode?: "scroll" | "select";
endDate?: Date | null;
excludeDates?: Date[];
excludeTimes?: Date[];
filterDate?(date: Date): boolean;
fixedHeight?: boolean;
forceShowMonthNavigation?: boolean;
formatWeekDay?(date: Date): string;
formatWeekNumber?(date: Date): string | number;
highlightDates?: Array<HighlightDates | Date>;
id?: string;
includeDates?: Date[];
includeTimes?: Date[];
injectTimes?: Date[];
inline?: boolean;
isClearable?: boolean;
locale?: string | Locale;
maxDate?: Date | null;
maxTime?: Date;
minDate?: Date | null;
minTime?: Date;
monthsShown?: number;
name?: string;
nextMonthButtonLabel?: string;
onBlur?(event: React.FocusEvent<HTMLInputElement>): void;
onChange(
date: Date | null,
event: React.SyntheticEvent<any> | undefined
): void;
onChangeRaw?(event: React.FocusEvent<HTMLInputElement>): void;
onClickOutside?(event: React.MouseEvent<HTMLDivElement>): void;
onFocus?(event: React.FocusEvent<HTMLInputElement>): void;
onInputClick?(): void;
onInputError?(err: { code: number; msg: string }): void;
onKeyDown?(event: React.KeyboardEvent<HTMLDivElement>): void;
onMonthChange?(date: Date): void;
onSelect?(date: Date, event: React.SyntheticEvent<any> | undefined): void;
onClickDay?(date: Date, event: React.SyntheticEvent<any> | undefined): void;
onWeekSelect?(
firstDayOfWeek: Date,
weekNumber: string | number,
event: React.SyntheticEvent<any> | undefined
): void;
onYearChange?(date: Date): void;
open?: boolean;
openToDate?: Date;
peekNextMonth?: boolean;
placeholderText?: string;
popperClassName?: string;
popperContainer?(props: { children: React.ReactNode[] }): React.ReactNode;
popperModifiers?: Popper.Modifiers;
popperPlacement?: string;
popperProps?: {};
preventOpenOnFocus?: boolean;
previousMonthButtonLabel?: string;
readOnly?: boolean;
renderCustomHeader?(params: {
date: Date;
changeYear(year: number): void;
changeMonth(month: number): void;
decreaseMonth(): void;
increaseMonth(): void;
decreaseYear(): void;
increaseYear(): void;
prevMonthButtonDisabled: boolean;
nextMonthButtonDisabled: boolean;
prevYearButtonDisabled: boolean;
nextYearButtonDisabled: boolean;
}): React.ReactNode;
renderDayContents?(dayOfMonth: number, date: Date): React.ReactNode;
required?: boolean;
scrollableMonthYearDropdown?: boolean;
scrollableYearDropdown?: boolean;
selected?: Date | null;
selectsEnd?: boolean;
selectsStart?: boolean;
shouldCloseOnSelect?: boolean;
showDisabledMonthNavigation?: boolean;
showMonthDropdown?: boolean;
showMonthYearDropdown?: boolean;
showMonthYearPicker?: boolean;
showTimeSelect?: boolean;
showTimeSelectOnly?: boolean;
showWeekNumbers?: boolean;
showYearDropdown?: boolean;
startDate?: Date | null;
startOpen?: boolean;
strictParsing?: boolean;
tabIndex?: number;
timeCaption?: string;
timeFormat?: string;
timeIntervals?: number;
title?: string;
todayButton?: React.ReactNode;
useShortMonthInDropdown?: boolean;
useWeekdaysShort?: boolean;
value?: string;
weekLabel?: string;
withPortal?: boolean;
yearDropdownItemNumber?: number;
timeInputLabel?: string;
showTimeInput?: boolean;
inlineFocusSelectedMonth?: boolean;
onDayMouseEnter?: (date: Date) => void;
onMonthMouseLeave?: () => void;
}
declare class ReactDatePicker extends React.Component<ReactDatePickerProps> {
readonly setBlur: () => void;
readonly setFocus: () => void;
readonly setOpen: (open: boolean, skipSetBlur?: boolean) => void;
readonly isCalendarOpen: () => boolean;
}
export default ReactDatePicker;