@owanturist/signal-form 0.4.0 → 0.5.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.
package/dist/index.d.cts CHANGED
@@ -1,413 +1,374 @@
1
- import * as _owanturist_signal from '@owanturist/signal';
2
- import { ReadonlySignal, Monitor, Signal, Equal } from '@owanturist/signal';
3
-
1
+ import { Equal, Monitor, ReadonlySignal, Signal } from "@owanturist/signal";
4
2
  type Result<TError, TData> = [TError, null] | [null, TData];
5
-
6
3
  type ValidateStrategy = "onTouch" | "onChange" | "onSubmit" | "onInit";
7
4
  declare const VALIDATE_ON_TOUCH: "onTouch";
8
5
  declare const VALIDATE_ON_CHANGE: "onChange";
9
6
  declare const VALIDATE_ON_SUBMIT: "onSubmit";
10
7
  declare const VALIDATE_ON_INIT: "onInit";
11
-
12
8
  interface SignalFormParams {
13
- readonly "input.setter": unknown;
14
- readonly "input.schema": unknown;
15
- readonly "output.schema": unknown;
16
- readonly "output.schema.verbose": unknown;
17
- readonly "flag.setter": unknown;
18
- readonly "flag.schema": unknown;
19
- readonly "flag.schema.verbose": unknown;
20
- readonly "validateOn.setter": unknown;
21
- readonly "validateOn.schema": unknown;
22
- readonly "validateOn.schema.verbose": unknown;
23
- readonly "error.setter": unknown;
24
- readonly "error.schema": unknown;
25
- readonly "error.schema.verbose": unknown;
26
- }
27
-
9
+ readonly "input.setter": unknown;
10
+ readonly "input.schema": unknown;
11
+ readonly "output.schema": unknown;
12
+ readonly "output.schema.verbose": unknown;
13
+ readonly "flag.setter": unknown;
14
+ readonly "flag.schema": unknown;
15
+ readonly "flag.schema.verbose": unknown;
16
+ readonly "validateOn.setter": unknown;
17
+ readonly "validateOn.schema": unknown;
18
+ readonly "validateOn.schema.verbose": unknown;
19
+ readonly "error.setter": unknown;
20
+ readonly "error.schema": unknown;
21
+ readonly "error.schema.verbose": unknown;
22
+ }
28
23
  declare class Emitter<TPayload = unknown, TResult = void> {
29
- private readonly _listeners;
30
- _subscribe(listener: (payload: TPayload) => TResult): VoidFunction;
31
- _emit(payload: TPayload): ReadonlyArray<TResult>;
32
- _isEmpty(): boolean;
24
+ private readonly _listeners;
25
+ _subscribe(listener: (payload: TPayload) => TResult): VoidFunction;
26
+ _emit(payload: TPayload): ReadonlyArray<TResult>;
27
+ _isEmpty(): boolean;
33
28
  }
34
-
35
29
  type Lazy<T> = () => T;
36
- declare function Lazy<T>(init: () => T): Lazy<T>;
37
-
38
- declare abstract class SignalFormState<TParams extends SignalFormParams = any> {
39
- abstract readonly _host: Lazy<SignalForm<TParams>>;
40
- readonly _root: SignalFormState;
41
- constructor(parent: null | SignalFormState);
42
- protected abstract _childOf(parent: null | SignalFormState): SignalFormState<TParams>;
43
- _clone(): SignalFormState<TParams>;
44
- _parentOf<TChild extends SignalFormState>(child: TChild): TChild;
45
- _hasSameRootWith(another: SignalFormState): boolean;
46
- abstract readonly _initial: ReadonlySignal<TParams["input.schema"]>;
47
- abstract _setInitial(monitor: Monitor, setter: TParams["input.setter"]): void;
48
- /**
49
- * Like {@link _setInitial} but a no-op for explicitly set initials.
50
- */
51
- abstract _patchInitial(monitor: Monitor, initial: TParams["input.schema"]): void;
52
- abstract readonly _input: ReadonlySignal<TParams["input.schema"]>;
53
- abstract _setInput(monitor: Monitor, setter: TParams["input.setter"]): void;
54
- abstract readonly _error: ReadonlySignal<null | TParams["error.schema"]>;
55
- abstract readonly _errorVerbose: ReadonlySignal<TParams["error.schema.verbose"]>;
56
- abstract _setError(monitor: Monitor, setter: TParams["error.setter"]): void;
57
- abstract readonly _validateOn: ReadonlySignal<TParams["validateOn.schema"]>;
58
- abstract readonly _validateOnVerbose: ReadonlySignal<TParams["validateOn.schema.verbose"]>;
59
- abstract _setValidateOn(monitor: Monitor, setter: TParams["validateOn.setter"]): void;
60
- abstract readonly _touched: ReadonlySignal<TParams["flag.schema"]>;
61
- abstract readonly _touchedVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
62
- abstract _setTouched(monitor: Monitor, setter: TParams["flag.setter"]): void;
63
- abstract readonly _output: ReadonlySignal<null | TParams["output.schema"]>;
64
- abstract readonly _outputVerbose: ReadonlySignal<TParams["output.schema.verbose"]>;
65
- abstract readonly _valid: ReadonlySignal<TParams["flag.schema"]>;
66
- abstract readonly _validVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
67
- abstract readonly _invalid: ReadonlySignal<TParams["flag.schema"]>;
68
- abstract readonly _invalidVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
69
- abstract readonly _validated: ReadonlySignal<TParams["flag.schema"]>;
70
- abstract readonly _validatedVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
71
- abstract _forceValidated(monitor: Monitor): void;
72
- abstract readonly _dirty: ReadonlySignal<TParams["flag.schema"]>;
73
- abstract readonly _dirtyVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
74
- abstract readonly _dirtyOnVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
75
- readonly _onFocus: Emitter<unknown, void>;
76
- _getFocusFirstInvalid(monitor: Monitor): null | VoidFunction;
77
- readonly _onSubmit: Emitter<unknown, void | Promise<unknown>>;
78
- readonly _submitAttempts: Signal<number>;
79
- readonly _submittingCount: Signal<number>;
80
- _submitWith(monitor: Monitor, output: TParams["output.schema"]): ReadonlyArray<void | Promise<unknown>>;
81
- /**
82
- * Comparing to {@link _setInitial} where the setter is always provided,
83
- * this method allows the resetter to be undefined.
84
- * This is for cases when the initial value is not changed BUT
85
- * the {@link SignalForm} should perform the rest of reset operations,
86
- * in comparison to {@link _setInitial} which only sets the initial value AND
87
- * not called at all if the setter is not provided.
88
- */
89
- abstract _reset(monitor: Monitor, resetter: undefined | TParams["input.setter"]): void;
90
- abstract _getChildren<TChildParams extends SignalFormParams>(monitor: Monitor): ReadonlyArray<SignalFormChild<TChildParams, TParams>>;
91
- }
92
- interface SignalFormChild<TChildParams extends SignalFormParams, TParams extends SignalFormParams> {
93
- _state: SignalFormState<TChildParams>;
94
- _mapToChild: (this: void, parentValue: TParams["output.schema"]) => TChildParams["output.schema"];
95
- }
96
-
30
+ declare abstract class SignalFormState<TParams extends SignalFormParams = any, THost extends SignalForm<TParams> = SignalForm<TParams>> {
31
+ abstract readonly _host: Lazy<THost>;
32
+ readonly _root: SignalFormState;
33
+ constructor(parent: null | SignalFormState);
34
+ protected abstract _childOf(parent: null | SignalFormState): SignalFormState<TParams, THost>;
35
+ _clone(): SignalFormState<TParams, THost>;
36
+ _parentOf<TChildParams extends SignalFormParams, TChildHost extends SignalForm<TChildParams>>(child: SignalFormState<TChildParams, TChildHost>): SignalFormState<TChildParams, TChildHost>;
37
+ _hasSameRootWith(another: SignalFormState): boolean;
38
+ abstract readonly _initial: ReadonlySignal<TParams["input.schema"]>;
39
+ abstract _setInitial(monitor: Monitor, setter: TParams["input.setter"]): void;
40
+ /**
41
+ * Like {@link _setInitial} but a no-op for explicitly set initials.
42
+ */
43
+ abstract _patchInitial(monitor: Monitor, initial: TParams["input.schema"]): void;
44
+ abstract readonly _input: ReadonlySignal<TParams["input.schema"]>;
45
+ abstract _setInput(monitor: Monitor, setter: TParams["input.setter"]): void;
46
+ abstract readonly _error: ReadonlySignal<null | TParams["error.schema"]>;
47
+ abstract readonly _errorVerbose: ReadonlySignal<TParams["error.schema.verbose"]>;
48
+ abstract _setError(monitor: Monitor, setter: TParams["error.setter"]): void;
49
+ abstract readonly _validateOn: ReadonlySignal<TParams["validateOn.schema"]>;
50
+ abstract readonly _validateOnVerbose: ReadonlySignal<TParams["validateOn.schema.verbose"]>;
51
+ abstract _setValidateOn(monitor: Monitor, setter: TParams["validateOn.setter"]): void;
52
+ abstract readonly _touched: ReadonlySignal<TParams["flag.schema"]>;
53
+ abstract readonly _touchedVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
54
+ abstract _setTouched(monitor: Monitor, setter: TParams["flag.setter"]): void;
55
+ abstract readonly _output: ReadonlySignal<null | TParams["output.schema"]>;
56
+ abstract readonly _outputVerbose: ReadonlySignal<TParams["output.schema.verbose"]>;
57
+ abstract readonly _valid: ReadonlySignal<TParams["flag.schema"]>;
58
+ abstract readonly _validVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
59
+ abstract readonly _invalid: ReadonlySignal<TParams["flag.schema"]>;
60
+ abstract readonly _invalidVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
61
+ abstract readonly _validated: ReadonlySignal<TParams["flag.schema"]>;
62
+ abstract readonly _validatedVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
63
+ abstract _forceValidated(monitor: Monitor): void;
64
+ abstract readonly _dirty: ReadonlySignal<TParams["flag.schema"]>;
65
+ abstract readonly _dirtyVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
66
+ abstract readonly _dirtyOnVerbose: ReadonlySignal<TParams["flag.schema.verbose"]>;
67
+ readonly _onFocus: Emitter<unknown, void>;
68
+ _getFocusFirstInvalid(monitor: Monitor): null | VoidFunction;
69
+ readonly _onSubmit: Emitter<unknown, void | Promise<unknown>>;
70
+ readonly _submitAttempts: Signal<number>;
71
+ readonly _submittingCount: Signal<number>;
72
+ _submitWith(monitor: Monitor, output: TParams["output.schema"]): ReadonlyArray<void | Promise<unknown>>;
73
+ /**
74
+ * Comparing to {@link _setInitial} where the setter is always provided,
75
+ * this method allows the resetter to be undefined.
76
+ * This is for cases when the initial value is not changed BUT
77
+ * the {@link SignalForm} should perform the rest of reset operations,
78
+ * in comparison to {@link _setInitial} which only sets the initial value AND
79
+ * not called at all if the setter is not provided.
80
+ */
81
+ abstract _reset(monitor: Monitor, resetter: undefined | TParams["input.setter"]): void;
82
+ abstract _getChildren(monitor: Monitor): ReadonlyArray<SignalFormChild<TParams>>;
83
+ }
84
+ interface SignalFormChild<TParams extends SignalFormParams> {
85
+ _state: SignalFormState;
86
+ _mapToChild: (this: void, parentValue: TParams["output.schema"]) => unknown;
87
+ }
88
+ type GetFormState<TForm extends SignalForm> = SignalFormState<GetFormParams<TForm>, TForm>;
97
89
  declare abstract class SignalForm<TParams extends SignalFormParams = any> {
98
- protected static _getState<TFormParams extends SignalFormParams>({ _state, }: SignalForm<TFormParams>): SignalFormState<TFormParams>;
99
- protected abstract readonly _state: SignalFormState<TParams>;
100
- clone(): SignalForm<TParams>;
101
- getOutput(monitor: Monitor): null | TParams["output.schema"];
102
- getOutput<TResult>(monitor: Monitor, select: (concise: null | TParams["output.schema"], verbose: TParams["output.schema.verbose"]) => TResult): TResult;
103
- getInitial(monitor: Monitor): TParams["input.schema"];
104
- setInitial(setter: TParams["input.setter"]): void;
105
- getInput(monitor: Monitor): TParams["input.schema"];
106
- setInput(setter: TParams["input.setter"]): void;
107
- getError(monitor: Monitor): null | TParams["error.schema"];
108
- getError<TResult>(monitor: Monitor, select: (concise: null | TParams["error.schema"], verbose: TParams["error.schema.verbose"]) => TResult): TResult;
109
- setError(setter: TParams["error.setter"]): void;
110
- getValidateOn(monitor: Monitor): TParams["validateOn.schema"];
111
- getValidateOn<TResult>(monitor: Monitor, select: (concise: TParams["validateOn.schema"], verbose: TParams["validateOn.schema.verbose"]) => TResult): TResult;
112
- setValidateOn(setter: TParams["validateOn.setter"]): void;
113
- isValid(monitor: Monitor): boolean;
114
- isValid<TResult>(monitor: Monitor, select: (concise: TParams["flag.schema"], verbose: TParams["flag.schema.verbose"]) => TResult): TResult;
115
- isInvalid(monitor: Monitor): boolean;
116
- isInvalid<TResult>(monitor: Monitor, select: (concise: TParams["flag.schema"], verbose: TParams["flag.schema.verbose"]) => TResult): TResult;
117
- isValidated(monitor: Monitor): boolean;
118
- isValidated<TResult>(monitor: Monitor, select: (concise: TParams["flag.schema"], verbose: TParams["flag.schema.verbose"]) => TResult): TResult;
119
- isDirty(monitor: Monitor): boolean;
120
- isDirty<TResult>(monitor: Monitor, select: (concise: TParams["flag.schema"], verbose: TParams["flag.schema.verbose"]) => TResult): TResult;
121
- isTouched(monitor: Monitor): boolean;
122
- isTouched<TResult>(monitor: Monitor, select: (concise: TParams["flag.schema"], verbose: TParams["flag.schema.verbose"]) => TResult): TResult;
123
- setTouched(setter: TParams["flag.setter"]): void;
124
- reset(resetter?: TParams["input.setter"]): void;
125
- onFocusWhenInvalid(onFocus: (error: TParams["error.schema.verbose"]) => void): VoidFunction;
126
- focusFirstInvalid(): void;
127
- getSubmitCount(monitor: Monitor): number;
128
- isSubmitting(monitor: Monitor): boolean;
129
- onSubmit(listener: (output: TParams["output.schema"]) => void | Promise<unknown>): VoidFunction;
130
- submit(): Promise<void>;
131
- }
132
-
90
+ protected static _getState<TForm extends SignalForm>(form: TForm): GetFormState<TForm>;
91
+ protected abstract readonly _state: SignalFormState<TParams>;
92
+ clone(): SignalForm<TParams>;
93
+ getOutput(monitor: Monitor): null | TParams["output.schema"];
94
+ getOutput<TResult>(monitor: Monitor, select: (concise: null | TParams["output.schema"], verbose: TParams["output.schema.verbose"]) => TResult): TResult;
95
+ getInitial(monitor: Monitor): TParams["input.schema"];
96
+ setInitial(setter: TParams["input.setter"]): void;
97
+ getInput(monitor: Monitor): TParams["input.schema"];
98
+ setInput(setter: TParams["input.setter"]): void;
99
+ getError(monitor: Monitor): null | TParams["error.schema"];
100
+ getError<TResult>(monitor: Monitor, select: (concise: null | TParams["error.schema"], verbose: TParams["error.schema.verbose"]) => TResult): TResult;
101
+ setError(setter: TParams["error.setter"]): void;
102
+ getValidateOn(monitor: Monitor): TParams["validateOn.schema"];
103
+ getValidateOn<TResult>(monitor: Monitor, select: (concise: TParams["validateOn.schema"], verbose: TParams["validateOn.schema.verbose"]) => TResult): TResult;
104
+ setValidateOn(setter: TParams["validateOn.setter"]): void;
105
+ isValid(monitor: Monitor): boolean;
106
+ isValid<TResult>(monitor: Monitor, select: (concise: TParams["flag.schema"], verbose: TParams["flag.schema.verbose"]) => TResult): TResult;
107
+ isInvalid(monitor: Monitor): boolean;
108
+ isInvalid<TResult>(monitor: Monitor, select: (concise: TParams["flag.schema"], verbose: TParams["flag.schema.verbose"]) => TResult): TResult;
109
+ isValidated(monitor: Monitor): boolean;
110
+ isValidated<TResult>(monitor: Monitor, select: (concise: TParams["flag.schema"], verbose: TParams["flag.schema.verbose"]) => TResult): TResult;
111
+ isDirty(monitor: Monitor): boolean;
112
+ isDirty<TResult>(monitor: Monitor, select: (concise: TParams["flag.schema"], verbose: TParams["flag.schema.verbose"]) => TResult): TResult;
113
+ isTouched(monitor: Monitor): boolean;
114
+ isTouched<TResult>(monitor: Monitor, select: (concise: TParams["flag.schema"], verbose: TParams["flag.schema.verbose"]) => TResult): TResult;
115
+ setTouched(setter: TParams["flag.setter"]): void;
116
+ reset(resetter?: TParams["input.setter"]): void;
117
+ onFocusWhenInvalid(onFocus: (error: TParams["error.schema.verbose"]) => void): VoidFunction;
118
+ focusFirstInvalid(): void;
119
+ getSubmitCount(monitor: Monitor): number;
120
+ isSubmitting(monitor: Monitor): boolean;
121
+ onSubmit(listener: (output: TParams["output.schema"]) => void | Promise<unknown>): VoidFunction;
122
+ submit(): Promise<void>;
123
+ }
133
124
  type GetFormParams<TTarget> = TTarget extends SignalForm<infer TParams> ? TParams : never;
