1 | export type MatcherFn<T> = (actualValue: T) => boolean;
|
2 | export interface MatcherLike<T> {
|
3 | asymmetricMatch(other: unknown): boolean;
|
4 | toString(): string;
|
5 | getExpectedType?(): string;
|
6 | toAsymmetricMatcher?(): string;
|
7 | }
|
8 | export declare class Matcher<T> implements MatcherLike<T> {
|
9 | readonly asymmetricMatch: MatcherFn<T>;
|
10 | private readonly description;
|
11 | $$typeof: symbol;
|
12 | inverse?: boolean;
|
13 | constructor(asymmetricMatch: MatcherFn<T>, description: string);
|
14 | toString(): string;
|
15 | toAsymmetricMatcher(): string;
|
16 | getExpectedType(): string;
|
17 | }
|
18 | export declare class CaptorMatcher<T> {
|
19 | $$typeof: symbol;
|
20 | readonly asymmetricMatch: MatcherFn<T>;
|
21 | readonly value: T;
|
22 | readonly values: T[];
|
23 | constructor();
|
24 | getExpectedType(): string;
|
25 | toString(): string;
|
26 | toAsymmetricMatcher(): string;
|
27 | }
|
28 | export interface MatcherCreator<T, E = T> {
|
29 | (expectedValue?: E): Matcher<T>;
|
30 | }
|
31 | export type MatchersOrLiterals<Y extends any[]> = {
|
32 | [K in keyof Y]: MatcherLike<Y[K]> | Y[K];
|
33 | };
|
34 | export declare const any: MatcherCreator<any>;
|
35 | export declare const anyBoolean: MatcherCreator<boolean>;
|
36 | export declare const anyNumber: MatcherCreator<number>;
|
37 | export declare const anyString: MatcherCreator<string>;
|
38 | export declare const anyFunction: MatcherCreator<Function>;
|
39 | export declare const anySymbol: MatcherCreator<Symbol>;
|
40 | export declare const anyObject: MatcherCreator<any>;
|
41 | export declare const anyArray: MatcherCreator<any[]>;
|
42 | export declare const anyMap: MatcherCreator<Map<any, any>>;
|
43 | export declare const anySet: MatcherCreator<Set<any>>;
|
44 | export declare const isA: MatcherCreator<any>;
|
45 | export declare const arrayIncludes: MatcherCreator<any[], any>;
|
46 | export declare const setHas: MatcherCreator<Set<any>, any>;
|
47 | export declare const mapHas: MatcherCreator<Map<any, any>, any>;
|
48 | export declare const objectContainsKey: MatcherCreator<any, string>;
|
49 | export declare const objectContainsValue: MatcherCreator<any>;
|
50 | export declare const notNull: MatcherCreator<any>;
|
51 | export declare const notUndefined: MatcherCreator<any>;
|
52 | export declare const notEmpty: MatcherCreator<any>;
|
53 | export declare const captor: <T extends unknown = any>() => CaptorMatcher<T>;
|
54 | export declare const matches: <T extends unknown = any>(matcher: MatcherFn<T>) => Matcher<T>;
|