forked from nhn/tui.date-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
224 lines (146 loc) · 5.34 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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
// Type definitions for TOAST UI Date Picker v4.0.3
// TypeScript Version: 3.8.3
export type CalendarType = 'date' | 'month' | 'year';
export type DatePickerEventType = 'change' | 'close' | 'draw' | 'open';
export type DateRangePickerEventType = 'change:start' | 'change:end';
export type CalendarEventType = 'draw';
export interface CalendarOptions {
language?: string;
showToday?: boolean;
showJumpButtons?: boolean;
date?: Date;
type?: CalendarType;
usageStatistics?: boolean;
}
export interface DefaultPickerOptions {
type?: CalendarType;
selectableRanges?: Array<[Date | number, Date | number]>;
calendar?: CalendarOptions;
timePicker?: object | boolean;
showAlways?: boolean;
autoClose?: boolean;
language?: string;
usageStatistics?: boolean;
}
export interface DatePickerOptions extends DefaultPickerOptions {
input?: {
element?: HTMLElement | string;
format?: string;
};
openers?: Array<string | HTMLElement>;
date?: Date | number;
weekStartDay?: String;
}
export interface DateRangePickerOptions extends DefaultPickerOptions {
startpicker: {
input: HTMLInputElement | string;
container: HTMLElement | string;
date?: Date | number;
};
endpicker: {
input: HTMLInputElement | string;
container: HTMLElement | string;
date?: Date | number;
};
format?: string;
}
export class Calendar {
public addCssClass(className: string): void;
public changeLanguage(language: string): void;
public destroy(): void;
public draw(options: object): void;
public drawNext(): void;
public drawPrev(): void;
public getDate(): Date;
public getDateElements(): [HTMLElement];
public getNextDate(): Date;
public getNextYearDate(): Date;
public getPrevDate(): Date;
public getPrevYearDate(): Date;
public getType(): CalendarType;
public hide(): void;
public removeCssClass(className: string): void;
public show(): void;
public off(
eventName?: CalendarEventType | { [key in CalendarEventType]?: Function } | Function,
handler?: Function
): void;
public on(
eventName: CalendarEventType | { [key in CalendarEventType]?: Function },
handler?: Function | object,
context?: object
): void;
static localeTexts: Record<string, object>;
}
export class DateRangePicker {
public addRange(start: Date | number, end: Date | number): void;
public changeLanguage(language: string): void;
public destroy(): void;
public setStartDate: (newDate: Date) => void;
public getStartDate: () => Date;
public setEndDate: (newDate: Date) => void;
public getEndDate: () => Date;
public getStartpicker: () => DatePicker;
public getEndpicker: () => DatePicker;
public setRanges(ranges: Array<[Date | number, Date | number]>): void;
public removeRange(start: Date | number, end: Date | number, type?: CalendarType | null): void;
public off(
eventName?: DateRangePickerEventType | { [key in DateRangePickerEventType]?: Function } | Function,
handler?: Function
): void;
public on(
eventName: DateRangePickerEventType | { [key in DateRangePickerEventType]?: Function },
handler?: Function | object,
context?: object
): void;
}
export default class DatePicker {
constructor(container: string | HTMLElement, options?: DatePickerOptions);
public addCssClass(className: string): void;
public addOpener(opener: HTMLElement | string): void;
public addRange(start: Date | number, end: Date | number): void;
public changeLanguage(language: string): void;
public disable(): void;
public enable(): void;
public drawLowerCalendar(date?: Date): void;
public drawUpperCalendar(date?: Date): void;
public findOverlappedRange(startDate: Date | number, endDate: Date | number): void;
public getCalendar(): Calendar;
public getCalendarType(): CalendarType;
public getDateElements(): [HTMLElement];
public getLocaleText(): Record<string, object>;
public getTimePicker(): unknown;
public getType(): CalendarType;
public isDisabled(): boolean;
public isOpened(): boolean;
public isSelectable(date: Date): boolean;
public isSelected(date: Date): boolean;
public open(): void;
public close(): void;
public removeAllOpeners(): void;
public removeCssClass(className: string): void;
public removeOpener(opener: HTMLElement | string): void;
public removeRange(start: Date | number, end: Date | number, type?: CalendarType | null): void;
public setDateFormat(format: string): void;
public setInput(element: HTMLElement | string, options: { format: string; syncFromInput: boolean }): void;
public setNull(): void;
public setRanges(ranges: Array<[Date | number, Date | number]>): void;
public setType(type: string): void;
public toggle(): void;
public destroy(): void;
public off(
eventName?: DatePickerEventType | { [key in DatePickerEventType]?: Function } | Function,
handler?: Function
): void;
public on(
eventName: DatePickerEventType | { [key in DatePickerEventType]?: Function },
handler?: Function | object,
context?: object
): void;
public setStartDate: (newDate: Date) => void;
public getDate: () => Date;
public setDate: (newDate: Date) => void;
static localeTexts: Record<string, object>;
static createRangePicker(props: DateRangePickerOptions): DateRangePicker;
static createCalendar(wrapperElement: string | HTMLElement, options: CalendarOptions): Calendar;
}