134
-
135
125
  type GetFormParam<TTarget, TKey extends keyof SignalFormParams> = GetFormParams<TTarget>[TKey];
136
-
137
126
  type GetFormError<TForm extends SignalForm> = GetFormParam<TForm, "error.schema">;
138
-
139
127
  type GetFormErrorSetter<TForm extends SignalForm> = GetFormParam<TForm, "error.setter">;
140
-
141
128
  type GetFormErrorVerbose<TForm extends SignalForm> = GetFormParam<TForm, "error.schema.verbose">;
142
-
143
129
  type GetFormFlag<TForm extends SignalForm> = GetFormParam<TForm, "flag.schema">;
144
-
145
130
  type GetFormFlagSetter<TForm extends SignalForm> = GetFormParam<TForm, "flag.setter">;
146
-
147
131
  type GetFormFlagVerbose<TForm extends SignalForm> = GetFormParam<TForm, "flag.schema.verbose">;
148
-
149
132
  type GetFormInput<TForm extends SignalForm> = GetFormParam<TForm, "input.schema">;
150
-
151
133
  type GetFormInputSetter<TForm extends SignalForm> = GetFormParam<TForm, "input.setter">;
152
-
153
134
  type GetFormOutput<TForm extends SignalForm> = GetFormParam<TForm, "output.schema">;
154
-
155
135
  type GetFormOutputVerbose<TForm extends SignalForm> = GetFormParam<TForm, "output.schema.verbose">;
156
-
157
136
  type GetFormValidateOn<TForm extends SignalForm> = GetFormParam<TForm, "validateOn.schema">;
158
-
159
137
  type GetFormValidateOnSetter<TForm extends SignalForm> = GetFormParam<TForm, "validateOn.setter">;
160
-
161
138
  type GetFormValidateOnVerbose<TForm extends SignalForm> = GetFormParam<TForm, "validateOn.schema.verbose">;
162
-
163
139
  declare function isSignalForm(value: unknown): value is SignalForm;
164
-
165
140
  type FormUnitTransformer<TInput, TOutput> = (input: TInput) => TOutput;
166
-
167
141
  type FormUnitValidator<TInput, TError, TOutput> = (input: TInput) => Result<TError, TOutput>;
168
-
169
142
  type Setter<TValue, TPrevValues extends ReadonlyArray<unknown> = [TValue]> = TValue | ((...args: TPrevValues) => TValue);
170
-
171
143
  type FormUnitErrorSetter<TError> = Setter<null | TError>;
172
-
173
144
  type FormUnitFlagSetter = Setter<boolean>;
174
-
175
145
  type FormUnitInputSetter<TInput> = Setter<TInput, [TInput, TInput]>;
176
-
177
146
  type FormUnitValidateOnSetter = Setter<ValidateStrategy>;
178
-
179
147
  interface FormUnitParams<TInput, TError, TOutput> extends SignalFormParams {
180
- readonly "input.setter": FormUnitInputSetter<TInput>;
181
- readonly "input.schema": TInput;
182
- readonly "output.schema": TOutput;
183
- readonly "output.schema.verbose": null | TOutput;
184
- readonly "flag.setter": FormUnitFlagSetter;
185
- readonly "flag.schema": boolean;
186
- readonly "flag.schema.verbose": boolean;
187
- readonly "validateOn.setter": FormUnitValidateOnSetter;
188
- readonly "validateOn.schema": ValidateStrategy;
189
- readonly "validateOn.schema.verbose": ValidateStrategy;
190
- readonly "error.setter": FormUnitErrorSetter<TError>;
191
- readonly "error.schema": null | TError;
192
- readonly "error.schema.verbose": null | TError;
193
- }
194
-
148
+ readonly "input.setter": FormUnitInputSetter<TInput>;
149
+ readonly "input.schema": TInput;
150
+ readonly "output.schema": TOutput;
151
+ readonly "output.schema.verbose": null | TOutput;
152
+ readonly "flag.setter": FormUnitFlagSetter;
153
+ readonly "flag.schema": boolean;
154
+ readonly "flag.schema.verbose": boolean;
155
+ readonly "validateOn.setter": FormUnitValidateOnSetter;
156
+ readonly "validateOn.schema": ValidateStrategy;
157
+ readonly "validateOn.schema.verbose": ValidateStrategy;
158
+ readonly "error.setter": FormUnitErrorSetter<TError>;
159
+ readonly "error.schema": null | TError;
160
+ readonly "error.schema.verbose": null | TError;
161
+ }
195
162
  interface ZodLikeIssue {
196
- message: string;
163
+ message: string;
197
164
  }
198
165
  type ZodLikeError = {
199
- get errors(): ReadonlyArray<ZodLikeIssue>;
166
+ get errors(): ReadonlyArray<ZodLikeIssue>;
200
167
  } | {
201
- errors: ReadonlyArray<ZodLikeIssue>;
168
+ errors: ReadonlyArray<ZodLikeIssue>;
202
169
  } | {
203
- issues: ReadonlyArray<ZodLikeIssue>;
170
+ issues: ReadonlyArray<ZodLikeIssue>;
204
171
  };
205
172
  type ZodLikeSafeParseResult<TOutput> = {
206
- success: false;
207
- error: ZodLikeError;
173
+ success: false;
174
+ error: ZodLikeError;
208
175
  } | {
209
- success: true;
210
- data: TOutput;
176
+ success: true;
177
+ data: TOutput;
211
178
  };
212
179
  type ZodLikeSchema<TOutput> = {
213
- parse(input: unknown): TOutput;
180
+ parse(input: unknown): TOutput;
214
181
  } | {
215
- safeParse(input: unknown): ZodLikeSafeParseResult<TOutput>;
182
+ safeParse(input: unknown): ZodLikeSafeParseResult<TOutput>;
216
183
  };
217
184
  declare function zodLikeParse<TOutput>(schema: ZodLikeSchema<TOutput>, input: unknown): Result<ReadonlyArray<string>, TOutput>;
218
-
219
185
  interface FormUnitTransform<TInput, TError, TOutput> {
220
- readonly _transformer: boolean;
221
- readonly _validator: FormUnitValidator<TInput, TError, TOutput>;
222
- }
223
-
224
- declare class FormUnitState<TInput, TError, TOutput> extends SignalFormState<FormUnitParams<TInput, TError, TOutput>> {
225
- readonly _initial: Signal<TInput>;
226
- readonly _input: Signal<TInput>;
227
- private readonly _customError;
228
- readonly _validateOn: Signal<ValidateStrategy>;
229
- readonly _touched: Signal<boolean>;
230
- private readonly _transform;
231
- private readonly _isInputDirty;
232
- private readonly _isOutputEqual;
233
- private readonly _isErrorEqual;
234
- private _isInitialExplicit;
235
- readonly _host: Lazy<FormUnit$1<TInput, TError, TOutput>>;
236
- constructor(parent: null | SignalFormState, _initial: Signal<TInput>, _input: Signal<TInput>, _customError: Signal<null | TError>, _validateOn: Signal<ValidateStrategy>, _touched: Signal<boolean>, _transform: Signal<FormUnitTransform<TInput, TError, TOutput>>, _isInputDirty: Equal<TInput>, _isOutputEqual: Equal<null | TOutput>, _isErrorEqual: Equal<null | TError>, _isInitialExplicit: boolean);
237
- _childOf(parent: null | SignalFormState): FormUnitState<TInput, TError, TOutput>;
238
- _setInitial(monitor: Monitor, setter: FormUnitInputSetter<TInput>): void;
239
- _patchInitial(_monitor: Monitor, candidate: TInput): void;
240
- _setInput(monitor: Monitor, setter: FormUnitInputSetter<TInput>): void;
241
- readonly _error: ReadonlySignal<null | TError>;
242
- readonly _errorVerbose: ReadonlySignal<null | TError>;
243
- _setError(_monitor: Monitor, setter: FormUnitErrorSetter<TError>): void;
244
- readonly _validateOnVerbose: ReadonlySignal<ValidateStrategy>;
245
- _setValidateOn(monitor: Monitor, setter: FormUnitValidateOnSetter): void;
246
- readonly _touchedVerbose: ReadonlySignal<boolean>;
247
- _setTouched(_monitor: Monitor, setter: FormUnitParams<TInput, TError, TOutput>["flag.setter"]): void;
248
- readonly _output: ReadonlySignal<null | TOutput>;
249
- readonly _outputVerbose: ReadonlySignal<null | TOutput>;
250
- readonly _valid: ReadonlySignal<boolean>;
251
- readonly _validVerbose: ReadonlySignal<boolean>;
252
- readonly _invalid: ReadonlySignal<boolean>;
253
- readonly _invalidVerbose: ReadonlySignal<boolean>;
254
- readonly _validated: Signal<boolean>;
255
- readonly _validatedVerbose: ReadonlySignal<boolean>;
256
- _forceValidated(): void;
257
- readonly _dirty: ReadonlySignal<boolean>;
258
- readonly _dirtyVerbose: ReadonlySignal<boolean>;
259
- readonly _dirtyOnVerbose: Signal<boolean>;
260
- _reset(monitor: Monitor, resetter: undefined | FormUnitInputSetter<TInput>): void;
261
- _getChildren(): ReadonlyArray<never>;
262
- _setTransform(transformer: FormUnitTransformer<TInput, TOutput>): void;
263
- }
264
-
186
+ readonly _transformer: boolean;
187
+ readonly _validator: FormUnitValidator<TInput, TError, TOutput>;
188
+ }
189
+ declare class FormUnitState<TInput, TError, TOutput> extends SignalFormState<FormUnitParams<TInput, TError, TOutput>, FormUnit$1<TInput, TError, TOutput>> {
190
+ readonly _initial: Signal<TInput>;
191
+ readonly _input: Signal<TInput>;
192
+ private readonly _customError;
193
+ readonly _validateOn: Signal<ValidateStrategy>;
194
+ readonly _touched: Signal<boolean>;
195
+ private readonly _transform;
196
+ private readonly _isInputDirty;
197
+ private readonly _isOutputEqual;
198
+ private readonly _isErrorEqual;
199
+ private _isInitialExplicit;
200
+ readonly _host: Lazy<FormUnit$1<TInput, TError, TOutput>>;
201
+ constructor(parent: null | SignalFormState, _initial: Signal<TInput>, _input: Signal<TInput>, _customError: Signal<null | TError>, _validateOn: Signal<ValidateStrategy>, _touched: Signal<boolean>, _transform: Signal<FormUnitTransform<TInput, TError, TOutput>>, _isInputDirty: Equal<TInput>, _isOutputEqual: Equal<null | TOutput>, _isErrorEqual: Equal<null | TError>, _isInitialExplicit: boolean);
202
+ _childOf(parent: null | SignalFormState): FormUnitState<TInput, TError, TOutput>;
203
+ _setInitial(monitor: Monitor, setter: FormUnitInputSetter<TInput>): void;
204
+ _patchInitial(_monitor: Monitor, candidate: TInput): void;
205
+ _setInput(monitor: Monitor, setter: FormUnitInputSetter<TInput>): void;
206
+ readonly _error: ReadonlySignal<null | TError>;
207
+ readonly _errorVerbose: ReadonlySignal<null | TError>;
208
+ _setError(_monitor: Monitor, setter: FormUnitErrorSetter<TError>): void;
209
+ readonly _validateOnVerbose: ReadonlySignal<ValidateStrategy>;
210
+ _setValidateOn(monitor: Monitor, setter: FormUnitValidateOnSetter): void;
211
+ readonly _touchedVerbose: ReadonlySignal<boolean>;
212
+ _setTouched(_monitor: Monitor, setter: FormUnitParams<TInput, TError, TOutput>["flag.setter"]): void;
213
+ readonly _output: ReadonlySignal<null | TOutput>;
214
+ readonly _outputVerbose: ReadonlySignal<null | TOutput>;
215
+ readonly _valid: ReadonlySignal<boolean>;
216
+ readonly _validVerbose: ReadonlySignal<boolean>;
217
+ readonly _invalid: ReadonlySignal<boolean>;
218
+ readonly _invalidVerbose: ReadonlySignal<boolean>;
219
+ readonly _validated: Signal<boolean>;
220
+ readonly _validatedVerbose: ReadonlySignal<boolean>;
221
+ _forceValidated(): void;
222
+ readonly _dirty: ReadonlySignal<boolean>;
223
+ readonly _dirtyVerbose: ReadonlySignal<boolean>;
224
+ readonly _dirtyOnVerbose: Signal<boolean>;
225
+ _reset(monitor: Monitor, resetter: undefined | FormUnitInputSetter<TInput>): void;
226
+ _getChildren(): ReadonlyArray<never>;
227
+ _setTransform(transformer: FormUnitTransformer<TInput, TOutput>): void;
228
+ }
265
229
  declare class FormUnit$1<TInput, TError, TOutput> extends SignalForm<FormUnitParams<TInput, TError, TOutput>> {
266
- readonly _state: FormUnitState<TInput, TError, TOutput>;
267
- constructor(_state: FormUnitState<TInput, TError, TOutput>);
268
- setTransform(transformer: FormUnitTransformer<TInput, TOutput>): void;
230
+ readonly _state: FormUnitState<TInput, TError, TOutput>;
231
+ constructor(_state: FormUnitState<TInput, TError, TOutput>);
232
+ setTransform(transformer: FormUnitTransformer<TInput, TOutput>): void;
269
233
  }
