UNPKG

@skiyee/uni-ui

Version:

一个由原子化CSS驱动、符合直觉设计、高度定制化、面向AI时代的移动端 UI 库,助力开发者打造独特且差异化的移动端应用程序

25 lines (24 loc) 1.14 kB
/** * @skiyee/uni-ui v1.0.0 * @author skiyee(https://github.com/skiyee) * @license Apache License 2.0 * @copyright 2025-present skiyee All rights reserved. **/ import { Schema, SchemaInferInput, SchemaInferOutput, SchemaIssue } from "./schema.type.cjs"; import { FormFieldValidationResult, FormValidationResult, FormValidatorConfig } from "./form.type.cjs"; //#region src/validator/form.d.ts declare class FormValidator<TSchema extends Schema> { private readonly schema; private readonly messageTransformer?; private readonly pathTransformer?; constructor(config: FormValidatorConfig<TSchema>); getDotPath(issue: SchemaIssue): string | undefined; private getErrors; validateForm(data: SchemaInferInput<TSchema>): Promise<FormValidationResult<SchemaInferOutput<TSchema>>>; validateField<T>(path: string, value: T, formData?: Partial<SchemaInferInput<TSchema>>): Promise<FormFieldValidationResult<T>>; private transformIssues; private getFieldPath; } declare function createFormValidator<TSchema extends Schema>(config: FormValidatorConfig<TSchema>): FormValidator<TSchema>; //#endregion export { createFormValidator };