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