@schema-render/core-react
Version:
Through a set of simple JSON Schema, efficiently build a set of forms.
24 lines (23 loc) • 1.64 kB
TypeScript
import type { IDeepReadonly, IObjectAny, IPath } from '../typings/common';
import type { ICore, IOpenFunctionValidatorResult, IOpenValidateResult, IOpenValidatorParams, IRenderer } from '../typings/core';
import type { IRootContext } from '../typings/rootContext';
import type { ISchema } from '../typings/schema';
export type IValidateRootSchemaParams = Required<Pick<IRootContext, 'rootSchema' | 'rootValue' | 'disabled' | 'readonly' | 'locale' | 'renderers' | 'rendererStorage' | 'validators' | 'userCtx'>>;
export declare function validateRootSchema({ rootSchema, rootValue, disabled, readonly, locale, renderers, rendererStorage, validators, userCtx, }: IValidateRootSchemaParams): Promise<IOpenValidateResult>;
export interface IValidateFormItemParams extends IComposeSchemaRules {
value: any;
globalValidators: ICore['validators'];
rendererValidator: IRenderer['validator'];
rendererValidatorParams: IOpenValidatorParams;
}
export declare function validateFormItem({ schema, rootValue, userCtx, path, locale, value, globalValidators, rendererValidator, rendererValidatorParams, }: IValidateFormItemParams): Promise<IOpenFunctionValidatorResult>;
export interface IComposeSchemaRules {
schema: ISchema | IDeepReadonly<ISchema>;
rootValue: IObjectAny;
path: IPath;
locale: IRootContext['locale'];
userCtx: IObjectAny | undefined;
}
type IMakeOpenValidatorParams = Omit<IOpenValidatorParams, 'required' | 'sPath'>;
export declare function makeOpenValidatorParams({ schema, value, path, disabled, readonly, rootValue, locale, userCtx, }: IMakeOpenValidatorParams): IOpenValidatorParams;
export {};