@formisch/qwik 0.1.0 → 0.1.1

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.
Files changed (66) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +392 -0
  3. package/dist/index.qwik.js +697 -0
  4. package/package.json +9 -17
  5. package/lib/components/Field/Field.qwik.cjs +0 -14
  6. package/lib/components/Field/Field.qwik.mjs +0 -14
  7. package/lib/components/FieldArray/FieldArray.qwik.cjs +0 -14
  8. package/lib/components/FieldArray/FieldArray.qwik.mjs +0 -14
  9. package/lib/components/Form/Form.qwik.cjs +0 -36
  10. package/lib/components/Form/Form.qwik.mjs +0 -36
  11. package/lib/hooks/useField/useField.qwik.cjs +0 -48
  12. package/lib/hooks/useField/useField.qwik.mjs +0 -48
  13. package/lib/hooks/useFieldArray/useFieldArray.qwik.cjs +0 -18
  14. package/lib/hooks/useFieldArray/useFieldArray.qwik.mjs +0 -18
  15. package/lib/hooks/useForm_/useForm_.qwik.cjs +0 -52
  16. package/lib/hooks/useForm_/useForm_.qwik.mjs +0 -35
  17. package/lib/hooks/usePathSignal/usePathSignal.qwik.cjs +0 -18
  18. package/lib/hooks/usePathSignal/usePathSignal.qwik.mjs +0 -18
  19. package/lib/hooks/useResolvedQrl/useResolvedQrl.qwik.cjs +0 -14
  20. package/lib/hooks/useResolvedQrl/useResolvedQrl.qwik.mjs +0 -14
  21. package/lib/index.qwik.cjs +0 -30
  22. package/lib/index.qwik.mjs +0 -30
  23. package/lib/packages/core/dist/index.qwik.qwik.cjs +0 -401
  24. package/lib/packages/core/dist/index.qwik.qwik.mjs +0 -379
  25. package/lib/packages/methods/dist/index.qwik.qwik.cjs +0 -178
  26. package/lib/packages/methods/dist/index.qwik.qwik.mjs +0 -178
  27. package/lib-types/components/Field/Field.d.ts +0 -16
  28. package/lib-types/components/Field/index.d.ts +0 -1
  29. package/lib-types/components/FieldArray/FieldArray.d.ts +0 -16
  30. package/lib-types/components/FieldArray/index.d.ts +0 -1
  31. package/lib-types/components/Form/Form.d.ts +0 -8
  32. package/lib-types/components/Form/index.d.ts +0 -1
  33. package/lib-types/components/Lifecycle/Lifecycle.d.ts +0 -6
  34. package/lib-types/components/Lifecycle/index.d.ts +0 -1
  35. package/lib-types/components/counter/counter.d.ts +0 -1
  36. package/lib-types/components/index.d.ts +0 -3
  37. package/lib-types/components/logo/logo.d.ts +0 -1
  38. package/lib-types/entry.dev.d.ts +0 -2
  39. package/lib-types/entry.ssr.d.ts +0 -14
  40. package/lib-types/hooks/index.d.ts +0 -3
  41. package/lib-types/hooks/useField/index.d.ts +0 -1
  42. package/lib-types/hooks/useField/useField.d.ts +0 -7
  43. package/lib-types/hooks/useField/useField_2.d.ts +0 -7
  44. package/lib-types/hooks/useFieldArray/index.d.ts +0 -1
  45. package/lib-types/hooks/useFieldArray/useFieldArray.d.ts +0 -7
  46. package/lib-types/hooks/useForm/index.d.ts +0 -1
  47. package/lib-types/hooks/useForm/useForm copy.d.ts +0 -9
  48. package/lib-types/hooks/useForm/useForm.d.ts +0 -5
  49. package/lib-types/hooks/useForm$/index.d.ts +0 -1
  50. package/lib-types/hooks/useForm$/useForm$.d.ts +0 -5
  51. package/lib-types/hooks/useFormStore/index.d.ts +0 -1
  52. package/lib-types/hooks/useFormStore/useFormStore.d.ts +0 -5
  53. package/lib-types/hooks/useLiveSignal copy/index.d.ts +0 -1
  54. package/lib-types/hooks/useLiveSignal copy/useLiveSignal.d.ts +0 -2
  55. package/lib-types/hooks/usePathSignal/index.d.ts +0 -1
  56. package/lib-types/hooks/usePathSignal/usePathSignal.d.ts +0 -3
  57. package/lib-types/hooks/useResolvedQrl/index.d.ts +0 -1
  58. package/lib-types/hooks/useResolvedQrl/useResolvedQrl.d.ts +0 -2
  59. package/lib-types/index.d.ts +0 -4
  60. package/lib-types/root.d.ts +0 -2
  61. package/lib-types/types/field.d.ts +0 -38
  62. package/lib-types/types/form.d.ts +0 -11
  63. package/lib-types/types/index.d.ts +0 -2
  64. package/lib-types/utils/createInternalSignal/createInternalSignal.d.ts +0 -3
  65. package/lib-types/utils/createInternalSignal/index.d.ts +0 -1
  66. package/lib-types/utils/index.d.ts +0 -0
