1 | import { type Shape, type TypeOfShape } from '../utils/match-shape.js';
|
2 | import { Predicate, type PredicateOptions } from './predicate.js';
|
3 | import type { BasePredicate } from './base-predicate.js';
|
4 | export declare class ObjectPredicate<T extends object = object> extends Predicate<T> {
|
5 | |
6 |
|
7 |
|
8 | constructor(options?: PredicateOptions);
|
9 | /**
|
10 | Test if an Object is a plain object.
|
11 | */
|
12 | get plain(): this;
|
13 | /**
|
14 | Test an object to be empty.
|
15 | */
|
16 | get empty(): this;
|
17 | /**
|
18 | Test an object to be not empty.
|
19 | */
|
20 | get nonEmpty(): this;
|
21 | /**
|
22 | Test all the values in the object to match the provided predicate.
|
23 |
|
24 | @param predicate - The predicate that should be applied against every value in the object.
|
25 | */
|
26 | valuesOfType<T>(predicate: BasePredicate<T>): this;
|
27 | /**
|
28 | Test all the values in the object deeply to match the provided predicate.
|
29 |
|
30 | @param predicate - The predicate that should be applied against every value in the object.
|
31 | */
|
32 | deepValuesOfType<T>(predicate: Predicate<T>): this;
|
33 | /**
|
34 | Test an object to be deeply equal to the provided object.
|
35 |
|
36 | @param expected - Expected object to match.
|
37 | */
|
38 | deepEqual(expected: object): this;
|
39 | /**
|
40 | Test an object to be of a specific instance type.
|
41 |
|
42 | @param instance - The expected instance type of the object.
|
43 | */
|
44 | instanceOf(instance: Function): this;
|
45 | /**
|
46 | Test an object to include all the provided keys. You can use [dot-notation](https:
|
47 |
|
48 | @param keys - The keys that should be present in the object.
|
49 | */
|
50 | hasKeys(...keys: readonly string[]): this;
|
51 | |
52 |
|
53 |
|
54 |
|
55 |
|
56 | hasAnyKeys(...keys: readonly string[]): this;
|
57 | |
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | partialShape<S extends Shape = Shape>(shape: S): ObjectPredicate<TypeOfShape<S>>;
|
79 | |
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 | exactShape<S extends Shape = Shape>(shape: S): ObjectPredicate<TypeOfShape<S>>;
|
96 | }
|
97 | export type { Shape } from '../utils/match-shape.js';
|
98 |
|
\ | No newline at end of file |