UNPKG

ff-validator

Version:
23 lines (22 loc) 629 B
import { getIn } from 'plain-object-helpers/dist/get-in'; export interface IValidResult { valid: boolean; errorMessage?: string; } export interface IValidFn<GValue = any, GAllValues = GValue, GMeta = GValue> { ( value: GValue, allValues: { [p: string]: GAllValues; }, meta?: GMeta[] ): IValidResult; ruleName?: string; details?: { [p: string]: any; }; } export declare const isValid: (valid: boolean, errorMessage: string) => IValidResult; export declare const isString: (value: any) => value is string; export declare const isNumber: (value: any) => value is number; export declare const _get: typeof getIn;