@pact-foundation/pact-core
Version:
Core of @pact-foundation/pact. You almost certainly don't want to depend on this directly.
8 lines (7 loc) • 499 B
TypeScript
export declare const wrapWithCheck: <F extends (...args: never[]) => boolean | number>(f: CheckableFunction<F>, contextMessage: string) => (...args: Parameters<F>) => ReturnType<F>;
type CheckableFunction<T> = T extends (...args: infer A) => boolean | number ? (...args: A) => ReturnType<T> : never;
type CheckableFunctions<T> = {
[key in keyof T]: CheckableFunction<T[key]>;
};
export declare const wrapAllWithCheck: <T extends CheckableFunctions<T>>(o: T) => CheckableFunctions<T>;
export {};