validx
Version:
Validation library for MobX
16 lines (15 loc) • 386 B
TypeScript
import { IValidator, IRule } from '../validation';
/**
* Rule options.
*/
export interface IRequiredRule extends IRule {
required?: boolean;
}
/**
* Validates that the field has a truthy value.
* The only exception is the number 0.
*
* @param rule
* @returns {(opts:any)=>boolean|string}
*/
export declare const required: (rule?: IRequiredRule | string) => IValidator<any>;