UNPKG

1.01 kBTypeScriptView Raw
1import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js';
2/**
3 * Constraints to be applied on {@link date}
4 * @remarks Since 3.3.0
5 * @public
6 */
7export interface DateConstraints {
8 /**
9 * Lower bound of the range (included)
10 * @defaultValue new Date(-8640000000000000)
11 * @remarks Since 1.17.0
12 */
13 min?: Date;
14 /**
15 * Upper bound of the range (included)
16 * @defaultValue new Date(8640000000000000)
17 * @remarks Since 1.17.0
18 */
19 max?: Date;
20 /**
21 * When set to true, no more "Invalid Date" can be generated.
22 * @defaultValue true
23 * @remarks Since 3.13.0
24 */
25 noInvalidDate?: boolean;
26}
27/**
28 * For date between constraints.min or new Date(-8640000000000000) (included) and constraints.max or new Date(8640000000000000) (included)
29 *
30 * @param constraints - Constraints to apply when building instances
31 *
32 * @remarks Since 1.17.0
33 * @public
34 */
35export declare function date(constraints?: DateConstraints): Arbitrary<Date>;