| Server IP : 14.225.204.176 / Your IP : 216.73.216.6 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/zinisoft.net-react/node_modules/yup/es/util/ |
Upload File : |
import ValidationError from '../ValidationError';
import { ValidateOptions, Message, InternalOptions, Callback, ExtraParams } from '../types';
import Reference from '../Reference';
import type { AnySchema } from '../schema';
export declare type CreateErrorOptions = {
path?: string;
message?: Message<any>;
params?: ExtraParams;
type?: string;
};
export declare type TestContext<TContext = {}> = {
path: string;
options: ValidateOptions<TContext>;
parent: any;
schema: any;
resolve: <T>(value: T | Reference<T>) => T;
createError: (params?: CreateErrorOptions) => ValidationError;
};
export declare type TestFunction<T = unknown, TContext = {}> = (this: TestContext<TContext>, value: T, context: TestContext<TContext>) => boolean | ValidationError | Promise<boolean | ValidationError>;
export declare type TestOptions<TSchema extends AnySchema = AnySchema> = {
value: any;
path?: string;
label?: string;
options: InternalOptions;
originalValue: any;
schema: TSchema;
sync?: boolean;
};
export declare type TestConfig<TValue = unknown, TContext = {}> = {
name?: string;
message?: Message<any>;
test: TestFunction<TValue, TContext>;
params?: ExtraParams;
exclusive?: boolean;
};
export declare type Test = ((opts: TestOptions, cb: Callback) => void) & {
OPTIONS: TestConfig;
};
export default function createValidation(config: {
name?: string;
test: TestFunction;
params?: ExtraParams;
message?: Message<any>;
}): {
<TSchema extends AnySchema<any, any, any> = AnySchema<any, any, any>>({ value, path, label, options, originalValue, sync, ...rest }: TestOptions<TSchema>, cb: Callback): void;
OPTIONS: {
name?: string | undefined;
test: TestFunction;
params?: ExtraParams | undefined;
message?: Message<any> | undefined;
};
};