@tanstack/form-core 0.28.0 → 0.29.2

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.
@@ -3,7 +3,6 @@ import { UpdateMetaOptions, ValidationCause, ValidationError, ValidationErrorMap
3
3
  import { FieldInfo, FormApi } from './FormApi.cjs';
4
4
  import { Updater } from './utils.cjs';
5
5
  import { DeepKeys, DeepValue, NoInfer } from './util-types.cjs';
6
-
7
6
  /**
8
7
  * @private
9
8
  */
@@ -3,7 +3,6 @@ import { Updater } from './utils.cjs';
3
3
  import { DeepKeys, DeepValue } from './util-types.cjs';
4
4
  import { FieldApi, FieldMeta } from './FieldApi.cjs';
5
5
  import { UpdateMetaOptions, ValidationCause, ValidationError, ValidationErrorMap, ValidationErrorMapKeys, Validator } from './types.cjs';
6
-
7
6
  /**
8
7
  * @private
9
8
  */
@@ -1,4 +1,3 @@
1
1
  import { Validator } from './types.cjs';
2
2
  import { FormOptions } from './FormApi.cjs';
3
-
4
3
  export declare function formOptions<TFormData, TFormValidator extends Validator<TFormData, unknown> | undefined = undefined>(defaultOpts?: FormOptions<TFormData, TFormValidator>): FormOptions<TFormData, TFormValidator> | undefined;
@@ -1,7 +1,6 @@
1
1
  import { FormApi } from './FormApi.cjs';
2
2
  import { Validator } from './types.cjs';
3
3
  import { NoInfer } from './util-types.cjs';
4
-
5
4
  /**
6
5
  * @private
7
6
  */
@@ -11,6 +11,13 @@ export type Validator<Type, Fn = unknown> = () => {
11
11
  value: Type;
12
12
  }, fn: Fn): Promise<ValidationError>;
13
13
  };
14
+ /**
15
+ * Parameters in common for all validator adapters, making it easier to swap adapter
16
+ * @private
17
+ */
18
+ export type ValidatorAdapterParams<TError = unknown> = {
19
+ transformErrors?: (errors: TError[]) => ValidationError;
20
+ };
14
21
  /**
15
22
  * "server" is only intended for SSR/SSG validation and should not execute anything
16
23
  * @private
@@ -1,7 +1,6 @@
1
1
  import { ValidationCause } from './types.cjs';
2
2
  import { FormValidators } from './FormApi.cjs';
3
3
  import { FieldValidators } from './FieldApi.cjs';
4
-
5
4
  export type UpdaterFn<TInput, TOutput = TInput> = (input: TInput) => TOutput;
6
5
  export type Updater<TInput, TOutput = TInput> = TOutput | UpdaterFn<TInput, TOutput>;
7
6
  /**
@@ -3,7 +3,6 @@ import { UpdateMetaOptions, ValidationCause, ValidationError, ValidationErrorMap
3
3
  import { FieldInfo, FormApi } from './FormApi.js';
4
4
  import { Updater } from './utils.js';
5
5
  import { DeepKeys, DeepValue, NoInfer } from './util-types.js';
6
-
7
6
  /**
8
7
  * @private
9
8
  */
@@ -3,7 +3,6 @@ import { Updater } from './utils.js';
3
3
  import { DeepKeys, DeepValue } from './util-types.js';
4
4
  import { FieldApi, FieldMeta } from './FieldApi.js';
5
5
  import { UpdateMetaOptions, ValidationCause, ValidationError, ValidationErrorMap, ValidationErrorMapKeys, Validator } from './types.js';
6
-
7
6
  /**
8
7
  * @private
9
8
  */
@@ -1,4 +1,3 @@
1
1
  import { Validator } from './types.js';
2
2
  import { FormOptions } from './FormApi.js';
3
-
4
3
  export declare function formOptions<TFormData, TFormValidator extends Validator<TFormData, unknown> | undefined = undefined>(defaultOpts?: FormOptions<TFormData, TFormValidator>): FormOptions<TFormData, TFormValidator> | undefined;
@@ -1,7 +1,6 @@
1
1
  import { FormApi } from './FormApi.js';
2
2
  import { Validator } from './types.js';
3
3
  import { NoInfer } from './util-types.js';
4
-
5
4
  /**
6
5
  * @private
7
6
  */
@@ -11,6 +11,13 @@ export type Validator<Type, Fn = unknown> = () => {
11
11
  value: Type;
12
12
  }, fn: Fn): Promise<ValidationError>;
13
13
  };
14
+ /**
15
+ * Parameters in common for all validator adapters, making it easier to swap adapter
16
+ * @private
17
+ */
18
+ export type ValidatorAdapterParams<TError = unknown> = {
19
+ transformErrors?: (errors: TError[]) => ValidationError;
20
+ };
14
21
  /**
15
22
  * "server" is only intended for SSR/SSG validation and should not execute anything
16
23
  * @private
@@ -1,7 +1,6 @@
1
1
  import { ValidationCause } from './types.js';
2
2
  import { FormValidators } from './FormApi.js';
3
3
  import { FieldValidators } from './FieldApi.js';
4
-
5
4
  export type UpdaterFn<TInput, TOutput = TInput> = (input: TInput) => TOutput;
6
5
  export type Updater<TInput, TOutput = TInput> = TOutput | UpdaterFn<TInput, TOutput>;
7
6
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/form-core",
3
- "version": "0.28.0",
3
+ "version": "0.29.2",
4
4
  "description": "Powerful, type-safe, framework agnostic forms.",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
package/src/types.ts CHANGED
@@ -9,6 +9,14 @@ export type Validator<Type, Fn = unknown> = () => {
9
9
  validateAsync(options: { value: Type }, fn: Fn): Promise<ValidationError>
10
10
  }
11
11
 
12
+ /**
13
+ * Parameters in common for all validator adapters, making it easier to swap adapter
14
+ * @private
15
+ */
16
+ export type ValidatorAdapterParams<TError = unknown> = {
17
+ transformErrors?: (errors: TError[]) => ValidationError
18
+ }
19
+
12
20
  /**
13
21
  * "server" is only intended for SSR/SSG validation and should not execute anything
14
22
  * @private