@regle/core 1.3.0-beta.1 → 1.3.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.
@@ -19,22 +19,19 @@ type ExcludeByType<T, U> = { [K in keyof T as T[K] extends U ? never : K]: T[K]
19
19
  type PrimitiveTypes = string | number | boolean | bigint | Date | File;
20
20
  type isRecordLiteral<T extends unknown> = NonNullable<T> extends Date | File ? false : NonNullable<T> extends Record<string, any> ? true : false;
21
21
  type NoInferLegacy<A extends any> = [A][A extends any ? 0 : never];
22
-
23
22
  //#endregion
24
23
  //#region src/types/utils/Array.types.d.ts
25
24
  type ArrayElement<T> = T extends Array<infer U> ? U : never;
26
-
27
25
  //#endregion
28
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/primitive.d.ts
26
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/primitive.d.ts
29
27
  /**
30
28
  Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
31
29
 
32
30
  @category Type
33
31
  */
34
32
  type Primitive = null | undefined | string | number | boolean | symbol | bigint;
35
-
36
33
  //#endregion
37
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/observable-like.d.ts
34
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/observable-like.d.ts
38
35
  declare global {
39
36
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
40
37
  interface SymbolConstructor {
@@ -42,8 +39,6 @@ declare global {
42
39
  }
43
40
  }
44
41
 
45
- //#endregion
46
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/union-to-intersection.d.ts
47
42
  /**
48
43
  @remarks
49
44
  The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
@@ -55,6 +50,8 @@ As well, some guidance on making an `Observable` to not include `closed` propert
55
50
  @category Observable
56
51
  */
57
52
 
53
+ //#endregion
54
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/union-to-intersection.d.ts
58
55
  /**
59
56
  Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
60
57
 
@@ -100,7 +97,7 @@ type Intersection = UnionToIntersection<Union>;
100
97
 
101
98
  @category Type
102
99
  */
103
- type UnionToIntersection$1<Union> = (
100
+ type UnionToIntersection<Union> = (
104
101
  // `extends unknown` is always going to be the case and is used to convert the
105
102
  // `Union` into a [distributive conditional
106
103
  // type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
@@ -115,9 +112,8 @@ Union extends unknown
115
112
  ) extends ((mergedIntersection: infer Intersection) => void)
116
113
  // The `& Union` is to allow indexing by the resulting type
117
114
  ? Intersection & Union : never;
118
-
119
115
  //#endregion
120
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/empty-object.d.ts
116
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/empty-object.d.ts
121
117
  declare const emptyObjectSymbol: unique symbol;
122
118
 
123
119
  /**
@@ -166,9 +162,8 @@ type Fail = IsEmptyObject<null>; //=> false
166
162
  @category Object
167
163
  */
168
164
  type IsEmptyObject<T> = T extends EmptyObject ? true : false;
169
-
170
165
  //#endregion
171
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/optional-keys-of.d.ts
166
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/optional-keys-of.d.ts
172
167
  /**
173
168
  Extract all optional keys from the given type.
174
169
 
@@ -204,11 +199,9 @@ const update2: UpdateOperation<User> = {
204
199
  */
205
200
  type OptionalKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
206
201
  ? (keyof { [Key in keyof BaseType as BaseType extends Record<Key, BaseType[Key]> ? never : Key]: never }) & (keyof BaseType) // Intersect with `keyof BaseType` to ensure result of `OptionalKeysOf<BaseType>` is always assignable to `keyof BaseType`
207
- : never;
208
-
202
+ : never; // Should never happen
209
203
  //#endregion
210
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/required-keys-of.d.ts
211
- // Should never happen
204
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/required-keys-of.d.ts
212
205
  /**
213
206
  Extract all required keys from the given type.
214
207
 
@@ -234,12 +227,10 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
234
227
  @category Utilities
235
228
  */
236
229
  type RequiredKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
237
- ? Exclude<keyof BaseType, OptionalKeysOf<BaseType>> : never;
230
+ ? Exclude<keyof BaseType, OptionalKeysOf<BaseType>> : never; // Should never happen
238
231
 
239
232
  //#endregion
240
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/is-never.d.ts
241
- // Should never happen
242
-
233
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/is-never.d.ts
243
234
  /**
244
235
  Returns a boolean for whether the given type is `never`.
245
236
 
@@ -282,9 +273,8 @@ endIfEqual('abc', '123');
282
273
  @category Utilities
283
274
  */
284
275
  type IsNever$1<T> = [T] extends [never] ? true : false;
285
-
286
276
  //#endregion
287
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/if-never.d.ts
277
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/if-never.d.ts
288
278
  /**
289
279
  An if-else-like type that resolves depending on whether the given type is `never`.
290
280
 
@@ -304,10 +294,9 @@ type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
304
294
  @category Type Guard
305
295
  @category Utilities
306
296
  */
307
- type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (IsNever$1<T> extends true ? TypeIfNever : TypeIfNotNever);
308
-
297
+ type IfNever$1<T, TypeIfNever = true, TypeIfNotNever = false> = (IsNever$1<T> extends true ? TypeIfNever : TypeIfNotNever);
309
298
  //#endregion
310
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/is-any.d.ts
299
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/is-any.d.ts
311
300
  // Can eventually be replaced with the built-in once this library supports
312
301
  // TS5.4+ only. Tracked in https://github.com/sindresorhus/type-fest/issues/848
313
302
  type NoInfer<T> = T extends infer U ? U : never;
@@ -341,19 +330,18 @@ const anyA = get(anyObject, 'a');
341
330
  @category Utilities
342
331
  */
343
332
  type IsAny$1<T> = 0 extends 1 & NoInfer<T> ? true : false;
344
-
345
333
  //#endregion
346
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/internal/keys.d.ts
334
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/internal/keys.d.ts
347
335
  /**
348
336
  Disallows any of the given keys.
349
337
  */
350
338
  type RequireNone<KeysType extends PropertyKey> = Partial<Record<KeysType, never>>;
351
339
 
352
- //#endregion
353
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/simplify.d.ts
354
340
  /**
355
341
  Utility type to retrieve only literal keys from type.
356
342
  */
343
+ //#endregion
344
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/simplify.d.ts
357
345
  /**
358
346
  Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
359
347
 
@@ -412,9 +400,8 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
412
400
  @category Object
413
401
  */
414
402
  type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
415
-
416
403
  //#endregion
417
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/omit-index-signature.d.ts
404
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/omit-index-signature.d.ts
418
405
  /**
419
406
  Omit any index signatures from the given object type, leaving only explicitly defined properties.
420
407
 
@@ -506,9 +493,8 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
506
493
  @category Object
507
494
  */
508
495
  type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
509
-
510
496
  //#endregion
511
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/pick-index-signature.d.ts
497
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/pick-index-signature.d.ts
512
498
  /**
513
499
  Pick only index signatures from the given object type, leaving out all explicitly defined properties.
514
500
 
@@ -555,9 +541,8 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
555
541
  @category Object
556
542
  */
557
543
  type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
558
-
559
544
  //#endregion
560
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/merge.d.ts
545
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/merge.d.ts
561
546
  // Merges two objects without worrying about index signatures.
562
547
  type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source;
563
548
 
@@ -596,9 +581,8 @@ export type FooBar = Merge<Foo, Bar>;
596
581
  @category Object
597
582
  */
598
583
  type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
599
-
600
584
  //#endregion
601
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/if-any.d.ts
585
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/if-any.d.ts
602
586
  /**
603
587
  An if-else-like type that resolves depending on whether the given type is `any`.
604
588
 
@@ -618,10 +602,9 @@ type ShouldBeBar = IfAny<'not any', 'foo', 'bar'>;
618
602
  @category Type Guard
619
603
  @category Utilities
620
604
  */
621
- type IfAny<T, TypeIfAny = true, TypeIfNotAny = false> = (IsAny$1<T> extends true ? TypeIfAny : TypeIfNotAny);
622
-
605
+ type IfAny$1<T, TypeIfAny = true, TypeIfNotAny = false> = (IsAny$1<T> extends true ? TypeIfAny : TypeIfNotAny);
623
606
  //#endregion
624
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/internal/type.d.ts
607
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/internal/type.d.ts
625
608
  /**
626
609
  Matches any primitive, `void`, `Date`, or `RegExp` value.
627
610
  */
@@ -671,12 +654,29 @@ IsNever$1<T> extends true ? false : T extends any ? [U] extends [T] ? false : tr
671
654
  // In some cases `Result` will return `false | true` which is `boolean`,
672
655
  // that means `T` has at least two types and it's a union type,
673
656
  // so we will return `true` instead of `boolean`.
674
- ? boolean extends Result ? true : Result : never;
657
+ ? boolean extends Result ? true : Result : never; // Should never happen
675
658
 
676
- //#endregion
677
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/internal/object.d.ts
678
- // Should never happen
659
+ /**
660
+ An if-else-like type that resolves depending on whether the given type is `any` or `never`.
661
+
662
+ @example
663
+ ```
664
+ // When `T` is a NOT `any` or `never` (like `string`) => Returns `IfNotAnyOrNever` branch
665
+ type A = IfNotAnyOrNever<string, 'VALID', 'IS_ANY', 'IS_NEVER'>;
666
+ //=> 'VALID'
667
+
668
+ // When `T` is `any` => Returns `IfAny` branch
669
+ type B = IfNotAnyOrNever<any, 'VALID', 'IS_ANY', 'IS_NEVER'>;
670
+ //=> 'IS_ANY'
679
671
 
672
+ // When `T` is `never` => Returns `IfNever` branch
673
+ type C = IfNotAnyOrNever<never, 'VALID', 'IS_ANY', 'IS_NEVER'>;
674
+ //=> 'IS_NEVER'
675
+ ```
676
+ */
677
+ type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = IsAny$1<T> extends true ? IfAny : IsNever$1<T> extends true ? IfNever : IfNotAnyOrNever;
678
+ //#endregion
679
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/internal/object.d.ts
680
680
  /**
681
681
  Merges user specified options with default options.
682
682
 
@@ -729,11 +729,10 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
729
729
  // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
730
730
  ```
731
731
  */
732
- type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = IfAny<SpecifiedOptions, Defaults, IfNever<SpecifiedOptions, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? Extract<SpecifiedOptions[Key], undefined> extends never ? Key : never : Key]: SpecifiedOptions[Key] }> & Required<Options>> // `& Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
732
+ type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = IfAny$1<SpecifiedOptions, Defaults, IfNever$1<SpecifiedOptions, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? Extract<SpecifiedOptions[Key], undefined> extends never ? Key : never : Key]: SpecifiedOptions[Key] }> & Required<Options>> // `& Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
733
733
  >>;