270
-
234
+ type FormUnit<TInput, TError = null, TOutput = TInput> = FormUnit$1<TInput, TError, TOutput>;
271
235
  interface FormUnitOptions<TInput, TError = null> {
272
- /**
273
- * The initial or custom error associated with the form value.
274
- * This can be used to set an error state manually.
275
- *
276
- * @default null
277
- */
278
- readonly error?: null | TError;
279
- readonly touched?: boolean;
280
- /**
281
- * PERFORMANCE OPTIMIZATION
282
- *
283
- * A equality check function that determines whether the input value changes.
284
- * When it does, the {@link SignalForm.getInput} returns the new value.
285
- * Otherwise, it returns the previous value.
286
- *
287
- * Useful for none primitive values such as Objects, Arrays, Date, etc.
288
- * Intended to improve performance but do not affect business logic.
289
- *
290
- * @default Object.is
291
- *
292
- * @example
293
- * const initial = { count: 0 }
294
- *
295
- * const form = FormUnit(initial, {
296
- * isInputEqual: (left, right) => left.count === right.count,
297
- * })
298
- *
299
- * form.setInput({ count: 0 })
300
- * form.getInput(monitor) === initial // true
301
- */
302
- readonly isInputEqual?: Equal<TInput>;
303
- /**
304
- * BUSINESS LOGIC TUNING
305
- *
306
- * A equality check function that determines whether the input is dirty.
307
- * When it is, the {@link SignalForm.isDirty} returns true.
308
- * Fallbacks to not(isInputEqual) if not provided.
309
- *
310
- * Useful for values that have intermediate states deviating from the initial value,
311
- * but should not be considered dirty such as strings, unsorted arrays, etc.
312
- * Intended to tune business logic and avoid false positives for dirty states.
313
- *
314
- * @default not(isInputEqual)
315
- *
316
- * @example
317
- * const form = FormUnit("", {
318
- * isInputDirty: (left, right) => left.trim() !== right.trim(),
319
- * })
320
- *
321
- * form.setInput(" ")
322
- * form.isDirty(monitor) === false
323
- */
324
- readonly isInputDirty?: Equal<TInput>;
325
- /**
326
- * PERFORMANCE OPTIMIZATION
327
- *
328
- * A equality check function that determines whether the validation error change.
329
- * When it does, the {@link SignalForm.getError} returns the new value.
330
- * Otherwise, it returns the previous value.
331
- *
332
- * Useful for none primitive values such as Objects, Arrays, Date, etc.
333
- * Intended to improve performance but do not affect business logic.
334
- *
335
- * @default Object.is
336
- */
337
- readonly isErrorEqual?: Equal<TError>;
338
- /**
339
- * @default input
340
- */
341
- readonly initial?: TInput;
236
+ /**
237
+ * The initial or custom error associated with the form value.
238
+ * This can be used to set an error state manually.
239
+ *
240
+ * @default null
241
+ */
242
+ readonly error?: null | TError;
243
+ readonly touched?: boolean;
244
+ /**
245
+ * PERFORMANCE OPTIMIZATION
246
+ *
247
+ * A equality check function that determines whether the input value changes.
248
+ * When it does, the {@link SignalForm.getInput} returns the new value.
249
+ * Otherwise, it returns the previous value.
250
+ *
251
+ * Useful for none primitive values such as Objects, Arrays, Date, etc.
252
+ * Intended to improve performance but do not affect business logic.
253
+ *
254
+ * @default Object.is
255
+ *
256
+ * @example
257
+ * const initial = { count: 0 }
258
+ *
259
+ * const form = FormUnit(initial, {
260
+ * isInputEqual: (left, right) => left.count === right.count,
261
+ * })
262
+ *
263
+ * form.setInput({ count: 0 })
264
+ * form.getInput(monitor) === initial // true
265
+ */
266
+ readonly isInputEqual?: Equal<TInput>;
267
+ /**
268
+ * BUSINESS LOGIC TUNING
269
+ *
270
+ * A equality check function that determines whether the input is dirty.
271
+ * When it is, the {@link SignalForm.isDirty} returns true.
272
+ * Fallbacks to not(isInputEqual) if not provided.
273
+ *
274
+ * Useful for values that have intermediate states deviating from the initial value,
275
+ * but should not be considered dirty such as strings, unsorted arrays, etc.
276
+ * Intended to tune business logic and avoid false positives for dirty states.
277
+ *
278
+ * @default not(isInputEqual)
279
+ *
280
+ * @example
281
+ * const form = FormUnit("", {
282
+ * isInputDirty: (left, right) => left.trim() !== right.trim(),
283
+ * })
284
+ *
285
+ * form.setInput(" ")
286
+ * form.isDirty(monitor) === false
287
+ */
288
+ readonly isInputDirty?: Equal<TInput>;
289
+ /**
290
+ * PERFORMANCE OPTIMIZATION
291
+ *
292
+ * A equality check function that determines whether the validation error change.
293
+ * When it does, the {@link SignalForm.getError} returns the new value.
294
+ * Otherwise, it returns the previous value.
295
+ *
296
+ * Useful for none primitive values such as Objects, Arrays, Date, etc.
297
+ * Intended to improve performance but do not affect business logic.
298
+ *
299
+ * @default Object.is
300
+ */
301
+ readonly isErrorEqual?: Equal<TError>;
302
+ /**
303
+ * @default input
304
+ */
305
+ readonly initial?: TInput;
342
306
  }
343
307
  interface FormUnitTransformedOptions<TInput, TError = null, TOutput = TInput> extends FormUnitOptions<TInput, TError> {
344
- readonly transform: FormUnitTransformer<TInput, TOutput>;
345
- readonly validate?: never;
346
- readonly schema?: never;
347
- readonly validateOn?: never;
348
- /**
349
- * PERFORMANCE OPTIMIZATION
350
- *
351
- * A equality check function that determines whether the output value changes.
352
- * When it does, the {@link SignalForm.getOutput} returns the new value.
353
- *
354
- * Useful for none primitive values such as Objects, Arrays, Date, etc.
355
- * Intended to improve performance but do not affect business logic.
356
- *
357
- * @default Object.is
358
- */
359
- readonly isOutputEqual?: Equal<TOutput>;
308
+ readonly transform: FormUnitTransformer<TInput, TOutput>;
309
+ readonly validate?: never;
310
+ readonly schema?: never;
311
+ readonly validateOn?: never;
312
+ /**
313
+ * PERFORMANCE OPTIMIZATION
314
+ *
315
+ * A equality check function that determines whether the output value changes.
316
+ * When it does, the {@link SignalForm.getOutput} returns the new value.
317
+ *
318
+ * Useful for none primitive values such as Objects, Arrays, Date, etc.
319
+ * Intended to improve performance but do not affect business logic.
320
+ *
321
+ * @default Object.is
322
+ */
323
+ readonly isOutputEqual?: Equal<TOutput>;
360
324
  }
361
325
  interface FormUnitSchemaOptions<TInput, TOutput = TInput> extends Omit<FormUnitOptions<TInput, ReadonlyArray<string>>, "isErrorEqual"> {
362
- readonly schema: ZodLikeSchema<TOutput>;
363
- /**
364
- * @default "onTouch"
365
- */
366
- readonly validateOn?: ValidateStrategy;
367
- readonly transform?: never;
368
- readonly validate?: never;
369
- /**
370
- * PERFORMANCE OPTIMIZATION
371
- *
372
- * A equality check function that determines whether the output value changes.
373
- * When it does, the {@link SignalForm.getOutput} returns the new value.
374
- *
375
- * Useful for none primitive values such as Objects, Arrays, Date, etc.
376
- * Intended to improve performance but do not affect business logic.
377
- *
378
- * @default Object.is
379
- */
380
- readonly isOutputEqual?: Equal<TOutput>;
326
+ readonly schema: ZodLikeSchema<TOutput>;
327
+ /**
328
+ * @default "onTouch"
329
+ */
330
+ readonly validateOn?: ValidateStrategy;
331
+ readonly transform?: never;
332
+ readonly validate?: never;
333
+ /**
334
+ * PERFORMANCE OPTIMIZATION
335
+ *
336
+ * A equality check function that determines whether the output value changes.
337
+ * When it does, the {@link SignalForm.getOutput} returns the new value.
338
+ *
339
+ * Useful for none primitive values such as Objects, Arrays, Date, etc.
340
+ * Intended to improve performance but do not affect business logic.
341
+ *
342
+ * @default Object.is
343
+ */
344
+ readonly isOutputEqual?: Equal<TOutput>;
381
345
  }
382
346
  interface FormUnitValidatedOptions<TInput, TError = null, TOutput = TInput> extends FormUnitOptions<TInput, TError> {
383
- readonly validate: FormUnitValidator<TInput, TError, TOutput>;
384
- /**
385
- * @default "onTouch"
386
- */
387
- readonly validateOn?: ValidateStrategy;
388
- readonly transform?: never;
389
- readonly schema?: never;
390
- /**
391
- * PERFORMANCE OPTIMIZATION
392
- *
393
- * A equality check function that determines whether the output value changes.
394
- * When it does, the {@link SignalForm.getOutput} returns the new value.
395
- *
396
- * Useful for none primitive values such as Objects, Arrays, Date, etc.
397
- * Intended to improve performance but do not affect business logic.
398
- *
399
- * @default Object.is
400
- */
401
- readonly isOutputEqual?: Equal<TOutput>;
347
+ readonly validate: FormUnitValidator<TInput, TError, TOutput>;
348
+ /**
349
+ * @default "onTouch"
350
+ */
351
+ readonly validateOn?: ValidateStrategy;
352
+ readonly transform?: never;
353
+ readonly schema?: never;
354
+ /**
355
+ * PERFORMANCE OPTIMIZATION
356
+ *
357
+ * A equality check function that determines whether the output value changes.
358
+ * When it does, the {@link SignalForm.getOutput} returns the new value.
359
+ *
360
+ * Useful for none primitive values such as Objects, Arrays, Date, etc.
361
+ * Intended to improve performance but do not affect business logic.
362
+ *
363
+ * @default Object.is
364
+ */
365
+ readonly isOutputEqual?: Equal<TOutput>;
402
366
  }
403
- type FormUnit<TInput, TError = null, TOutput = TInput> = FormUnit$1<TInput, TError, TOutput>;
404
367
  declare function FormUnit<TInput, TError = null, TOutput = TInput>(input: TInput, options: FormUnitValidatedOptions<TInput, TError, TOutput> | FormUnitTransformedOptions<TInput, TError, TOutput>): FormUnit<TInput, TError, TOutput>;
405
368
  declare function FormUnit<TInput, TOutput = TInput>(input: TInput, options: FormUnitSchemaOptions<TInput, TOutput>): FormUnit<TInput, ReadonlyArray<string>, TOutput>;
406
369
  declare function FormUnit<TInput>(input: TInput, options?: FormUnitOptions<TInput>): FormUnit<TInput, null, TInput>;
407
370
  declare function FormUnit<TInput, TError>(input: TInput, options?: FormUnitOptions<TInput, TError>): FormUnit<TInput, TError, TInput>;
408
-
409
371
  declare function isFormUnit(value: unknown): value is FormUnit$1<unknown, unknown, unknown>;
410
-
411
372
  /**
412
373
  * Self-referential homomorphic constraint: use as `<TFields extends FormShapeFields<TFields>>`.
413
374
  *
@@ -417,560 +378,408 @@ declare function isFormUnit(value: unknown): value is FormUnit$1<unknown, unknow
417
378
  * each known key against `SignalForm` without requiring an index signature, so both
418
379
  * `interface` and `type` declarations satisfy the constraint.
419
380
  */
420
- type FormShapeFields<TFields = Record<string, SignalForm>> = {
421
- readonly [TField in keyof TFields]: SignalForm;
422
- };
423
-
424
- type GetFormShapeParam<TFields extends FormShapeFields<TFields>, TKey extends keyof SignalFormParams> = {
425
- readonly [TField in keyof TFields]: GetFormParam<TFields[TField], TKey>;
426
- };
427
-
381
+ type FormShapeFields<TFields = Record<string, SignalForm>> = { readonly [TField in keyof TFields]: SignalForm; };
382
+ type GetFormShapeParam<TFields extends FormShapeFields<TFields>, TKey extends keyof SignalFormParams> = { readonly [TField in keyof TFields]: GetFormParam<TFields[TField], TKey>; };
428
383
  type FormShapeErrorVerbose<TFields extends FormShapeFields<TFields>> = GetFormShapeParam<TFields, "error.schema.verbose">;
429
-
430
- type FormShapeErrorSetter<TFields extends FormShapeFields<TFields>> = Setter<null | Partial<GetFormShapeParam<TFields, "error.setter">>, [
431
- FormShapeErrorVerbose<TFields>
432
- ]>;
433
-
384
+ type FormShapeErrorSetter<TFields extends FormShapeFields<TFields>> = Setter<null | Partial<GetFormShapeParam<TFields, "error.setter">>, [FormShapeErrorVerbose<TFields>]>;
434
385
  type FormShapeFlagVerbose<TFields extends FormShapeFields<TFields>> = GetFormShapeParam<TFields, "flag.schema.verbose">;
435
-
436
- type FormShapeFlagSetter<TFields extends FormShapeFields<TFields>> = Setter<boolean | Partial<GetFormShapeParam<TFields, "flag.setter">>, [
437
- FormShapeFlagVerbose<TFields>
438
- ]>;
439
-
386
+ type FormShapeFlagSetter<TFields extends FormShapeFields<TFields>> = Setter<boolean | Partial<GetFormShapeParam<TFields, "flag.setter">>, [FormShapeFlagVerbose<TFields>]>;
440
387
  type FormShapeInput<TFields extends FormShapeFields<TFields>> = GetFormShapeParam<TFields, "input.schema">;
441
-
442
- type FormShapeInputSetter<TFields extends FormShapeFields<TFields>> = Setter<Partial<GetFormShapeParam<TFields, "input.setter">>, [
443
- FormShapeInput<TFields>,
444
- FormShapeInput<TFields>
445
- ]>;
446
-
388
+ type FormShapeInputSetter<TFields extends FormShapeFields<TFields>> = Setter<Partial<GetFormShapeParam<TFields, "input.setter">>, [FormShapeInput<TFields>, FormShapeInput<TFields>]>;
447
389
  type FormShapeValidateOnVerbose<TFields extends FormShapeFields<TFields>> = GetFormShapeParam<TFields, "validateOn.schema.verbose">;
448
-
449
- type FormShapeValidateOnSetter<TFields extends FormShapeFields<TFields>> = Setter<ValidateStrategy | Partial<GetFormShapeParam<TFields, "validateOn.setter">>, [
450
- FormShapeValidateOnVerbose<TFields>
451
- ]>;
452
-
390
+ type FormShapeValidateOnSetter<TFields extends FormShapeFields<TFields>> = Setter<ValidateStrategy | Partial<GetFormShapeParam<TFields, "validateOn.setter">>, [FormShapeValidateOnVerbose<TFields>]>;
453
391
  type FormShapeError<TFields extends FormShapeFields<TFields>> = null | GetFormShapeParam<TFields, "error.schema">;
454
-
455
392
  type FormShapeFlag<TFields extends FormShapeFields<TFields>> = boolean | GetFormShapeParam<TFields, "flag.schema">;
456
-
457
393
  type FormShapeOutput<TFields extends FormShapeFields<TFields>> = GetFormShapeParam<TFields, "output.schema">;
458
-
459
394
  type FormShapeOutputVerbose<TFields extends FormShapeFields<TFields>> = GetFormShapeParam<TFields, "output.schema.verbose">;
