Skip to content

Commit 52fbdda

Browse files
ci: apply automated fixes and generate docs
1 parent 3f3b509 commit 52fbdda

10 files changed

+2576
-939
lines changed

packages/form-core/src/FieldApi.d.ts

+1,151-327
Large diffs are not rendered by default.

packages/form-core/src/FormApi.d.ts

+987-412
Large diffs are not rendered by default.
+6-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
import type { FormOptions } from './FormApi';
2-
export declare function formOptions<T extends Partial<FormOptions<any, any, any, any, any, any, any, any, any, any>>>(defaultOpts: T): T;
1+
import type { FormOptions } from './FormApi'
2+
export declare function formOptions<
3+
T extends Partial<
4+
FormOptions<any, any, any, any, any, any, any, any, any, any>
5+
>,
6+
>(defaultOpts: T): T

packages/form-core/src/index.d.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export * from './FormApi';
2-
export * from './FieldApi';
3-
export * from './utils';
4-
export * from './util-types';
5-
export * from './types';
6-
export * from './mergeForm';
7-
export * from './formOptions';
8-
export * from './standardSchemaValidator';
1+
export * from './FormApi'
2+
export * from './FieldApi'
3+
export * from './utils'
4+
export * from './util-types'
5+
export * from './types'
6+
export * from './mergeForm'
7+
export * from './formOptions'
8+
export * from './standardSchemaValidator'

