UNPKG

assertthat

Version:
8 lines (7 loc) 788 B
import { AssertionFailed } from './errors'; import { Result } from 'defekt'; declare type Assertion<TValue, TParams extends any[]> = (actual: TValue, ...rest: TParams) => Result<undefined, AssertionFailed>; declare const wrapAssertionForIterable: <TValue, TParams extends any[]>(assertion: Assertion<TValue, TParams>) => Assertion<Set<TValue> | Map<any, TValue> | TValue[], TParams>; declare type AsyncAssertion<TValue, TParams extends any[]> = (actual: TValue, ...rest: TParams) => Promise<Result<undefined, AssertionFailed>>; declare const wrapAsyncAssertionForIterable: <TValue, TParams extends any[]>(assertion: AsyncAssertion<TValue, TParams>) => AsyncAssertion<Set<TValue> | Map<any, TValue> | TValue[], TParams>; export { wrapAssertionForIterable, wrapAsyncAssertionForIterable };