@formisch/solid 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -8
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -194,23 +194,27 @@ declare const INTERNAL: "~internal";
|
|
|
194
194
|
/**
|
|
195
195
|
* Checks if a type is `any`.
|
|
196
196
|
*/
|
|
197
|
-
type IsAny<
|
|
197
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
198
198
|
/**
|
|
199
199
|
* Checks if a type is `never`.
|
|
200
200
|
*/
|
|
201
|
-
type IsNever<
|
|
201
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
202
202
|
/**
|
|
203
203
|
* Constructs a type that is maybe a promise.
|
|
204
204
|
*/
|
|
205
|
-
type MaybePromise<
|
|
205
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
206
206
|
/**
|
|
207
207
|
* Makes all properties deeply optional.
|
|
208
208
|
*/
|
|
209
|
-
type DeepPartial<TValue> = TValue extends Record<PropertyKey, unknown> | readonly unknown[] ? { [
|
|
209
|
+
type DeepPartial<TValue> = TValue extends Record<PropertyKey, unknown> | readonly unknown[] ? { [TKey in keyof TValue]?: DeepPartial<TValue[TKey]> | undefined } : TValue | undefined;
|
|
210
210
|
/**
|
|
211
211
|
* Makes all value properties optional.
|
|
212
|
+
*
|
|
213
|
+
* Hint: For dynamic arrays, only plain objects and nested arrays have their
|
|
214
|
+
* values made optional. Primitives and class instances are kept as-is to avoid
|
|
215
|
+
* types like `(string | undefined)[]`.
|
|
212
216
|
*/
|
|
213
|
-
type PartialValues<TValue> = TValue extends Record<PropertyKey, unknown> | readonly unknown[] ? { [
|
|
217
|
+
type PartialValues<TValue> = TValue extends readonly (infer TItem)[] ? number extends TValue["length"] ? (TItem extends Record<PropertyKey, unknown> | readonly unknown[] ? { [TKey in keyof TItem]: PartialValues<TItem[TKey]> } : TItem)[] : { [TKey in keyof TValue]: PartialValues<TValue[TKey]> } : TValue extends Record<PropertyKey, unknown> ? { [TKey in keyof TValue]: PartialValues<TValue[TKey]> } : TValue | undefined;
|
|
214
218
|
//#endregion
|
|
215
219
|
//#region src/types/form.d.ts
|
|
216
220
|
/**
|
|
@@ -245,7 +249,7 @@ interface InternalFormStore<TSchema extends Schema = Schema> extends InternalObj
|
|
|
245
249
|
/**
|
|
246
250
|
* The element of the form.
|
|
247
251
|
*/
|
|
248
|
-
element?: HTMLFormElement;
|
|
252
|
+
element?: HTMLFormElement | undefined;
|
|
249
253
|
/**
|
|
250
254
|
* The number of active validators.
|
|
251
255
|
*/
|
|
@@ -319,7 +323,7 @@ type KeyOf<TValue> = IsAny<TValue> extends true ? never : TValue extends readonl
|
|
|
319
323
|
* properties that do not exist in all union options are not accessible
|
|
320
324
|
* and result in "any" when accessed.
|
|
321
325
|
*/
|
|
322
|
-
type MergeUnion<
|
|
326
|
+
type MergeUnion<TValue> = { [TKey in KeyOf<TValue>]: TValue extends Record<TKey, infer TItem> ? TItem : never };
|
|
323
327
|
/**
|
|
324
328
|
* Lazily evaluates only the first valid path segment based on the given value.
|
|
325
329
|
*/
|
|
@@ -651,7 +655,7 @@ interface ResetFieldConfig<TSchema extends Schema, TFieldPath extends RequiredPa
|
|
|
651
655
|
* The new initial input to reset the field to. If provided, replaces the
|
|
652
656
|
* field's initial input.
|
|
653
657
|
*/
|
|
654
|
-
readonly initialInput?: DeepPartial<PathValue<v.InferInput<TSchema>, TFieldPath
|
|
658
|
+
readonly initialInput?: DeepPartial<PathValue<v.InferInput<TSchema>, TFieldPath>> | undefined;
|
|
655
659
|
}
|
|
656
660
|
/**
|
|
657
661
|
* Resets a specific field or the entire form to its initial state. Provides
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formisch/solid",
|
|
3
3
|
"description": "The modular and type-safe form library for SolidJS",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Fabian Hiller",
|
|
7
7
|
"homepage": "https://formisch.dev",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"typescript": "^5.8.3",
|
|
58
58
|
"valibot": "^1.2.0",
|
|
59
59
|
"vitest": "3.2.4",
|
|
60
|
+
"@formisch/core": "0.6.2",
|
|
60
61
|
"@formisch/eslint-config": "0.1.0",
|
|
61
|
-
"@formisch/methods": "0.7.0"
|
|
62
|
-
"@formisch/core": "0.6.1"
|
|
62
|
+
"@formisch/methods": "0.7.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"solid-js": "^1.6.0",
|