460
-
461
395
  type FormShapeValidateOn<TFields extends FormShapeFields<TFields>> = ValidateStrategy | GetFormShapeParam<TFields, "validateOn.schema">;
462
-
463
396
  interface FormShapeParams<TFields extends FormShapeFields<TFields>> extends SignalFormParams {
464
- readonly "input.schema": FormShapeInput<TFields>;
465
- readonly "input.setter": FormShapeInputSetter<TFields>;
466
- readonly "output.schema": FormShapeOutput<TFields>;
467
- readonly "output.schema.verbose": FormShapeOutputVerbose<TFields>;
468
- readonly "flag.setter": FormShapeFlagSetter<TFields>;
469
- readonly "flag.schema": FormShapeFlag<TFields>;
470
- readonly "flag.schema.verbose": FormShapeFlagVerbose<TFields>;
471
- readonly "validateOn.setter": FormShapeValidateOnSetter<TFields>;
472
- readonly "validateOn.schema": FormShapeValidateOn<TFields>;
473
- readonly "validateOn.schema.verbose": FormShapeValidateOnVerbose<TFields>;
474
- readonly "error.setter": FormShapeErrorSetter<TFields>;
475
- readonly "error.schema": FormShapeError<TFields>;
476
- readonly "error.schema.verbose": FormShapeErrorVerbose<TFields>;
477
- }
478
-
479
- type FormShapeStateFields<TFields extends FormShapeFields<TFields>> = {
480
- [TField in keyof TFields]: SignalFormState<GetFormParams<TFields[TField]>>;
481
- };
482
- declare class FormShapeState<TFields extends FormShapeFields<TFields> = Record<string, SignalForm>> extends SignalFormState<FormShapeParams<TFields>> {
483
- readonly _host: Lazy<FormShape$1<TFields>>;
484
- readonly _fields: FormShapeStateFields<TFields>;
485
- constructor(parent: null | SignalFormState, fields: FormShapeStateFields<TFields>);
486
- _childOf(parent: null | SignalFormState): FormShapeState<TFields>;
487
- readonly _initial: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "input.schema">>;
488
- _setInitial(monitor: Monitor, setter: FormShapeInputSetter<TFields>): void;
489
- _patchInitial(monitor: Monitor, initials: FormShapeInput<TFields>): void;
490
- readonly _input: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "input.schema">>;
491
- _setInput(monitor: Monitor, setter: FormShapeInputSetter<TFields>): void;
492
- readonly _error: _owanturist_signal.ReadonlySignal<FormShapeError<TFields>>;
493
- readonly _errorVerbose: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "error.schema.verbose">>;
494
- _setError(monitor: Monitor, setter: FormShapeErrorSetter<TFields>): void;
495
- readonly _validateOn: _owanturist_signal.ReadonlySignal<FormShapeValidateOn<TFields>>;
496
- readonly _validateOnVerbose: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "validateOn.schema.verbose">>;
497
- _setValidateOn(monitor: Monitor, setter: FormShapeValidateOnSetter<TFields>): void;
498
- readonly _touched: _owanturist_signal.ReadonlySignal<FormShapeFlag<TFields>>;
499
- readonly _touchedVerbose: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
500
- _setTouched(monitor: Monitor, setter: FormShapeFlagSetter<TFields>): void;
501
- readonly _output: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "output.schema"> | null>;
502
- readonly _outputVerbose: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "output.schema.verbose">>;
503
- readonly _valid: _owanturist_signal.ReadonlySignal<FormShapeFlag<TFields>>;
504
- readonly _validVerbose: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
505
- readonly _invalid: _owanturist_signal.ReadonlySignal<FormShapeFlag<TFields>>;
506
- readonly _invalidVerbose: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
507
- readonly _validated: _owanturist_signal.ReadonlySignal<FormShapeFlag<TFields>>;
508
- readonly _validatedVerbose: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
509
- _forceValidated(monitor: Monitor): void;
510
- readonly _dirty: _owanturist_signal.ReadonlySignal<FormShapeFlag<TFields>>;
511
- readonly _dirtyVerbose: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
512
- readonly _dirtyOnVerbose: _owanturist_signal.ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
513
- _reset(monitor: Monitor, resetter: undefined | FormShapeInputSetter<TFields>): void;
514
- _getChildren<TChildParams extends SignalFormParams>(): ReadonlyArray<SignalFormChild<TChildParams, FormShapeParams<TFields>>>;
515
- }
516
-
397
+ readonly "input.schema": FormShapeInput<TFields>;
398
+ readonly "input.setter": FormShapeInputSetter<TFields>;
399
+ readonly "output.schema": FormShapeOutput<TFields>;
400
+ readonly "output.schema.verbose": FormShapeOutputVerbose<TFields>;
401
+ readonly "flag.setter": FormShapeFlagSetter<TFields>;
402
+ readonly "flag.schema": FormShapeFlag<TFields>;
403
+ readonly "flag.schema.verbose": FormShapeFlagVerbose<TFields>;
404
+ readonly "validateOn.setter": FormShapeValidateOnSetter<TFields>;
405
+ readonly "validateOn.schema": FormShapeValidateOn<TFields>;
406
+ readonly "validateOn.schema.verbose": FormShapeValidateOnVerbose<TFields>;
407
+ readonly "error.setter": FormShapeErrorSetter<TFields>;
408
+ readonly "error.schema": FormShapeError<TFields>;
409
+ readonly "error.schema.verbose": FormShapeErrorVerbose<TFields>;
410
+ }
411
+ type SignalFormRecord<TForms> = { readonly [TKey in keyof TForms]: SignalForm; };
412
+ type GetFormStates<TForms extends SignalFormRecord<TForms>> = { [TKey in keyof TForms]: GetFormState<TForms[TKey]>; };
413
+ type FormShapeStateFields<TFields extends FormShapeFields<TFields>> = GetFormStates<TFields>;
414
+ declare class FormShapeState<TFields extends FormShapeFields<TFields> = Record<string, SignalForm>> extends SignalFormState<FormShapeParams<TFields>, FormShape$1<TFields>> {
415
+ readonly _host: Lazy<FormShape$1<TFields>>;
416
+ readonly _fields: FormShapeStateFields<TFields>;
417
+ constructor(parent: null | SignalFormState, fields: FormShapeStateFields<TFields>);
418
+ _childOf(parent: null | SignalFormState): FormShapeState<TFields>;
419
+ readonly _initial: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "input.schema">>;
420
+ _setInitial(monitor: Monitor, setter: FormShapeInputSetter<TFields>): void;
421
+ _patchInitial(monitor: Monitor, initials: FormShapeInput<TFields>): void;
422
+ readonly _input: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "input.schema">>;
423
+ _setInput(monitor: Monitor, setter: FormShapeInputSetter<TFields>): void;
424
+ readonly _error: import("@owanturist/signal").ReadonlySignal<FormShapeError<TFields>>;
425
+ readonly _errorVerbose: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "error.schema.verbose">>;
426
+ _setError(monitor: Monitor, setter: FormShapeErrorSetter<TFields>): void;
427
+ readonly _validateOn: import("@owanturist/signal").ReadonlySignal<FormShapeValidateOn<TFields>>;
428
+ readonly _validateOnVerbose: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "validateOn.schema.verbose">>;
429
+ _setValidateOn(monitor: Monitor, setter: FormShapeValidateOnSetter<TFields>): void;
430
+ readonly _touched: import("@owanturist/signal").ReadonlySignal<FormShapeFlag<TFields>>;
431
+ readonly _touchedVerbose: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
432
+ _setTouched(monitor: Monitor, setter: FormShapeFlagSetter<TFields>): void;
433
+ readonly _output: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "output.schema"> | null>;
434
+ readonly _outputVerbose: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "output.schema.verbose">>;
435
+ readonly _valid: import("@owanturist/signal").ReadonlySignal<FormShapeFlag<TFields>>;
436
+ readonly _validVerbose: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
437
+ readonly _invalid: import("@owanturist/signal").ReadonlySignal<FormShapeFlag<TFields>>;
438
+ readonly _invalidVerbose: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
439
+ readonly _validated: import("@owanturist/signal").ReadonlySignal<FormShapeFlag<TFields>>;
440
+ readonly _validatedVerbose: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
441
+ _forceValidated(monitor: Monitor): void;
442
+ readonly _dirty: import("@owanturist/signal").ReadonlySignal<FormShapeFlag<TFields>>;
443
+ readonly _dirtyVerbose: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
444
+ readonly _dirtyOnVerbose: import("@owanturist/signal").ReadonlySignal<GetFormShapeParam<TFields, "flag.schema.verbose">>;
445
+ _reset(monitor: Monitor, resetter: undefined | FormShapeInputSetter<TFields>): void;
446
+ _getChildren(): ReadonlyArray<SignalFormChild<FormShapeParams<TFields>>>;
447
+ }
517
448
  declare class FormShape$1<TFields extends FormShapeFields<TFields>> extends SignalForm<FormShapeParams<TFields>> {
518
- readonly _state: FormShapeState<TFields>;
519
- static _getState: typeof SignalForm._getState;
520
- readonly fields: TFields;
521
- constructor(_state: FormShapeState<TFields>);
449
+ readonly _state: FormShapeState<TFields>;
450
+ static _getState: typeof SignalForm._getState;
451
+ readonly fields: TFields;
452
+ constructor(_state: FormShapeState<TFields>);
522
453
  }
523
-
454
+ type FormShape<TFields extends FormShapeFields<TFields>> = FormShape$1<TFields>;
524
455
  interface FormShapeOptions<TFields extends FormShapeFields<TFields>> {
525
- readonly input?: FormShapeInputSetter<TFields>;
526
- readonly initial?: FormShapeInputSetter<TFields>;
527
- readonly touched?: FormShapeFlagSetter<TFields>;
528
- readonly validateOn?: FormShapeValidateOnSetter<TFields>;
529
- readonly error?: FormShapeErrorSetter<TFields>;
456
+ readonly input?: FormShapeInputSetter<TFields>;
457
+ readonly initial?: FormShapeInputSetter<TFields>;
458
+ readonly touched?: FormShapeFlagSetter<TFields>;
459
+ readonly validateOn?: FormShapeValidateOnSetter<TFields>;
460
+ readonly error?: FormShapeErrorSetter<TFields>;
530
461
  }
531
- type FormShape<TFields extends FormShapeFields<TFields>> = FormShape$1<TFields>;
532
462
  declare function FormShape<TFields extends FormShapeFields<TFields>>(fields: TFields, { input, initial, touched, validateOn, error }?: FormShapeOptions<NoInfer<TFields>>): FormShape<TFields>;
533
-
534
463
  declare function isFormShape(value: unknown): value is FormShape$1<FormShapeFields>;
535
-
536
464
  type FormListErrorVerbose<TElement extends SignalForm> = ReadonlyArray<GetFormErrorVerbose<TElement>>;
537
-
538
- type FormListErrorSetter<TElement extends SignalForm> = Setter<null | ReadonlyArray<undefined | GetFormErrorSetter<TElement>>, [
539
- FormListErrorVerbose<TElement>
540
- ]>;
541
-
465
+ type FormListErrorSetter<TElement extends SignalForm> = Setter<null | ReadonlyArray<undefined | GetFormErrorSetter<TElement>>, [FormListErrorVerbose<TElement>]>;
542
466
  type FormListFlagVerbose<TElement extends SignalForm> = ReadonlyArray<GetFormFlagVerbose<TElement>>;
543
-
544
- type FormListFlagSetter<TElement extends SignalForm> = Setter<boolean | ReadonlyArray<undefined | GetFormFlagSetter<TElement>>, [
545
- FormListFlagVerbose<TElement>
546
- ]>;
547
-
467
+ type FormListFlagSetter<TElement extends SignalForm> = Setter<boolean | ReadonlyArray<undefined | GetFormFlagSetter<TElement>>, [FormListFlagVerbose<TElement>]>;
548
468
  type FormListInput<TElement extends SignalForm> = ReadonlyArray<GetFormInput<TElement>>;
549
-
550
469
  type FormListValidateOnVerbose<TElement extends SignalForm> = ReadonlyArray<GetFormValidateOnVerbose<TElement>>;
551
-
552
- type FormListValidateOnSetter<TElement extends SignalForm> = Setter<ValidateStrategy | ReadonlyArray<undefined | GetFormValidateOnSetter<TElement>>, [
553
- FormListValidateOnVerbose<TElement>
554
- ]>;
555
-
470
+ type FormListValidateOnSetter<TElement extends SignalForm> = Setter<ValidateStrategy | ReadonlyArray<undefined | GetFormValidateOnSetter<TElement>>, [FormListValidateOnVerbose<TElement>]>;
556
471
  type FormListError<TElement extends SignalForm> = null | ReadonlyArray<GetFormError<TElement>>;
557
-
558
472
  type FormListFlag<TElement extends SignalForm> = boolean | ReadonlyArray<GetFormFlag<TElement>>;
559
-
560
- type FormListInputSetter<TElement extends SignalForm> = Setter<ReadonlyArray<GetFormInputSetter<TElement>>, [
561
- FormListInput<TElement>,
562
- FormListInput<TElement>
563
- ]>;
564
-
473
+ type FormListInputSetter<TElement extends SignalForm> = Setter<ReadonlyArray<GetFormInput<TElement>>, [FormListInput<TElement>, FormListInput<TElement>]>;
565
474
  type FormListOutput<TElement extends SignalForm> = ReadonlyArray<GetFormOutput<TElement>>;
566
-
567
475
  type FormListOutputVerbose<TElement extends SignalForm> = ReadonlyArray<GetFormOutputVerbose<TElement>>;
568
-
569
476
  type FormListValidateOn<TElement extends SignalForm> = ValidateStrategy | ReadonlyArray<GetFormValidateOn<TElement>>;
