Skip to content

Commit 8cf87c4

Browse files
committed
Use type aliases for min/max date and time options
1 parent 668800d commit 8cf87c4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pickadate/pickadate.d.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ declare module Pickadate {
166166
onSet?: (event: any) => void;
167167
onStop?: (event: any) => void;
168168
}
169+
170+
type MinOrMaxDateOption = Date | [number, number, number] | number | boolean;
171+
type MinOrMaxTimeOption = Date | [number, number] | number | boolean;
169172

170173
export interface DateOptions extends Options {
171174
// Strings and translations
@@ -211,13 +214,13 @@ declare module Pickadate {
211214
* for a date relative to today, or a boolean (`true` sets it to today,
212215
* `false` removes any limit).
213216
*/
214-
min?: Date | [number, number, number] | number | boolean;
217+
min?: MinOrMaxDateOption;
215218

216219
/**
217220
* Set the maximum selectable date on the picker.
218221
* Accepts the same values as the `min` property.
219222
*/
220-
max?: Date | [number, number, number] | number | boolean;
223+
max?: MinOrMaxDateOption;
221224

222225
/**
223226
* Disable a specific or arbitrary set of dates selectable on the
@@ -253,13 +256,13 @@ declare module Pickadate {
253256
* for a time relative to now, or a boolean (`true` sets it to now, and
254257
* `false` removes any limit).
255258
*/
256-
min?: Date | [number, number] | number | boolean;
259+
min?: MinOrMaxTimeOption;
257260

258261
/**
259262
* Set the maximum selectable time on the picker.
260263
* Accepts the same values as the `min` property.
261264
*/
262-
max?: Date | [number, number] | number | boolean;
265+
max?: MinOrMaxTimeOption;
263266

264267
/**
265268
* Disable a specific or arbitrary set of times selectable on the picker.

0 commit comments

Comments
 (0)