UNPKG

@darkobits/valida

Version:
15 lines (14 loc) 647 B
import { BasePredicate } from 'ow'; import type { Constructor, MethodDecorator, Prototype } from "../etc/types"; /** * Provided an error, formats its message and returns it. */ export declare function formatMessage(err: any): string | undefined; /** * Returns `true` if the provided value is an instance of Predicate. */ export declare function isPredicate(value: any): value is BasePredicate; /** * Decorates the indicated class method using the provided function. */ export declare function decorateMethod<C extends Constructor<any>, M extends keyof C | keyof Prototype<C>>(ctor: C, methodName: M, decorator: MethodDecorator<C, M>): void;