570
-
571
477
  interface FormListParams<TElement extends SignalForm> extends SignalFormParams {
572
- "input.schema": FormListInput<TElement>;
573
- "input.setter": FormListInputSetter<TElement>;
574
- "output.schema": FormListOutput<TElement>;
575
- "output.schema.verbose": FormListOutputVerbose<TElement>;
576
- "flag.setter": FormListFlagSetter<TElement>;
577
- "flag.schema": FormListFlag<TElement>;
578
- "flag.schema.verbose": FormListFlagVerbose<TElement>;
579
- "validateOn.setter": FormListValidateOnSetter<TElement>;
580
- "validateOn.schema": FormListValidateOn<TElement>;
581
- "validateOn.schema.verbose": FormListValidateOnVerbose<TElement>;
582
- "error.setter": FormListErrorSetter<TElement>;
583
- "error.schema": FormListError<TElement>;
584
- "error.schema.verbose": FormListErrorVerbose<TElement>;
585
- }
586
-
587
- type FormListElementFactoryInternal<TElement extends SignalForm> = (input: GetFormInput<TElement>, index: number) => SignalFormState<GetFormParams<TElement>>;
588
- declare class FormListState<TElement extends SignalForm = SignalForm> extends SignalFormState<FormListParams<TElement>> {
589
- private readonly _factory;
590
- readonly _initialInputs: Signal<ReadonlyArray<GetFormInput<TElement>>>;
591
- readonly _host: Lazy<FormList$1<TElement>>;
592
- readonly _elements: Signal<ReadonlyArray<SignalFormState<GetFormParams<TElement>>>>;
593
- constructor(parent: null | SignalFormState, _factory: FormListElementFactoryInternal<TElement>, _initialInputs: Signal<ReadonlyArray<GetFormInput<TElement>>>, elements?: ReadonlyArray<SignalFormState<GetFormParams<TElement>>>);
594
- _childOf(parent: null | SignalFormState): FormListState<TElement>;
595
- _getElements(monitor: Monitor): ReadonlyArray<TElement>;
596
- readonly _initial: _owanturist_signal.ReadonlySignal<FormListInput<TElement>>;
597
- _setInitial(monitor: Monitor, setter: FormListInputSetter<TElement>): void;
598
- _patchInitial(monitor: Monitor, initials: FormListInput<TElement>): void;
599
- readonly _input: _owanturist_signal.ReadonlySignal<FormListInput<TElement>>;
600
- _setInput(monitor: Monitor, setter: FormListInputSetter<TElement>): void;
601
- readonly _error: _owanturist_signal.ReadonlySignal<FormListError<TElement>>;
602
- readonly _errorVerbose: _owanturist_signal.ReadonlySignal<FormListErrorVerbose<TElement>>;
603
- _setError(monitor: Monitor, setter: FormListErrorSetter<TElement>): void;
604
- readonly _validateOn: _owanturist_signal.ReadonlySignal<FormListValidateOn<TElement>>;
605
- readonly _validateOnVerbose: _owanturist_signal.ReadonlySignal<FormListValidateOnVerbose<TElement>>;
606
- _setValidateOn(monitor: Monitor, setter: FormListValidateOnSetter<TElement>): void;
607
- readonly _touched: _owanturist_signal.ReadonlySignal<FormListFlag<TElement>>;
608
- readonly _touchedVerbose: _owanturist_signal.ReadonlySignal<FormListFlagVerbose<TElement>>;
609
- _setTouched(monitor: Monitor, setter: FormListFlagSetter<TElement>): void;
610
- readonly _output: _owanturist_signal.ReadonlySignal<FormListOutput<TElement> | null>;
611
- readonly _outputVerbose: _owanturist_signal.ReadonlySignal<FormListOutputVerbose<TElement>>;
612
- readonly _valid: _owanturist_signal.ReadonlySignal<FormListFlag<TElement>>;
613
- readonly _validVerbose: _owanturist_signal.ReadonlySignal<FormListFlagVerbose<TElement>>;
614
- readonly _invalid: _owanturist_signal.ReadonlySignal<FormListFlag<TElement>>;
615
- readonly _invalidVerbose: _owanturist_signal.ReadonlySignal<FormListFlagVerbose<TElement>>;
616
- readonly _validated: _owanturist_signal.ReadonlySignal<FormListFlag<TElement>>;
617
- readonly _validatedVerbose: _owanturist_signal.ReadonlySignal<FormListFlagVerbose<TElement>>;
618
- _forceValidated(monitor: Monitor): void;
619
- readonly _dirty: _owanturist_signal.ReadonlySignal<FormListFlag<TElement>>;
620
- readonly _dirtyVerbose: _owanturist_signal.ReadonlySignal<FormListFlagVerbose<TElement>>;
621
- readonly _dirtyOnVerbose: _owanturist_signal.ReadonlySignal<FormListFlagVerbose<TElement>>;
622
- _reset(monitor: Monitor, resetter: undefined | FormListInputSetter<TElement>): void;
623
- _getChildren<TChildParams extends SignalFormParams>(monitor: Monitor): ReadonlyArray<SignalFormChild<TChildParams, FormListParams<TElement>>>;
624
- }
625
-
478
+ "input.schema": FormListInput<TElement>;
479
+ "input.setter": FormListInputSetter<TElement>;
480
+ "output.schema": FormListOutput<TElement>;
481
+ "output.schema.verbose": FormListOutputVerbose<TElement>;
482
+ "flag.setter": FormListFlagSetter<TElement>;
483
+ "flag.schema": FormListFlag<TElement>;
484
+ "flag.schema.verbose": FormListFlagVerbose<TElement>;
485
+ "validateOn.setter": FormListValidateOnSetter<TElement>;
486
+ "validateOn.schema": FormListValidateOn<TElement>;
487
+ "validateOn.schema.verbose": FormListValidateOnVerbose<TElement>;
488
+ "error.setter": FormListErrorSetter<TElement>;
489
+ "error.schema": FormListError<TElement>;
490
+ "error.schema.verbose": FormListErrorVerbose<TElement>;
491
+ }
492
+ type FormListElementFactoryInternal<TElement extends SignalForm> = (input: GetFormInput<TElement>, index: number) => GetFormState<TElement>;
493
+ declare class FormListState<TElement extends SignalForm = SignalForm> extends SignalFormState<FormListParams<TElement>, FormList$1<TElement>> {
494
+ private readonly _factory;
495
+ readonly _initialInputs: Signal<ReadonlyArray<GetFormInput<TElement>>>;
496
+ readonly _host: Lazy<FormList$1<TElement>>;
497
+ readonly _elements: Signal<ReadonlyArray<GetFormState<TElement>>>;
498
+ constructor(parent: null | SignalFormState, _factory: FormListElementFactoryInternal<TElement>, _initialInputs: Signal<ReadonlyArray<GetFormInput<TElement>>>, elements?: ReadonlyArray<GetFormState<TElement>>);
499
+ _childOf(parent: null | SignalFormState): FormListState<TElement>;
500
+ _getElements(monitor: Monitor): ReadonlyArray<TElement>;
501
+ readonly _initial: import("@owanturist/signal").ReadonlySignal<FormListInput<TElement>>;
502
+ _setInitial(monitor: Monitor, setter: FormListInputSetter<TElement>): void;
503
+ _patchInitial(monitor: Monitor, initials: FormListInput<TElement>): void;
504
+ readonly _input: import("@owanturist/signal").ReadonlySignal<FormListInput<TElement>>;
505
+ _setInput(monitor: Monitor, setter: FormListInputSetter<TElement>): void;
506
+ readonly _error: import("@owanturist/signal").ReadonlySignal<FormListError<TElement>>;
507
+ readonly _errorVerbose: import("@owanturist/signal").ReadonlySignal<FormListErrorVerbose<TElement>>;
508
+ _setError(monitor: Monitor, setter: FormListErrorSetter<TElement>): void;
509
+ readonly _validateOn: import("@owanturist/signal").ReadonlySignal<FormListValidateOn<TElement>>;
510
+ readonly _validateOnVerbose: import("@owanturist/signal").ReadonlySignal<FormListValidateOnVerbose<TElement>>;
511
+ _setValidateOn(monitor: Monitor, setter: FormListValidateOnSetter<TElement>): void;
512
+ readonly _touched: import("@owanturist/signal").ReadonlySignal<FormListFlag<TElement>>;
513
+ readonly _touchedVerbose: import("@owanturist/signal").ReadonlySignal<FormListFlagVerbose<TElement>>;
514
+ _setTouched(monitor: Monitor, setter: FormListFlagSetter<TElement>): void;
515
+ readonly _output: import("@owanturist/signal").ReadonlySignal<FormListOutput<TElement> | null>;
516
+ readonly _outputVerbose: import("@owanturist/signal").ReadonlySignal<FormListOutputVerbose<TElement>>;
517
+ readonly _valid: import("@owanturist/signal").ReadonlySignal<FormListFlag<TElement>>;
518
+ readonly _validVerbose: import("@owanturist/signal").ReadonlySignal<FormListFlagVerbose<TElement>>;
519
+ readonly _invalid: import("@owanturist/signal").ReadonlySignal<FormListFlag<TElement>>;
520
+ readonly _invalidVerbose: import("@owanturist/signal").ReadonlySignal<FormListFlagVerbose<TElement>>;
521
+ readonly _validated: import("@owanturist/signal").ReadonlySignal<FormListFlag<TElement>>;
522
+ readonly _validatedVerbose: import("@owanturist/signal").ReadonlySignal<FormListFlagVerbose<TElement>>;
523
+ _forceValidated(monitor: Monitor): void;
524
+ readonly _dirty: import("@owanturist/signal").ReadonlySignal<FormListFlag<TElement>>;
525
+ readonly _dirtyVerbose: import("@owanturist/signal").ReadonlySignal<FormListFlagVerbose<TElement>>;
526
+ readonly _dirtyOnVerbose: import("@owanturist/signal").ReadonlySignal<FormListFlagVerbose<TElement>>;
527
+ _reset(monitor: Monitor, resetter: undefined | FormListInputSetter<TElement>): void;
528
+ _getChildren(monitor: Monitor): ReadonlyArray<SignalFormChild<FormListParams<TElement>>>;
529
+ }
626
530
  declare class FormList$1<TElement extends SignalForm> extends SignalForm<FormListParams<TElement>> {
627
- readonly _state: FormListState<TElement>;
628
- static _getState: typeof SignalForm._getState;
629
- private readonly _elements;
630
- constructor(_state: FormListState<TElement>);
631
- getElements(monitor: Monitor): ReadonlyArray<TElement>;
632
- getElements<TResult>(monitor: Monitor, select: (elements: ReadonlyArray<TElement>) => TResult): TResult;
633
- setElements(setter: Setter<ReadonlyArray<TElement>, [ReadonlyArray<TElement>, Monitor]>): void;
634
- }
635
-
531
+ readonly _state: FormListState<TElement>;
532
+ static _getState: typeof SignalForm._getState;
533
+ private readonly _elements;
534
+ constructor(_state: FormListState<TElement>);
535
+ getElements(monitor: Monitor): ReadonlyArray<TElement>;
536
+ getElements<TResult>(monitor: Monitor, select: (elements: ReadonlyArray<TElement>) => TResult): TResult;
537
+ setElements(setter: Setter<ReadonlyArray<TElement>, [ReadonlyArray<TElement>, Monitor]>): void;
538
+ }
539
+ type FormList<TElement extends SignalForm> = FormList$1<TElement>;
636
540
  type FormListElementFactory<TElement extends SignalForm> = (input: GetFormInput<TElement>, index: number) => TElement;
637
541
  interface FormListOptions<TElement extends SignalForm> {
638
- /**
639
- * @default []
640
- */
641
- readonly initial?: FormListInput<TElement>;
642
- /**
643
- * @default {@link initial}
644
- */
645
- readonly input?: FormListInput<TElement>;
646
- readonly touched?: FormListFlagSetter<TElement>;
647
- readonly validateOn?: FormListValidateOnSetter<TElement>;
648
- readonly error?: FormListErrorSetter<TElement>;
542
+ /**
543
+ * @default []
544
+ */
545
+ readonly initial?: FormListInput<TElement>;
546
+ /**
547
+ * @default {@link initial}
548
+ */
549
+ readonly input?: FormListInput<TElement>;
550
+ readonly touched?: FormListFlagSetter<TElement>;
551
+ readonly validateOn?: FormListValidateOnSetter<TElement>;
552
+ readonly error?: FormListErrorSetter<TElement>;
649
553
  }
650
- type FormList<TElement extends SignalForm> = FormList$1<TElement>;
651
554
  declare function FormList<TElement extends SignalForm>(factory: FormListElementFactory<TElement>, { input, initial, touched, validateOn, error }?: FormListOptions<TElement>): FormList<TElement>;
652
-
653
555
  declare function isFormList(value: unknown): value is FormList$1<SignalForm>;
654
-
655
556
  type IsEqualType<TLeft, TRight> = [TLeft, TRight] extends [TRight, TLeft] ? true : false;
656
-
657
557
  interface FormOptionalSchema<TEnabled, TElement> {
658
- readonly enabled: TEnabled;
659
- readonly element: TElement;
558
+ readonly enabled: TEnabled;
559
+ readonly element: TElement;
660
560
  }
661
-
662
561
  type FormOptionalParam<TEnabled extends SignalForm, TElement extends SignalForm, TKey extends keyof SignalFormParams, TConcise = never> = TConcise | FormOptionalSchema<TConcise | GetFormParam<TEnabled, TKey>, TConcise | GetFormParam<TElement, TKey>>;
663
-
664
562
  type FormOptionalErrorVerbose<TEnabled extends SignalForm, TElement extends SignalForm> = FormOptionalParam<TEnabled, TElement, "error.schema.verbose">;
665
-
666
- type FormOptionalErrorSetter<TEnabled extends SignalForm, TElement extends SignalForm> = Setter<null | Partial<FormOptionalSchema<GetFormParam<TEnabled, "error.setter">, GetFormParam<TElement, "error.setter">>>, [
667
- FormOptionalErrorVerbose<TEnabled, TElement>
668
- ]>;
669
-
563
+ type FormOptionalErrorSetter<TEnabled extends SignalForm, TElement extends SignalForm> = Setter<null | Partial<FormOptionalSchema<GetFormParam<TEnabled, "error.setter">, GetFormParam<TElement, "error.setter">>>, [FormOptionalErrorVerbose<TEnabled, TElement>]>;
670
564
  type FormOptionalFlagVerbose<TEnabled extends SignalForm, TElement extends SignalForm> = FormOptionalParam<TEnabled, TElement, "flag.schema.verbose">;
671
-
672
- type FormOptionalFlagSetter<TEnabled extends SignalForm, TElement extends SignalForm> = Setter<boolean | Partial<FormOptionalSchema<GetFormParam<TEnabled, "flag.setter">, GetFormParam<TElement, "flag.setter">>>, [
673
- FormOptionalFlagVerbose<TEnabled, TElement>
674
- ]>;
675
-
565
+ type FormOptionalFlagSetter<TEnabled extends SignalForm, TElement extends SignalForm> = Setter<boolean | Partial<FormOptionalSchema<GetFormParam<TEnabled, "flag.setter">, GetFormParam<TElement, "flag.setter">>>, [FormOptionalFlagVerbose<TEnabled, TElement>]>;
676
566
  type FormOptionalInput<TEnabled extends SignalForm, TElement extends SignalForm> = FormOptionalSchema<GetFormParam<TEnabled, "input.schema">, GetFormParam<TElement, "input.schema">>;
677
-
678
- type FormOptionalInputSetter<TEnabled extends SignalForm, TElement extends SignalForm> = Setter<Partial<FormOptionalSchema<GetFormParam<TEnabled, "input.setter">, GetFormParam<TElement, "input.setter">>>, [
679
- FormOptionalInput<TEnabled, TElement>,
680
- FormOptionalInput<TEnabled, TElement>
681
- ]>;
682
-
567
+ type FormOptionalInputSetter<TEnabled extends SignalForm, TElement extends SignalForm> = Setter<Partial<FormOptionalSchema<GetFormParam<TEnabled, "input.setter">, GetFormParam<TElement, "input.setter">>>, [FormOptionalInput<TEnabled, TElement>, FormOptionalInput<TEnabled, TElement>]>;
683
568
  type FormOptionalValidateOnVerbose<TEnabled extends SignalForm, TElement extends SignalForm> = FormOptionalParam<TEnabled, TElement, "validateOn.schema.verbose">;
684
-
685
- type FormOptionalValidateOnSetter<TEnabled extends SignalForm, TElement extends SignalForm> = Setter<ValidateStrategy | Partial<FormOptionalSchema<GetFormParam<TEnabled, "validateOn.setter">, GetFormParam<TElement, "validateOn.setter">>>, [
686
- FormOptionalValidateOnVerbose<TEnabled, TElement>
687
- ]>;
688
-
569
+ type FormOptionalValidateOnSetter<TEnabled extends SignalForm, TElement extends SignalForm> = Setter<ValidateStrategy | Partial<FormOptionalSchema<GetFormParam<TEnabled, "validateOn.setter">, GetFormParam<TElement, "validateOn.setter">>>, [FormOptionalValidateOnVerbose<TEnabled, TElement>]>;
689
570
  type FormOptionalError<TEnabled extends SignalForm, TElement extends SignalForm> = FormOptionalParam<TEnabled, TElement, "error.schema", null>;
