UNPKG

1.56 kBTypeScriptView Raw
1import { Predicate, type PredicateOptions } from './predicate.js';
2export declare class SetPredicate<T = any> extends Predicate<Set<T>> {
3 /**
4 @hidden
5 */
6 constructor(options?: PredicateOptions);
7 /**
8 Test a Set to have a specific size.
9
10 @param size - The size of the Set.
11 */
12 size(size: number): this;
13 /**
14 Test a Set to have a minimum size.
15
16 @param size - The minimum size of the Set.
17 */
18 minSize(size: number): this;
19 /**
20 Test a Set to have a maximum size.
21
22 @param size - The maximum size of the Set.
23 */
24 maxSize(size: number): this;
25 /**
26 Test a Set to include all the provided items. The items are tested by identity, not structure.
27
28 @param items - The items that should be a item in the Set.
29 */
30 has(...items: readonly T[]): this;
31 /**
32 Test a Set to include any of the provided items. The items are tested by identity, not structure.
33
34 @param items - The items that could be a item in the Set.
35 */
36 hasAny(...items: readonly T[]): this;
37 /**
38 Test all the items in the Set to match the provided predicate.
39
40 @param predicate - The predicate that should be applied against every item in the Set.
41 */
42 ofType(predicate: Predicate<T>): this;
43 /**
44 Test a Set to be empty.
45 */
46 get empty(): this;
47 /**
48 Test a Set to be not empty.
49 */
50 get nonEmpty(): this;
51 /**
52 Test a Set to be deeply equal to the provided Set.
53
54 @param expected - Expected Set to match.
55 */
56 deepEqual(expected: Set<T>): this;
57}