@formisch/qwik 0.9.1 → 0.9.3
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
|
@@ -201,23 +201,27 @@ declare const INTERNAL: "~internal";
|
|
|
201
201
|
/**
|
|
202
202
|
* Checks if a type is `any`.
|
|
203
203
|
*/
|
|
204
|
-
type IsAny<
|
|
204
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
205
205
|
/**
|
|
206
206
|
* Checks if a type is `never`.
|
|
207
207
|
*/
|
|
208
|
-
type IsNever<
|
|
208
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
209
209
|
/**
|
|
210
210
|
* Constructs a type that is maybe a promise.
|
|
211
211
|
*/
|
|
212
|
-
type MaybePromise<
|
|
212
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
213
213
|
/**
|
|
214
214
|
* Makes all properties deeply optional.
|
|
215
215
|
*/
|
|
216
|
-
type DeepPartial<TValue> = TValue extends
|
|
216
|
+
type DeepPartial<TValue> = TValue extends Record<PropertyKey, unknown> | readonly unknown[] ? { [TKey in keyof TValue]?: DeepPartial<TValue[TKey]> | undefined } : TValue | undefined;
|
|
217
217
|
/**
|
|
218
218
|
* Makes all value properties optional.
|
|
219
|
+
*
|
|
220
|
+
* Hint: For dynamic arrays, only plain objects and nested arrays have their
|
|
221
|
+
* values made optional. Primitives and class instances are kept as-is to avoid
|
|
222
|
+
* types like `(string | undefined)[]`.
|
|
219
223
|
*/
|
|
220
|
-
type PartialValues<TValue> = TValue extends readonly
|
|
224
|
+
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;
|
|
221
225
|
//#endregion
|
|
222
226
|
//#region src/types/form.d.ts
|
|
223
227
|
/**
|
|
@@ -262,7 +266,7 @@ interface InternalFormStore<TSchema extends Schema = Schema> extends InternalObj
|
|
|
262
266
|
/**
|
|
263
267
|
* The element of the form.
|
|
264
268
|
*/
|
|
265
|
-
element?: HTMLFormElement;
|
|
269
|
+
element?: HTMLFormElement | undefined;
|
|
266
270
|
/**
|
|
267
271
|
* The number of active validators.
|
|
268
272
|
*/
|
|
@@ -328,7 +332,7 @@ type KeyOf<TValue> = IsAny<TValue> extends true ? never : TValue extends readonl
|
|
|
328
332
|
* properties that do not exist in all union options are not accessible
|
|
329
333
|
* and result in "any" when accessed.
|
|
330
334
|
*/
|
|
331
|
-
type MergeUnion<
|
|
335
|
+
type MergeUnion<TValue> = { [TKey in KeyOf<TValue>]: TValue extends Record<TKey, infer TItem> ? TItem : never };
|
|
332
336
|
/**
|
|
333
337
|
* Lazily evaluates only the first valid path segment based on the given value.
|
|
334
338
|
*/
|
|
@@ -660,7 +664,7 @@ interface ResetFieldConfig<TSchema extends Schema, TFieldPath extends RequiredPa
|
|
|
660
664
|
* The new initial input to reset the field to. If provided, replaces the
|
|
661
665
|
* field's initial input.
|
|
662
666
|
*/
|
|
663
|
-
readonly initialInput?: DeepPartial<PathValue<v.InferInput<TSchema>, TFieldPath
|
|
667
|
+
readonly initialInput?: DeepPartial<PathValue<v.InferInput<TSchema>, TFieldPath>> | undefined;
|
|
664
668
|
}
|
|
665
669
|
/**
|
|
666
670
|
* 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/qwik",
|
|
3
3
|
"description": "The modular and type-safe form library for Qwik",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Fabian Hiller",
|
|
7
7
|
"homepage": "https://formisch.dev",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"valibot": "^1.2.0",
|
|
48
48
|
"vite": "7.0.4",
|
|
49
49
|
"vite-tsconfig-paths": "^5.1.4",
|
|
50
|
-
"@formisch/
|
|
50
|
+
"@formisch/core": "0.6.2",
|
|
51
51
|
"@formisch/methods": "0.7.0",
|
|
52
|
-
"@formisch/
|
|
52
|
+
"@formisch/eslint-config": "0.1.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@qwik.dev/core": ">=2",
|