packages/form-core/src/mergeForm.d.ts

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
1-
import type { FormApi } from './FormApi';
1+
import type { FormApi } from './FormApi'
22
/**
33
* @private
44
*/
5-
export declare function mutateMergeDeep(target: object | null | undefined, source: object | null | undefined): object;
6-
export declare function mergeForm<TFormData>(baseForm: FormApi<NoInfer<TFormData>, any, any, any, any, any, any, any, any, any>, state: Partial<FormApi<TFormData, any, any, any, any, any, any, any, any, any>['state']>): FormApi<NoInfer<TFormData>, any, any, any, any, any, any, any, any, any>;
5+
export declare function mutateMergeDeep(
6+
target: object | null | undefined,
7+
source: object | null | undefined,
8+
): object
9+
export declare function mergeForm<TFormData>(
10+
baseForm: FormApi<
11+
NoInfer<TFormData>,
12+
any,
13+
any,
14+
any,
15+
any,
16+
any,
17+
any,
18+
any,
19+
any,
20+
any
21+
>,
22+
state: Partial<
23+
FormApi<TFormData, any, any, any, any, any, any, any, any, any>['state']
24+
>,
25+
): FormApi<NoInfer<TFormData>, any, any, any, any, any, any, any, any, any>
+42-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,42 @@
1-
import type { FormApi, FormAsyncValidateOrFn, FormValidateOrFn } from './FormApi';
2-
import type { AnyFieldMeta } from './FieldApi';
3-
import type { DeepKeys } from './util-types';
4-
type ArrayFieldMode = 'insert' | 'remove' | 'swap' | 'move';
5-
export declare const defaultFieldMeta: AnyFieldMeta;
6-
export declare function metaHelper<TFormData, TOnMount extends undefined | FormValidateOrFn<TFormData>, TOnChange extends undefined | FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>, TSubmitMeta>(formApi: FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta>): {
7-
handleArrayFieldMetaShift: (field: DeepKeys<TFormData>, index: number, mode: ArrayFieldMode, secondIndex?: number) => void;
8-
};
9-
export {};
1+
import type {
2+
FormApi,
3+
FormAsyncValidateOrFn,
4+
FormValidateOrFn,
5+
} from './FormApi'
6+
import type { AnyFieldMeta } from './FieldApi'
7+
import type { DeepKeys } from './util-types'
8+
type ArrayFieldMode = 'insert' | 'remove' | 'swap' | 'move'
9+
export declare const defaultFieldMeta: AnyFieldMeta
10+
export declare function metaHelper<
11+
TFormData,
12+
TOnMount extends undefined | FormValidateOrFn<TFormData>,
13+
TOnChange extends undefined | FormValidateOrFn<TFormData>,
14+
TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
15+
TOnBlur extends undefined | FormValidateOrFn<TFormData>,
16+
TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
17+
TOnSubmit extends undefined | FormValidateOrFn<TFormData>,
18+
TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
19+
TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>,
20+
TSubmitMeta,
21+
>(
22+
formApi: FormApi<
23+
TFormData,
24+
TOnMount,
25+
TOnChange,
26+
TOnChangeAsync,
27+
TOnBlur,
28+
TOnBlurAsync,
29+
TOnSubmit,
30+
TOnSubmitAsync,
31+
TOnServer,
32+
TSubmitMeta
33+
>,
34+
): {
35+
handleArrayFieldMetaShift: (
36+
field: DeepKeys<TFormData>,
37+
index: number,
38+
mode: ArrayFieldMode,
39+
secondIndex?: number,
40+
) => void
41+
}
42+
export {}
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,135 @@
1-
import type { ValidationSource } from './types';
2-
export type TStandardSchemaValidatorValue<TData, TSource extends ValidationSource = ValidationSource> = {
3-
value: TData;
4-
validationSource: TSource;
5-
};
6-
export type TStandardSchemaValidatorIssue<TSource extends ValidationSource = ValidationSource> = TSource extends 'form' ? {
7-
form: Record<string, StandardSchemaV1Issue[]>;
8-
fields: Record<string, StandardSchemaV1Issue[]>;
9-
} : TSource extends 'field' ? StandardSchemaV1Issue[] : never;
1+
import type { ValidationSource } from './types'
2+
export type TStandardSchemaValidatorValue<
3+
TData,
4+
TSource extends ValidationSource = ValidationSource,
5+
> = {
6+
value: TData
7+
validationSource: TSource
8+
}
9+
export type TStandardSchemaValidatorIssue<
10+
TSource extends ValidationSource = ValidationSource,
11+
> = TSource extends 'form'
12+
? {
13+
form: Record<string, StandardSchemaV1Issue[]>
14+
fields: Record<string, StandardSchemaV1Issue[]>
15+
}
16+
: TSource extends 'field'
17+
? StandardSchemaV1Issue[]
18+
: never
1019
export declare const standardSchemaValidators: {
11-
validate<TSource extends ValidationSource = ValidationSource>({ value, validationSource, }: TStandardSchemaValidatorValue<unknown, TSource>, schema: StandardSchemaV1): TStandardSchemaValidatorIssue<TSource> | undefined;
12-
validateAsync<TSource extends ValidationSource>({ value, validationSource, }: TStandardSchemaValidatorValue<unknown, TSource>, schema: StandardSchemaV1): Promise<TStandardSchemaValidatorIssue<TSource> | undefined>;
13-
};
14-
export declare const isStandardSchemaValidator: (validator: unknown) => validator is StandardSchemaV1;
20+
validate<TSource extends ValidationSource = ValidationSource>(
21+
{
22+
value,
23+
validationSource,
24+
}: TStandardSchemaValidatorValue<unknown, TSource>,
25+
schema: StandardSchemaV1,
26+
): TStandardSchemaValidatorIssue<TSource> | undefined
27+
validateAsync<TSource extends ValidationSource>(
28+
{
29+
value,
30+
validationSource,
31+
}: TStandardSchemaValidatorValue<unknown, TSource>,
32+
schema: StandardSchemaV1,
33+
): Promise<TStandardSchemaValidatorIssue<TSource> | undefined>
34+
}
35+
export declare const isStandardSchemaValidator: (
36+
validator: unknown,
37+
) => validator is StandardSchemaV1
1538
/**
1639
* The Standard Schema interface.
1740
*/
1841
export type StandardSchemaV1<Input = unknown, Output = Input> = {
19-
/**
20-
* The Standard Schema properties.
21-
*/
22-
readonly '~standard': StandardSchemaV1Props<Input, Output>;
23-
};
42+
/**
43+
* The Standard Schema properties.
44+
*/
45+
readonly '~standard': StandardSchemaV1Props<Input, Output>
46+
}
2447
/**
2548
* The Standard Schema properties interface.
2649
*/
2750
interface StandardSchemaV1Props<Input = unknown, Output = Input> {
28-
/**
29-
* The version number of the standard.
30-
*/
31-
readonly version: 1;
32-
/**
33-
* The vendor name of the schema library.
34-
*/
35-
readonly vendor: string;
36-
/**
37-
* Validates unknown input values.
38-
*/
39-
readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
40-
/**
41-
* Inferred types associated with the schema.
42-
*/
43-
readonly types?: StandardSchemaV1Types<Input, Output> | undefined;
51+
/**
52+
* The version number of the standard.
53+
*/
54+
readonly version: 1
55+
/**
56+
* The vendor name of the schema library.
57+
*/
58+
readonly vendor: string
59+
/**
60+
* Validates unknown input values.
61+
*/
62+
readonly validate: (
63+
value: unknown,
64+
) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>
65+
/**
66+
* Inferred types associated with the schema.
67+
*/
68+
readonly types?: StandardSchemaV1Types<Input, Output> | undefined
4469
}
4570
/**
4671
* The result interface of the validate function.
4772
*/
48-
type StandardSchemaV1Result<Output> = StandardSchemaV1SuccessResult<Output> | StandardSchemaV1FailureResult;
73+
type StandardSchemaV1Result<Output> =
74+
| StandardSchemaV1SuccessResult<Output>
75+
| StandardSchemaV1FailureResult
4976
/**
5077
* The result interface if validation succeeds.
5178
*/
5279
interface StandardSchemaV1SuccessResult<Output> {
53-
/**
54-
* The typed output value.
55-
*/
56-
readonly value: Output;
57-
/**
58-
* The non-existent issues.
59-
*/
60-
readonly issues?: undefined;
80+
/**
81+
* The typed output value.
82+
*/
83+
readonly value: Output
84+
/**
85+
* The non-existent issues.
86+
*/
87+
readonly issues?: undefined
6188
}
6289
/**
6390
* The result interface if validation fails.
6491
*/
6592
interface StandardSchemaV1FailureResult {
66-
/**
67-
* The issues of failed validation.
68-
*/
69-
readonly issues: ReadonlyArray<StandardSchemaV1Issue>;
93+
/**
94+
* The issues of failed validation.
95+
*/
96+
readonly issues: ReadonlyArray<StandardSchemaV1Issue>
7097
}
7198
/**
7299
* The issue interface of the failure output.
73100
*/
74101
export interface StandardSchemaV1Issue {
75-
/**
76-
* The error message of the issue.
77-
*/
78-
readonly message: string;
79-
/**
80-
* The path of the issue, if any.
81-
*/
82-
readonly path?: ReadonlyArray<PropertyKey | StandardSchemaV1PathSegment> | undefined;
102+
/**
103+
* The error message of the issue.
104+
*/
105+
readonly message: string
106+
/**
107+
* The path of the issue, if any.
108+
*/
109+
readonly path?:
110+
| ReadonlyArray<PropertyKey | StandardSchemaV1PathSegment>
111+
| undefined
83112
}
84113
/**
85114
* The path segment interface of the issue.
86115
*/
87116
interface StandardSchemaV1PathSegment {
88-
/**
89-
* The key representing a path segment.
90-
*/
91-
readonly key: PropertyKey;
117+
/**
118+
* The key representing a path segment.
119+
*/
120+
readonly key: PropertyKey
92121
}
93122
/**
94123
* The Standard Schema types interface.
95124
*/
96125
interface StandardSchemaV1Types<Input = unknown, Output = Input> {
97-
/**
98-
* The input type of the schema.
99-
*/
100-
readonly input: Input;
101-
/**
102-
* The output type of the schema.
103-
*/
104-
readonly output: Output;
126+
/**
127+
* The input type of the schema.
128+
*/
129+
readonly input: Input
130+
/**
131+
* The output type of the schema.
132+
*/
133+
readonly output: Output
105134
}
106-
export {};
135+
export {}

0 commit comments

Comments
 (0)