690
-
691
571
  type FormOptionalFlag<TEnabled extends SignalForm, TElement extends SignalForm> = FormOptionalParam<TEnabled, TElement, "flag.schema", boolean>;
692
-
693
572
  type FormOptionalOutput<TElement extends SignalForm> = undefined | GetFormParam<TElement, "output.schema">;
694
-
695
573
  type FormOptionalOutputVerbose<TEnabled extends SignalForm, TElement extends SignalForm> = FormOptionalParam<TEnabled, TElement, "output.schema.verbose">;
696
-
697
574
  type FormOptionalValidateOn<TEnabled extends SignalForm, TElement extends SignalForm> = FormOptionalParam<TEnabled, TElement, "validateOn.schema", ValidateStrategy>;
698
-
699
575
  interface FormOptionalParams<TEnabled extends SignalForm, TElement extends SignalForm> extends SignalFormParams {
700
- "input.schema": FormOptionalInput<TEnabled, TElement>;
701
- "input.setter": FormOptionalInputSetter<TEnabled, TElement>;
702
- "output.schema": FormOptionalOutput<TElement>;
703
- "output.schema.verbose": FormOptionalOutputVerbose<TEnabled, TElement>;
704
- "flag.setter": FormOptionalFlagSetter<TEnabled, TElement>;
705
- "flag.schema": FormOptionalFlag<TEnabled, TElement>;
706
- "flag.schema.verbose": FormOptionalFlagVerbose<TEnabled, TElement>;
707
- "validateOn.setter": FormOptionalValidateOnSetter<TEnabled, TElement>;
708
- "validateOn.schema": FormOptionalValidateOn<TEnabled, TElement>;
709
- "validateOn.schema.verbose": FormOptionalValidateOnVerbose<TEnabled, TElement>;
710
- "error.setter": FormOptionalErrorSetter<TEnabled, TElement>;
711
- "error.schema": FormOptionalError<TEnabled, TElement>;
712
- "error.schema.verbose": FormOptionalErrorVerbose<TEnabled, TElement>;
713
- }
714
-
715
- declare class FormOptionalState<TEnabled extends SignalForm, TElement extends SignalForm> extends SignalFormState<FormOptionalParams<TEnabled, TElement>> {
716
- readonly _host: Lazy<FormOptional$1<TEnabled, TElement>>;
717
- readonly _enabled: SignalFormState<GetFormParams<TEnabled>>;
718
- readonly _element: SignalFormState<GetFormParams<TElement>>;
719
- constructor(parent: null | SignalFormState, enabled: SignalFormState<GetFormParams<TEnabled>>, element: SignalFormState<GetFormParams<TElement>>);
720
- private _isEnabled;
721
- _getEnabledElement(monitor: Monitor): undefined | SignalFormState<GetFormParams<TElement>>;
722
- _childOf(parent: null | SignalFormState): FormOptionalState<TEnabled, TElement>;
723
- private _toConcise;
724
- private _toVerbose;
725
- readonly _initial: _owanturist_signal.ReadonlySignal<FormOptionalInput<TEnabled, TElement>>;
726
- _setInitial(monitor: Monitor, setter: FormOptionalInputSetter<TEnabled, TElement>): void;
727
- _patchInitial(monitor: Monitor, initial: FormOptionalInput<TEnabled, TElement>): void;
728
- readonly _input: _owanturist_signal.ReadonlySignal<FormOptionalInput<TEnabled, TElement>>;
729
- _setInput(monitor: Monitor, setter: FormOptionalInputSetter<TEnabled, TElement>): void;
730
- readonly _error: _owanturist_signal.ReadonlySignal<FormOptionalError<TEnabled, TElement>>;
731
- readonly _errorVerbose: _owanturist_signal.ReadonlySignal<FormOptionalErrorVerbose<TEnabled, TElement>>;
732
- _setError(monitor: Monitor, setter: FormOptionalErrorSetter<TEnabled, TElement>): void;
733
- readonly _validateOn: _owanturist_signal.ReadonlySignal<FormOptionalValidateOn<TEnabled, TElement>>;
734
- readonly _validateOnVerbose: _owanturist_signal.ReadonlySignal<FormOptionalValidateOnVerbose<TEnabled, TElement>>;
735
- _setValidateOn(monitor: Monitor, setter: FormOptionalValidateOnSetter<TEnabled, TElement>): void;
736
- readonly _touched: _owanturist_signal.ReadonlySignal<FormOptionalFlag<TEnabled, TElement>>;
737
- readonly _touchedVerbose: _owanturist_signal.ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
738
- _setTouched(monitor: Monitor, setter: FormOptionalFlagSetter<TEnabled, TElement>): void;
739
- readonly _output: _owanturist_signal.ReadonlySignal<FormOptionalOutput<TElement> | null>;
740
- readonly _outputVerbose: _owanturist_signal.ReadonlySignal<FormOptionalOutputVerbose<TEnabled, TElement>>;
741
- readonly _valid: _owanturist_signal.ReadonlySignal<FormOptionalFlag<TEnabled, TElement>>;
742
- readonly _validVerbose: _owanturist_signal.ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
743
- readonly _invalid: _owanturist_signal.ReadonlySignal<FormOptionalFlag<TEnabled, TElement>>;
744
- readonly _invalidVerbose: _owanturist_signal.ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
745
- readonly _validated: _owanturist_signal.ReadonlySignal<FormOptionalFlag<TEnabled, TElement>>;
746
- readonly _validatedVerbose: _owanturist_signal.ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
747
- _forceValidated(monitor: Monitor): void;
748
- readonly _dirty: _owanturist_signal.ReadonlySignal<FormOptionalFlag<TEnabled, TElement>>;
749
- readonly _dirtyVerbose: _owanturist_signal.ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
750
- readonly _dirtyOnVerbose: _owanturist_signal.ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
751
- _reset(monitor: Monitor, resetter: undefined | FormOptionalInputSetter<TEnabled, TElement>): void;
752
- _getChildren<TChildParams extends SignalFormParams>(monitor: Monitor): ReadonlyArray<SignalFormChild<TChildParams, FormOptionalParams<TEnabled, TElement>>>;
753
- }
754
-
576
+ "input.schema": FormOptionalInput<TEnabled, TElement>;
577
+ "input.setter": FormOptionalInputSetter<TEnabled, TElement>;
578
+ "output.schema": FormOptionalOutput<TElement>;
579
+ "output.schema.verbose": FormOptionalOutputVerbose<TEnabled, TElement>;
580
+ "flag.setter": FormOptionalFlagSetter<TEnabled, TElement>;
581
+ "flag.schema": FormOptionalFlag<TEnabled, TElement>;
582
+ "flag.schema.verbose": FormOptionalFlagVerbose<TEnabled, TElement>;
583
+ "validateOn.setter": FormOptionalValidateOnSetter<TEnabled, TElement>;
584
+ "validateOn.schema": FormOptionalValidateOn<TEnabled, TElement>;
585
+ "validateOn.schema.verbose": FormOptionalValidateOnVerbose<TEnabled, TElement>;
586
+ "error.setter": FormOptionalErrorSetter<TEnabled, TElement>;
587
+ "error.schema": FormOptionalError<TEnabled, TElement>;
588
+ "error.schema.verbose": FormOptionalErrorVerbose<TEnabled, TElement>;
589
+ }
590
+ declare class FormOptionalState<TEnabled extends SignalForm, TElement extends SignalForm> extends SignalFormState<FormOptionalParams<TEnabled, TElement>, FormOptional$1<TEnabled, TElement>> {
591
+ readonly _host: Lazy<FormOptional$1<TEnabled, TElement>>;
592
+ readonly _enabled: GetFormState<TEnabled>;
593
+ readonly _element: GetFormState<TElement>;
594
+ constructor(parent: null | SignalFormState, enabled: GetFormState<TEnabled>, element: GetFormState<TElement>);
595
+ private _isEnabled;
596
+ _getEnabledElement(monitor: Monitor): undefined | GetFormState<TElement>;
597
+ _childOf(parent: null | SignalFormState): FormOptionalState<TEnabled, TElement>;
598
+ private _toConcise;
599
+ readonly _initial: import("@owanturist/signal").ReadonlySignal<FormOptionalInput<TEnabled, TElement>>;
600
+ _setInitial(monitor: Monitor, setter: FormOptionalInputSetter<TEnabled, TElement>): void;
601
+ _patchInitial(monitor: Monitor, initial: FormOptionalInput<TEnabled, TElement>): void;
602
+ readonly _input: import("@owanturist/signal").ReadonlySignal<FormOptionalInput<TEnabled, TElement>>;
603
+ _setInput(monitor: Monitor, setter: FormOptionalInputSetter<TEnabled, TElement>): void;
604
+ readonly _error: import("@owanturist/signal").ReadonlySignal<FormOptionalError<TEnabled, TElement>>;
605
+ readonly _errorVerbose: import("@owanturist/signal").ReadonlySignal<FormOptionalErrorVerbose<TEnabled, TElement>>;
606
+ _setError(monitor: Monitor, setter: FormOptionalErrorSetter<TEnabled, TElement>): void;
607
+ readonly _validateOn: import("@owanturist/signal").ReadonlySignal<FormOptionalValidateOn<TEnabled, TElement>>;
608
+ readonly _validateOnVerbose: import("@owanturist/signal").ReadonlySignal<FormOptionalValidateOnVerbose<TEnabled, TElement>>;
609
+ _setValidateOn(monitor: Monitor, setter: FormOptionalValidateOnSetter<TEnabled, TElement>): void;
610
+ readonly _touched: import("@owanturist/signal").ReadonlySignal<FormOptionalFlag<TEnabled, TElement>>;
611
+ readonly _touchedVerbose: import("@owanturist/signal").ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
612
+ _setTouched(monitor: Monitor, setter: FormOptionalFlagSetter<TEnabled, TElement>): void;
613
+ readonly _output: import("@owanturist/signal").ReadonlySignal<FormOptionalOutput<TElement> | null>;
614
+ readonly _outputVerbose: import("@owanturist/signal").ReadonlySignal<FormOptionalOutputVerbose<TEnabled, TElement>>;
615
+ readonly _valid: import("@owanturist/signal").ReadonlySignal<FormOptionalFlag<TEnabled, TElement>>;
616
+ readonly _validVerbose: import("@owanturist/signal").ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
617
+ readonly _invalid: import("@owanturist/signal").ReadonlySignal<FormOptionalFlag<TEnabled, TElement>>;
618
+ readonly _invalidVerbose: import("@owanturist/signal").ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
619
+ readonly _validated: import("@owanturist/signal").ReadonlySignal<FormOptionalFlag<TEnabled, TElement>>;
620
+ readonly _validatedVerbose: import("@owanturist/signal").ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
621
+ _forceValidated(monitor: Monitor): void;
622
+ readonly _dirty: import("@owanturist/signal").ReadonlySignal<FormOptionalFlag<TEnabled, TElement>>;
623
+ readonly _dirtyVerbose: import("@owanturist/signal").ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
624
+ readonly _dirtyOnVerbose: import("@owanturist/signal").ReadonlySignal<FormOptionalFlagVerbose<TEnabled, TElement>>;
625
+ _reset(monitor: Monitor, resetter: undefined | FormOptionalInputSetter<TEnabled, TElement>): void;
626
+ _getChildren(monitor: Monitor): ReadonlyArray<SignalFormChild<FormOptionalParams<TEnabled, TElement>>>;
627
+ }
755
628
  declare class FormOptional$1<TEnabled extends SignalForm, TElement extends SignalForm> extends SignalForm<FormOptionalParams<TEnabled, TElement>> {
756
- readonly _state: FormOptionalState<TEnabled, TElement>;
757
- static _getState: typeof SignalForm._getState;
758
- readonly enabled: TEnabled;
759
- readonly element: TElement;
760
- constructor(_state: FormOptionalState<TEnabled, TElement>);
761
- getEnabledElement(monitor: Monitor): undefined | TElement;
762
- }
763
-
764
- interface FormOptionalOptions<TEnabled extends SignalForm, TElement extends SignalForm> {
765
- input?: FormOptionalInputSetter<TEnabled, TElement>;
766
- initial?: FormOptionalInputSetter<TEnabled, TElement>;
767
- touched?: FormOptionalFlagSetter<TEnabled, TElement>;
768
- validateOn?: FormOptionalValidateOnSetter<TEnabled, TElement>;
769
- error?: FormOptionalErrorSetter<TEnabled, TElement>;
629
+ readonly _state: FormOptionalState<TEnabled, TElement>;
630
+ static _getState: typeof SignalForm._getState;
631
+ readonly enabled: TEnabled;
632
+ readonly element: TElement;
633
+ constructor(_state: FormOptionalState<TEnabled, TElement>);
634
+ getEnabledElement(monitor: Monitor): undefined | TElement;
770
635
  }
771
636
  type FormOptional<TEnabled extends SignalForm, TElement extends SignalForm> = FormOptional$1<TEnabled, TElement>;
637
+ interface FormOptionalOptions<TEnabled extends SignalForm, TElement extends SignalForm> {
638
+ input?: FormOptionalInputSetter<TEnabled, TElement>;
639
+ initial?: FormOptionalInputSetter<TEnabled, TElement>;
640
+ touched?: FormOptionalFlagSetter<TEnabled, TElement>;
641
+ validateOn?: FormOptionalValidateOnSetter<TEnabled, TElement>;
642
+ error?: FormOptionalErrorSetter<TEnabled, TElement>;
643
+ }
772
644
  declare function FormOptional<TEnabled extends SignalForm, TElement extends SignalForm>(enabled: IsEqualType<GetFormParam<TEnabled, "output.schema">, boolean> extends true ? TEnabled : never, element: TElement, { input, initial, touched, validateOn, error }?: FormOptionalOptions<TEnabled, TElement>): FormOptional<TEnabled, TElement>;
773
-
774
645
  declare function isFormOptional(anything: unknown): anything is FormOptional$1<SignalForm, SignalForm>;
775
-
776
646
  type FormSwitchBranches<TKind extends SignalForm> = GetFormParam<TKind, "output.schema"> extends string ? Record<GetFormParam<TKind, "output.schema">, SignalForm> : never;
777
-
778
647
  interface FormSwitchConciseSchema<TActive, TBranch> {
779
- readonly active: TActive;
780
- readonly branch: TBranch;
648
+ readonly active: TActive;
649
+ readonly branch: TBranch;
781
650
  }
782
-
783
- type Compute<Obj> = unknown & {
784
- [K in keyof Obj]: Obj[K];
785
- };
786
-
651
+ type Compute<Obj> = unknown & { [K in keyof Obj]: Obj[K]; };
787
652
  interface FormSwitchVerboseSchema<TActive, TBranches> {
788
- readonly active: TActive;
789
- readonly branches: TBranches;
790
- }
791
-
792
- type GetFormSwitchBranchesParam<TBranches extends FormSwitchBranches<SignalForm>, TKey extends keyof SignalFormParams> = Compute<{
793
- readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], TKey>;
794
- }>;
795
-
653
+ readonly active: TActive;
654
+ readonly branches: TBranches;
655
+ }
656
+ type GetFormSwitchBranchesParam<TBranches extends FormSwitchBranches<SignalForm>, TKey extends keyof SignalFormParams> = Compute<{ readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], TKey>; }>;
796
657
  type FormSwitchVerboseParam<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>, TKey extends keyof SignalFormParams> = Compute<FormSwitchVerboseSchema<GetFormParam<TKind, TKey>, GetFormSwitchBranchesParam<TBranches, TKey>>>;
797
-
798
658
  type FormSwitchErrorVerbose<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = FormSwitchVerboseParam<TKind, TBranches, "error.schema.verbose">;