734
-
735
734
  //#endregion
736
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/require-exactly-one.d.ts
735
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/require-exactly-one.d.ts
737
736
  /**
738
737
  Create a type that requires exactly one of the given keys and disallows more. The remaining keys are kept as is.
739
738
 
@@ -763,10 +762,10 @@ const responder: RequireExactlyOne<Responder, 'text' | 'json'> = {
763
762
 
764
763
  @category Object
765
764
  */
766
- type RequireExactlyOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = { [Key in KeysType]: (Required<Pick<ObjectType, Key>> & Partial<Record<Exclude<KeysType, Key>, never>>) }[KeysType] & Omit<ObjectType, KeysType>;
767
-
765
+ type RequireExactlyOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, IfNever$1<KeysType, never, _RequireExactlyOne<ObjectType, IfAny$1<KeysType, keyof ObjectType, KeysType>>>>;
766
+ type _RequireExactlyOne<ObjectType, KeysType extends keyof ObjectType> = { [Key in KeysType]: (Required<Pick<ObjectType, Key>> & Partial<Record<Exclude<KeysType, Key>, never>>) }[KeysType] & Omit<ObjectType, KeysType>;
768
767
  //#endregion
769
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/require-one-or-none.d.ts
768
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/require-one-or-none.d.ts
770
769
  /**
771
770
  Create a type that requires exactly one of the given keys and disallows more, or none of the given keys. The remaining keys are kept as is.
772
771
 
@@ -797,11 +796,10 @@ const responder3: Responder = {
797
796
 
798
797
  @category Object
799
798
  */
800
- type RequireOneOrNone<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = (RequireExactlyOne<ObjectType, KeysType> | RequireNone<KeysType>) & Omit<ObjectType, KeysType>;
801
-
799
+ type RequireOneOrNone<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, IfNever$1<KeysType, ObjectType, _RequireOneOrNone<ObjectType, IfAny$1<KeysType, keyof ObjectType, KeysType>>>>;
800
+ type _RequireOneOrNone<ObjectType, KeysType extends keyof ObjectType> = (RequireExactlyOne<ObjectType, KeysType> | RequireNone<KeysType>) & Omit<ObjectType, KeysType>; // Ignore unspecified keys.
802
801
  //#endregion
803
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/partial-deep.d.ts
804
- // Ignore unspecified keys.
802
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/partial-deep.d.ts
805
803
  /**
806
804
  @see {@link PartialDeep}
807
805
  */
