@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.
- package/dist/cjs/FieldApi.d.cts +0 -1
- package/dist/cjs/FormApi.d.cts +0 -1
- package/dist/cjs/formOptions.d.cts +0 -1
- package/dist/cjs/mergeForm.d.cts +0 -1
- package/dist/cjs/types.d.cts +7 -0
- package/dist/cjs/utils.d.cts +0 -1
- package/dist/esm/FieldApi.d.ts +0 -1
- package/dist/esm/FormApi.d.ts +0 -1
- package/dist/esm/formOptions.d.ts +0 -1
- package/dist/esm/mergeForm.d.ts +0 -1
- package/dist/esm/types.d.ts +7 -0
- package/dist/esm/utils.d.ts +0 -1
- package/package.json +1 -1
- package/src/types.ts +8 -0
package/dist/cjs/FieldApi.d.cts
CHANGED
package/dist/cjs/FormApi.d.cts
CHANGED
|
@@ -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;
|
package/dist/cjs/mergeForm.d.cts
CHANGED
package/dist/cjs/types.d.cts
CHANGED
|
@@ -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
|
package/dist/cjs/utils.d.cts
CHANGED
|
@@ -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
|
/**
|
package/dist/esm/FieldApi.d.ts
CHANGED
package/dist/esm/FormApi.d.ts
CHANGED
|
@@ -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;
|
package/dist/esm/mergeForm.d.ts
CHANGED
package/dist/esm/types.d.ts
CHANGED
|
@@ -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
|
package/dist/esm/utils.d.ts
CHANGED
|
@@ -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
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
|