799
-
800
659
  interface FormSwitchBranch<TKind, TValue> {
801
- readonly kind: TKind;
802
- readonly value: TValue;
803
- }
804
-
805
- type FormSwitchBranchUnion<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>, TKey extends keyof SignalFormParams> = {
806
- [TBranch in GetFormOutput<TKind>]: FormSwitchBranch<TBranch, GetFormParam<TBranches[TBranch], TKey>>;
807
- }[GetFormOutput<TKind>];
808
-
809
- type FormSwitchErrorSetter<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = Setter<null | Partial<FormSwitchConciseSchema<GetFormParam<TKind, "error.setter">, Setter<null | FormSwitchBranchUnion<TKind, TBranches, "error.setter">, [
810
- FormSwitchBranchUnion<TKind, TBranches, "error.schema.verbose">
811
- ]>>> | Partial<FormSwitchVerboseSchema<GetFormParam<TKind, "error.setter">, Setter<null | Partial<GetFormSwitchBranchesParam<TBranches, "error.setter">>, [
812
- GetFormSwitchBranchesParam<TBranches, "error.schema.verbose">
813
- ]>>>, [
814
- FormSwitchErrorVerbose<TKind, TBranches>
815
- ]>;
816
-
660
+ readonly kind: TKind;
661
+ readonly value: TValue;
662
+ }
663
+ type FormSwitchBranchUnion<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>, TKey extends keyof SignalFormParams> = { [TBranch in GetFormOutput<TKind>]: FormSwitchBranch<TBranch, GetFormParam<TBranches[TBranch], TKey>>; }[GetFormOutput<TKind>];
664
+ type FormSwitchErrorSetter<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = Setter<null | Partial<FormSwitchConciseSchema<GetFormParam<TKind, "error.setter">, Setter<null | FormSwitchBranchUnion<TKind, TBranches, "error.setter">, [FormSwitchBranchUnion<TKind, TBranches, "error.schema.verbose">]>>> | Partial<FormSwitchVerboseSchema<GetFormParam<TKind, "error.setter">, Setter<null | Partial<GetFormSwitchBranchesParam<TBranches, "error.setter">>, [GetFormSwitchBranchesParam<TBranches, "error.schema.verbose">]>>>, [FormSwitchErrorVerbose<TKind, TBranches>]>;
817
665
  type FormSwitchFlagVerbose<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = FormSwitchVerboseParam<TKind, TBranches, "flag.schema.verbose">;
818
-
819
- type FormSwitchFlagSetter<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = Setter<boolean | Partial<FormSwitchConciseSchema<GetFormParam<TKind, "flag.setter">, Setter<boolean | FormSwitchBranchUnion<TKind, TBranches, "flag.setter">, [
820
- FormSwitchBranchUnion<TKind, TBranches, "flag.schema.verbose">
821
- ]>>> | Partial<FormSwitchVerboseSchema<GetFormParam<TKind, "flag.setter">, Setter<boolean | Partial<GetFormSwitchBranchesParam<TBranches, "flag.setter">>, [
822
- GetFormSwitchBranchesParam<TBranches, "flag.schema.verbose">
823
- ]>>>, [
824
- FormSwitchFlagVerbose<TKind, TBranches>
825
- ]>;
826
-
666
+ type FormSwitchFlagSetter<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = Setter<boolean | Partial<FormSwitchConciseSchema<GetFormParam<TKind, "flag.setter">, Setter<boolean | FormSwitchBranchUnion<TKind, TBranches, "flag.setter">, [FormSwitchBranchUnion<TKind, TBranches, "flag.schema.verbose">]>>> | Partial<FormSwitchVerboseSchema<GetFormParam<TKind, "flag.setter">, Setter<boolean | Partial<GetFormSwitchBranchesParam<TBranches, "flag.setter">>, [GetFormSwitchBranchesParam<TBranches, "flag.schema.verbose">]>>>, [FormSwitchFlagVerbose<TKind, TBranches>]>;
827
667
  type FormSwitchInput<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = FormSwitchVerboseParam<TKind, TBranches, "input.schema">;
828
-
829
- type FormSwitchInputSetter<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = Setter<Partial<FormSwitchVerboseSchema<GetFormParam<TKind, "input.setter">, Setter<Partial<GetFormSwitchBranchesParam<TBranches, "input.setter">>, [
830
- GetFormSwitchBranchesParam<TBranches, "input.schema">,
831
- GetFormSwitchBranchesParam<TBranches, "input.schema">
832
- ]>>>, [
833
- FormSwitchInput<TKind, TBranches>,
834
- FormSwitchInput<TKind, TBranches>
835
- ]>;
836
-
668
+ type FormSwitchInputSetter<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = Setter<Partial<FormSwitchVerboseSchema<GetFormParam<TKind, "input.setter">, Setter<Partial<GetFormSwitchBranchesParam<TBranches, "input.setter">>, [GetFormSwitchBranchesParam<TBranches, "input.schema">, GetFormSwitchBranchesParam<TBranches, "input.schema">]>>>, [FormSwitchInput<TKind, TBranches>, FormSwitchInput<TKind, TBranches>]>;
837
669
  type FormSwitchValidateOnVerbose<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = FormSwitchVerboseParam<TKind, TBranches, "validateOn.schema.verbose">;
838
-
839
- type FormSwitchValidateOnSetter<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = Setter<ValidateStrategy | Partial<FormSwitchConciseSchema<GetFormParam<TKind, "validateOn.setter">, Setter<ValidateStrategy | FormSwitchBranchUnion<TKind, TBranches, "validateOn.setter">, [
840
- FormSwitchBranchUnion<TKind, TBranches, "validateOn.schema.verbose">
841
- ]>>> | Partial<FormSwitchVerboseSchema<GetFormParam<TKind, "validateOn.setter">, Setter<ValidateStrategy | Partial<GetFormSwitchBranchesParam<TBranches, "validateOn.setter">>, [
842
- GetFormSwitchBranchesParam<TBranches, "validateOn.schema.verbose">
843
- ]>>>, [
844
- FormSwitchValidateOnVerbose<TKind, TBranches>
845
- ]>;
846
-
847
- type FormSwitchActiveBranch<TBranches extends FormSwitchBranches<SignalForm>> = {
848
- [TBranch in keyof TBranches]: FormSwitchBranch<TBranch, TBranches[TBranch]>;
849
- }[keyof TBranches];
850
-
670
+ type FormSwitchValidateOnSetter<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = Setter<ValidateStrategy | Partial<FormSwitchConciseSchema<GetFormParam<TKind, "validateOn.setter">, Setter<ValidateStrategy | FormSwitchBranchUnion<TKind, TBranches, "validateOn.setter">, [FormSwitchBranchUnion<TKind, TBranches, "validateOn.schema.verbose">]>>> | Partial<FormSwitchVerboseSchema<GetFormParam<TKind, "validateOn.setter">, Setter<ValidateStrategy | Partial<GetFormSwitchBranchesParam<TBranches, "validateOn.setter">>, [GetFormSwitchBranchesParam<TBranches, "validateOn.schema.verbose">]>>>, [FormSwitchValidateOnVerbose<TKind, TBranches>]>;
671
+ type FormSwitchActiveBranch<TBranches extends FormSwitchBranches<SignalForm>> = { [TBranch in keyof TBranches]: FormSwitchBranch<TBranch, TBranches[TBranch]>; }[keyof TBranches];
851
672
  type FormSwitchConciseParam<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>, TKey extends keyof SignalFormParams, TConcise> = TConcise | FormSwitchConciseSchema<TConcise | GetFormParam<TKind, TKey>, TConcise | FormSwitchBranchUnion<TKind, TBranches, TKey>>;
852
-
853
673
  type FormSwitchError<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = FormSwitchConciseParam<TKind, TBranches, "error.schema", null>;
854
-
855
674
  type FormSwitchFlag<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = FormSwitchConciseParam<TKind, TBranches, "flag.schema", boolean>;
856
-
857
675
  type FormSwitchOutput<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = FormSwitchBranchUnion<TKind, TBranches, "output.schema">;
858
-
859
676
  type FormSwitchOutputVerbose<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = FormSwitchVerboseParam<TKind, TBranches, "output.schema.verbose">;
860
-
861
677
  type FormSwitchValidateOn<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = FormSwitchConciseParam<TKind, TBranches, "validateOn.schema", ValidateStrategy>;
