validx
Version:
Validation library for MobX
15 lines (14 loc) • 371 B
TypeScript
import { IValidator, IRule } from '../validation';
/**
* Rule options.
*/
export interface IFuncRule extends IRule {
fn: IValidator<any>;
}
/**
* Simple way to run a function and return an error message.
*
* @param rule
* @returns {(opts:any)=>boolean|string}
*/
export declare const func: (rule: IFuncRule | IValidator<any>, msg?: string) => IValidator<any>;