@tanstack/form-core 0.29.2 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { DeepKeys } from './util-types'
2
+
1
3
  export type ValidationError = undefined | false | null | string
2
4
 
3
5
  /**
@@ -35,6 +37,26 @@ export type ValidationErrorMap = {
35
37
  [K in ValidationErrorMapKeys]?: ValidationError
36
38
  }
37
39
 
40
+ /**
41
+ * @private
42
+ *
43
+ * @example
44
+ * ```tsx
45
+ * {
46
+ * form: 'This form contains an error',
47
+ * fields: {
48
+ * age: "Must be 13 or older to register"
49
+ * }
50
+ * }
51
+ * ````
52
+ */
53
+ export type FormValidationError<TFormData> =
54
+ | ValidationError
55
+ | {
56
+ form?: ValidationError
57
+ fields: Partial<Record<DeepKeys<TFormData>, ValidationError>>
58
+ }
59
+
38
60
  /**
39
61
  * @private
40
62
  */