earljs
Version:
Ergonomic, modern and type-safe assertion library
12 lines (11 loc) • 701 B
TypeScript
import { Expectation } from '../Expectation';
import { SmartEqResult } from '../isEqual/rules';
export declare type DynamicValidator<T> = (this: Expectation<T>, ...args: any[]) => void | Promise<void>;
export declare type DynamicMatcher = (...args: any[]) => any;
export declare type SmartEqRule<TActual, TExpected> = (actual: TActual, expected: TExpected, strict: boolean) => SmartEqResult | undefined;
export declare type PluginSmartEqRules<T> = ReadonlyArray<SmartEqRule<T, T>> | Record<string, SmartEqRule<T, T>>;
export interface PluginConfig {
matchers?: Record<string, DynamicMatcher>;
validators?: Record<string, DynamicValidator<any>>;
smartEqRules?: PluginSmartEqRules<never>;
}