package/README.md CHANGED
@@ -58,7 +58,7 @@ export default component$(() => {
58
58
  });
59
59
  ```
60
60
 
61
- In addition, Formisch offers several functions (we call them "methods") that can be used to manipulate the form state. These include `reset`, `setInput`, and `setErrors`. These methods allow you to control the form programmatically.
61
+ In addition, Formisch offers several functions (we call them "methods") that can be used to read and manipulate the form state. These include `focus`, `getErrors`, `getAllErrors`, `getInput`, `insert`, `move`, `remove`, `replace`, `reset`, `setErrors`, `setInput`, `submit`, `swap` and `validate`. These methods allow you to control the form programmatically.
62
62
 
63
63
  ## Feedback
64
64
 
@@ -0,0 +1,392 @@
1
+ import * as v from "valibot";
2
+ import { JSXOutput, NoSerialize, PropsOf, QRL, ReadonlySignal } from "@qwik.dev/core";
3
+ import * as _qwik_dev_core_internal3 from "@qwik.dev/core/internal";
4
+
5
+ //#region ../../packages/core/dist/index.qwik.d.ts
6
+ //#region src/types/schema.d.ts
7
+ type Schema = v.GenericSchema | v.GenericSchemaAsync;
8
+ //#endregion
9
+ //#region src/types/signal.d.ts
10
+ interface Signal<T> {
11
+ value: T;
12
+ }
13
+ //#endregion
14
+ //#region src/types/field.d.ts
15
+ /**
16
+ * Value type of the field element.
17
+ */
18
+ type FieldElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
19
+ //#endregion
20
+ //#region src/types/field.qwik.d.ts
21
+ interface InternalBaseStore {
22
+ kind: "array" | "object" | "value";
23
+ name: string;
24
+ schema: NoSerialize<Schema>;
25
+ elements: FieldElement[];
26
+ errors: Signal<[string, ...string[]] | null>;
27
+ }
28
+ interface InternalArrayStore extends InternalBaseStore {
29
+ kind: "array";
30
+ children: InternalFieldStore[];
31
+ initialItems: Signal<string[]>;
32
+ startItems: Signal<string[]>;
33
+ items: Signal<string[]>;
34
+ isTouched: Signal<boolean>;
35
+ isDirty: Signal<boolean>;
36
+ }
37
+ interface InternalObjectStore extends InternalBaseStore {
38
+ kind: "object";
39
+ children: Record<string, InternalFieldStore>;
40
+ }
41
+ interface InternalValueStore extends InternalBaseStore {
42
+ kind: "value";
43
+ initialInput: Signal<unknown>;
44
+ startInput: Signal<unknown>;
45
+ input: Signal<unknown>;
46
+ isTouched: Signal<boolean>;
47
+ isDirty: Signal<boolean>;
48
+ }
49
+ type InternalFieldStore = InternalArrayStore | InternalObjectStore | InternalValueStore;
50
+ //#endregion
51
+ //#region src/values.d.ts
52
+ declare const INTERNAL: "~internal";
53
+ //#endregion
54
+ //#region src/types/utils.d.ts
55
+ /**
56
+ * Checks if a type is `any`.
57
+ */
58
+ type IsAny<Type> = 0 extends 1 & Type ? true : false;
59
+ /**
60
+ * Checks if a type is `never`.
61
+ */
62
+ type IsNever<Type> = [Type] extends [never] ? true : false;
63
+ /**
64
+ * Constructs a type that is maybe a promise.
65
+ */
66
+ type MaybePromise<TValue> = TValue | Promise<TValue>;
67
+ /**
68
+ * Makes all properties deeply optional.
69
+ */
70
+ type DeepPartial<TValue> = TValue extends readonly unknown[] ? number extends TValue["length"] ? TValue : { [Key in keyof TValue]?: DeepPartial<TValue[Key]> | undefined } : TValue extends Record<PropertyKey, unknown> ? { [Key in keyof TValue]?: DeepPartial<TValue[Key]> | undefined } : TValue | undefined;
71
+ /**
72
+ * Makes all value properties optional.
73
+ */
74
+ type PartialValues<TValue> = TValue extends readonly unknown[] ? number extends TValue["length"] ? TValue : { [Key in keyof TValue]: PartialValues<TValue[Key]> } : TValue extends Record<PropertyKey, unknown> ? { [Key in keyof TValue]: PartialValues<TValue[Key]> } : TValue | undefined;
75
+ //#endregion
76
+ //#region src/types/form.d.ts
77
+ /**
78
+ * Value type of the validation mode.
79
+ */
80
+ type ValidationMode = "initial" | "touch" | "input" | "change" | "blur" | "submit";
81
+ type SubmitHandler<TSchema extends Schema> = (output: v.InferOutput<TSchema>, event: SubmitEvent) => MaybePromise<void>;
82
+ //#endregion
83
+ //#region src/types/form.qwik.d.ts
84
+ interface FormConfig<TSchema extends Schema = Schema> {
85
+ readonly schema: TSchema;
86
+ readonly initialInput?: DeepPartial<v.InferInput<TSchema>> | undefined;
87
+ readonly validateOn?: ValidationMode | undefined;
88
+ readonly revalidateOn?: Exclude<ValidationMode, "initial"> | undefined;
89
+ }
90
+ interface InternalFormStore<TSchema extends Schema = Schema> extends InternalObjectStore {
91
+ element?: HTMLFormElement;
92
+ validators: number;
93
+ validateOn: ValidationMode;
94
+ revalidateOn: Exclude<ValidationMode, "initial">;
95
+ validate: QRL<(input: unknown) => Promise<v.SafeParseResult<TSchema>>>;
96
+ isSubmitting: Signal<boolean>;
97
+ isSubmitted: Signal<boolean>;
98
+ isValidating: Signal<boolean>;
99
+ }
100
+ interface BaseFormStore<TSchema extends Schema = Schema> {
101
+ [INTERNAL]: InternalFormStore<TSchema>;
102
+ }
103
+ //#endregion
104
+ //#region src/types/path.d.ts
105
+ /**
106
+ * Path key type.
107
+ */
108
+ type PathKey = string | number;
109
+ /**
110
+ * Path type.
111
+ */
112
+ type Path = readonly PathKey[];
113
+ /**
114
+ * Required path type.
115
+ */
116
+ type RequiredPath = readonly [PathKey, ...Path];
117
+ /**
118
+ * Extracts the exact keys of a tuple, array or object.
119
+ */
120
+ type KeyOf<TValue> = IsAny<TValue> extends true ? never : TValue extends readonly unknown[] ? number extends TValue["length"] ? number : { [TKey in keyof TValue]: TKey extends `${infer TIndex extends number}` ? TIndex : never }[number] : TValue extends Record<string, unknown> ? keyof TValue & PathKey : never;
121
+ /**
122
+ * Merges array and object unions into a single object.
123
+ *
124
+ * Hint: This is necessary to make any property accessible. By default,
125
+ * properties that do not exist in all union options are not accessible
126
+ * and result in "any" when accessed.
127
+ */
128
+ type MergeUnion<T> = { [K in KeyOf<T>]: T extends Record<K, infer V> ? V : never };
129
+ /**
130
+ * Lazily evaluate only the first valid path segment based on the given value.
131
+ */
132
+ type LazyPath<TValue, TPathToCheck extends Path, TValidPath extends Path = readonly []> = TPathToCheck extends readonly [] ? TValidPath : TPathToCheck extends readonly [infer TFirstKey extends KeyOf<TValue>, ...infer TPathRest extends Path] ? LazyPath<MergeUnion<TValue>[TFirstKey], TPathRest, readonly [...TValidPath, TFirstKey]> : IsNever<KeyOf<TValue>> extends false ? readonly [...TValidPath, KeyOf<TValue>] : TValidPath;
133
+ /**
134
+ * Returns the path if valid, otherwise the first possible valid path based on
135
+ * the given value.
136
+ */
137
+ type ValidPath<TValue, TPath extends RequiredPath> = TPath extends LazyPath<TValue, TPath> ? TPath : LazyPath<TValue, TPath>;
138
+ /**
139
+ * Extracts the value type at the given path.
140
+ */
141
+ type PathValue<TValue, TPath extends Path> = TPath extends readonly [infer TKey, ...infer TRest extends Path] ? TKey extends KeyOf<TValue> ? PathValue<MergeUnion<TValue>[TKey], TRest> : unknown : TValue;
142
+ /**
143
+ * Checks if a value is an array or contains one.
144
+ */
145
+ type IsOrHasArray<TValue> = IsAny<TValue> extends true ? false : TValue extends readonly unknown[] ? true : TValue extends Record<string, unknown> ? true extends { [TKey in keyof TValue]: IsOrHasArray<TValue[TKey]> }[keyof TValue] ? true : false : false;
146
+ /**
147
+ * Extracts the exact keys of a tuple, array or object that contain arrays.
148
+ */
149
+ type KeyOfArrayPath<TValue> = IsAny<TValue> extends true ? never : TValue extends readonly (infer TItem)[] ? number extends TValue["length"] ? IsOrHasArray<TItem> extends true ? number : never : { [TKey in keyof TValue]: TKey extends `${infer TIndex extends number}` ? IsOrHasArray<TValue[TKey]> extends true ? TIndex : never : never }[number] : TValue extends Record<string, unknown> ? { [TKey in keyof TValue]: IsOrHasArray<TValue[TKey]> extends true ? TKey : never }[keyof TValue] & PathKey : never;
150
+ /**
151
+ * Lazily evaluate only the first valid array path segment based on the given value.
152
+ */
153
+ type LazyArrayPath<TValue, TPathToCheck extends Path, TValidPath extends Path = readonly []> = TPathToCheck extends readonly [] ? TValue extends readonly unknown[] ? TValidPath : readonly [...TValidPath, KeyOfArrayPath<TValue>] : TPathToCheck extends readonly [infer TFirstKey extends KeyOfArrayPath<TValue>, ...infer TPathRest extends Path] ? LazyArrayPath<MergeUnion<TValue>[TFirstKey], TPathRest, readonly [...TValidPath, TFirstKey]> : IsNever<KeyOfArrayPath<TValue>> extends false ? readonly [...TValidPath, KeyOfArrayPath<TValue>] : never;
154
+ /**
155
+ * Returns the path if valid, otherwise the first possible valid array path based on
156
+ * the given value.
157
+ */
158
+ type ValidArrayPath<TValue, TPath extends RequiredPath> = TPath extends LazyArrayPath<TValue, TPath> ? TPath : LazyArrayPath<TValue, TPath>;
159
+ //#endregion
160
+ //#region src/array/copyItemState/copyItemState.d.ts
161
+ /**
162
+ * Copies the deeply nested state (signal values) from one array item to another.
163
+ * This includes the `isTouched`, `isDirty`, `startInput`, `input`, `startItems`, and `items` properties.
164
+ * Recursively walks through the field stores and copies all signal values.
165
+ *
166
+ * @param internalArrayStore - The field store of the array (not the array item)
167
+ * @param fromIndex - The source index to copy from
168
+ * @param toIndex - The destination index to copy to
169
+ */
170
+ //#endregion
171
+ //#region ../../packages/methods/dist/index.qwik.d.ts
172
+ //#region src/focus/focus.d.ts
173
+ interface FocusFieldConfig<TSchema extends Schema, TFieldPath extends RequiredPath> {
174
+ readonly form: BaseFormStore<TSchema>;
175
+ readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
176
+ }
177
+ declare function focus<TSchema extends Schema, TFieldPath extends RequiredPath>(config: FocusFieldConfig<TSchema, TFieldPath>): void;
178
+ //#endregion
179
+ //#region src/getAllErrors/getAllErrors.d.ts
180
+ declare function getAllErrors(form: BaseFormStore): [string, ...string[]] | null;
181
+ //#endregion
182
+ //#region src/getErrors/getErrors.d.ts
183
+ interface GetFormErrorsConfig {
184
+ readonly path?: undefined;
185
+ }
186
+ interface GetFieldErrorsConfig<TSchema extends Schema, TFieldPath extends RequiredPath> {
187
+ readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
188
+ }
189
+ declare function getErrors<TSchema extends Schema>(form: BaseFormStore<TSchema>): [string, ...string[]] | null;
190
+ declare function getErrors<TSchema extends Schema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? GetFieldErrorsConfig<TSchema, TFieldPath> : GetFormErrorsConfig): [string, ...string[]] | null;
191
+ //#endregion
192
+ //#region src/getInput/getInput.d.ts
193
+ interface GetFormInputConfig {
194
+ readonly path?: undefined;
195
+ }
196
+ interface GetFieldInputConfig<TSchema extends Schema, TFieldPath extends RequiredPath> {
197
+ readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
198
+ }
199
+ declare function getInput<TSchema extends Schema>(form: BaseFormStore<TSchema>): PartialValues<v.InferInput<TSchema>>;
200
+ declare function getInput<TSchema extends Schema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? GetFieldInputConfig<TSchema, TFieldPath> : GetFormInputConfig): PartialValues<TFieldPath extends RequiredPath ? PathValue<v.InferInput<TSchema>, TFieldPath> : v.InferInput<TSchema>>;
201
+ //#endregion
202
+ //#region src/insert/insert.d.ts
203
+ interface InsertConfig<TSchema extends Schema, TFieldArrayPath extends RequiredPath> {
204
+ readonly path: ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>;
205
+ readonly at?: number | undefined;
206
+ readonly initialInput?: DeepPartial<PathValue<v.InferInput<TSchema>, [...TFieldArrayPath, number]>> | undefined;
207
+ }
208
+ declare function insert<TSchema extends Schema, TFieldArrayPath extends RequiredPath>(form: BaseFormStore<TSchema>, config: InsertConfig<TSchema, TFieldArrayPath>): void;
209
+ //#endregion
210
+ //#region src/move/move.d.ts
211
+ interface MoveConfig<TSchema extends Schema, TFieldArrayPath extends RequiredPath> {
212
+ readonly path: ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>;
213
+ readonly from: number;
214
+ readonly to: number;
215
+ }
216
+ declare function move<TSchema extends Schema, TFieldArrayPath extends RequiredPath>(form: BaseFormStore<TSchema>, config: MoveConfig<TSchema, TFieldArrayPath>): void;
217
+ //#endregion
218
+ //#region src/remove/remove.d.ts
219
+ interface RemoveConfig<TSchema extends Schema, TFieldArrayPath extends RequiredPath> {
220
+ readonly path: ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>;
221
+ readonly at: number;
222
+ }
223
+ declare function remove<TSchema extends Schema, TFieldArrayPath extends RequiredPath>(form: BaseFormStore<TSchema>, config: RemoveConfig<TSchema, TFieldArrayPath>): void;
224
+ //#endregion
225
+ //#region src/replace/replace.d.ts
226
+ interface ReplaceConfig<TSchema extends Schema, TFieldArrayPath extends RequiredPath> {
227
+ readonly path: ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>;
228
+ readonly at: number;
229
+ readonly initialInput?: DeepPartial<PathValue<v.InferInput<TSchema>, [...TFieldArrayPath, number]>> | undefined;
230
+ }
231
+ declare function replace<TSchema extends Schema, TFieldArrayPath extends RequiredPath>(form: BaseFormStore<TSchema>, config: ReplaceConfig<TSchema, TFieldArrayPath>): void;
232
+ //#endregion
233
+ //#region src/reset/reset.d.ts
234
+ interface ResetBaseConfig {
235
+ readonly keepInput?: boolean | undefined;
236
+ readonly keepTouched?: boolean | undefined;
237
+ readonly keepErrors?: boolean | undefined;
238
+ }
239
+ interface ResetFormConfig<TSchema extends Schema> extends ResetBaseConfig {
240
+ readonly path?: undefined;
241
+ readonly initialInput?: DeepPartial<v.InferInput<TSchema>> | undefined;
242
+ readonly keepSubmitCount?: boolean | undefined;
243
+ readonly keepSubmitted?: boolean | undefined;
244
+ }
245
+ interface ResetFieldConfig<TSchema extends Schema, TFieldPath extends RequiredPath> extends ResetBaseConfig {
246
+ readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
247
+ readonly initialInput?: DeepPartial<PathValue<v.InferInput<TSchema>, TFieldPath>>;
248
+ }
249
+ declare function reset(form: BaseFormStore): void;
250
+ declare function reset<TSchema extends Schema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? ResetFieldConfig<TSchema, TFieldPath> : ResetFormConfig<TSchema>): void;
251
+ //#endregion
252
+ //#region src/setErrors/setErrors.d.ts
253
+ interface SetFormErrorsConfig {
254
+ readonly path?: undefined;
255
+ readonly errors: [string, ...string[]] | null;
256
+ }
257
+ interface SetFieldErrorsConfig<TSchema extends Schema, TFieldPath extends RequiredPath> {
258
+ readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
259
+ readonly errors: [string, ...string[]] | null;
260
+ }
261
+ declare function setErrors<TSchema extends Schema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? SetFieldErrorsConfig<TSchema, TFieldPath> : SetFormErrorsConfig): void;
262
+ //#endregion
263
+ //#region src/setInput/setInput.d.ts
264
+ interface SetFormInputConfig<TSchema extends Schema> {
265
+ readonly path?: undefined;
266
+ readonly input: v.InferInput<TSchema>;
267
+ }
268
+ interface SetFieldInputConfig<TSchema extends Schema, TFieldPath extends RequiredPath> {
269
+ readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
270
+ readonly input: PathValue<v.InferInput<TSchema>, TFieldPath>;
271
+ }
272
+ declare function setInput<TSchema extends Schema>(form: BaseFormStore<TSchema>, config: SetFormInputConfig<TSchema>): void;
273
+ declare function setInput<TSchema extends Schema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? SetFieldInputConfig<TSchema, TFieldPath> : SetFormInputConfig<TSchema>): void;
274
+ //#endregion
275
+ //#region src/submit/submit.d.ts
276
+ declare function submit(form: BaseFormStore): void;
277
+ //#endregion
278
+ //#region src/swap/swap.d.ts
279
+ interface SwapConfig<TSchema extends Schema, TFieldArrayPath extends RequiredPath> {
280
+ readonly path: ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>;
281
+ readonly at: number;
282
+ readonly and: number;
283
+ }
284
+ declare function swap<TSchema extends Schema, TFieldArrayPath extends RequiredPath>(form: BaseFormStore<TSchema>, config: SwapConfig<TSchema, TFieldArrayPath>): void;
285
+ //#endregion
286
+ //#region src/validate/validate.d.ts
287
+ interface ValidateFormConfig {
288
+ readonly shouldFocus?: boolean | undefined;
289
+ }
290
+ declare function validate<TSchema extends Schema>(form: BaseFormStore<TSchema>, config?: ValidateFormConfig): Promise<v.SafeParseResult<TSchema>>;
291
+ //#endregion
292
+ //#endregion
293
+ //#region src/types/field.d.ts
294
+ /**
295
+ * Value type of the field element props.
296
+ */
297
+ interface FieldElementProps {
298
+ readonly name: string;
299
+ readonly autofocus: boolean;
300
+ readonly ref: QRL<(element: FieldElement) => void>;
301
+ readonly onFocus$: QRL<(event: FocusEvent, element: FieldElement) => void>;
302
+ readonly onInput$: QRL<(event: InputEvent, element: FieldElement) => void>;
303
+ readonly onChange$: QRL<(event: Event, element: FieldElement) => void>;
304
+ readonly onBlur$: QRL<(event: FocusEvent, element: FieldElement) => void>;
305
+ }
306
+ /**
307
+ * Value type of the field store.
308
+ */
309
+ interface FieldStore<TSchema extends Schema = Schema, TFieldPath extends RequiredPath = RequiredPath> {
310
+ readonly path: ReadonlySignal<ValidPath<v.InferInput<TSchema>, TFieldPath>>;
311
+ readonly input: ReadonlySignal<PartialValues<PathValue<v.InferInput<TSchema>, TFieldPath>>>;
312
+ readonly errors: ReadonlySignal<[string, ...string[]] | null>;
313
+ readonly isTouched: ReadonlySignal<boolean>;
314
+ readonly isDirty: ReadonlySignal<boolean>;
315
+ readonly isValid: ReadonlySignal<boolean>;
316
+ readonly props: FieldElementProps;
317
+ }
318
+ /**
319
+ * Value type of the field array store.
320
+ */
321
+ interface FieldArrayStore<TSchema extends Schema = Schema, TFieldArrayPath extends RequiredPath = RequiredPath> {
322
+ readonly path: ReadonlySignal<ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>>;
323
+ readonly items: ReadonlySignal<string[]>;
324
+ readonly errors: ReadonlySignal<[string, ...string[]] | null>;
325
+ readonly isTouched: ReadonlySignal<boolean>;
326
+ readonly isDirty: ReadonlySignal<boolean>;
327
+ readonly isValid: ReadonlySignal<boolean>;
328
+ }
329
+ //#endregion
330
+ //#region src/types/form.d.ts
331
+ interface FormStore<TSchema extends Schema = Schema> extends BaseFormStore<TSchema> {
332
+ readonly isSubmitting: ReadonlySignal<boolean>;
333
+ readonly isSubmitted: ReadonlySignal<boolean>;
334
+ readonly isValidating: ReadonlySignal<boolean>;
335
+ readonly isTouched: ReadonlySignal<boolean>;
336
+ readonly isDirty: ReadonlySignal<boolean>;
337
+ readonly isValid: ReadonlySignal<boolean>;
338
+ readonly errors: ReadonlySignal<[string, ...string[]] | null>;
339
+ }
340
+ //#endregion
341
+ //#region src/components/Field/Field.d.ts
342
+ /**
343
+ * Properties of the `Field` component.
344
+ */
345
+ interface FieldProps<TSchema extends Schema = Schema, TFieldPath extends RequiredPath = RequiredPath> {
346
+ readonly of: FormStore<TSchema>;
347
+ readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
348
+ readonly render$: QRL<(store: FieldStore<TSchema, TFieldPath>) => JSXOutput>;
349
+ }
350
+ /**
351
+ * Headless form field that provides reactive properties and state.
352
+ */
353
+ declare const Field: <TSchema extends Schema, TFieldPath extends RequiredPath>(props: _qwik_dev_core_internal3.PublicProps<FieldProps<TSchema, TFieldPath>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal3.DevJSX) => JSXOutput;
354
+ //#endregion
355
+ //#region src/components/FieldArray/FieldArray.d.ts
356
+ /**
357
+ * Properties of the `FieldArray` component.
358
+ */
359
+ interface FieldArrayProps<TSchema extends Schema = Schema, TFieldArrayPath extends RequiredPath = RequiredPath> {
360
+ readonly of: FormStore<TSchema>;
361
+ readonly path: ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>;
362
+ readonly render$: QRL<(store: FieldArrayStore<TSchema, TFieldArrayPath>) => JSXOutput>;
363
+ }
364
+ /**
365
+ * Headless field array that provides reactive properties and state.
366
+ */
367
+ declare const FieldArray: <TSchema extends Schema, TFieldArrayPath extends RequiredPath>(props: _qwik_dev_core_internal3.PublicProps<FieldArrayProps<TSchema, TFieldArrayPath>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal3.DevJSX) => JSXOutput;
368
+ //#endregion
369
+ //#region src/components/Form/Form.d.ts
370
+ type FormProps<TSchema extends Schema = Schema> = Omit<PropsOf<'form'>, 'onSubmit$'> & {
371
+ of: FormStore<TSchema>;
372
+ onSubmit$: QRL<SubmitHandler<TSchema>>;
373
+ };
374
+ declare const Form: <TSchema extends Schema>(props: _qwik_dev_core_internal3.PublicProps<FormProps<TSchema>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal3.DevJSX) => JSXOutput;
375
+ //#endregion
376
+ //#region src/hooks/useField/useField.d.ts
377
+ interface UseFieldConfig<TSchema extends Schema = Schema, TFieldPath extends RequiredPath = RequiredPath> {
378
+ readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
379
+ }
380
+ declare function useField<TSchema extends Schema, TFieldPath extends RequiredPath>(form: FormStore<TSchema>, config: UseFieldConfig<TSchema, TFieldPath>): FieldStore<TSchema, TFieldPath>;
381
+ //#endregion
382
+ //#region src/hooks/useFieldArray/useFieldArray.d.ts
383
+ interface UseFieldArrayConfig<TSchema extends Schema = Schema, TFieldArrayPath extends RequiredPath = RequiredPath> {
384
+ readonly path: ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>;
385
+ }
386
+ declare function useFieldArray<TSchema extends Schema, TFieldArrayPath extends RequiredPath>(form: FormStore<TSchema>, config: UseFieldArrayConfig<TSchema, TFieldArrayPath>): FieldArrayStore<TSchema, TFieldArrayPath>;
387
+ //#endregion
388
+ //#region src/hooks/useForm$/useForm$.d.ts
389
+ declare function useFormQrl<TSchema extends Schema>(configQrl: QRL<FormConfig<TSchema>>): FormStore<TSchema>;
390
+ declare const useForm$: <TSchema extends Schema>(qrl: FormConfig<TSchema>) => FormStore<TSchema>;
391
+ //#endregion
392
+ export { Field, FieldArray, FieldArrayProps, FieldArrayStore, FieldElementProps, FieldProps, FieldStore, FocusFieldConfig, Form, FormProps, FormStore, GetFieldErrorsConfig, GetFieldInputConfig, GetFormErrorsConfig, GetFormInputConfig, InsertConfig, MoveConfig, RemoveConfig, ReplaceConfig, ResetFieldConfig, ResetFormConfig, SetFieldErrorsConfig, SetFieldInputConfig, SetFormErrorsConfig, SetFormInputConfig, SwapConfig, UseFieldArrayConfig, UseFieldConfig, ValidateFormConfig, focus, getAllErrors, getErrors, getInput, insert, move, remove, replace, reset, setErrors, setInput, submit, swap, useField, useFieldArray, useForm$, useFormQrl, validate };