| 8 | * They also handle validating the form value and returning error messages in a consistent format. |
| 9 | */ |
| 10 | export interface SchemaProvider<T = any> { |
| 11 | /** |
| 12 | * Parse the schema into a format that AutoForm can use. |
| 13 | */ |
| 14 | parseSchema(): ParsedSchema; |
| 15 | |
| 16 | /** |
| 17 | * Validate the form values against the schema. |
| 18 | * This returns either the transformed result (e.g. with date coersion) or an array of errors. |
| 19 | * |
| 20 | * @param values - Form values to validate |
| 21 | */ |
| 22 | validateSchema(_values: T): SchemaValidation; |
| 23 | |
| 24 | /** |
| 25 | * Get the default values for the fields. |
| 26 | * This is used to populate the form with initial values. |
| 27 | * |
| 28 | * @returns Default values for the form |
| 29 | */ |
| 30 | getDefaultValues(): Record<string, any>; |
| 31 | } |
no outgoing calls
no test coverage detected