react-ocean-forms
Version:
Forms components for react based on the context api.
21 lines (20 loc) • 1.55 kB
TypeScript
/**
* Copyright (c) 2018-present, Umweltbundesamt GmbH
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { IFormContext } from '../components/FormContext';
import { TBasicFieldValue } from '../components/withField';
import { TFieldError } from './validators.types';
export declare const validators: {
withParam: (validator: (value: TBasicFieldValue, context: IFormContext<import("../components/FormContext").IFieldValues>, ...args: unknown[]) => TFieldError, ...args: unknown[]) => (value: TBasicFieldValue, context: IFormContext<import("../components/FormContext").IFieldValues>, ...args: unknown[]) => TFieldError;
withAsyncParam: (validator: (value: TBasicFieldValue, context: IFormContext<import("../components/FormContext").IFieldValues>, ...args: unknown[]) => Promise<TFieldError>, ...args: unknown[]) => (value: TBasicFieldValue, context: IFormContext<import("../components/FormContext").IFieldValues>, ...args: unknown[]) => Promise<TFieldError>;
required: {
(value: TBasicFieldValue): TFieldError;
isDefaultValidator: boolean;
};
alphaNumeric: (value: TBasicFieldValue) => TFieldError;
minLength: (value: TBasicFieldValue, context: IFormContext<import("../components/FormContext").IFieldValues>, [length]: [number]) => TFieldError;
maxLength: (value: TBasicFieldValue, context: IFormContext<import("../components/FormContext").IFieldValues>, [length]: [number]) => TFieldError;
};