UNPKG

949 BTypeScriptView Raw
1import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
2/**
3 * Constraints to be applied on {@link falsy}
4 * @remarks Since 1.26.0
5 * @public
6 */
7export interface FalsyContraints {
8 /**
9 * Enable falsy bigint value
10 * @remarks Since 1.26.0
11 */
12 withBigInt?: boolean;
13}
14/**
15 * Typing for values generated by {@link falsy}
16 * @remarks Since 2.2.0
17 * @public
18 */
19export declare type FalsyValue<TConstraints extends FalsyContraints = {}> = false | null | 0 | '' | typeof NaN | undefined | (TConstraints extends {
20 withBigInt: true;
21} ? 0n : never);
22/**
23 * For falsy values:
24 * - ''
25 * - 0
26 * - NaN
27 * - false
28 * - null
29 * - undefined
30 * - 0n (whenever withBigInt: true)
31 *
32 * @param constraints - Constraints to apply when building instances
33 *
34 * @remarks Since 1.26.0
35 * @public
36 */
37export declare function falsy<TConstraints extends FalsyContraints>(constraints?: TConstraints): Arbitrary<FalsyValue<TConstraints>>;