Open History to see the last commit
1import type {
2 DeepKeys,
3 DeepKeysWhereValueIncludes,
4 DeepValue,
5 FieldValidators,
6 FormApiArrayMethods,
7 FormApiFieldMethods,
8 FormErrorTypes,
9 FormState,
10 ValidationIssue,
11} from '@tanstack/form-core'
12import type { Component, JSX } from 'solid-js'
13import type {
14 SolidFormFieldProps,
15 SolidFormSubscribeProps,
16} from '../Components.public'
17import type { ReadonlyAtom } from '@tanstack/solid-store'
18β
19export interface FieldGroupFieldComponent<
20 TFieldData,
21 TFieldComponents extends Record<string, Component<any>>,
22> {
23 <const TFieldName extends DeepKeys<TFieldData>>(
24 props: SolidFormFieldProps<
25 TFieldData,
26 TFieldName,
27 DeepValue<TFieldData, TFieldName>,
28 FieldValidators<
29 TFieldData,
30 TFieldName,
31 DeepValue<TFieldData, TFieldName>
32 >,
33 ValidationIssue,
34 unknown,
35 FormErrorTypes,
36 TFieldComponents
37 >,
38 ): JSX.Element
39}
40β
41export interface FieldGroupArrayFieldComponent<
42 TFieldData,
43 TFieldComponents extends Record<string, Component<any>>,
44> {
45 <const TFieldName extends DeepKeysWhereValueIncludes<TFieldData, Array<any>>>(
46 props: SolidFormFieldProps<
47 TFieldData,
48 TFieldName,
49 DeepValue<TFieldData, TFieldName>,
50 FieldValidators<
51 TFieldData,
52 TFieldName,
53 DeepValue<TFieldData, TFieldName>
54 >,
55 ValidationIssue,
56 unknown,
57 FormErrorTypes,
58 TFieldComponents
59 >,
60 ): JSX.Element
61}
62β
63export type FieldGroupSubscribeProps<TSelected> = SolidFormSubscribeProps<
64 unknown,
65 FormErrorTypes,
66 TSelected
67>
68β
69export type FieldGroupSubscribeComponent = <const TSelected>(
70 props: FieldGroupSubscribeProps<TSelected>,
71) => JSX.Element
72β
73export interface FieldGroupApi<
74 TFieldData,
75 TFieldComponents extends Record<string, Component<any>> = Record<
76 never,
77 never
78 >,
79>
80 extends FormApiFieldMethods<TFieldData>, FormApiArrayMethods<TFieldData> {
81 atom: ReadonlyAtom<TFieldData>
82 Field: FieldGroupFieldComponent<TFieldData, TFieldComponents>
83 ArrayField: FieldGroupArrayFieldComponent<TFieldData, TFieldComponents>
84 Subscribe: FieldGroupSubscribeComponent
85}
86β
87export type AnyFieldGroupApi = FieldGroupApi<
88 any,
89 Record<string, Component<any>>
90>
91export type FieldGroupFormState = FormState<unknown, FormErrorTypes>