export declare type IValidateCtxUserData = Record; declare type IValidateContext = { property: string; data: object; u: TCTX; }; export interface IValidationProc { (value: any, next: (errorMessage?: string) => any, contexts: IValidateContext): void; } export default class Validator { private validator; private _thisArg; constructor(validate: IValidationProc); validate(data: any, next: (message?: string) => void, contexts?: TCTX): void; validateSync(data: any, contexts?: TCTX): string | void; _setThisArg(thisArg: object): void; /** * @description enforce validating if data field defined. */ ifDefined(): Validator; /** * @description enforce validating if data field not empty string. */ ifNotEmptyString(): Validator; /** * @description enforce validating if data field's type equals to `type` */ ifType(type: string): Validator; ifNotType(type: string): Validator; } export {};