1 |
|
2 | import type { Buffer } from 'node:buffer';
|
3 | import type { TypedArray } from './typed-array.js';
|
4 | import { StringPredicate } from './predicates/string.js';
|
5 | import { NumberPredicate } from './predicates/number.js';
|
6 | import { BigIntPredicate } from './predicates/bigint.js';
|
7 | import { BooleanPredicate } from './predicates/boolean.js';
|
8 | import { Predicate, type PredicateOptions } from './predicates/predicate.js';
|
9 | import { ArrayPredicate } from './predicates/array.js';
|
10 | import { ObjectPredicate } from './predicates/object.js';
|
11 | import { DatePredicate } from './predicates/date.js';
|
12 | import { ErrorPredicate } from './predicates/error.js';
|
13 | import { MapPredicate } from './predicates/map.js';
|
14 | import { WeakMapPredicate } from './predicates/weak-map.js';
|
15 | import { SetPredicate } from './predicates/set.js';
|
16 | import { WeakSetPredicate } from './predicates/weak-set.js';
|
17 | import { TypedArrayPredicate } from './predicates/typed-array.js';
|
18 | import { ArrayBufferPredicate } from './predicates/array-buffer.js';
|
19 | import { DataViewPredicate } from './predicates/data-view.js';
|
20 | import type { BasePredicate } from './predicates/base-predicate.js';
|
21 | import { AnyPredicate } from './predicates/any.js';
|
22 | export type Predicates = {
|
23 | |
24 |
|
25 |
|
26 | readonly string: StringPredicate;
|
27 | |
28 |
|
29 |
|
30 | readonly number: NumberPredicate;
|
31 | |
32 |
|
33 |
|
34 | readonly bigint: BigIntPredicate;
|
35 | |
36 |
|
37 |
|
38 | readonly boolean: BooleanPredicate;
|
39 | |
40 |
|
41 |
|
42 | readonly undefined: Predicate<undefined>;
|
43 | |
44 |
|
45 |
|
46 | readonly null: Predicate<null>;
|
47 | |
48 |
|
49 |
|
50 | readonly nullOrUndefined: Predicate<null | undefined>;
|
51 | |
52 |
|
53 |
|
54 | readonly nan: Predicate<number>;
|
55 | |
56 |
|
57 |
|
58 | readonly symbol: Predicate<symbol>;
|
59 | |
60 |
|
61 |
|
62 | readonly array: ArrayPredicate;
|
63 | |
64 |
|
65 |
|
66 | readonly object: ObjectPredicate;
|
67 | |
68 |
|
69 |
|
70 | readonly date: DatePredicate;
|
71 | |
72 |
|
73 |
|
74 | readonly error: ErrorPredicate;
|
75 | |
76 |
|
77 |
|
78 | readonly map: MapPredicate;
|
79 | |
80 |
|
81 |
|
82 | readonly weakMap: WeakMapPredicate;
|
83 | |
84 |
|
85 |
|
86 | readonly set: SetPredicate;
|
87 | |
88 |
|
89 |
|
90 | readonly weakSet: WeakSetPredicate;
|
91 | |
92 |
|
93 |
|
94 | readonly function: Predicate<Function>;
|
95 | |
96 |
|
97 |
|
98 | readonly buffer: Predicate<Buffer>;
|
99 | |
100 |
|
101 |
|
102 | readonly regExp: Predicate<RegExp>;
|
103 | |
104 |
|
105 |
|
106 | readonly promise: Predicate<Promise<unknown>>;
|
107 | |
108 |
|
109 |
|
110 | readonly typedArray: TypedArrayPredicate<TypedArray>;
|
111 | |
112 |
|
113 |
|
114 | readonly int8Array: TypedArrayPredicate<Int8Array>;
|
115 | |
116 |
|
117 |
|
118 | readonly uint8Array: TypedArrayPredicate<Uint8Array>;
|
119 | |
120 |
|
121 |
|
122 | readonly uint8ClampedArray: TypedArrayPredicate<Uint8ClampedArray>;
|
123 | |
124 |
|
125 |
|
126 | readonly int16Array: TypedArrayPredicate<Int16Array>;
|
127 | |
128 |
|
129 |
|
130 | readonly uint16Array: TypedArrayPredicate<Uint16Array>;
|
131 | |
132 |
|
133 |
|
134 | readonly int32Array: TypedArrayPredicate<Int32Array>;
|
135 | |
136 |
|
137 |
|
138 | readonly uint32Array: TypedArrayPredicate<Uint32Array>;
|
139 | |
140 |
|
141 |
|
142 | readonly float32Array: TypedArrayPredicate<Float32Array>;
|
143 | |
144 |
|
145 |
|
146 | readonly float64Array: TypedArrayPredicate<Float64Array>;
|
147 | |
148 |
|
149 |
|
150 | readonly arrayBuffer: ArrayBufferPredicate<ArrayBuffer>;
|
151 | |
152 |
|
153 |
|
154 | readonly sharedArrayBuffer: ArrayBufferPredicate<SharedArrayBuffer>;
|
155 | |
156 |
|
157 |
|
158 | readonly dataView: DataViewPredicate;
|
159 | |
160 |
|
161 |
|
162 | readonly iterable: Predicate<Iterable<unknown>>;
|
163 | |
164 |
|
165 |
|
166 | any: (<T1>(p1: BasePredicate<T1>) => AnyPredicate<T1>) & (<T1, T2>(p1: BasePredicate<T1>, p2: BasePredicate<T2>) => AnyPredicate<T1 | T2>) & (<T1, T2, T3>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>) => AnyPredicate<T1 | T2 | T3>) & (<T1, T2, T3, T4>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>) => AnyPredicate<T1 | T2 | T3 | T4>) & (<T1, T2, T3, T4, T5>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>) => AnyPredicate<T1 | T2 | T3 | T4 | T5>) & (<T1, T2, T3, T4, T5, T6>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>) => AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6>) & (<T1, T2, T3, T4, T5, T6, T7>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>) => AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7>) & (<T1, T2, T3, T4, T5, T6, T7, T8>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>, p8: BasePredicate<T8>) => AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8>) & (<T1, T2, T3, T4, T5, T6, T7, T8, T9>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>, p8: BasePredicate<T8>, p9: BasePredicate<T9>) => AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>) & (<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>, p8: BasePredicate<T8>, p9: BasePredicate<T9>, p10: BasePredicate<T10>) => AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9 | T10>) & ((...predicate: BasePredicate[]) => AnyPredicate);
|
167 | };
|
168 | declare const predicates: <T>(object: T, options?: PredicateOptions) => T & Predicates;
|
169 | export default predicates;
|
170 | export { ObjectPredicate } from './predicates/object.js';
|
171 | export type { Shape } from './predicates/object.js';
|
172 | export { StringPredicate } from './predicates/string.js';
|
173 | export { NumberPredicate } from './predicates/number.js';
|
174 | export { BigIntPredicate } from './predicates/bigint.js';
|
175 | export { BooleanPredicate } from './predicates/boolean.js';
|
176 | export { ArrayPredicate } from './predicates/array.js';
|
177 | export { DatePredicate } from './predicates/date.js';
|
178 | export { ErrorPredicate } from './predicates/error.js';
|
179 | export { MapPredicate } from './predicates/map.js';
|
180 | export { WeakMapPredicate } from './predicates/weak-map.js';
|
181 | export { SetPredicate } from './predicates/set.js';
|
182 | export { WeakSetPredicate } from './predicates/weak-set.js';
|
183 | export { TypedArrayPredicate } from './predicates/typed-array.js';
|
184 | export { ArrayBufferPredicate } from './predicates/array-buffer.js';
|
185 | export { DataViewPredicate } from './predicates/data-view.js';
|
186 | export { AnyPredicate } from './predicates/any.js';
|