862
-
863
678
  interface FormSwitchParams<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> extends SignalFormParams {
864
- "input.schema": FormSwitchInput<TKind, TBranches>;
865
- "input.setter": FormSwitchInputSetter<TKind, TBranches>;
866
- "output.schema": FormSwitchOutput<TKind, TBranches>;
867
- "output.schema.verbose": FormSwitchOutputVerbose<TKind, TBranches>;
868
- "flag.setter": FormSwitchFlagSetter<TKind, TBranches>;
869
- "flag.schema": FormSwitchFlag<TKind, TBranches>;
870
- "flag.schema.verbose": FormSwitchFlagVerbose<TKind, TBranches>;
871
- "validateOn.setter": FormSwitchValidateOnSetter<TKind, TBranches>;
872
- "validateOn.schema": FormSwitchValidateOn<TKind, TBranches>;
873
- "validateOn.schema.verbose": FormSwitchValidateOnVerbose<TKind, TBranches>;
874
- "error.setter": FormSwitchErrorSetter<TKind, TBranches>;
875
- "error.schema": FormSwitchError<TKind, TBranches>;
876
- "error.schema.verbose": FormSwitchErrorVerbose<TKind, TBranches>;
877
- }
878
-
879
- type FormSwitchStateBranches<TBranches> = {
880
- [TBranch in keyof TBranches]: SignalFormState<GetFormParams<TBranches[TBranch]>>;
881
- };
882
- type ActiveSwitchStateBranch<TBranches> = FormSwitchBranch<keyof TBranches, FormSwitchStateBranches<TBranches>[keyof TBranches]>;
883
- declare class FormSwitchState<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> extends SignalFormState<FormSwitchParams<TKind, TBranches>> {
884
- readonly _host: Lazy<FormSwitch$1<TKind, TBranches>>;
885
- readonly _active: SignalFormState<GetFormParams<TKind>>;
886
- readonly _branches: FormSwitchStateBranches<TBranches>;
887
- constructor(parent: null | SignalFormState, active: SignalFormState<GetFormParams<TKind>>, branches: FormSwitchStateBranches<TBranches>);
888
- _getActiveBranch(monitor: Monitor): undefined | ActiveSwitchStateBranch<TBranches>;
889
- private _toConcise;
890
- private _toVerbose;
891
- _childOf(parent: null | SignalFormState): FormSwitchState<TKind, TBranches>;
892
- readonly _initial: _owanturist_signal.ReadonlySignal<{
893
- readonly active: GetFormParam<TKind, "input.schema">;
894
- readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "input.schema">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "input.schema">; }[K]; };
895
- }>;
896
- _setInitial(monitor: Monitor, setter: FormSwitchInputSetter<TKind, TBranches>): void;
897
- _patchInitial(monitor: Monitor, initial: FormSwitchInput<TKind, TBranches>): void;
898
- readonly _input: _owanturist_signal.ReadonlySignal<{
899
- readonly active: GetFormParam<TKind, "input.schema">;
900
- readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "input.schema">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "input.schema">; }[K]; };
901
- }>;
902
- _setInput(monitor: Monitor, setter: FormSwitchInputSetter<TKind, TBranches>): void;
903
- readonly _error: _owanturist_signal.ReadonlySignal<FormSwitchError<TKind, TBranches>>;
904
- readonly _errorVerbose: _owanturist_signal.ReadonlySignal<{
905
- readonly active: GetFormParam<TKind, "error.schema.verbose">;
906
- readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "error.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "error.schema.verbose">; }[K]; };
907
- }>;
908
- _setError(monitor: Monitor, setter: FormSwitchErrorSetter<TKind, TBranches>): void;
909
- readonly _validateOn: _owanturist_signal.ReadonlySignal<FormSwitchValidateOn<TKind, TBranches>>;
910
- readonly _validateOnVerbose: _owanturist_signal.ReadonlySignal<{
911
- readonly active: GetFormParam<TKind, "validateOn.schema.verbose">;
912
- readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "validateOn.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "validateOn.schema.verbose">; }[K]; };
913
- }>;
914
- _setValidateOn(monitor: Monitor, setter: FormSwitchValidateOnSetter<TKind, TBranches>): void;
915
- readonly _touched: _owanturist_signal.ReadonlySignal<FormSwitchFlag<TKind, TBranches>>;
916
- readonly _touchedVerbose: _owanturist_signal.ReadonlySignal<{
917
- readonly active: GetFormParam<TKind, "flag.schema.verbose">;
918
- readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
919
- }>;
920
- _setTouched(monitor: Monitor, setter: FormSwitchFlagSetter<TKind, TBranches>): void;
921
- readonly _output: _owanturist_signal.ReadonlySignal<FormSwitchOutput<TKind, TBranches> | null>;
922
- readonly _outputVerbose: _owanturist_signal.ReadonlySignal<{
923
- readonly active: GetFormParam<TKind, "output.schema.verbose">;
924
- readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "output.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "output.schema.verbose">; }[K]; };
925
- }>;
926
- readonly _valid: _owanturist_signal.ReadonlySignal<FormSwitchFlag<TKind, TBranches>>;
927
- readonly _validVerbose: _owanturist_signal.ReadonlySignal<{
928
- readonly active: GetFormParam<TKind, "flag.schema.verbose">;
929
- readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
930
- }>;
931
- readonly _invalid: _owanturist_signal.ReadonlySignal<FormSwitchFlag<TKind, TBranches>>;
932
- readonly _invalidVerbose: _owanturist_signal.ReadonlySignal<{
933
- readonly active: GetFormParam<TKind, "flag.schema.verbose">;
934
- readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
935
- }>;
936
- readonly _validated: _owanturist_signal.ReadonlySignal<FormSwitchFlag<TKind, TBranches>>;
937
- readonly _validatedVerbose: _owanturist_signal.ReadonlySignal<{
938
- readonly active: GetFormParam<TKind, "flag.schema.verbose">;
939
- readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
940
- }>;
941
- _forceValidated(monitor: Monitor): void;
942
- readonly _dirty: _owanturist_signal.ReadonlySignal<FormSwitchFlag<TKind, TBranches>>;
943
- readonly _dirtyVerbose: _owanturist_signal.ReadonlySignal<{
944
- readonly active: GetFormParam<TKind, "flag.schema.verbose">;
945
- readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
946
- }>;
947
- readonly _dirtyOnVerbose: _owanturist_signal.ReadonlySignal<{
948
- readonly active: GetFormParam<TKind, "flag.schema.verbose">;
949
- readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
950
- }>;
951
- _reset(monitor: Monitor, resetter: undefined | FormSwitchInputSetter<TKind, TBranches>): void;
952
- _getChildren<TChildParams extends SignalFormParams>(monitor: Monitor): ReadonlyArray<SignalFormChild<TChildParams, FormSwitchParams<TKind, TBranches>>>;
953
- }
954
-
679
+ "input.schema": FormSwitchInput<TKind, TBranches>;
680
+ "input.setter": FormSwitchInputSetter<TKind, TBranches>;
681
+ "output.schema": FormSwitchOutput<TKind, TBranches>;
682
+ "output.schema.verbose": FormSwitchOutputVerbose<TKind, TBranches>;
683
+ "flag.setter": FormSwitchFlagSetter<TKind, TBranches>;
684
+ "flag.schema": FormSwitchFlag<TKind, TBranches>;
685
+ "flag.schema.verbose": FormSwitchFlagVerbose<TKind, TBranches>;
686
+ "validateOn.setter": FormSwitchValidateOnSetter<TKind, TBranches>;
687
+ "validateOn.schema": FormSwitchValidateOn<TKind, TBranches>;
688
+ "validateOn.schema.verbose": FormSwitchValidateOnVerbose<TKind, TBranches>;
689
+ "error.setter": FormSwitchErrorSetter<TKind, TBranches>;
690
+ "error.schema": FormSwitchError<TKind, TBranches>;
691
+ "error.schema.verbose": FormSwitchErrorVerbose<TKind, TBranches>;
692
+ }
693
+ type FormSwitchStateBranches<TBranches extends SignalFormRecord<TBranches>> = GetFormStates<TBranches>;
694
+ type ActiveSwitchStateBranch<TBranches extends SignalFormRecord<TBranches>> = FormSwitchBranch<keyof TBranches, FormSwitchStateBranches<TBranches>[keyof TBranches]>;
695
+ declare class FormSwitchState<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> extends SignalFormState<FormSwitchParams<TKind, TBranches>, FormSwitch$1<TKind, TBranches>> {
696
+ readonly _host: Lazy<FormSwitch$1<TKind, TBranches>>;
697
+ readonly _active: GetFormState<TKind>;
698
+ readonly _branches: FormSwitchStateBranches<TBranches>;
699
+ constructor(parent: null | SignalFormState, active: GetFormState<TKind>, branches: FormSwitchStateBranches<TBranches>);
700
+ _getActiveBranch(monitor: Monitor): undefined | ActiveSwitchStateBranch<TBranches>;
701
+ private _toConcise;
702
+ private _toVerbose;
703
+ _childOf(parent: null | SignalFormState): FormSwitchState<TKind, TBranches>;
704
+ readonly _initial: import("@owanturist/signal").ReadonlySignal<{
705
+ readonly active: GetFormParam<TKind, "input.schema">;
706
+ readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "input.schema">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "input.schema">; }[K]; };
707
+ }>;
708
+ _setInitial(monitor: Monitor, setter: FormSwitchInputSetter<TKind, TBranches>): void;
709
+ _patchInitial(monitor: Monitor, initial: FormSwitchInput<TKind, TBranches>): void;
710
+ readonly _input: import("@owanturist/signal").ReadonlySignal<{
711
+ readonly active: GetFormParam<TKind, "input.schema">;
712
+ readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "input.schema">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "input.schema">; }[K]; };
713
+ }>;
714
+ _setInput(monitor: Monitor, setter: FormSwitchInputSetter<TKind, TBranches>): void;
715
+ readonly _error: import("@owanturist/signal").ReadonlySignal<FormSwitchError<TKind, TBranches>>;
716
+ readonly _errorVerbose: import("@owanturist/signal").ReadonlySignal<{
717
+ readonly active: GetFormParam<TKind, "error.schema.verbose">;
718
+ readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "error.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "error.schema.verbose">; }[K]; };
719
+ }>;
720
+ _setError(monitor: Monitor, setter: FormSwitchErrorSetter<TKind, TBranches>): void;
721
+ readonly _validateOn: import("@owanturist/signal").ReadonlySignal<FormSwitchValidateOn<TKind, TBranches>>;
722
+ readonly _validateOnVerbose: import("@owanturist/signal").ReadonlySignal<{
723
+ readonly active: GetFormParam<TKind, "validateOn.schema.verbose">;
724
+ readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "validateOn.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "validateOn.schema.verbose">; }[K]; };
725
+ }>;
726
+ _setValidateOn(monitor: Monitor, setter: FormSwitchValidateOnSetter<TKind, TBranches>): void;
727
+ readonly _touched: import("@owanturist/signal").ReadonlySignal<FormSwitchFlag<TKind, TBranches>>;
728
+ readonly _touchedVerbose: import("@owanturist/signal").ReadonlySignal<{
729
+ readonly active: GetFormParam<TKind, "flag.schema.verbose">;
730
+ readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
731
+ }>;
732
+ _setTouched(monitor: Monitor, setter: FormSwitchFlagSetter<TKind, TBranches>): void;
733
+ readonly _output: import("@owanturist/signal").ReadonlySignal<FormSwitchOutput<TKind, TBranches> | null>;
734
+ readonly _outputVerbose: import("@owanturist/signal").ReadonlySignal<{
735
+ readonly active: GetFormParam<TKind, "output.schema.verbose">;
736
+ readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "output.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "output.schema.verbose">; }[K]; };
737
+ }>;
738
+ readonly _valid: import("@owanturist/signal").ReadonlySignal<FormSwitchFlag<TKind, TBranches>>;
739
+ readonly _validVerbose: import("@owanturist/signal").ReadonlySignal<{
740
+ readonly active: GetFormParam<TKind, "flag.schema.verbose">;
741
+ readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
742
+ }>;
743
+ readonly _invalid: import("@owanturist/signal").ReadonlySignal<FormSwitchFlag<TKind, TBranches>>;
744
+ readonly _invalidVerbose: import("@owanturist/signal").ReadonlySignal<{
745
+ readonly active: GetFormParam<TKind, "flag.schema.verbose">;
746
+ readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
747
+ }>;
748
+ readonly _validated: import("@owanturist/signal").ReadonlySignal<FormSwitchFlag<TKind, TBranches>>;
749
+ readonly _validatedVerbose: import("@owanturist/signal").ReadonlySignal<{
750
+ readonly active: GetFormParam<TKind, "flag.schema.verbose">;
751
+ readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
752
+ }>;
753
+ _forceValidated(monitor: Monitor): void;
754
+ readonly _dirty: import("@owanturist/signal").ReadonlySignal<FormSwitchFlag<TKind, TBranches>>;
755
+ readonly _dirtyVerbose: import("@owanturist/signal").ReadonlySignal<{
756
+ readonly active: GetFormParam<TKind, "flag.schema.verbose">;
757
+ readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
758
+ }>;
759
+ readonly _dirtyOnVerbose: import("@owanturist/signal").ReadonlySignal<{
760
+ readonly active: GetFormParam<TKind, "flag.schema.verbose">;
761
+ readonly branches: { [K in keyof { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }]: { readonly [TBranch in keyof TBranches]: GetFormParam<TBranches[TBranch], "flag.schema.verbose">; }[K]; };
762
+ }>;
763
+ _reset(monitor: Monitor, resetter: undefined | FormSwitchInputSetter<TKind, TBranches>): void;
764
+ _getChildren(monitor: Monitor): ReadonlyArray<SignalFormChild<FormSwitchParams<TKind, TBranches>>>;
765
+ }
955
766
  declare class FormSwitch$1<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> extends SignalForm<FormSwitchParams<TKind, TBranches>> {
956
- readonly _state: FormSwitchState<TKind, TBranches>;
957
- static _getState: typeof SignalForm._getState;
958
- readonly active: TKind;
959
- readonly branches: Readonly<TBranches>;
960
- constructor(_state: FormSwitchState<TKind, TBranches>);
961
- getActiveBranch(monitor: Monitor): undefined | FormSwitchActiveBranch<TBranches>;
962
- }
963
-
964
- interface FormSwitchOptions<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> {
965
- input?: FormSwitchInputSetter<TKind, TBranches>;
966
- initial?: FormSwitchInputSetter<TKind, TBranches>;
967
- touched?: FormSwitchFlagSetter<TKind, TBranches>;
968
- validateOn?: FormSwitchValidateOnSetter<TKind, TBranches>;
969
- error?: FormSwitchErrorSetter<TKind, TBranches>;
767
+ readonly _state: FormSwitchState<TKind, TBranches>;
768
+ static _getState: typeof SignalForm._getState;
769
+ readonly active: TKind;
770
+ readonly branches: Readonly<TBranches>;
771
+ constructor(_state: FormSwitchState<TKind, TBranches>);
772
+ getActiveBranch(monitor: Monitor): undefined | FormSwitchActiveBranch<TBranches>;
970
773
  }
971
774
  type FormSwitch<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> = FormSwitch$1<TKind, TBranches>;
775
+ interface FormSwitchOptions<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>> {
776
+ input?: FormSwitchInputSetter<TKind, TBranches>;
777
+ initial?: FormSwitchInputSetter<TKind, TBranches>;
778
+ touched?: FormSwitchFlagSetter<TKind, TBranches>;
779
+ validateOn?: FormSwitchValidateOnSetter<TKind, TBranches>;
780
+ error?: FormSwitchErrorSetter<TKind, TBranches>;
781
+ }
972
782
  declare function FormSwitch<TKind extends SignalForm, TBranches extends FormSwitchBranches<TKind>>(active: TKind, branches: IsEqualType<GetFormParam<TKind, "output.schema">, keyof TBranches> extends true ? TBranches : never, { input, initial, touched, validateOn, error }?: FormSwitchOptions<TKind, TBranches>): FormSwitch<TKind, TBranches>;
973
-
974
783
  declare function isFormSwitch(anything: unknown): anything is FormSwitch$1<SignalForm, FormSwitchBranches<SignalForm>>;
975
-
976
- export { FormList, type FormListElementFactory, type FormListError, type FormListErrorSetter, type FormListErrorVerbose, type FormListFlag, type FormListFlagSetter, type FormListFlagVerbose, type FormListInput, type FormListInputSetter, type FormListOptions, type FormListOutput, type FormListOutputVerbose, type FormListParams, type FormListValidateOn, type FormListValidateOnSetter, type FormListValidateOnVerbose, FormOptional, type FormOptionalError, type FormOptionalErrorSetter, type FormOptionalErrorVerbose, type FormOptionalFlag, type FormOptionalFlagSetter, type FormOptionalFlagVerbose, type FormOptionalInput, type FormOptionalInputSetter, type FormOptionalOptions, type FormOptionalOutput, type FormOptionalOutputVerbose, type FormOptionalParams, type FormOptionalSchema, type FormOptionalValidateOn, type FormOptionalValidateOnSetter, type FormOptionalValidateOnVerbose, FormShape, type FormShapeError, type FormShapeErrorSetter, type FormShapeErrorVerbose, type FormShapeFields, type FormShapeFlag, type FormShapeFlagSetter, type FormShapeFlagVerbose, type FormShapeInput, type FormShapeInputSetter, type FormShapeOptions, type FormShapeOutput, type FormShapeOutputVerbose, type FormShapeParams, type FormShapeValidateOn, type FormShapeValidateOnSetter, type FormShapeValidateOnVerbose, FormSwitch, type FormSwitchActiveBranch, type FormSwitchBranch, type FormSwitchBranches, type FormSwitchConciseSchema, type FormSwitchError, type FormSwitchErrorSetter, type FormSwitchErrorVerbose, type FormSwitchFlag, type FormSwitchFlagSetter, type FormSwitchFlagVerbose, type FormSwitchInput, type FormSwitchInputSetter, type FormSwitchOptions, type FormSwitchOutput, type FormSwitchOutputVerbose, type FormSwitchParams, type FormSwitchValidateOn, type FormSwitchValidateOnSetter, type FormSwitchValidateOnVerbose, type FormSwitchVerboseSchema, FormUnit, type FormUnitErrorSetter, type FormUnitFlagSetter, type FormUnitInputSetter, type FormUnitOptions, type FormUnitParams, type FormUnitSchemaOptions, type FormUnitTransformedOptions, type FormUnitTransformer, type FormUnitValidateOnSetter, type FormUnitValidatedOptions, type FormUnitValidator, type GetFormError, type GetFormErrorSetter, type GetFormErrorVerbose, type GetFormFlag, type GetFormFlagSetter, type GetFormFlagVerbose, type GetFormInput, type GetFormInputSetter, type GetFormOutput, type GetFormOutputVerbose, type GetFormParam, type GetFormShapeParam, type GetFormSwitchBranchesParam, type GetFormValidateOn, type GetFormValidateOnSetter, type GetFormValidateOnVerbose, type Result, SignalForm, type SignalFormParams, VALIDATE_ON_CHANGE, VALIDATE_ON_INIT, VALIDATE_ON_SUBMIT, VALIDATE_ON_TOUCH, type ValidateStrategy, type ZodLikeError, type ZodLikeIssue, type ZodLikeSafeParseResult, type ZodLikeSchema, isFormList, isFormOptional, isFormShape, isFormSwitch, isFormUnit, isSignalForm, zodLikeParse };
784
+ export { FormList, type FormListElementFactory, type FormListError, type FormListErrorSetter, type FormListErrorVerbose, type FormListFlag, type FormListFlagSetter, type FormListFlagVerbose, type FormListInput, type FormListInputSetter, type FormListOptions, type FormListOutput, type FormListOutputVerbose, type FormListParams, type FormListValidateOn, type FormListValidateOnSetter, type FormListValidateOnVerbose, FormOptional, type FormOptionalError, type FormOptionalErrorSetter, type FormOptionalErrorVerbose, type FormOptionalFlag, type FormOptionalFlagSetter, type FormOptionalFlagVerbose, type FormOptionalInput, type FormOptionalInputSetter, type FormOptionalOptions, type FormOptionalOutput, type FormOptionalOutputVerbose, type FormOptionalParams, type FormOptionalSchema, type FormOptionalValidateOn, type FormOptionalValidateOnSetter, type FormOptionalValidateOnVerbose, FormShape, type FormShapeError, type FormShapeErrorSetter, type FormShapeErrorVerbose, type FormShapeFields, type FormShapeFlag, type FormShapeFlagSetter, type FormShapeFlagVerbose, type FormShapeInput, type FormShapeInputSetter, type FormShapeOptions, type FormShapeOutput, type FormShapeOutputVerbose, type FormShapeParams, type FormShapeValidateOn, type FormShapeValidateOnSetter, type FormShapeValidateOnVerbose, FormSwitch, type FormSwitchActiveBranch, type FormSwitchBranch, type FormSwitchBranches, type FormSwitchConciseSchema, type FormSwitchError, type FormSwitchErrorSetter, type FormSwitchErrorVerbose, type FormSwitchFlag, type FormSwitchFlagSetter, type FormSwitchFlagVerbose, type FormSwitchInput, type FormSwitchInputSetter, type FormSwitchOptions, type FormSwitchOutput, type FormSwitchOutputVerbose, type FormSwitchParams, type FormSwitchValidateOn, type FormSwitchValidateOnSetter, type FormSwitchValidateOnVerbose, type FormSwitchVerboseSchema, FormUnit, type FormUnitErrorSetter, type FormUnitFlagSetter, type FormUnitInputSetter, type FormUnitOptions, type FormUnitParams, type FormUnitSchemaOptions, type FormUnitTransformedOptions, type FormUnitTransformer, type FormUnitValidateOnSetter, type FormUnitValidatedOptions, type FormUnitValidator, type GetFormError, type GetFormErrorSetter, type GetFormErrorVerbose, type GetFormFlag, type GetFormFlagSetter, type GetFormFlagVerbose, type GetFormInput, type GetFormInputSetter, type GetFormOutput, type GetFormOutputVerbose, type GetFormParam, type GetFormShapeParam, type GetFormSwitchBranchesParam, type GetFormValidateOn, type GetFormValidateOnSetter, type GetFormValidateOnVerbose, type Result, type SignalForm, type SignalFormParams, VALIDATE_ON_CHANGE, VALIDATE_ON_INIT, VALIDATE_ON_SUBMIT, VALIDATE_ON_TOUCH, type ValidateStrategy, type ZodLikeError, type ZodLikeIssue, type ZodLikeSafeParseResult, type ZodLikeSchema, isFormList, isFormOptional, isFormShape, isFormSwitch, isFormUnit, isSignalForm, type zodLikeParse };
785
+ //# sourceMappingURL=index.d.cts.map