forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-input-calendar.d.ts
59 lines (58 loc) · 2.09 KB
/
react-input-calendar.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
// Type definitions for react-input-calendar
// Project: https://github.com/Rudeg/react-input-calendar
// Definitions by: Stepan Mikhaylyuk <https://github.com/stepancar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../react/react.d.ts"/>
declare module reactInputCalendar {
export interface ReactInputCalendarProps {
/**
* Format of date, which display in input and set in date property.
* Allowed Keys: All formats supported by moment.js
* @default 'MM-DD-YYYY'
*/
format?: string;
/**
* Set initial date value
* @default current date
*/
date?: string | Date;
/**
* Set minimal view. Values:
* 0 - days
* 1 - months
* 2 - years.
* @default 0 (DaysView)
*/
minView?: number;
/**
* Format of date for the onChange event. Default on the date format (ISO 8601) to ease the save of data.
* Allowed Keys: All formats supported by moment.js
* @default 'MM-DD-YYYY'
*/
computableFormat?: string;
/**
* Set an function that will be triggered whenever there is a change in the selected date. It will return the date in the props.computableFormat format.
*/
onChange?:(selectedDate: string)=>any;
/**
* Define state when date picker would close once the user has clicked on a date.
*/
closeOnSelect?:boolean;
/**
* Setting this value to true makes the calendar widget open when the iput field is focused.
*/
openOnInputFocus?: boolean;
/**
* Value to show in the input text box if no date is set.
*/
placeholder?:string
}
interface ReactInputCalendarState { }
export class ReactInputCalendar extends __React.Component<ReactInputCalendarProps, ReactInputCalendarState>{
render(): __React.DOMElement<any>
}
}
declare var ReactInputCalendar: typeof reactInputCalendar.ReactInputCalendar
declare module "react-input-calendar" {
export = ReactInputCalendar
}