@@ -918,9 +916,8 @@ type PartialReadonlySetDeep<T, Options extends Required<PartialDeepOptions>> = {
918
916
  Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
919
917
  */
920
918
  type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = (ObjectType extends ((...arguments_: any) => unknown) ? (...arguments_: Parameters<ObjectType>) => ReturnType<ObjectType> : {}) & ({ [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options> });
921
-
922
919
  //#endregion
923
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/required-deep.d.ts
920
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/required-deep.d.ts
924
921
  type ExcludeUndefined<T> = Exclude<T, undefined>;
925
922
 
926
923
  /**
@@ -970,9 +967,8 @@ type RequiredDeep<T, E extends ExcludeUndefined<T> = ExcludeUndefined<T>> = E ex
970
967
  : RequiredObjectDeep<E> // Tuples behave properly
971
968
  : RequiredObjectDeep<E> : unknown;
972
969
  type RequiredObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectType]-?: RequiredDeep<ObjectType[KeyType]> };
973
-
974
970
  //#endregion
975
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/union-to-tuple.d.ts
971
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/union-to-tuple.d.ts
976
972
  /**
977
973
  Returns the last element of a union type.
978
974
 
@@ -982,7 +978,7 @@ type Last = LastOfUnion<1 | 2 | 3>;
982
978
  //=> 3
983
979
  ```
984
980
  */
985
- type LastOfUnion<T> = UnionToIntersection$1<T extends any ? () => T : never> extends (() => (infer R)) ? R : never;
981
+ type LastOfUnion<T> = UnionToIntersection<T extends any ? () => T : never> extends (() => (infer R)) ? R : never;
986
982
 
987
983
  /**
988
984
  Convert a union type into an unordered tuple type of its elements.
@@ -1019,10 +1015,9 @@ const petList = Object.keys(pets) as UnionToTuple<Pet>;
1019
1015
 
1020
1016
  @category Array
1021
1017
  */
1022
- type UnionToTuple$1<T, L = LastOfUnion<T>> = IsNever$1<T> extends false ? [...UnionToTuple$1<Exclude<T, L>>, L] : [];
1023
-
1018
+ type UnionToTuple<T, L = LastOfUnion<T>> = IsNever$1<T> extends false ? [...UnionToTuple<Exclude<T, L>>, L] : [];
1024
1019
  //#endregion
1025
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/is-null.d.ts
1020
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/is-null.d.ts
1026
1021
  /**
1027
1022
  Returns a boolean for whether the given type is `null`.
1028
1023
 
@@ -1043,9 +1038,8 @@ type Example2 = NonNullFallback<number, string>;
1043
1038
  @category Utilities
1044
1039
  */
1045
1040
  type IsNull<T> = [T] extends [null] ? true : false;
1046
-
1047
1041
  //#endregion
1048
- //#region ../../node_modules/.pnpm/type-fest@4.40.1/node_modules/type-fest/source/is-unknown.d.ts
1042
+ //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/is-unknown.d.ts
1049
1043
  /**
1050
1044
  Returns a boolean for whether the given type is `unknown`.
1051
1045
 
@@ -1089,10 +1083,9 @@ store.execute((state, payload) => ({value: state.value + payload}), someExternal
1089
1083
 
1090
1084
  @category Utilities
1091
1085
  */
1092
- type IsUnknown$1<T> = (unknown extends T // `T` can be `unknown` or `any`
1086
+ type IsUnknown<T> = (unknown extends T // `T` can be `unknown` or `any`
1093
1087
  ? IsNull<T> extends false // `any` can be `null`, but `unknown` can't be
1094
1088
  ? true : false : false);
1095
-
1096
1089
  //#endregion
1097
1090
  //#region src/types/core/modifiers.types.d.ts
1098
1091
  interface RegleBehaviourOptions {
@@ -1180,7 +1173,6 @@ type RegleShortcutDefinition<TCustomRules extends Record<string, any> = {}> = {
1180
1173
  collections?: ShortcutCommonFn<RegleCollectionStatus<any[], Partial<TCustomRules> & Partial<DefaultValidators>>>;
1181
1174
  };
1182
1175
  type AddDollarToOptions<T extends Record<string, any>> = { [K in keyof T as `$${string & K}`]: T[K] };
1183
-
1184
1176
  //#endregion
1185
1177
  //#region src/types/core/useRegle.types.d.ts
1186
1178
  type Regle<TState extends Record<string, any> = EmptyObject, TRules extends ReglePartialRuleTree<TState, CustomRulesDeclarationTree> = EmptyObject, TValidationGroups extends Record<string, RegleValidationGroupEntry[]> = {}, TShortcuts extends RegleShortcutDefinition = {}, TAdditionalReturnProperties extends Record<string, any> = {}> = {
@@ -1201,7 +1193,6 @@ type RegleSingleField<TState extends Maybe<PrimitiveTypes> = any, TRules extends
1201
1193
  } & TAdditionalReturnProperties;
1202
1194
  type DeepReactiveState<T extends Record<string, any> | unknown | undefined> = ExtendOnlyRealRecord<T> extends true ? { [K in keyof T]: InferDeepReactiveState<T[K]> } : never;
1203
1195
  type InferDeepReactiveState<TState> = NonNullable<TState> extends Array<infer U extends Record<string, any>> ? DeepReactiveState<U[]> : NonNullable<TState> extends Date | File ? MaybeRef<TState> : NonNullable<TState> extends Record<string, any> ? DeepReactiveState<TState> : MaybeRef<TState>;
1204
-
1205
1196
  //#endregion
1206
1197
  //#region src/types/core/reset.types.d.ts
1207
1198
  type ResetOptions<TState extends unknown> = RequireOneOrNone<{
@@ -1221,23 +1212,21 @@ type ResetOptions<TState extends unknown> = RequireOneOrNone<{
1221
1212
  */
1222
1213
  clearExternalErrors?: boolean;
1223
1214
  }, 'toInitialState' | 'toState'>;
1224
-
1225
1215
  //#endregion
1226
1216
  //#region src/types/core/scopedRegle.types.d.ts
1227
1217
  type ScopedInstancesRecord = Record<string, Record<string, SuperCompatibleRegleRoot>> & {
1228
1218
  '~~global': Record<string, SuperCompatibleRegleRoot>;
1229
1219
  };
1230
1220
  type ScopedInstancesRecordLike = Partial<ScopedInstancesRecord>;
1231
-
1232
1221
  //#endregion
1233
1222
  //#region src/types/core/results.types.d.ts
1234
1223
  type PartialFormState<TState extends Record<string, any>> = [unknown] extends [TState] ? {} : Prettify<{ [K in keyof TState as ExtendOnlyRealRecord<TState[K]> extends true ? never : TState[K] extends Array<any> ? never : K]?: MaybeOutput<TState[K]> } & { [K in keyof TState as ExtendOnlyRealRecord<TState[K]> extends true ? K : TState[K] extends Array<any> ? K : never]: NonNullable<TState[K]> extends Array<infer U extends Record<string, any>> ? PartialFormState<U>[] : PartialFormState<TState[K]> }>;
1235
1224
  type RegleResult<Data extends Record<string, any> | any[] | unknown, TRules extends ReglePartialRuleTree<any>> = {
1236
1225
  valid: false;
1237
- data: IsUnknown$1<Data> extends true ? unknown : NonNullable<Data> extends Date | File ? MaybeOutput<Data> : NonNullable<Data> extends Array<infer U extends Record<string, any>> ? PartialFormState<U>[] : NonNullable<Data> extends Record<string, any> ? PartialFormState<NonNullable<Data>> : MaybeOutput<Data>;
1226
+ data: IsUnknown<Data> extends true ? unknown : NonNullable<Data> extends Date | File ? MaybeOutput<Data> : NonNullable<Data> extends Array<infer U extends Record<string, any>> ? PartialFormState<U>[] : NonNullable<Data> extends Record<string, any> ? PartialFormState<NonNullable<Data>> : MaybeOutput<Data>;
1238
1227
  } | {
1239
1228
  valid: true;
1240
- data: IsUnknown$1<Data> extends true ? unknown : Data extends Array<infer U extends Record<string, any>> ? DeepSafeFormState<U, TRules>[] : Data extends Date | File ? SafeFieldProperty<Data, TRules> : Data extends Record<string, any> ? DeepSafeFormState<Data, TRules> : SafeFieldProperty<Data, TRules>;
1229
+ data: IsUnknown<Data> extends true ? unknown : Data extends Array<infer U extends Record<string, any>> ? DeepSafeFormState<U, TRules>[] : Data extends Date | File ? SafeFieldProperty<Data, TRules> : Data extends Record<string, any> ? DeepSafeFormState<Data, TRules> : SafeFieldProperty<Data, TRules>;
1241
1230
  };
1242
1231
  /**
1243
1232
  * Infer safe output from any `r$` instance
@@ -1258,7 +1247,6 @@ type ArrayHaveAtLeastOneRequiredField<TState extends Maybe<any[]>, TRule extends
1258
1247
  type SafeProperty<TState, TRule extends RegleFormPropertyType<any, any> | undefined> = unknown extends TState ? unknown : TRule extends RegleCollectionRuleDecl<any, any> ? TState extends Array<infer U extends Record<string, any>> ? DeepSafeFormState<U, ExtractFromGetter<TRule['$each']>>[] : TState : TRule extends ReglePartialRuleTree<any, any> ? ExtendOnlyRealRecord<TState> extends true ? DeepSafeFormState<NonNullable<TState> extends Record<string, any> ? JoinDiscriminatedUnions<NonNullable<TState>> : {}, TRule> : TRule extends RegleRuleDecl<any, any> ? FieldHaveRequiredRule<TRule> extends true ? TState : MaybeOutput<TState> : TState : TState;
1259
1248
  type IsPropertyOutputRequired<TState, TRule extends RegleFormPropertyType<any, any> | undefined> = [unknown] extends [TState] ? unknown : NonNullable<TState> extends Array<any> ? TRule extends RegleCollectionRuleDecl<any, any> ? ArrayHaveAtLeastOneRequiredField<NonNullable<TState>, TRule> extends false ? false : true : false : TRule extends ReglePartialRuleTree<any, any> ? ExtendOnlyRealRecord<TState> extends true ? ObjectHaveAtLeastOneRequiredField<NonNullable<TState> extends Record<string, any> ? NonNullable<TState> : {}, TRule> extends false ? false : true : TRule extends RegleRuleDecl<any, any> ? FieldHaveRequiredRule<TRule> extends false ? false : true : false : false;
1260
1249
  type SafeFieldProperty<TState, TRule extends RegleFormPropertyType<any, any> | undefined = never> = FieldHaveRequiredRule<TRule> extends true ? NonNullable<TState> : MaybeOutput<TState>;
1261
-
1262
1250
  //#endregion
1263
1251
  //#region ../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/utils.d.ts
1264
1252
  /**
@@ -1299,7 +1287,7 @@ type IsAny<T> = [T] extends [Secret] ? Not<IsNever<T>> : false;
1299
1287
  /**
1300
1288
  * Determines if the given type is `unknown`.
1301
1289
  */
1302
- type IsUnknown<T> = [unknown] extends [T] ? Not<IsAny<T>> : false;
1290
+ type IsUnknown$1<T> = [unknown] extends [T] ? Not<IsAny<T>> : false;
1303
1291
  /**
1304
1292
  * Determines if a type is either `never` or `any`.
1305
1293
  */
@@ -1369,13 +1357,13 @@ type MutuallyExtends<Left, Right> = And<[Extends<Left, Right>, Extends<Right, Le
1369
1357
  * Convert a union to an intersection.
1370
1358
  * `A | B | C` -\> `A & B & C`
1371
1359
  */
1372
- type UnionToIntersection<Union> = (Union extends any ? (distributedUnion: Union) => void : never) extends ((mergedIntersection: infer Intersection) => void) ? Intersection : never;
1360
+ type UnionToIntersection$1<Union> = (Union extends any ? (distributedUnion: Union) => void : never) extends ((mergedIntersection: infer Intersection) => void) ? Intersection : never;
1373
1361
  /**
1374
1362
  * Get the last element of a union.
1375
1363
  * First, converts to a union of `() => T` functions,
1376
1364
  * then uses {@linkcode UnionToIntersection} to get the last one.
1377
1365
  */
1378
- type LastOf<Union> = UnionToIntersection<Union extends any ? () => Union : never> extends (() => infer R) ? R : never;
1366
+ type LastOf<Union> = UnionToIntersection$1<Union extends any ? () => Union : never> extends (() => infer R) ? R : never;
1379
1367
  /**
1380
1368
  * Intermediate type for {@linkcode UnionToTuple} which pushes the
1381
1369
  * "last" union member to the end of a tuple, and recursively prepends
@@ -1385,11 +1373,8 @@ type TuplifyUnion<Union, LastElement = LastOf<Union>> = IsNever<Union> extends t
1385
1373
  /**
1386
1374
  * Convert a union like `1 | 2 | 3` to a tuple like `[1, 2, 3]`.
1387
1375
  */
1388
- type UnionToTuple<Union> = TuplifyUnion<Union>;
1389
- type IsUnion<T> = Not<Extends<UnionToTuple<T>['length'], 1>>;
1390
-
1391
- //#endregion
1392
- //#region ../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/overloads.d.ts
1376
+ type UnionToTuple$1<Union> = TuplifyUnion<Union>;
1377
+ type IsUnion<T> = Not<Extends<UnionToTuple$1<T>['length'], 1>>;
1393
1378
  /**
1394
1379
  * A recursive version of `Pick` that selects properties from the left type that are present in the right type.
1395
1380
  * The "leaf" types from `Left` are used - only the keys of `Right` are considered.
@@ -1401,6 +1386,8 @@ type IsUnion<T> = Not<Extends<UnionToTuple<T>['length'], 1>>;
1401
1386
  * type Result = DeepPickMatchingProps<typeof user, {name: unknown; address: {city: unknown}}> // {name: string, address: {city: string}}
1402
1387
  * ```
1403
1388
  */
1389
+ //#endregion
1390
+ //#region ../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/overloads.d.ts
1404
1391
  /**
1405
1392
  * The simple(ish) way to get overload info from a function
1406
1393
  * {@linkcode FunctionType}. Recent versions of TypeScript will match any
@@ -1665,8 +1652,7 @@ type ConstructorOverloadParameters<ConstructorType> = ConstructorOverloadsUnion<
1665
1652
  /**
1666
1653
  * Calculates the number of overloads for a given function type.
1667
1654
  */
1668
- type NumOverloads<FunctionType> = UnionToTuple<OverloadsInfoUnion<FunctionType>>['length'];
1669
-
1655
+ type NumOverloads<FunctionType> = UnionToTuple$1<OverloadsInfoUnion<FunctionType>>['length'];
1670
1656
  //#endregion
1671
1657
  //#region ../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/branding.d.ts
1672
1658
  /**
@@ -1689,7 +1675,7 @@ type DeepBrand<T> = IsNever<T> extends true ? {
1689
1675
  type: 'never';
1690
1676
  } : IsAny<T> extends true ? {
1691
1677
  type: 'any';
1692
- } : IsUnknown<T> extends true ? {
1678
+ } : IsUnknown$1<T> extends true ? {
1693
1679
  type: 'unknown';
1694
1680
  } : T extends string | number | boolean | symbol | bigint | null | undefined | void ? {
1695
1681
  type: 'primitive';
@@ -1704,7 +1690,7 @@ type DeepBrand<T> = IsNever<T> extends true ? {
1704
1690
  return: DeepBrand<R>;
1705
1691
  this: DeepBrand<ThisParameterType<T>>;
1706
1692
  props: DeepBrand<Omit<T, keyof Function>>;
1707
- } : UnionToTuple<OverloadsInfoUnion<T>> extends infer OverloadsTuple ? {
1693
+ } : UnionToTuple$1<OverloadsInfoUnion<T>> extends infer OverloadsTuple ? {
1708
1694
  type: 'overloads';
1709
1695
  overloads: { [K in keyof OverloadsTuple]: DeepBrand<OverloadsTuple[K]> };
1710
1696
  } : never : T extends any[] ? {
@@ -1722,13 +1708,12 @@ type DeepBrand<T> = IsNever<T> extends true ? {
1722
1708
  * Checks if two types are strictly equal using branding.
1723
1709
  */
1724
1710
  type StrictEqualUsingBranding<Left, Right> = MutuallyExtends<DeepBrand<Left>, DeepBrand<Right>>;
1725
-
1726
1711
  //#endregion
1727
1712
  //#region ../../node_modules/.pnpm/expect-type@1.2.1/node_modules/expect-type/dist/messages.d.ts
1728
1713
  /**
1729
1714
  * Determines the printable type representation for a given type.
1730
1715
  */
1731
- type PrintType<T> = IsUnknown<T> extends true ? 'unknown' : IsNever<T> extends true ? 'never' : IsAny<T> extends true ? never : boolean extends T ? 'boolean' : T extends boolean ? `literal boolean: ${T}` : string extends T ? 'string' : T extends string ? `literal string: ${T}` : number extends T ? 'number' : T extends number ? `literal number: ${T}` : bigint extends T ? 'bigint' : T extends bigint ? `literal bigint: ${T}` : T extends null ? 'null' : T extends undefined ? 'undefined' : T extends ((...args: any[]) => any) ? 'function' : '...';
1716
+ type PrintType<T> = IsUnknown$1<T> extends true ? 'unknown' : IsNever<T> extends true ? 'never' : IsAny<T> extends true ? never : boolean extends T ? 'boolean' : T extends boolean ? `literal boolean: ${T}` : string extends T ? 'string' : T extends string ? `literal string: ${T}` : number extends T ? 'number' : T extends number ? `literal number: ${T}` : bigint extends T ? 'bigint' : T extends bigint ? `literal bigint: ${T}` : T extends null ? 'null' : T extends undefined ? 'undefined' : T extends ((...args: any[]) => any) ? 'function' : '...';
1732
1717
  /**
1733
1718
  * Helper for showing end-user a hint why their type assertion is failing.
1734
1719
  * This swaps "leaf" types with a literal message about what the actual and
@@ -1736,12 +1721,11 @@ type PrintType<T> = IsUnknown<T> extends true ? 'unknown' : IsNever<T> extends t
1736
1721
  * otherwise `LeafTypeOf<Actual>` returns `never`, which extends everything 🤔
1737
1722
  */
1738
1723
  type MismatchInfo<Actual, Expected> = And<[Extends<PrintType<Actual>, '...'>, Not<IsAny<Actual>>]> extends true ? And<[Extends<any[], Actual>, Extends<any[], Expected>]> extends true ? Array<MismatchInfo<Extract<Actual, any[]>[number], Extract<Expected, any[]>[number]>> : { [K in UsefulKeys<Actual> | UsefulKeys<Expected>]: MismatchInfo<K extends keyof Actual ? Actual[K] : never, K extends keyof Expected ? Expected[K] : never> } : StrictEqualUsingBranding<Actual, Expected> extends true ? Actual : `Expected: ${PrintType<Expected>}, Actual: ${PrintType<Exclude<Actual, Expected>>}`;
1739
-
1740
- //#endregion
1741
- //#region src/types/core/variants.types.d.ts
1742
1724
  /**
1743
1725
  * @internal
1744
1726
  */
1727
+ //#endregion
1728
+ //#region src/types/core/variants.types.d.ts
1745
1729
  type NarrowVariant<TRoot extends {
1746
1730
  [x: string]: unknown;
1747
1731
  }, TKey extends keyof TRoot, TValue extends (LazyJoinDiscriminatedUnions<Exclude<TRoot[TKey], RegleCollectionStatus<any, any, any> | RegleStatus<any, any, any>>> extends {
@@ -1750,7 +1734,7 @@ type NarrowVariant<TRoot extends {
1750
1734
  type MaybeVariantStatus<TState extends Record<string, any> | undefined = Record<string, any>, TRules extends ReglePartialRuleTree<NonNullable<TState>> = Record<string, any>, TShortcuts extends RegleShortcutDefinition = {}> = IsUnion<NonNullable<TState>> extends true ? Omit<RegleStatus<TState, TRules, TShortcuts>, '$fields'> & {
1751
1735
  $fields: ProcessChildrenFields<TState, TRules, TShortcuts>[keyof ProcessChildrenFields<TState, TRules, TShortcuts>];
1752
1736
  } : RegleStatus<TState, TRules, TShortcuts>;
1753
- type ProcessChildrenFields<TState extends Record<string, any> | undefined, TRules extends ReglePartialRuleTree<NonNullable<TState>>, TShortcuts extends RegleShortcutDefinition = {}> = { [TIndex in keyof TupleToPlainObj<UnionToTuple$1<TState>>]: TIndex extends `${infer TIndexInt extends number}` ? { [TKey in keyof UnionToTuple$1<TState>[TIndexInt] as IsEmptyObject<FindCorrespondingVariant<UnionToTuple$1<TState>[TIndexInt] extends Record<string, any> ? UnionToTuple$1<TState>[TIndexInt] : never, UnionToTuple$1<TRules>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject> extends true ? TKey extends keyof TState ? TState[TKey] extends NonNullable<TState[TKey]> ? TKey : never : never : TKey]-?: InferRegleStatusType<FindCorrespondingVariant<UnionToTuple$1<TState>[TIndexInt] extends Record<string, any> ? UnionToTuple$1<TState>[TIndexInt] : never, UnionToTuple$1<TRules>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject, NonNullable<UnionToTuple$1<TState>[TIndexInt]>, TKey, TShortcuts> } & { [TKey in keyof UnionToTuple$1<TState>[TIndexInt] as IsEmptyObject<FindCorrespondingVariant<UnionToTuple$1<TState>[TIndexInt] extends Record<string, any> ? UnionToTuple$1<TState>[TIndexInt] : never, UnionToTuple$1<TRules>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject> extends true ? TKey extends keyof TState ? TState[TKey] extends NonNullable<TState[TKey]> ? never : TKey : TKey : never]?: InferRegleStatusType<FindCorrespondingVariant<UnionToTuple$1<TState>[TIndexInt] extends Record<string, any> ? UnionToTuple$1<TState>[TIndexInt] : never, UnionToTuple$1<TRules>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject, NonNullable<UnionToTuple$1<TState>[TIndexInt]>, TKey, TShortcuts> } : {} };
1737
+ type ProcessChildrenFields<TState extends Record<string, any> | undefined, TRules extends ReglePartialRuleTree<NonNullable<TState>>, TShortcuts extends RegleShortcutDefinition = {}> = { [TIndex in keyof TupleToPlainObj<UnionToTuple<TState>>]: TIndex extends `${infer TIndexInt extends number}` ? { [TKey in keyof UnionToTuple<TState>[TIndexInt] as IsEmptyObject<FindCorrespondingVariant<UnionToTuple<TState>[TIndexInt] extends Record<string, any> ? UnionToTuple<TState>[TIndexInt] : never, UnionToTuple<TRules>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject> extends true ? TKey extends keyof TState ? TState[TKey] extends NonNullable<TState[TKey]> ? TKey : never : never : TKey]-?: InferRegleStatusType<FindCorrespondingVariant<UnionToTuple<TState>[TIndexInt] extends Record<string, any> ? UnionToTuple<TState>[TIndexInt] : never, UnionToTuple<TRules>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject, NonNullable<UnionToTuple<TState>[TIndexInt]>, TKey, TShortcuts> } & { [TKey in keyof UnionToTuple<TState>[TIndexInt] as IsEmptyObject<FindCorrespondingVariant<UnionToTuple<TState>[TIndexInt] extends Record<string, any> ? UnionToTuple<TState>[TIndexInt] : never, UnionToTuple<TRules>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject> extends true ? TKey extends keyof TState ? TState[TKey] extends NonNullable<TState[TKey]> ? never : TKey : TKey : never]?: InferRegleStatusType<FindCorrespondingVariant<UnionToTuple<TState>[TIndexInt] extends Record<string, any> ? UnionToTuple<TState>[TIndexInt] : never, UnionToTuple<TRules>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject, NonNullable<UnionToTuple<TState>[TIndexInt]>, TKey, TShortcuts> } : {} };
1754
1738
  type FindCorrespondingVariant<TState extends Record<string, any>, TRules extends any[]> = TRules extends [infer F, ...infer R] ? F extends ReglePartialRuleTree<TState> ? [F] : FindCorrespondingVariant<TState, R> : [];
1755
1739
  type PossibleLiteralTypes<T extends Record<string, any>, TKey extends keyof T> = unknown extends T[TKey] ? {
1756
1740
  [x: string]: { [K in TKey]-?: Omit<RegleRuleDecl<any, Partial<AllRulesDeclarations>>, 'literal'> & {
@@ -1761,7 +1745,6 @@ type PossibleLiteralTypes<T extends Record<string, any>, TKey extends keyof T> =
1761
1745
  } } };
1762
1746
  type RequiredForm<T extends Record<string, any>, TKey extends keyof T> = Omit<ReglePartialRuleTree<T>, TKey> & PossibleLiteralTypes<T, TKey>[keyof PossibleLiteralTypes<T, TKey>];
1763
1747
  type VariantTuple<T extends Record<string, any>, TKey extends keyof T> = [RequiredForm<T, TKey>, ...RequiredForm<T, TKey>[]];
1764
-
1765
1748
  //#endregion
1766
1749
  //#region src/core/useRegle/useRegle.d.ts
1767
1750
  type useRegleFnOptions<TState extends Record<string, any> | MaybeInput<PrimitiveTypes>, TRules extends ReglePartialRuleTree<Unwrap<TState extends Record<string, any> ? TState : {}>, Partial<AllRulesDeclarations>>, TAdditionalOptions extends Record<string, any>, TValidationGroups extends Record<string, RegleValidationGroupEntry[]>> = TState extends MaybeInput<PrimitiveTypes> ? Partial<DeepMaybeRef<RegleBehaviourOptions>> & TAdditionalOptions : Partial<DeepMaybeRef<RegleBehaviourOptions>> & LocalRegleBehaviourOptions<JoinDiscriminatedUnions<TState extends Record<string, any> ? Unwrap<TState> : {}>, TState extends Record<string, any> ? TRules : {}, TValidationGroups> & TAdditionalOptions;
@@ -1793,7 +1776,6 @@ interface useRegleFn<TCustomRules extends Partial<AllRulesDeclarations>, TShortc
1793
1776
  * Docs: {@link https://reglejs.dev/core-concepts/}
1794
1777
  */
1795
1778
  declare const useRegle: useRegleFn<Partial<AllRulesDeclarations>, RegleShortcutDefinition<any>, {}, {}>;
1796
-
1797
1779
  //#endregion
1798
1780
  //#region src/core/useRegle/inferRules.d.ts
1799
1781
  interface inferRulesFn<TCustomRules extends Partial<AllRulesDeclarations>> {
@@ -1807,7 +1789,6 @@ interface inferRulesFn<TCustomRules extends Partial<AllRulesDeclarations>> {
1807
1789
  * @param rules - Your rule tree
1808
1790
  */
1809
1791
  declare const inferRules: inferRulesFn<Partial<AllRulesDeclarations>>;
1810
-
1811
1792
  //#endregion
1812
1793
  //#region src/core/useRegle/root/useRootStorage.d.ts
1813
1794
  declare function useRootStorage({
@@ -1833,7 +1814,6 @@ declare function useRootStorage({
1833
1814
  }): {
1834
1815
  regle: $InternalRegleStatusType | undefined;
1835
1816
  };
1836
-
1837
1817
  //#endregion
1838
1818
  //#region src/core/useRegle/useErrors.d.ts
1839
1819
  /**
@@ -1850,15 +1830,41 @@ declare function flatErrors(errors: $InternalRegleErrors, options: {
1850
1830
  declare function flatErrors(errors: $InternalRegleErrors, options?: {
1851
1831
  includePath?: false;
1852
1832
  }): string[];
1853
-
1854
1833
  //#endregion
1855
1834
  //#region src/types/utils/props.types.d.ts
1835
+ /**
1836
+ * Infer type of the `r$` of any function returning a regle instance
1837
+ */
1856
1838
  type InferRegleRoot<T extends (...args: any[]) => SuperCompatibleRegle> = T extends ((...args: any[]) => infer U) ? U extends SuperCompatibleRegle ? U['r$'] : never : never;
1839
+ /**
1840
+ * Infer custom rules declared in a global configuration
1841
+ */
1857
1842
  type InferRegleRules<T extends useRegleFn<any, any>> = T extends useRegleFn<infer U, any> ? UnwrapRuleTree<Partial<U> & Partial<DefaultValidators>> : {};
1843
+ /**
1844
+ * Infer custom shortcuts declared in a global configuration
1845
+ */
1858
1846
  type InferRegleShortcuts<T extends useRegleFn<any, any>> = T extends useRegleFn<any, infer U> ? U : {};
1847
+ /**
1848
+ * Extract a set rules and setting them as required
1849
+ */
1859
1850
  type RegleEnforceRequiredRules<TRules extends keyof DefaultValidators> = Omit<Partial<DefaultValidatorsTree>, TRules> & { [K in TRules]-?: UnwrapRuleWithParams<DefaultValidators[K]> };
1860
- type RegleEnforceCustomRequiredRules<T extends Partial<AllRulesDeclarations> | useRegleFn<any, any>, TRules extends (T extends useRegleFn<any, any> ? keyof InferRegleRules<T> : keyof T)> = Omit<Partial<DefaultValidatorsTree>, TRules> & { [K in TRules]-?: T extends useRegleFn<any, any> ? K extends keyof InferRegleRules<T> ? NonNullable<UnwrapRuleWithParams<InferRegleRules<T>[K]>> : never : K extends keyof T ? NonNullable<T[K]> : never };
1851
+ /**
1852
+ * Extract a set of custom rules from a global configuration and setting them as required
1861
1853
 
1854
+ */
1855
+ type RegleEnforceCustomRequiredRules<T extends Partial<AllRulesDeclarations> | useRegleFn<any, any>, TRules extends (T extends useRegleFn<any, any> ? keyof InferRegleRules<T> : keyof T)> = Omit<Partial<DefaultValidatorsTree>, TRules> & { [K in TRules]-?: T extends useRegleFn<any, any> ? K extends keyof InferRegleRules<T> ? NonNullable<UnwrapRuleWithParams<InferRegleRules<T>[K]>> : never : K extends keyof T ? NonNullable<T[K]> : never };
1856
+ /**
1857
+ * Extract custom rules and custom shortcuts and apply them to a RegleFieldStatus type
1858
+ */
1859
+ type RegleCustomFieldStatus<T extends useRegleFn<any, any>, TState extends unknown = any, TRules extends RegleFormPropertyType<any, Partial<AllRulesDeclarations>> = InferRegleRules<T>> = RegleFieldStatus<TState, TRules, InferRegleShortcuts<T>>;
1860
+ /**
1861
+ * Extract custom rules and custom shortcuts and apply them to a RegleFieldStatus type
1862
+ */
1863
+ type RegleCustomStatus<T extends useRegleFn<any, any>, TState extends Record<string, any> | undefined = Record<string, any>, TRules extends ReglePartialRuleTree<NonNullable<TState>> = InferRegleRules<T>> = RegleStatus<TState, TRules, InferRegleShortcuts<T>>;
1864
+ /**
1865
+ * Extract custom rules and custom shortcuts and apply them to a RegleFieldStatus type
1866
+ */
1867
+ type RegleCustomCollectionStatus<T extends useRegleFn<any, any>, TState extends any[] = any[], TRules extends ReglePartialRuleTree<ArrayElement<TState>> = InferRegleRules<T>> = RegleCollectionStatus<TState, TRules, InferRegleShortcuts<T>>;
1862
1868
  //#endregion
1863
1869
  //#region src/types/utils/object.types.d.ts
1864
1870
  type RemoveCommonKey<T extends readonly any[], K extends PropertyKey> = T extends [infer F, ...infer R] ? [Prettify<Omit<F, K>>, ...RemoveCommonKey<R, K>] : [];
@@ -1886,12 +1892,12 @@ type RetrieveUnionUnknownKeysOf<T extends readonly any[]> = T extends [infer F,
1886
1892
  /**
1887
1893
  * Transforms a union and apply undefined values to non-present keys to support intersection
1888
1894
  */
1889
- type NormalizeUnion<TUnion> = RetrieveUnionUnknownValues<NonNullable<UnionToTuple$1<TUnion>>, RetrieveUnionUnknownKeysOf<NonNullable<UnionToTuple$1<TUnion>>>[number]>[number];
1895
+ type NormalizeUnion<TUnion> = RetrieveUnionUnknownValues<NonNullable<UnionToTuple<TUnion>>, RetrieveUnionUnknownKeysOf<NonNullable<UnionToTuple<TUnion>>>[number]>[number];
1890
1896
  /**
1891
1897
  * Combine all members of a union type, merging types for each key, and keeping loose types
1892
1898
  */
1893
- type JoinDiscriminatedUnions<TUnion extends unknown> = isRecordLiteral<TUnion> extends true ? Prettify<Partial<UnionToIntersection$1<RemoveCommonKey<UnionToTuple$1<NonNullable<TUnion>>, keyof NormalizeUnion<NonNullable<TUnion>>>[number]>> & Pick<NormalizeUnion<NonNullable<TUnion>>, keyof NormalizeUnion<NonNullable<TUnion>>>> : TUnion;
1894
- type LazyJoinDiscriminatedUnions<TUnion extends unknown> = isRecordLiteral<TUnion> extends true ? Prettify<Partial<UnionToIntersection$1<RemoveCommonKey<UnionToTuple$1<TUnion>, keyof NonNullable<TUnion>>[number]>> & Pick<NonNullable<TUnion>, keyof NonNullable<TUnion>>> : TUnion;
1899
+ type JoinDiscriminatedUnions<TUnion extends unknown> = isRecordLiteral<TUnion> extends true ? Prettify<Partial<UnionToIntersection<RemoveCommonKey<UnionToTuple<NonNullable<TUnion>>, keyof NormalizeUnion<NonNullable<TUnion>>>[number]>> & Pick<NormalizeUnion<NonNullable<TUnion>>, keyof NormalizeUnion<NonNullable<TUnion>>>> : TUnion;
1900
+ type LazyJoinDiscriminatedUnions<TUnion extends unknown> = isRecordLiteral<TUnion> extends true ? Prettify<Partial<UnionToIntersection<RemoveCommonKey<UnionToTuple<TUnion>, keyof NonNullable<TUnion>>[number]>> & Pick<NonNullable<TUnion>, keyof NonNullable<TUnion>>> : TUnion;
1895
1901
  type EnumLike = {
1896
1902
  [k: string]: string | number;
1897
1903
  [nu: number]: string;
@@ -1899,15 +1905,13 @@ type EnumLike = {
1899
1905
  type enumType<T extends Record<string, unknown>> = T[keyof T];
1900
1906
  type UnwrapMaybeRef<T extends MaybeRef<any> | DeepReactiveState<any>> = T extends Ref<any> ? UnwrapRef<T> : UnwrapNestedRefs<T>;
1901
1907
  type TupleToPlainObj<T> = { [I in keyof T & `${number}`]: T[I] };
1902
-
1903
1908
  //#endregion
1904
1909
  //#region src/types/utils/mismatch.types.d.ts
1905
1910
  type isDeepExact<TRules, TTree> = { [K in keyof TRules]-?: CheckDeepExact<NonNullable<TRules[K]>, K extends keyof JoinDiscriminatedUnions<TTree> ? NonNullable<JoinDiscriminatedUnions<TTree>[K]> : never> }[keyof TRules] extends true ? true : false;
1906
1911
  type CheckDeepExact<TRules, TTree> = [TTree] extends [never] ? false : TRules extends RegleCollectionRuleDecl ? TTree extends Array<any> ? isDeepExact<NonNullable<TRules['$each']>, JoinDiscriminatedUnions<NonNullable<ArrayElement<TTree>>>> : TRules extends RegleRuleDecl ? true : TRules extends ReglePartialRuleTree<any> ? isDeepExact<TRules, TTree> : false : TRules extends RegleRuleDecl ? true : TRules extends ReglePartialRuleTree<any> ? isDeepExact<TRules, TTree> : false;
1907
-
1908
1912
  //#endregion
1909
1913
  //#region src/types/utils/infer.types.d.ts
1910
- type InferInput<TRules extends MaybeRef<ReglePartialRuleTree<Record<string, any>, any>> | ((state: any) => ReglePartialRuleTree<Record<string, any>, any>), TMarkMaybe extends boolean = true> = IsUnion$1<UnwrapSimple<TRules>> extends true ? InferTupleUnionInput<UnionToTuple$1<UnwrapSimple<TRules>>>[number] : TMarkMaybe extends true ? Prettify<{ [K in keyof UnwrapSimple<TRules>]?: ProcessInputChildren<UnwrapSimple<TRules>[K], TMarkMaybe> }> : Prettify<{ [K in keyof UnwrapSimple<TRules>]: ProcessInputChildren<UnwrapSimple<TRules>[K], TMarkMaybe> }>;
1914
+ type InferInput<TRules extends MaybeRef<ReglePartialRuleTree<Record<string, any>, any>> | ((state: any) => ReglePartialRuleTree<Record<string, any>, any>), TMarkMaybe extends boolean = true> = IsUnion$1<UnwrapSimple<TRules>> extends true ? InferTupleUnionInput<UnionToTuple<UnwrapSimple<TRules>>>[number] : TMarkMaybe extends true ? Prettify<{ [K in keyof UnwrapSimple<TRules>]?: ProcessInputChildren<UnwrapSimple<TRules>[K], TMarkMaybe> }> : Prettify<{ [K in keyof UnwrapSimple<TRules>]: ProcessInputChildren<UnwrapSimple<TRules>[K], TMarkMaybe> }>;
1911
1915
  type ProcessInputChildren<TRule extends unknown, TMarkMaybe extends boolean> = TRule extends {
1912
1916
  $each: RegleCollectionEachRules<any, any>;
1913
1917
  } ? ExtractFromGetter<TRule['$each']> extends ReglePartialRuleTree<any, any> ? InferInput<ExtractFromGetter<TRule['$each']>, TMarkMaybe>[] : any[] : TRule extends RegleRuleDecl<any, any> ? [ExtractTypeFromRules<TRule>] extends [never] ? unknown : ExtractTypeFromRules<TRule> : TRule extends ReglePartialRuleTree<any, any> ? InferInput<TRule, TMarkMaybe> : string;
@@ -1917,7 +1921,6 @@ type ExtractTypeFromRules<TRules extends RegleRuleDecl<any, any>> = FilterRulesW
1917
1921
  type FilterRulesWithInput<TRules extends RegleRuleDecl<any, any>> = { [K in keyof TRules as TRules[K] extends RegleRuleDefinition<any, any, any, any, infer Input> ? unknown extends Input ? never : K : never]: TRules[K] extends RegleRuleDefinition<any, any, any, any, infer Input> ? Input : unknown };
1918
1922
  type FilterRulesWithSingleType<TRules extends RegleRuleDecl<any, any>> = { [K in keyof TRules as TRules[K] extends RegleRuleDefinition<any, any, any, any, infer Input> ? unknown extends Input ? never : IsUnion$1<NonNullable<Input>> extends true ? never : K : never]: TRules[K] extends RegleRuleDefinition<any, any, any, any, infer Input> ? IsUnion$1<NonNullable<Input>> extends true ? unknown : Input : unknown };
1919
1923
  type InferTupleUnionInput<T extends any[]> = T extends [infer F extends ReglePartialRuleTree, ...infer R] ? [InferInput<F, true>, ...InferTupleUnionInput<R>] : [];
1920
-
1921
1924
  //#endregion
1922
1925
  //#region src/types/rules/rule.params.types.d.ts
1923
1926
  type CreateFn<T extends any[]> = (...args: T) => any;
@@ -1928,7 +1931,6 @@ type CreateFn<T extends any[]> = (...args: T) => any;
1928
1931
  */
1929
1932
  type RegleUniversalParams<T extends any[] = [], F = CreateFn<T>> = [T] extends [[]] ? [] : Parameters<F extends ((...args: infer Args) => any) ? (...args: { [K in keyof Args]: MaybeRefOrGetter<Maybe<Args[K]>> }) => any : never>;
1930
1933
  type UnwrapRegleUniversalParams<T extends MaybeRefOrGetter[] = [], F = CreateFn<T>> = [T] extends [[]] ? [] : Parameters<F extends ((...args: infer Args) => any) ? (...args: { [K in keyof Args]: Args[K] extends MaybeRefOrGetter<Maybe<infer U>> ? U : Args[K] }) => any : never>;
1931
-
1932
1934
  //#endregion
1933
1935
  //#region src/types/rules/rule.internal.types.d.ts
1934
1936
  /**
@@ -1951,7 +1953,6 @@ declare const InternalRuleType: {
1951
1953
  readonly Async: "__async";
1952
1954
  };
1953
1955
  type InternalRuleType = enumType<typeof InternalRuleType>;
1954
-
1955
1956
  //#endregion
1956
1957
  //#region src/types/rules/rule.definition.type.d.ts
1957
1958
  type IsLiteral<T> = string extends T ? false : true;
@@ -2040,7 +2041,6 @@ type RegleCollectionRuleDefinition<TValue = any[], TCustomRules extends Partial<
2040
2041
  }) | ({
2041
2042
  $each: MaybeGetter<RegleFormPropertyType<ArrayElement<NonNullable<TValue>>, TCustomRules>, ArrayElement<TValue>>;
2042
2043
  } & CollectionRegleBehaviourOptions);
2043
-
2044
2044
  //#endregion
2045
2045
  //#region src/types/rules/rule.init.types.d.ts
2046
2046
  type RegleInitPropertyGetter<TValue, TReturn, TParams extends [...any[]], TMetadata extends RegleRuleMetadataDefinition> = TReturn | ((metadata: RegleRuleMetadataConsumer<TValue, TParams, TMetadata>) => TReturn);
@@ -2076,7 +2076,6 @@ type RegleRuleTypeReturn<TValue, TParams extends [...any[]]> = {
2076
2076
  value: TValue;
2077
2077
  params: [...TParams];
2078
2078
  };
2079
-
2080
2079
  //#endregion
2081
2080
  //#region src/core/defaultValidators.d.ts
2082
2081
  interface CommonComparisonOptions {
@@ -2142,7 +2141,6 @@ type DefaultValidators = {
2142
2141
  startsWith: RegleRuleWithParamsDefinition<string, [part: Maybe<string>], false, boolean>;
2143
2142
  url: RegleRuleDefinition<string, [], false, boolean, string>;
2144
2143
  };
2145
-
2146
2144
  //#endregion
2147
2145
  //#region src/types/rules/rule.custom.types.d.ts
2148
2146
  type CustomRulesDeclarationTree = {
@@ -2150,7 +2148,6 @@ type CustomRulesDeclarationTree = {
2150
2148
  };
2151
2149
  type DefaultValidatorsTree = { [K in keyof DefaultValidators]: RegleRuleRawInput<any, any[], boolean, any> | undefined };
2152
2150
  type AllRulesDeclarations = CustomRulesDeclarationTree & DefaultValidatorsTree;
2153
-
2154
2151
  //#endregion
2155
2152
  //#region src/types/rules/rule.declaration.types.d.ts
2156
2153
  /**
@@ -2233,7 +2230,6 @@ type InlineRuleDeclaration<TValue extends any = any, TParams extends any[] = any
2233
2230
  * Regroup inline and registered rules
2234
2231
  * */
2235
2232
  type FormRuleDeclaration<TValue extends any = unknown, TParams extends any[] = any[], TReturn extends RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition> = RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition>, TMetadata extends RegleRuleMetadataDefinition = (TReturn extends Promise<infer M> ? M : TReturn), TAsync extends boolean = boolean> = InlineRuleDeclaration<TValue, TParams, TReturn> | RegleRuleDefinition<TValue, TParams, TAsync, TMetadata> | RegleRuleWithParamsDefinitionInput<TValue, [param?: any], TAsync, TMetadata> | RegleRuleWithParamsDefinitionInput<TValue, [param?: any, ...any[]], TAsync, TMetadata>;
2236
-
2237
2233
  //#endregion
2238
2234
  //#region src/types/rules/rule.errors.types.d.ts
2239
2235
  type RegleErrorTree<TState = MaybeRef<Record<string, any> | any[]>> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>]: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>[K], false> };
@@ -2259,7 +2255,6 @@ type $InternalRegleErrorTree = {
2259
2255
  * @internal
2260
2256
  */
2261
2257
  type $InternalRegleErrors = $InternalRegleCollectionErrors | string[] | $InternalRegleErrorTree;
2262
-
2263
2258
  //#endregion
2264
2259
  //#region src/types/rules/rule.status.types.d.ts
2265
2260
  /**
@@ -2439,7 +2434,7 @@ type RegleRuleStatus<TValue = any, TParams extends any[] = any[], TMetadata exte
2439
2434
  /** Reset the $valid, $metadata and $pending states */
2440
2435
  $reset(): void;
2441
2436
  /** Returns the original rule validator function. */
2442
- $validator: ((value: IsUnknown$1<TValue> extends true ? any : MaybeInput<TValue>, ...args: any[]) => RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition>) & ((value: IsUnknown$1<TValue> extends true ? any : TValue, ...args: [TParams] extends [never[]] ? [] : [unknown[]] extends [TParams] ? any[] : TParams) => RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition>);
2437
+ $validator: ((value: IsUnknown<TValue> extends true ? any : MaybeInput<TValue>, ...args: any[]) => RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition>) & ((value: IsUnknown<TValue> extends true ? any : TValue, ...args: [TParams] extends [never[]] ? [] : [unknown[]] extends [TParams] ? any[] : TParams) => RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition>);
2443
2438
  } & ([TParams] extends [never[]] ? {} : [unknown[]] extends [TParams] ? {
2444
2439
  readonly $params?: any[];
2445
2440
  } : {
@@ -2510,7 +2505,6 @@ interface $InternalRegleCollectionStatus extends Omit<$InternalRegleStatus, '$fi
2510
2505
  $extractDirtyFields: (filterNullishValues?: boolean) => any[];
2511
2506
  $validate: () => Promise<$InternalRegleResult>;
2512
2507
  }
2513
-
2514
2508
  //#endregion
2515
2509
  //#region src/types/rules/compatibility.rules.d.ts
2516
2510
  interface SuperCompatibleRegle {
@@ -2558,7 +2552,6 @@ interface SuperCompatibleRegleCollectionStatus extends Omit<SuperCompatibleRegle
2558
2552
  $validate?: () => Promise<SuperCompatibleRegleResult>;
2559
2553
  }
2560
2554
  type SuperCompatibleRegleCollectionErrors = $InternalRegleCollectionErrors;
2561
-
2562
2555
  //#endregion
2563
2556
  //#region src/core/createRule/createRule.d.ts
2564
2557
  /**
@@ -2593,7 +2586,6 @@ type SuperCompatibleRegleCollectionErrors = $InternalRegleCollectionErrors;
2593
2586
  * Docs: {@link https://reglejs.dev/core-concepts/rules/reusable-rules}
2594
2587
  */
2595
2588
  declare function createRule<TValue extends any, TParams extends any[], TReturn extends RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition>, TMetadata extends RegleRuleMetadataDefinition = (TReturn extends Promise<infer M> ? M : TReturn), TAsync extends boolean = (TReturn extends Promise<any> ? true : false)>(definition: RegleRuleInit<TValue, TParams, TReturn, TMetadata, TAsync>): InferRegleRule<TValue, TParams, TAsync, TMetadata>;
2596
-
2597
2589
  //#endregion
2598
2590
  //#region src/core/createRule/unwrapRuleParameters.d.ts
2599
2591
  /**
@@ -2601,14 +2593,13 @@ declare function createRule<TValue extends any, TParams extends any[], TReturn e
2601
2593
  * Removing Ref and executing function to return the unwrapped value
2602
2594
  */
2603
2595
  declare function unwrapRuleParameters<TParams extends any[]>(params: MaybeRefOrGetter[]): TParams;
2604
-
2605
- //#endregion
2606
- //#region src/core/defineRegleConfig.d.ts
2607
2596
  /**
2608
2597
  * Returns a clean list of parameters
2609
2598
  * Removing Ref and executing function to return the unwrapped value
2610
2599
  */
2611
2600
 
2601
+ //#endregion
2602
+ //#region src/core/defineRegleConfig.d.ts
2612
2603
  /**
2613
2604
  * Define a global regle configuration, where you can:
2614
2605
  * - Customize built-in rules messages
@@ -2653,7 +2644,6 @@ declare function extendRegleConfig<TRootCustomRules extends Partial<AllRulesDecl
2653
2644
  useRegle: useRegleFn<Merge<TRootCustomRules, TCustomRules>, TRootShortcuts & TShortcuts>;
2654
2645
  inferRules: inferRulesFn<Merge<TRootCustomRules, TCustomRules>>;
2655
2646
  };
2656
-
2657
2647
  //#endregion
2658
2648
  //#region src/core/mergeRegles.d.ts
2659
2649
  type MergedRegles<TRegles extends Record<string, SuperCompatibleRegleRoot>, TValue = { [K in keyof TRegles]: TRegles[K]['$value'] }> = Omit<RegleCommonStatus, '$value' | '$silentValue' | '$errors' | '$silentErrors' | '$name' | '$unwatch' | '$watch'> & {
@@ -2701,7 +2691,6 @@ type MergedReglesResult<TRegles extends Record<string, SuperCompatibleRegleRoot>
2701
2691
  }>['data'] };
2702
2692
  };
2703
2693
  declare function mergeRegles<TRegles extends Record<string, SuperCompatibleRegleRoot>, TScoped extends boolean = false>(regles: TRegles, _scoped?: TScoped): TScoped extends false ? MergedRegles<TRegles> : MergedScopedRegles;
2704
-
2705
2694
  //#endregion
2706
2695
  //#region src/core/createScopedUseRegle/useCollectScope.d.ts
2707
2696
  type useCollectScopeFn<TNamedScoped extends boolean = false> = TNamedScoped extends true ? <const TValue extends Record<string, Record<string, any>>>(namespace?: MaybeRefOrGetter<string>) => {
@@ -2709,7 +2698,6 @@ type useCollectScopeFn<TNamedScoped extends boolean = false> = TNamedScoped exte
2709
2698
  } : <TValue extends Record<string, unknown>[] = Record<string, unknown>[]>(namespace?: MaybeRefOrGetter<string>) => {
2710
2699
  r$: MergedScopedRegles<TValue>;
2711
2700
  };
2712
-
2713
2701
  //#endregion
2714
2702
  //#region src/core/createScopedUseRegle/useScopedRegle.d.ts
2715
2703
  type UseScopedRegleOptions<TAsRecord extends boolean> = {
@@ -2717,7 +2705,6 @@ type UseScopedRegleOptions<TAsRecord extends boolean> = {
2717
2705
  } & (TAsRecord extends true ? {
2718
2706
  scopeKey: string;
2719
2707
  } : {});
2720
-
2721
2708
  //#endregion
2722
2709
  //#region src/core/createScopedUseRegle/createScopedUseRegle.d.ts
2723
2710
  type CreateScopedUseRegleOptions<TCustomRegle extends useRegleFn<any, any>, TAsRecord extends boolean> = {
@@ -2801,7 +2788,6 @@ declare function narrowVariant<TRoot extends {
2801
2788
  declare function variantToRef<TRoot extends RegleStatus<{}, any, any>, const TKey extends keyof TRoot['$fields'], const TValue extends (LazyJoinDiscriminatedUnions<Exclude<TRoot['$fields'][TKey], RegleCollectionStatus<any, any, any> | RegleStatus<any, any, any>>> extends {
2802
2789
  $value: infer V;
2803
2790
  } ? V : unknown)>(root: MaybeRef<TRoot>, discriminantKey: TKey, discriminantValue: TValue): Ref<Extract<TRoot['$fields'], { [K in TKey]: RegleFieldStatus<TValue, any, any> }> | undefined>;
2804
-
2805
2791
  //#endregion
2806
2792
  //#region src/core/refineRules.d.ts
2807
2793
  /**
@@ -2830,6 +2816,5 @@ declare function defineRules<TRules extends RegleUnknownRulesTree>(rules: TRules
2830
2816
  * ```
2831
2817
  */
2832
2818
  declare function refineRules<TRules extends RegleUnknownRulesTree, TRefinement extends ReglePartialRuleTree<InferInput<TRules>> & RegleUnknownRulesTree>(rules: TRules, refinement: (state: Ref<InferInput<TRules>>) => TRefinement): (state: Ref<InferInput<TRules>>) => Merge<TRules, TRefinement>;
2833
-
2834
2819
  //#endregion
2835
- export { $InternalRegleStatus, AllRulesDeclarations, CommonAlphaOptions, CommonComparisonOptions, CreateScopedUseRegleOptions, DeepMaybeRef, DeepReactiveState, DefaultValidatorsTree, FormRuleDeclaration, HaveAnyRequiredProps, InferInput, InferRegleRoot, InferRegleRule, InferRegleRules, InferRegleShortcuts, InferRegleStatusType, InferSafeOutput, InlineRuleDeclaration, InternalRuleType, JoinDiscriminatedUnions, LocalRegleBehaviourOptions, Maybe, MaybeInput, MaybeOutput, MaybeReadonly, MaybeVariantStatus, MergedRegles, MergedScopedRegles, NarrowVariant, NoInferLegacy, PrimitiveTypes, Regle, RegleBehaviourOptions, RegleCollectionErrors, RegleCollectionRuleDecl, RegleCollectionRuleDefinition, RegleCollectionStatus, RegleCommonStatus, RegleComputedRules, RegleEnforceCustomRequiredRules, RegleEnforceRequiredRules, RegleErrorTree, RegleExternalCollectionErrors, RegleExternalErrorTree, RegleFieldStatus, RegleFormPropertyType, RegleInternalRuleDefs, ReglePartialRuleTree, RegleResult, RegleRoot, RegleRuleCore, RegleRuleDecl, RegleRuleDefinition, RegleRuleDefinitionProcessor, RegleRuleDefinitionWithMetadataProcessor, RegleRuleInit, RegleRuleMetadataConsumer, RegleRuleMetadataDefinition, RegleRuleMetadataExtended, RegleRuleRaw, RegleRuleStatus, RegleRuleTypeReturn, RegleRuleWithParamsDefinition, RegleShortcutDefinition, RegleSingleField, RegleStatus, RegleUniversalParams, RegleUnknownRulesTree, RegleValidationErrors, RegleValidationGroupEntry, RegleValidationGroupOutput, RegleRuleTree as RegleValidationTree, ResolvedRegleBehaviourOptions, ScopedInstancesRecord, ScopedInstancesRecordLike, SuperCompatibleRegle, SuperCompatibleRegleCollectionErrors, SuperCompatibleRegleCollectionStatus, SuperCompatibleRegleFieldStatus, SuperCompatibleRegleResult, SuperCompatibleRegleRoot, SuperCompatibleRegleRuleStatus, SuperCompatibleRegleStatus, Unwrap, UnwrapRegleUniversalParams, UnwrapRuleWithParams, UseScopedRegleOptions, createRule, createScopedUseRegle, createVariant, defineRegleConfig, defineRules, extendRegleConfig, flatErrors, inferRules, inferRulesFn, mergeRegles, narrowVariant, refineRules, unwrapRuleParameters, useCollectScope, useCollectScopeFn, useRegle, useRegleFn, useRootStorage, useScopedRegle, variantToRef };
2820
+ export { $InternalRegleStatus, AllRulesDeclarations, CommonAlphaOptions, CommonComparisonOptions, CreateScopedUseRegleOptions, DeepMaybeRef, DeepReactiveState, DefaultValidatorsTree, FormRuleDeclaration, HaveAnyRequiredProps, InferInput, InferRegleRoot, InferRegleRule, InferRegleRules, InferRegleShortcuts, InferRegleStatusType, InferSafeOutput, InlineRuleDeclaration, InternalRuleType, JoinDiscriminatedUnions, LocalRegleBehaviourOptions, Maybe, MaybeInput, MaybeOutput, MaybeReadonly, MaybeVariantStatus, MergedRegles, MergedScopedRegles, NarrowVariant, NoInferLegacy, PrimitiveTypes, Regle, RegleBehaviourOptions, RegleCollectionErrors, RegleCollectionRuleDecl, RegleCollectionRuleDefinition, RegleCollectionStatus, RegleCommonStatus, RegleComputedRules, RegleCustomCollectionStatus, RegleCustomFieldStatus, RegleCustomStatus, RegleEnforceCustomRequiredRules, RegleEnforceRequiredRules, RegleErrorTree, RegleExternalCollectionErrors, RegleExternalErrorTree, RegleFieldStatus, RegleFormPropertyType, RegleInternalRuleDefs, ReglePartialRuleTree, RegleResult, RegleRoot, RegleRuleCore, RegleRuleDecl, RegleRuleDefinition, RegleRuleDefinitionProcessor, RegleRuleDefinitionWithMetadataProcessor, RegleRuleInit, RegleRuleMetadataConsumer, RegleRuleMetadataDefinition, RegleRuleMetadataExtended, RegleRuleRaw, RegleRuleStatus, RegleRuleTypeReturn, RegleRuleWithParamsDefinition, RegleShortcutDefinition, RegleSingleField, RegleStatus, RegleUniversalParams, RegleUnknownRulesTree, RegleValidationErrors, RegleValidationGroupEntry, RegleValidationGroupOutput, RegleRuleTree as RegleValidationTree, ResolvedRegleBehaviourOptions, ScopedInstancesRecord, ScopedInstancesRecordLike, SuperCompatibleRegle, SuperCompatibleRegleCollectionErrors, SuperCompatibleRegleCollectionStatus, SuperCompatibleRegleFieldStatus, SuperCompatibleRegleResult, SuperCompatibleRegleRoot, SuperCompatibleRegleRuleStatus, SuperCompatibleRegleStatus, Unwrap, UnwrapRegleUniversalParams, UnwrapRuleWithParams, UseScopedRegleOptions, createRule, createScopedUseRegle, createVariant, defineRegleConfig, defineRules, extendRegleConfig, flatErrors, inferRules, inferRulesFn, mergeRegles, narrowVariant, refineRules, unwrapRuleParameters, useCollectScope, useCollectScopeFn, useRegle, useRegleFn, useRootStorage, useScopedRegle, variantToRef };
@@ -89,11 +89,11 @@ function merge(obj1, ...objs) {
89
89
  */
90
90
  function toDate(argument) {
91
91
  const argStr = Object.prototype.toString.call(argument);
92
- if (argument == null) return new Date(NaN);
92
+ if (argument == null) return /* @__PURE__ */ new Date(NaN);
93
93
  else if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") return new Date(argument.getTime());
94
94
  else if (typeof argument === "number" || argStr === "[object Number]") return new Date(argument);
95
95
  else if (typeof argument === "string" || argStr === "[object String]") return new Date(argument);
96
- else return new Date(NaN);
96
+ else return /* @__PURE__ */ new Date(NaN);
97
97
  }
98
98
 
99
99
  //#endregion
@@ -337,12 +337,12 @@ function createRule(definition) {
337
337
  * Inspired by Vuelidate storage
338
338
  */
339
339
  function useStorage() {
340
- const ruleDeclStorage = shallowRef(new Map());
341
- const fieldsStorage = shallowRef(new Map());
342
- const collectionsStorage = shallowRef(new Map());
343
- const dirtyStorage = shallowRef(new Map());
344
- const ruleStatusStorage = shallowRef(new Map());
345
- const arrayStatusStorage = shallowRef(new Map());
340
+ const ruleDeclStorage = shallowRef(/* @__PURE__ */ new Map());
341
+ const fieldsStorage = shallowRef(/* @__PURE__ */ new Map());
342
+ const collectionsStorage = shallowRef(/* @__PURE__ */ new Map());
343
+ const dirtyStorage = shallowRef(/* @__PURE__ */ new Map());
344
+ const ruleStatusStorage = shallowRef(/* @__PURE__ */ new Map());
345
+ const arrayStatusStorage = shallowRef(/* @__PURE__ */ new Map());
346
346
  function getFieldsEntry($path) {
347
347
  const existingFields = fieldsStorage.value.get($path);
348
348
  if (existingFields) return existingFields;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regle/core",
3
- "version": "1.3.0-beta.1",
3
+ "version": "1.3.1",
4
4
  "description": "Headless form validation library for Vue 3",
5
5
  "peerDependencies": {
6
6
  "pinia": ">=2.2.5",
@@ -13,20 +13,20 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@total-typescript/ts-reset": "0.6.1",
16
- "@types/node": "22.15.3",
16
+ "@types/node": "22.15.29",
17
17
  "@typescript-eslint/eslint-plugin": "8.28.0",
18
18
  "@typescript-eslint/parser": "8.28.0",
19
19
  "@vue/test-utils": "2.4.6",
20
- "eslint": "9.25.1",
21
- "eslint-config-prettier": "9.1.0",
22
- "eslint-plugin-vue": "9.33.0",
20
+ "eslint": "9.28.0",
21
+ "eslint-config-prettier": "10.1.5",
22
+ "eslint-plugin-vue": "10.1.0",
23
23
  "expect-type": "1.2.1",
24
24
  "prettier": "3.5.3",
25
- "tsdown": "0.12.3",
26
- "type-fest": "4.40.1",
25
+ "tsdown": "0.12.7",
26
+ "type-fest": "4.41.0",
27
27
  "typescript": "5.8.3",
28
- "vitest": "3.1.2",
29
- "vue": "3.5.13",
28
+ "vitest": "3.2.2",
29
+ "vue": "3.5.16",
30
30
  "vue-eslint-parser": "10.1.3",
31
31
  "vue-tsc": "2.2.10"
32
32
  },