@regle/core 1.18.0-beta.3 → 1.18.0

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.
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @regle/core v1.18.0-beta.3
2
+ * @regle/core v1.18.0
3
3
  * (c) 2026 Victor Garcia
4
4
  * @license MIT
5
5
  */
6
6
 
7
7
  import { ComputedRef, MaybeRef, MaybeRefOrGetter, Plugin, Raw, Ref, UnwrapNestedRefs, UnwrapRef } from "vue";
8
- import { EmptyObject, IsAny, IsEmptyObject, IsUnion, IsUnknown, Merge, Or, RequireAtLeastOne, RequireOneOrNone, RequiredDeep, UnionToIntersection, UnionToTuple } from "type-fest";
8
+ import { EmptyObject, Get, IsAny, IsEmptyObject, IsNullable, IsOptional, IsStringLiteral, IsUnion, IsUnknown, Merge, Or, Paths, RequireAtLeastOne, RequireOneOrNone, RequiredDeep, UnionToIntersection, UnionToTuple } from "type-fest";
9
9
  import { StandardSchemaV1 } from "@standard-schema/spec";
10
10
  declare const RegleStaticSymbol: unique symbol;
11
11
  type RegleStatic<T> = T extends (new (...args: infer Args) => infer U) ? RegleStaticImpl<new (...args: Args) => RegleStaticImpl<U>> : RegleStaticImpl<T>;
@@ -15,13 +15,13 @@ type RegleStaticImpl<T> = Raw<T & {
15
15
  type IsRegleStatic<T> = T extends RegleStaticImpl<T> ? true : false;
16
16
  type UnwrapStatic<T> = IsUnknown<T> extends true ? any : NonNullable<T> extends RegleStaticImpl<infer U> ? Raw<U> : UnwrapStaticSimple<T>;
17
17
  type UnwrapStaticSimple<T> = NonNullable<T> extends Array<infer U> ? Array<UnwrapStatic<U>> : isRecordLiteral<NonNullable<T>> extends true ? { [K in keyof T]: UnwrapStatic<T[K]> } : T;
18
- interface GlobalConfigOverrides<TValue$1 extends unknown = unknown> {
18
+ interface GlobalConfigOverrides<TValue extends unknown = unknown> {
19
19
  /**
20
20
  * Override the default $edited handler.
21
21
  */
22
- isEdited?: isEditedHandlerFn<TValue$1>;
22
+ isEdited?: isEditedHandlerFn<TValue>;
23
23
  }
24
- type isEditedHandlerFn<TValue$1 extends unknown = unknown> = (currentValue: MaybeInput<TValue$1>, initialValue: MaybeInput<TValue$1>, defaultHandlerFn: (currentValue: unknown, initialValue: unknown) => boolean) => boolean;
24
+ type isEditedHandlerFn<TValue extends unknown = unknown> = (currentValue: MaybeInput<TValue>, initialValue: MaybeInput<TValue>, defaultHandlerFn: (currentValue: unknown, initialValue: unknown) => boolean) => boolean;
25
25
  interface RegleBehaviourOptions {
26
26
  /**
27
27
  * Does not run rules until the field is dirty.
@@ -62,7 +62,7 @@ interface RegleBehaviourOptions {
62
62
  */
63
63
  immediateDirty?: boolean | undefined;
64
64
  }
65
- interface LocalRegleBehaviourOptions<TState$1 extends Record<string, any>, TRules$1 extends ReglePartialRuleTree<TState$1>, TValidationGroups extends Record<string, RegleValidationGroupEntry[]> = {}> {
65
+ interface LocalRegleBehaviourOptions<TState extends Record<string, any>, TRules extends ReglePartialRuleTree<TState>, TValidationGroups extends Record<string, RegleValidationGroupEntry[]> = {}> {
66
66
  /**
67
67
  * A dictionary of external errors to be injected into the field statuses.
68
68
  *
@@ -71,7 +71,7 @@ interface LocalRegleBehaviourOptions<TState$1 extends Record<string, any>, TRule
71
71
  *
72
72
  * More details: https://reglejs.dev/advanced-usage/external-errors
73
73
  */
74
- externalErrors?: Ref<RegleExternalErrorTree<Unwrap<TState$1>> | Record<string, string[]>>;
74
+ externalErrors?: Ref<RegleExternalErrorTree<Unwrap<TState>> | Record<string, string[]>>;
75
75
  /**
76
76
  * Allows you to group fields for custom collective validation logic.
77
77
  *
@@ -83,7 +83,7 @@ interface LocalRegleBehaviourOptions<TState$1 extends Record<string, any>, TRule
83
83
  *
84
84
  * More details: https://reglejs.dev/core-concepts/modifiers#validationgroups
85
85
  */
86
- validationGroups?: (fields: RegleStatus<TState$1, TRules$1>['$fields']) => TValidationGroups;
86
+ validationGroups?: (fields: RegleStatus<TState, TRules>['$fields']) => TValidationGroups;
87
87
  /**
88
88
  * A unique identifier for the Regle instance in the devtools.
89
89
  * @default undefined
@@ -107,7 +107,7 @@ interface RegleValidationGroupOutput {
107
107
  /** Collection of all error messages from fields in the group, regardless of $dirty state. */
108
108
  $silentErrors: string[];
109
109
  }
110
- type FieldRegleBehaviourOptions<TValue$1 extends unknown = unknown> = AddDollarToOptions<RegleBehaviourOptions> & {
110
+ type FieldRegleBehaviourOptions<TValue extends unknown = unknown> = AddDollarToOptions<RegleBehaviourOptions> & {
111
111
  /**
112
112
  * Let you declare the number of milliseconds the rule needs to wait before executing. Useful for async or heavy computations.
113
113
  */
@@ -115,9 +115,9 @@ type FieldRegleBehaviourOptions<TValue$1 extends unknown = unknown> = AddDollarT
115
115
  /**
116
116
  * Override the default `$edited` handler.
117
117
  */
118
- $isEdited?: isEditedHandlerFn<TValue$1>;
118
+ $isEdited?: isEditedHandlerFn<TValue>;
119
119
  };
120
- type CollectionRegleBehaviourOptions<TValue$1 extends unknown = unknown> = FieldRegleBehaviourOptions<TValue$1> & {
120
+ type CollectionRegleBehaviourOptions<TValue extends unknown = unknown> = FieldRegleBehaviourOptions<TValue> & {
121
121
  /**
122
122
  * Allow deep compare of array children to compute the `$edited` property
123
123
  *
@@ -156,13 +156,13 @@ type AddDollarToOptions<T extends Record<string, any>> = { [K in keyof T as `$${
156
156
  * @template TAdditionalReturnProperties - Additional properties to extend the return type
157
157
  *
158
158
  */
159
- type Regle<TState$1 extends Record<string, any> = EmptyObject, TRules$1 extends ReglePartialRuleTree<TState$1, CustomRulesDeclarationTree> = EmptyObject, TValidationGroups extends Record<string, RegleValidationGroupEntry[]> = {}, TShortcuts extends RegleShortcutDefinition = {}, TAdditionalReturnProperties extends Record<string, any> = {}> = {
159
+ 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> = {}> = {
160
160
  /**
161
161
  * r$ is a reactive object containing the values, errors, dirty state and all the necessary validations properties you'll need to display information.
162
162
  *
163
163
  * To see the list of properties: {@link https://reglejs.dev/core-concepts/validation-properties}
164
164
  */
165
- r$: Raw<RegleRoot<TState$1, TRules$1, TValidationGroups, TShortcuts>>;
165
+ r$: Raw<RegleRoot<TState, TRules, TValidationGroups, TShortcuts>>;
166
166
  } & TAdditionalReturnProperties;
167
167
  /**
168
168
  * The type for a single field validation instance.
@@ -172,17 +172,17 @@ type Regle<TState$1 extends Record<string, any> = EmptyObject, TRules$1 extends
172
172
  * @template TShortcuts - Custom shortcut definitions for common validation patterns
173
173
  * @template TAdditionalReturnProperties - Additional properties to extend the return type
174
174
  */
175
- type RegleSingleField<TState$1 extends Maybe<PrimitiveTypes> = any, TRules$1 extends RegleRuleDecl<NonNullable<TState$1>> = EmptyObject, TShortcuts extends RegleShortcutDefinition = {}, TAdditionalReturnProperties extends Record<string, any> = {}> = {
175
+ type RegleSingleField<TState extends Maybe<PrimitiveTypes> = any, TRules extends RegleRuleDecl<NonNullable<TState>> = EmptyObject, TShortcuts extends RegleShortcutDefinition = {}, TAdditionalReturnProperties extends Record<string, any> = {}> = {
176
176
  /**
177
177
  * r$ is a reactive object containing the values, errors, dirty state and all the necessary validations properties you'll need to display information.
178
178
  *
179
179
  * To see the list of properties: {@link https://reglejs.dev/core-concepts/validation-properties}
180
180
  */
181
- r$: Raw<RegleFieldStatus<TState$1, TRules$1, TShortcuts>>;
181
+ r$: Raw<RegleFieldStatus<TState, TRules, TShortcuts>>;
182
182
  } & TAdditionalReturnProperties;
183
183
  type DeepReactiveState<T extends Record<string, any> | unknown | undefined> = ExtendOnlyRealRecord<T> extends true ? { [K in keyof T]: InferDeepReactiveState<T[K]> } : never;
184
- type InferDeepReactiveState<TState$1> = NonNullable<TState$1> extends Array<infer U extends Record<string, any>> ? DeepReactiveState<U[]> : NonNullable<TState$1> extends Date | File ? MaybeRef<TState$1> : NonNullable<TState$1> extends Record<string, any> ? DeepReactiveState<TState$1> : MaybeRef<TState$1>;
185
- type ResetOptions<TState$1 extends unknown> = RequireOneOrNone<{
184
+ 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>;
185
+ type ResetOptions<TState extends unknown> = RequireOneOrNone<{
186
186
  /**
187
187
  * Reset validation status and reset form state to its initial state.
188
188
  *
@@ -203,7 +203,7 @@ type ResetOptions<TState$1 extends unknown> = RequireOneOrNone<{
203
203
  * Reset validation status and reset form state to the given state
204
204
  * Also set the new state as the initial state.
205
205
  */
206
- toState?: TState$1 | (() => TState$1);
206
+ toState?: TState | (() => TState);
207
207
  /**
208
208
  * Clears the $externalErrors state back to an empty object.
209
209
  *
@@ -222,18 +222,16 @@ type ScopedInstancesRecord = Record<string, Record<string, SuperCompatibleRegleR
222
222
  '~~global': Record<string, SuperCompatibleRegleRoot>;
223
223
  };
224
224
  type ScopedInstancesRecordLike = Partial<ScopedInstancesRecord>;
225
- type PartialFormState<TState$1 extends Record<string, any>> = [unknown] extends [TState$1] ? {} : Prettify<{ [K in keyof TState$1 as ExtendOnlyRealRecord<TState$1[K]> extends true ? never : TState$1[K] extends Array<any> ? never : K]?: MaybeOutput<TState$1[K]> } & { [K in keyof TState$1 as ExtendOnlyRealRecord<TState$1[K]> extends true ? K : TState$1[K] extends Array<any> ? K : never]: NonNullable<TState$1[K]> extends Array<infer U extends Record<string, any>> ? PartialFormState<U>[] : PartialFormState<TState$1[K]> }>;
226
- type RegleResult<Data extends Record<string, any> | any[] | unknown, TRules$1 extends ReglePartialRuleTree<any> | RegleFormPropertyType<any>> = {
227
- /** The result of the validation */
228
- valid: false;
229
- /** Output data, filter the result by checking the `valid` property */
230
- data: IsUnknown<Data> extends true ? unknown : IsAny<Data> extends true ? unknown : IsEmptyObject<TRules$1> extends true ? MaybeOutput<Data> : HasNamedKeys<Data> extends true ? NonNullable<Data> extends Date | File ? MaybeOutput<Raw<Data>> : NonNullable<Data> extends Array<infer U extends Record<string, any>> ? PartialFormState<U>[] : NonNullable<Data> extends Record<string, any> ? PartialFormState<NonNullable<Data>> : MaybeOutput<Data> : unknown;
225
+ 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]> }>;
226
+ type RegleResult<Data extends Record<string, any> | any[] | unknown, TRules extends ReglePartialRuleTree<any> | RegleFormPropertyType<any>> = {
227
+ /** The result of the validation */valid: false; /** Output data, filter the result by checking the `valid` property */
228
+ data: IsUnknown<Data> extends true ? unknown : IsAny<Data> extends true ? unknown : IsEmptyObject<TRules> extends true ? MaybeOutput<Data> : HasNamedKeys<Data> extends true ? NonNullable<Data> extends Date | File ? MaybeOutput<Raw<Data>> : NonNullable<Data> extends Array<infer U extends Record<string, any>> ? PartialFormState<U>[] : NonNullable<Data> extends Record<string, any> ? PartialFormState<NonNullable<Data>> : MaybeOutput<Data> : unknown;
231
229
  /**
232
230
  * Collection of all the error messages, collected for all children properties and nested forms.
233
231
  *
234
232
  * Only contains errors from properties where $dirty equals true.
235
233
  * */
236
- issues: DataTypeRegleIssues<Data, TRules$1>;
234
+ issues: DataTypeRegleIssues<Data, TRules>;
237
235
  /**
238
236
  * Collection of all the issues, collected for all children properties and nested forms.
239
237
  *
@@ -242,13 +240,13 @@ type RegleResult<Data extends Record<string, any> | any[] | unknown, TRules$1 ex
242
240
  errors: DataTypeRegleErrors<Data>;
243
241
  } | {
244
242
  valid: true;
245
- data: IsUnknown<Data> extends true ? unknown : IsAny<Data> extends true ? unknown : IsEmptyObject<TRules$1> extends true ? MaybeOutput<Data> : HasNamedKeys<Data> extends true ? NonNullable<Data> extends Array<infer U extends Record<string, any>> ? DeepSafeFormState<U, TRules$1 extends ReglePartialRuleTree<any> ? TRules$1 : {}>[] : NonNullable<Data> extends Date | File ? SafeFieldProperty<Raw<NonNullable<Data>>, TRules$1 extends ReglePartialRuleTree<any> ? TRules$1 : {}> : NonNullable<Data> extends Record<string, any> ? DeepSafeFormState<NonNullable<Data>, TRules$1 extends ReglePartialRuleTree<any> ? TRules$1 : {}> : SafeFieldProperty<Data, TRules$1 extends ReglePartialRuleTree<any> ? TRules$1 : {}> : unknown;
243
+ data: IsUnknown<Data> extends true ? unknown : IsAny<Data> extends true ? unknown : IsEmptyObject<TRules> extends true ? MaybeOutput<Data> : HasNamedKeys<Data> extends true ? NonNullable<Data> extends Array<infer U extends Record<string, any>> ? DeepSafeFormState<U, TRules extends ReglePartialRuleTree<any> ? TRules : {}>[] : NonNullable<Data> extends Date | File ? SafeFieldProperty<Raw<NonNullable<Data>>, TRules extends ReglePartialRuleTree<any> ? TRules : {}> : NonNullable<Data> extends Record<string, any> ? DeepSafeFormState<NonNullable<Data>, TRules extends ReglePartialRuleTree<any> ? TRules : {}> : SafeFieldProperty<Data, TRules extends ReglePartialRuleTree<any> ? TRules : {}> : unknown;
246
244
  issues: EmptyObject;
247
245
  errors: EmptyObject;
248
246
  };
249
- type DataTypeRegleIssues<TData extends Record<string, any> | any[] | unknown, TRules$1 extends ReglePartialRuleTree<any> | RegleFormPropertyType<any> = never> = HasNamedKeys<TData> extends true ? NonNullable<TData> extends Array<infer U> ? isRecordLiteral<U> extends true ? RegleFieldIssue<TRules$1>[] : RegleCollectionErrors<TData, true> : isRecordLiteral<TData> extends true ? RegleIssuesTree<TData> : RegleFieldIssue<TRules$1>[] : RegleFieldIssue | RegleCollectionErrors<TData, true> | RegleIssuesTree<TData>;
247
+ type DataTypeRegleIssues<TData extends Record<string, any> | any[] | unknown, TRules extends ReglePartialRuleTree<any> | RegleFormPropertyType<any> = never> = HasNamedKeys<TData> extends true ? NonNullable<TData> extends Array<infer U> ? isRecordLiteral<U> extends true ? RegleFieldIssue<TRules>[] : RegleCollectionErrors<TData, true> : isRecordLiteral<TData> extends true ? RegleIssuesTree<TData> : RegleFieldIssue<TRules>[] : RegleFieldIssue | RegleCollectionErrors<TData, true> | RegleIssuesTree<TData>;
250
248
  type DataTypeRegleErrors<TData extends Record<string, any> | any[] | unknown> = HasNamedKeys<TData> extends true ? NonNullable<TData> extends Array<infer U> ? isRecordLiteral<U> extends true ? string[] : RegleCollectionErrors<TData> : isRecordLiteral<TData> extends true ? RegleErrorTree<TData> : string[] : string[] | RegleErrorTree<TData> | RegleCollectionErrors<TData>;
251
- type RegleCollectionResult<Data extends any[], TRules$1 extends ReglePartialRuleTree<any> | RegleFormPropertyType<any>> = RegleResult<Data, TRules$1> & ({
249
+ type RegleCollectionResult<Data extends any[], TRules extends ReglePartialRuleTree<any> | RegleFormPropertyType<any>> = RegleResult<Data, TRules> & ({
252
250
  valid: false;
253
251
  issues: RegleCollectionErrors<Data, true>;
254
252
  errors: RegleCollectionErrors<Data>;
@@ -257,9 +255,9 @@ type RegleCollectionResult<Data extends any[], TRules$1 extends ReglePartialRule
257
255
  issues: EmptyObject;
258
256
  errors: EmptyObject;
259
257
  });
260
- type RegleFieldResult<Data extends any, TRules$1 extends ReglePartialRuleTree<any> | RegleFormPropertyType<any>> = RegleResult<Data, TRules$1> & ({
258
+ type RegleFieldResult<Data extends any, TRules extends ReglePartialRuleTree<any> | RegleFormPropertyType<any>> = RegleResult<Data, TRules> & ({
261
259
  valid: false;
262
- issues: RegleFieldIssue<TRules$1>[];
260
+ issues: RegleFieldIssue<TRules>[];
263
261
  errors: string[];
264
262
  } | {
265
263
  valid: true;
@@ -272,15 +270,15 @@ type $InternalRegleResult = {
272
270
  errors: $InternalRegleErrorTree | $InternalRegleCollectionErrors | string[];
273
271
  issues: $InternalRegleIssuesTree | $InternalRegleCollectionIssues | RegleFieldIssue[];
274
272
  };
275
- type DeepSafeFormState<TState$1 extends Record<string, any>, TRules$1 extends ReglePartialRuleTree<Record<string, any>, CustomRulesDeclarationTree> | undefined> = [unknown] extends [TState$1] ? {} : TRules$1 extends undefined ? TState$1 : TRules$1 extends ReglePartialRuleTree<TState$1, CustomRulesDeclarationTree> ? Prettify<{ [K in keyof TState$1 as IsPropertyOutputRequired<TState$1[K], TRules$1[K]> extends false ? K : never]?: SafeProperty<TState$1[K], TRules$1[K]> extends MaybeInput<infer M> ? MaybeOutput<M> : SafeProperty<TState$1[K], TRules$1[K]> } & { [K in keyof TState$1 as IsPropertyOutputRequired<TState$1[K], TRules$1[K]> extends false ? never : K]-?: unknown extends SafeProperty<TState$1[K], TRules$1[K]> ? unknown : NonNullable<SafeProperty<TState$1[K], TRules$1[K]>> }> : TState$1;
273
+ type DeepSafeFormState<TState extends Record<string, any>, TRules extends ReglePartialRuleTree<Record<string, any>, CustomRulesDeclarationTree> | undefined> = [unknown] extends [TState] ? {} : TRules extends undefined ? TState : TRules extends ReglePartialRuleTree<TState, CustomRulesDeclarationTree> ? Prettify<{ [K in keyof TState as IsPropertyOutputRequired<TState[K], TRules[K]> extends false ? K : never]?: SafeProperty<TState[K], TRules[K]> extends MaybeInput<infer M> ? MaybeOutput<M> : SafeProperty<TState[K], TRules[K]> } & { [K in keyof TState as IsPropertyOutputRequired<TState[K], TRules[K]> extends false ? never : K]-?: unknown extends SafeProperty<TState[K], TRules[K]> ? unknown : NonNullable<SafeProperty<TState[K], TRules[K]>> }> : TState;
276
274
  type FieldHaveRequiredRule<TRule extends RegleFormPropertyType<any, any> | undefined = never> = TRule extends MaybeRefOrComputedRef<RegleRuleDecl<any, any>> ? { [K in keyof UnwrapRef<TRule>]-?: UnwrapRef<TRule>[K] extends RegleRuleDefinition<unknown, any, any[], any, any, any, any, true> ? true : false }[keyof UnwrapRef<TRule>] extends false ? false : true : false;
277
- type ObjectHaveAtLeastOneRequiredField<TState$1 extends Record<string, any>, TRules$1 extends ReglePartialRuleTree<TState$1, any>> = TState$1 extends Maybe<TState$1> ? ({ [K in keyof NonNullable<TState$1>]-?: IsPropertyOutputRequired<NonNullable<TState$1>[K], TRules$1[K] extends RegleFormPropertyType<any, any> ? TRules$1[K] : {}> } & {
278
- $self: IsPropertyOutputRequired<string, TRules$1['$self']>;
279
- })[keyof TState$1 | '$self'] extends false ? false : true : true;
280
- type ArrayHaveAtLeastOneRequiredField<TState$1 extends Maybe<any[]>, TRule extends RegleCollectionRuleDecl<TState$1>> = TState$1 extends Maybe<TState$1> ? FieldHaveRequiredRule<Omit<TRule, '$each'> extends MaybeRef<RegleRuleDecl> ? Omit<UnwrapRef<TRule>, '$each'> : {}> | ObjectHaveAtLeastOneRequiredField<ArrayElement<NonNullable<TState$1>>, ExtractFromGetter<TRule['$each']> extends undefined ? {} : NonNullable<ExtractFromGetter<TRule['$each']>>> extends false ? false : true : true;
281
- type SafeProperty<TState$1, TRule extends RegleFormPropertyType<any, any> | undefined> = unknown extends TState$1 ? unknown : TRule extends RegleCollectionRuleDecl<any, any> ? TState$1 extends Array<infer U extends Record<string, any>> ? DeepSafeFormState<U, ExtractFromGetter<TRule['$each']>>[] : TState$1 : TRule extends ReglePartialRuleTree<any, any> ? ExtendOnlyRealRecord<TState$1> extends true ? DeepSafeFormState<NonNullable<TState$1> extends Record<string, any> ? JoinDiscriminatedUnions<NonNullable<TState$1>> : {}, TRule> : TRule extends MaybeRef<RegleRuleDecl<any, any>> ? FieldHaveRequiredRule<UnwrapRef<TRule>> extends true ? TState$1 : MaybeOutput<TState$1> : TState$1 : TState$1;
282
- type IsPropertyOutputRequired<TState$1, TRule extends RegleFormPropertyType<any, any> | undefined> = [unknown] extends [TState$1] ? unknown : NonNullable<TState$1> extends Array<any> ? TRule extends RegleCollectionRuleDecl<any, any> ? ArrayHaveAtLeastOneRequiredField<NonNullable<TState$1>, TRule> extends false ? false : true : false : TRule extends ReglePartialRuleTree<any, any> ? ExtendOnlyRealRecord<TState$1> extends true ? ObjectHaveAtLeastOneRequiredField<NonNullable<TState$1> extends Record<string, any> ? NonNullable<TState$1> : {}, TRule extends ReglePartialRuleTree<NonNullable<TState$1> extends Record<string, any> ? NonNullable<TState$1> : {}, any> ? TRule : {}> extends false ? false : true : TRule extends MaybeRef<RegleRuleDecl<any, any>> ? FieldHaveRequiredRule<UnwrapRef<TRule>> extends false ? false : true : false : false;
283
- type SafeFieldProperty<TState$1, TRule extends RegleFormPropertyType<any, any> | undefined = never> = FieldHaveRequiredRule<TRule> extends true ? NonNullable<TState$1> : MaybeOutput<TState$1>;
275
+ type ObjectHaveAtLeastOneRequiredField<TState extends Record<string, any>, TRules extends ReglePartialRuleTree<TState, any>> = TState extends Maybe<TState> ? ({ [K in keyof NonNullable<TState>]-?: IsPropertyOutputRequired<NonNullable<TState>[K], TRules[K] extends RegleFormPropertyType<any, any> ? TRules[K] : {}> } & {
276
+ $self: IsPropertyOutputRequired<string, TRules['$self']>;
277
+ })[keyof TState | '$self'] extends false ? false : true : true;
278
+ type ArrayHaveAtLeastOneRequiredField<TState extends Maybe<any[]>, TRule extends RegleCollectionRuleDecl<TState>> = TState extends Maybe<TState> ? FieldHaveRequiredRule<Omit<TRule, '$each'> extends MaybeRef<RegleRuleDecl> ? Omit<UnwrapRef<TRule>, '$each'> : {}> | ObjectHaveAtLeastOneRequiredField<ArrayElement<NonNullable<TState>>, ExtractFromGetter<TRule['$each']> extends undefined ? {} : NonNullable<ExtractFromGetter<TRule['$each']>>> extends false ? false : true : true;
279
+ 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 MaybeRef<RegleRuleDecl<any, any>> ? FieldHaveRequiredRule<UnwrapRef<TRule>> extends true ? TState : MaybeOutput<TState> : TState : TState;
280
+ 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 ReglePartialRuleTree<NonNullable<TState> extends Record<string, any> ? NonNullable<TState> : {}, any> ? TRule : {}> extends false ? false : true : TRule extends MaybeRef<RegleRuleDecl<any, any>> ? FieldHaveRequiredRule<UnwrapRef<TRule>> extends false ? false : true : false : false;
281
+ type SafeFieldProperty<TState, TRule extends RegleFormPropertyType<any, any> | undefined = never> = FieldHaveRequiredRule<TRule> extends true ? NonNullable<TState> : MaybeOutput<TState>;
284
282
  /** Types to be augmented by @regle/schemas */
285
283
  interface NarrowVariantExtracts {}
286
284
  interface NarrowVariantFieldExtracts<T extends unknown> {}
@@ -290,31 +288,31 @@ type NarrowVariant<TRoot extends {
290
288
  [x: string]: unknown;
291
289
  };
292
290
  $value: unknown;
293
- }, TKey$1 extends keyof TRoot, TValue$1 extends (LazyJoinDiscriminatedUnions<Exclude<TRoot[TKey$1], RegleCollectionStatus<any, any, any> | RegleStatus<any, any, any> | NarrowVariantExtracts[keyof NarrowVariantExtracts]>> extends {
291
+ }, TKey extends keyof TRoot, TValue extends (LazyJoinDiscriminatedUnions<Exclude<TRoot[TKey], RegleCollectionStatus<any, any, any> | RegleStatus<any, any, any> | NarrowVariantExtracts[keyof NarrowVariantExtracts]>> extends {
294
292
  $value: infer V;
295
- } ? V : unknown)> = Extract<TRoot, { [K in TKey$1]: RegleFieldStatus<TValue$1, any, any> | RegleFieldStatus<MaybeInput<TValue$1>, any, any> | (IsEmptyObject<NarrowVariantFieldExtracts<TValue$1>> extends true ? EmptyObject : NarrowVariantFieldExtracts<TValue$1>[keyof NarrowVariantFieldExtracts<TValue$1>]) }> & {
296
- $fields: Extract<TRoot['$fields'], { [K in TKey$1]: RegleFieldStatus<TValue$1, any, any> | RegleFieldStatus<MaybeInput<TValue$1>, any, any> | (IsEmptyObject<NarrowVariantFieldExtracts<TValue$1>> extends true ? EmptyObject : NarrowVariantFieldExtracts<TValue$1>[keyof NarrowVariantFieldExtracts<TValue$1>]) }> & { [K in TKey$1]: TRoot[K] & {
297
- $value: TValue$1;
293
+ } ? V : unknown)> = Extract<TRoot, { [K in TKey]: RegleFieldStatus<TValue, any, any> | RegleFieldStatus<MaybeInput<TValue>, any, any> | (IsEmptyObject<NarrowVariantFieldExtracts<TValue>> extends true ? EmptyObject : NarrowVariantFieldExtracts<TValue>[keyof NarrowVariantFieldExtracts<TValue>]) }> & {
294
+ $fields: Extract<TRoot['$fields'], { [K in TKey]: RegleFieldStatus<TValue, any, any> | RegleFieldStatus<MaybeInput<TValue>, any, any> | (IsEmptyObject<NarrowVariantFieldExtracts<TValue>> extends true ? EmptyObject : NarrowVariantFieldExtracts<TValue>[keyof NarrowVariantFieldExtracts<TValue>]) }> & { [K in TKey]: TRoot[K] & {
295
+ $value: TValue;
298
296
  } };
299
297
  } & {
300
- $value: Omit<TRoot['$value'], TKey$1> & { [K in TKey$1]: TValue$1 };
301
- } & { [K in TKey$1]: TRoot[K] & {
302
- $value: TValue$1;
298
+ $value: Omit<TRoot['$value'], TKey> & { [K in TKey]: TValue };
299
+ } & { [K in TKey]: TRoot[K] & {
300
+ $value: TValue;
303
301
  } };
304
- type MaybeVariantStatus<TState$1 extends Record<string, any> | undefined = Record<string, any>, TRules$1 extends ReglePartialRuleTree<NonNullable<TState$1>> = Record<string, any>, TShortcuts extends RegleShortcutDefinition = {}> = IsUnion<NonNullable<TState$1>> extends true ? IsUnion<TRules$1> extends true ? Omit<RegleStatus<TState$1, TRules$1, TShortcuts>, '$fields'> & {
305
- $fields: ProcessChildrenFields<TState$1, TRules$1, TShortcuts>[keyof ProcessChildrenFields<TState$1, TRules$1, TShortcuts>];
306
- } & (HasNamedKeys<TState$1> extends true ? ProcessChildrenFields<TState$1, TRules$1, TShortcuts>[keyof ProcessChildrenFields<TState$1, TRules$1, TShortcuts>] : {}) : RegleStatus<JoinDiscriminatedUnions<TState$1>, TRules$1 extends ReglePartialRuleTree<NonNullable<JoinDiscriminatedUnions<TState$1>>> ? TRules$1 : EmptyObject, TShortcuts> : RegleStatus<TState$1, TRules$1, TShortcuts>;
307
- type ProcessChildrenFields<TState$1 extends Record<string, any> | undefined, TRules$1 extends ReglePartialRuleTree<NonNullable<TState$1>>, TShortcuts extends RegleShortcutDefinition = {}> = { [TIndex in keyof TupleToPlainObj<UnionToTuple<TState$1>>]: TIndex extends `${infer TIndexInt extends number}` ? { [TKey in keyof UnionToTuple<TState$1>[TIndexInt] as IsEmptyObject<FindCorrespondingVariant<UnionToTuple<TState$1>[TIndexInt] extends Record<string, any> ? UnionToTuple<TState$1>[TIndexInt] : never, UnionToTuple<TRules$1>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject> extends true ? TKey extends keyof TState$1 ? TState$1[TKey] extends NonNullable<TState$1[TKey]> ? TKey : never : never : TKey]-?: InferRegleStatusType<FindCorrespondingVariant<UnionToTuple<TState$1>[TIndexInt] extends Record<string, any> ? UnionToTuple<TState$1>[TIndexInt] : never, UnionToTuple<TRules$1>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject, NonNullable<UnionToTuple<TState$1>[TIndexInt]>, TKey, TShortcuts> } & { [TKey in keyof UnionToTuple<TState$1>[TIndexInt] as IsEmptyObject<FindCorrespondingVariant<UnionToTuple<TState$1>[TIndexInt] extends Record<string, any> ? UnionToTuple<TState$1>[TIndexInt] : never, UnionToTuple<TRules$1>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject> extends true ? TKey extends keyof TState$1 ? TState$1[TKey] extends NonNullable<TState$1[TKey]> ? never : TKey : TKey : never]?: InferRegleStatusType<FindCorrespondingVariant<UnionToTuple<TState$1>[TIndexInt] extends Record<string, any> ? UnionToTuple<TState$1>[TIndexInt] : never, UnionToTuple<TRules$1>> extends [infer U] ? TKey extends keyof U ? U[TKey] : EmptyObject : EmptyObject, NonNullable<UnionToTuple<TState$1>[TIndexInt]>, TKey, TShortcuts> } : {} };
308
- type FindCorrespondingVariant<TState$1 extends Record<string, any>, TRules$1 extends any[]> = TRules$1 extends [infer F, ...infer R] ? F extends ReglePartialRuleTree<TState$1> ? [F] : FindCorrespondingVariant<TState$1, R> : [];
309
- type PossibleLiteralTypes<T extends Record<string, any>, TKey$1 extends keyof T> = unknown extends T[TKey$1] ? {
310
- [x: string]: { [K in TKey$1]-?: Omit<RegleRuleDecl<any, Partial<ExtendedRulesDeclarations>>, 'literal'> & {
302
+ 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 ? IsUnion<TRules> extends true ? Omit<RegleStatus<TState, TRules, TShortcuts>, '$fields'> & {
303
+ $fields: ProcessChildrenFields<TState, TRules, TShortcuts>[keyof ProcessChildrenFields<TState, TRules, TShortcuts>];
304
+ } & (HasNamedKeys<TState> extends true ? ProcessChildrenFields<TState, TRules, TShortcuts>[keyof ProcessChildrenFields<TState, TRules, TShortcuts>] : {}) : RegleStatus<JoinDiscriminatedUnions<TState>, TRules extends ReglePartialRuleTree<NonNullable<JoinDiscriminatedUnions<TState>>> ? TRules : EmptyObject, TShortcuts> : RegleStatus<TState, TRules, TShortcuts>;
305
+ 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> } : {} };
306
+ type FindCorrespondingVariant<TState extends Record<string, any>, TRules extends any[]> = TRules extends [infer F, ...infer R] ? F extends ReglePartialRuleTree<TState> ? [F] : FindCorrespondingVariant<TState, R> : [];
307
+ type PossibleLiteralTypes<T extends Record<string, any>, TKey extends keyof T> = unknown extends T[TKey] ? {
308
+ [x: string]: { [K in TKey]-?: Omit<RegleRuleDecl<any, Partial<ExtendedRulesDeclarations>>, 'literal'> & {
311
309
  literal?: RegleRuleDefinition<'literal', any, [literal: any], false, boolean, any, string | number, true>;
312
310
  } };
313
- } : { [TVal in NonNullable<T[TKey$1]>]: { [K in TKey$1]-?: Omit<RegleRuleDecl<TVal, Partial<ExtendedRulesDeclarations>>, 'literal'> & {
311
+ } : { [TVal in NonNullable<T[TKey]>]: { [K in TKey]-?: Omit<RegleRuleDecl<TVal, Partial<ExtendedRulesDeclarations>>, 'literal'> & {
314
312
  literal?: RegleRuleDefinition<'literal', MaybeInput<TVal>, [literal: TVal], false, boolean, MaybeInput<TVal>, string | number, true>;
315
313
  } } };
316
- type RequiredForm<T extends Record<string, any>, TKey$1 extends keyof T> = Omit<ReglePartialRuleTree<T>, TKey$1> & PossibleLiteralTypes<T, TKey$1>[keyof PossibleLiteralTypes<T, TKey$1>];
317
- type VariantTuple<T extends Record<string, any>, TKey$1 extends keyof T> = [RequiredForm<T, TKey$1>, ...RequiredForm<T, TKey$1>[]];
314
+ type RequiredForm<T extends Record<string, any>, TKey extends keyof T> = Omit<ReglePartialRuleTree<T>, TKey> & PossibleLiteralTypes<T, TKey>[keyof PossibleLiteralTypes<T, TKey>];
315
+ type VariantTuple<T extends Record<string, any>, TKey extends keyof T> = [RequiredForm<T, TKey>, ...RequiredForm<T, TKey>[]];
318
316
  /**
319
317
  * Combine all members of a union type, merging types for each key, and keeping loose types
320
318
  */
@@ -325,8 +323,8 @@ type ResolveKeys<TUnion extends unknown> = Partial<UnionToIntersection<RemoveCom
325
323
  */
326
324
  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;
327
325
  type DumbJoinDiscriminatedUnions<TUnion extends unknown> = isRecordLiteral<TUnion> extends true ? Prettify<Partial<UnionToIntersection<TUnion>> & Pick<NonNullable<TUnion>, keyof NonNullable<TUnion>>> : TUnion;
328
- type RemoveCommonKey<T extends readonly any[], K$1 extends PropertyKey> = T extends [infer F, ...infer R] ? [Prettify<Omit<F, K$1>>, ...RemoveCommonKey<R, K$1>] : [];
329
- type HasCommonKey<T extends readonly any[], K$1 extends PropertyKey> = T extends [infer F, ...infer R] ? K$1 extends keyof F ? true : HasCommonKey<R, K$1> : false;
326
+ type RemoveCommonKey<T extends readonly any[], K extends PropertyKey> = T extends [infer F, ...infer R] ? [Prettify<Omit<F, K>>, ...RemoveCommonKey<R, K>] : [];
327
+ type HasCommonKey<T extends readonly any[], K extends PropertyKey> = T extends [infer F, ...infer R] ? K extends keyof F ? true : HasCommonKey<R, K> : false;
330
328
  /**
331
329
  * Transforms a union and apply undefined values to non-present keys to support intersection
332
330
  */
@@ -342,7 +340,7 @@ type RetrieveUnionUnknownKeysOf<T extends readonly any[]> = T extends [infer F,
342
340
  /**
343
341
  * Get item value from object, otherwise fallback to undefined. Avoid TS to not be able to infer keys not present on all unions
344
342
  */
345
- type GetMaybeObjectValue<O extends Record<string, any>, K$1 extends string> = K$1 extends keyof O ? O[K$1] : undefined;
343
+ type GetMaybeObjectValue<O extends Record<string, any>, K extends string> = K extends keyof O ? O[K] : undefined;
346
344
  type RemoveIndexSignature<T> = { [K in keyof T as string extends K ? never : number extends K ? never : symbol extends K ? never : K]: T[K] };
347
345
  /**
348
346
  * Merge every boolean property into a single boolean.
@@ -372,19 +370,20 @@ type MaybeInput<T = any> = T | null | undefined;
372
370
  type MaybeOutput<T = any> = T | undefined;
373
371
  type MaybeReadonly<T> = T | Readonly<T>;
374
372
  type NonUndefined<T> = Exclude<T, undefined>;
373
+ type MaybeNullable<T> = Or<IsNullable<T>, IsOptional<T>>;
375
374
  type PromiseReturn<T> = T extends Promise<infer U> ? U : T;
376
- type MaybeGetter<T, V$1 = any, TAdd extends Record<string, any> = {}, TSelf extends Record<string, any> = {}> = (T & TSelf) | ((value: Ref<V$1>, index: number) => T & TAdd & TSelf);
375
+ type MaybeGetter<T, V = any, TAdd extends Record<string, any> = {}, TSelf extends Record<string, any> = {}> = (T & TSelf) | ((value: Ref<V>, index: number) => T & TAdd & TSelf);
377
376
  type MaybeComputedOrGetter<T> = MaybeRefOrComputedRef<T> | ((...args: any[]) => T);
378
377
  type Unwrap<T extends MaybeRef<unknown>> = T extends Ref ? UnwrapRef<T> : UnwrapNestedRefs<T>;
379
378
  type UnwrapSimple<T extends MaybeRef<Record<string, any>>> = T extends MaybeComputedOrGetter<infer U> ? U : T extends Ref<infer U> ? U : T extends ((...args: any[]) => infer U) ? U : T;
380
379
  type ExtractFromGetter<T extends MaybeGetter<any, any, any>> = T extends ((value: Ref<any>, index: number) => infer U extends Record<string, any>) ? U : T;
381
380
  type ExtendOnlyRealRecord<T extends unknown> = NonNullable<T> extends File | Date | RegleStatic<{}> | RegleStaticImpl<{}> ? false : NonNullable<T> extends Record<string, any> ? true : false;
382
- type OmitByType<T extends Record<string, any>, U$1> = { [K in keyof T as T[K] extends U$1 ? never : K]: T[K] };
381
+ type OmitByType<T extends Record<string, any>, U> = { [K in keyof T as T[K] extends U ? never : K]: T[K] };
383
382
  type DeepMaybeRef<T extends Record<string, any>> = { [K in keyof T]: MaybeRef<T[K]> };
384
- type ExcludeByType<T, U$1> = { [K in keyof T as T[K] extends U$1 ? never : K]: T[K] extends U$1 ? never : T[K] };
383
+ type ExcludeByType<T, U> = { [K in keyof T as T[K] extends U ? never : K]: T[K] extends U ? never : T[K] };
385
384
  type PrimitiveTypes = string | number | boolean | bigint | Date | File;
386
385
  type isRecordLiteral<T extends unknown> = NonNullable<T> extends Date | File | RegleStatic<unknown> | RegleStaticImpl<unknown> ? false : NonNullable<T> extends Record<string, any> ? true : false;
387
- type NoInferLegacy<A$1 extends any> = [A$1][A$1 extends any ? 0 : never];
386
+ type NoInferLegacy<A extends any> = [A][A extends any ? 0 : never];
388
387
  /**
389
388
  * Extract the element type from an array.
390
389
  *
@@ -399,7 +398,7 @@ type ArrayElement<T> = T extends Array<infer U> ? U : never;
399
398
  */
400
399
  type NonEmptyTuple<T> = [T, ...T[]] | T[];
401
400
  interface inferRulesFn<TCustomRules extends Partial<ExtendedRulesDeclarations>> {
402
- <TState$1 extends MaybeRef<Record<string, any> | MaybeInput<PrimitiveTypes>>, TRules$1 extends ReglePartialRuleTree<Unwrap<TState$1 extends Record<string, any> ? TState$1 : {}>, Partial<DefaultValidatorsTree> & TCustomRules>, TDecl extends RegleRuleDecl<NonNullable<TState$1>, Partial<DefaultValidatorsTree> & TCustomRules>>(state: Maybe<TState$1> | DeepReactiveState<TState$1>, rulesFactory: Unwrap<TState$1> extends MaybeInput<PrimitiveTypes> ? TDecl : Unwrap<TState$1> extends Record<string, any> ? TRules$1 : {}): NonNullable<Unwrap<TState$1>> extends PrimitiveTypes ? TDecl : TRules$1;
401
+ <TState extends MaybeRef<Record<string, any> | MaybeInput<PrimitiveTypes>>, TRules extends ReglePartialRuleTree<Unwrap<TState extends Record<string, any> ? TState : {}>, Partial<DefaultValidatorsTree> & TCustomRules>, TDecl extends RegleRuleDecl<NonNullable<TState>, Partial<DefaultValidatorsTree> & TCustomRules>>(state: Maybe<TState> | DeepReactiveState<TState>, rulesFactory: Unwrap<TState> extends MaybeInput<PrimitiveTypes> ? TDecl : Unwrap<TState> extends Record<string, any> ? TRules : {}): NonNullable<Unwrap<TState>> extends PrimitiveTypes ? TDecl : TRules;
403
402
  }
404
403
  /**
405
404
  * Type helper to provide autocomplete and type-checking for your form rules.
@@ -567,9 +566,9 @@ declare function extendRegleConfig<TRootCustomRules extends Partial<ExtendedRule
567
566
  useRegle: useRegleFn<Merge<TRootCustomRules, TCustomRules>, TRootShortcuts & TShortcuts>;
568
567
  inferRules: inferRulesFn<Merge<TRootCustomRules, TCustomRules>>;
569
568
  };
570
- type useRegleFnOptions<TState$1 extends Record<string, any> | MaybeInput<PrimitiveTypes>, TRules$1 extends ReglePartialRuleTree<NonNullable<JoinDiscriminatedUnions<TState$1>>, Partial<ExtendedRulesDeclarations>>, TAdditionalOptions extends Record<string, any>, TValidationGroups extends Record<string, RegleValidationGroupEntry[]>> = TState$1 extends Record<string, any> ? Partial<DeepMaybeRef<RegleBehaviourOptions>> & LocalRegleBehaviourOptions<JoinDiscriminatedUnions<TState$1>, TRules$1, TValidationGroups> & TAdditionalOptions : Partial<DeepMaybeRef<RegleBehaviourOptions>> & TAdditionalOptions;
569
+ type useRegleFnOptions<TState extends Record<string, any> | MaybeInput<PrimitiveTypes>, TRules extends ReglePartialRuleTree<NonNullable<JoinDiscriminatedUnions<TState>>, Partial<ExtendedRulesDeclarations>>, TAdditionalOptions extends Record<string, any>, TValidationGroups extends Record<string, RegleValidationGroupEntry[]>> = TState extends Record<string, any> ? Partial<DeepMaybeRef<RegleBehaviourOptions>> & LocalRegleBehaviourOptions<JoinDiscriminatedUnions<TState>, TRules, TValidationGroups> & TAdditionalOptions : Partial<DeepMaybeRef<RegleBehaviourOptions>> & TAdditionalOptions;
571
570
  interface useRegleFn<TCustomRules extends Partial<ExtendedRulesDeclarations>, TShortcuts extends RegleShortcutDefinition<any> = never, TAdditionalReturnProperties extends Record<string, any> = {}, TAdditionalOptions extends Record<string, any> = {}> {
572
- <TState$1 extends MaybeRef<Record<string, any> | MaybeInput<PrimitiveTypes>>, TRules$1 extends ReglePartialRuleTree<JoinDiscriminatedUnions<Unwrap<TState$1>>, Partial<ExtendedRulesDeclarations> & Partial<TCustomRules>>, TDecl extends RegleRuleDecl<NonNullable<Unwrap<TState$1>>, Partial<ExtendedRulesDeclarations> & Partial<TCustomRules>>, TValidationGroups extends Record<string, RegleValidationGroupEntry[]>>(...params: [state: Maybe<TState$1> | DeepReactiveState<TState$1>, rulesFactory: Unwrap<TState$1> extends MaybeInput<PrimitiveTypes> ? MaybeRefOrGetter<TDecl> : Unwrap<TState$1> extends Record<string, any> ? MaybeComputedOrGetter<TRules$1> : {}, ...(HaveAnyRequiredProps<useRegleFnOptions<Unwrap<TState$1>, TRules$1, TAdditionalOptions, TValidationGroups>> extends true ? [options: useRegleFnOptions<Unwrap<TState$1>, TRules$1, TAdditionalOptions, TValidationGroups>] : [options?: useRegleFnOptions<Unwrap<TState$1>, TRules$1, TAdditionalOptions, TValidationGroups>])]): NonNullable<Unwrap<TState$1>> extends PrimitiveTypes ? RegleSingleField<NonNullable<Unwrap<TState$1>>, TDecl, TShortcuts, TAdditionalReturnProperties> : Regle<Unwrap<TState$1> extends Record<string, any> ? Unwrap<TState$1> : {}, UnwrapSimple<TRules$1> extends Record<string, any> ? UnwrapSimple<TRules$1> : {}, TValidationGroups, TShortcuts, TAdditionalReturnProperties>;
571
+ <TState extends MaybeRef<Record<string, any> | MaybeInput<PrimitiveTypes>>, TRules extends ReglePartialRuleTree<JoinDiscriminatedUnions<Unwrap<TState>>, Partial<ExtendedRulesDeclarations> & Partial<TCustomRules>>, TDecl extends RegleRuleDecl<NonNullable<Unwrap<TState>>, Partial<ExtendedRulesDeclarations> & Partial<TCustomRules>>, TValidationGroups extends Record<string, RegleValidationGroupEntry[]>>(...params: [state: Maybe<TState> | DeepReactiveState<TState>, rulesFactory: Unwrap<TState> extends MaybeInput<PrimitiveTypes> ? MaybeRefOrGetter<TDecl> : Unwrap<TState> extends Record<string, any> ? MaybeComputedOrGetter<TRules> : {}, ...(HaveAnyRequiredProps<useRegleFnOptions<Unwrap<TState>, TRules, TAdditionalOptions, TValidationGroups>> extends true ? [options: useRegleFnOptions<Unwrap<TState>, TRules, TAdditionalOptions, TValidationGroups>] : [options?: useRegleFnOptions<Unwrap<TState>, TRules, TAdditionalOptions, TValidationGroups>])]): NonNullable<Unwrap<TState>> extends PrimitiveTypes ? RegleSingleField<NonNullable<Unwrap<TState>>, TDecl, TShortcuts, TAdditionalReturnProperties> : Regle<Unwrap<TState> extends Record<string, any> ? Unwrap<TState> : {}, UnwrapSimple<TRules> extends Record<string, any> ? UnwrapSimple<TRules> : {}, TValidationGroups, TShortcuts, TAdditionalReturnProperties>;
573
572
  __config?: GlobalConfigOptions<TCustomRules, TShortcuts>;
574
573
  }
575
574
  /**
@@ -679,9 +678,81 @@ declare function flatErrors(errors: $InternalRegleErrors, options: {
679
678
  declare function flatErrors(errors: $InternalRegleErrors, options?: {
680
679
  includePath?: false;
681
680
  }): string[];
682
- type useRulesFnOptions<TRules$1 extends RegleUnknownRulesTree | RegleRuleDecl, TValidationGroups extends Record<string, RegleValidationGroupEntry[]>, TState$1 = InferInput<TRules$1>> = Partial<DeepMaybeRef<RegleBehaviourOptions>> & LocalRegleBehaviourOptions<JoinDiscriminatedUnions<TState$1 extends Record<string, any> ? Unwrap<TState$1> : {}>, TState$1 extends Record<string, any> ? (TRules$1 extends Record<string, any> ? TRules$1 : {}) : {}, TValidationGroups>;
681
+ /**
682
+ * Retrieves error messages for a specific field using a dot-notation path.
683
+ * Provides type-safe access to nested error arrays in a Regle instance.
684
+ *
685
+ * @typeParam TRegle - The Regle instance type (root or status)
686
+ * @typeParam TPath - The dot-notation path type, validated at compile-time
687
+ *
688
+ * @param r$ - The Regle instance (e.g., from `useRegle()`)
689
+ * @param path - Dot-notation path to the field (e.g., `'user.email'` or `'items.0.name'`)
690
+ * @returns Array of error strings for the field, or `undefined` if path doesn't exist
691
+ *
692
+ * @example
693
+ * ```ts
694
+ * import { getErrors, useRegle } from '@regle/core';
695
+ * import { required, email } from '@regle/rules';
696
+ *
697
+ * const { r$ } = useRegle(
698
+ * { user: { email: '' } },
699
+ * { user: { email: { required, email } } }
700
+ * );
701
+ *
702
+ * await r$.$validate();
703
+ *
704
+ * // Type-safe access to nested errors
705
+ * const emailErrors = getErrors(r$, 'user.email');
706
+ * // ['This field is required']
707
+ *
708
+ * // Works with collections too
709
+ * const itemErrors = getErrors(r$, 'items.0.name');
710
+ * ```
711
+ *
712
+ * @see {@link https://reglejs.dev/core-concepts/displaying-errors#get-errors-by-path Documentation}
713
+ */
714
+ declare function getErrors<TRegle extends SuperCompatibleRegleRoot | SuperCompatibleRegleStatus, TPath extends Paths<TRegle['$errors']> | (string & {})>(r$: MaybeRef<TRegle>, path: TPath): IsStringLiteral<TPath> extends true ? Get<TRegle['$errors'], TPath & string> : string[] | undefined;
715
+ /**
716
+ * Retrieves detailed validation issues for a specific field using a dot-notation path.
717
+ * Issues contain more information than errors, including the rule name, property, and metadata.
718
+ *
719
+ * @typeParam TRegle - The Regle instance type (root or status)
720
+ * @typeParam TPath - The dot-notation path type, validated at compile-time
721
+ *
722
+ * @param r$ - The Regle instance (e.g., from `useRegle()`)
723
+ * @param path - Dot-notation path to the field (e.g., `'user.email'` or `'items.0.name'`)
724
+ * @returns Array of `RegleFieldIssue` objects for the field, or `undefined` if path doesn't exist
725
+ *
726
+ * @example
727
+ * ```ts
728
+ * import { getIssues, useRegle } from '@regle/core';
729
+ * import { required, email } from '@regle/rules';
730
+ *
731
+ * const { r$ } = useRegle(
732
+ * { user: { email: '' } },
733
+ * { user: { email: { required, email } } }
734
+ * );
735
+ *
736
+ * await r$.$validate();
737
+ *
738
+ * // Type-safe access to nested issues with full metadata
739
+ * const emailIssues = getIssues(r$, 'user.email');
740
+ * // [{
741
+ * // $message: 'This field is required',
742
+ * // $property: 'email',
743
+ * // $rule: 'required'
744
+ * // }]
745
+ *
746
+ * // Works with collections too
747
+ * const itemIssues = getIssues(r$, 'items.0.name');
748
+ * ```
749
+ *
750
+ * @see {@link https://reglejs.dev/core-concepts/displaying-errors#get-issues-by-path Documentation}
751
+ */
752
+ declare function getIssues<TRegle extends SuperCompatibleRegleRoot | SuperCompatibleRegleStatus, TPath extends Paths<TRegle['$issues']>>(r$: MaybeRef<TRegle>, path: TPath | (string & {})): IsStringLiteral<TPath> extends true ? Get<TRegle['$issues'], TPath & string> : RegleFieldIssue[] | undefined;
753
+ type useRulesFnOptions<TRules extends RegleUnknownRulesTree | RegleRuleDecl, TValidationGroups extends Record<string, RegleValidationGroupEntry[]>, TState = InferInput<TRules>> = Partial<DeepMaybeRef<RegleBehaviourOptions>> & LocalRegleBehaviourOptions<JoinDiscriminatedUnions<TState extends Record<string, any> ? Unwrap<TState> : {}>, TState extends Record<string, any> ? (TRules extends Record<string, any> ? TRules : {}) : {}, TValidationGroups>;
683
754
  interface useRulesFn<TCustomRules extends Partial<ExtendedRulesDeclarations>, TShortcuts extends RegleShortcutDefinition<any> = never> {
684
- <TRules$1 extends RegleUnknownRulesTree | RegleRuleDecl, TDecl extends RegleRuleDecl<NonNullable<TState$1>, Partial<ExtendedRulesDeclarations> & TCustomRules>, TValidationGroups extends Record<string, RegleValidationGroupEntry[]>, TState$1 extends Record<string, any> = InferInput<TRules$1>>(rulesFactory: TState$1 extends Record<string, any> ? MaybeRef<TRules$1> | ((...args: any[]) => TRules$1) : {}, options?: useRulesFnOptions<TRules$1, TValidationGroups, TState$1>): NonNullable<TState$1> extends PrimitiveTypes ? Raw<RegleFieldStatus<NonNullable<TState$1>, TDecl, TShortcuts>> & StandardSchemaV1<TState$1> : Raw<RegleRoot<TState$1 extends Record<string, any> ? Unwrap<TState$1> : {}, TRules$1 extends Record<string, any> ? TRules$1 : {}, TValidationGroups, TShortcuts>> & StandardSchemaV1<TState$1>;
755
+ <TRules extends RegleUnknownRulesTree | RegleRuleDecl, TDecl extends RegleRuleDecl<NonNullable<TState>, Partial<ExtendedRulesDeclarations> & TCustomRules>, TValidationGroups extends Record<string, RegleValidationGroupEntry[]>, TState extends Record<string, any> = InferInput<TRules>>(rulesFactory: TState extends Record<string, any> ? MaybeRef<TRules> | ((...args: any[]) => TRules) : {}, options?: useRulesFnOptions<TRules, TValidationGroups, TState>): NonNullable<TState> extends PrimitiveTypes ? Raw<RegleFieldStatus<NonNullable<TState>, TDecl, TShortcuts>> & StandardSchemaV1<TState> : Raw<RegleRoot<TState extends Record<string, any> ? Unwrap<TState> : {}, TRules extends Record<string, any> ? TRules : {}, TValidationGroups, TShortcuts>> & StandardSchemaV1<TState>;
685
756
  __config?: GlobalConfigOptions<TCustomRules, TShortcuts>;
686
757
  }
687
758
  /**
@@ -741,16 +812,16 @@ type InferRegleShortcuts<T extends useRegleFn<any, any>> = T extends useRegleFn<
741
812
  /**
742
813
  * Extract a set rules and setting them as required
743
814
  */
744
- type RegleEnforceRequiredRules<TRules$1 extends keyof DefaultValidators> = Omit<Partial<DefaultValidatorsTree>, TRules$1> & { [K in TRules$1]-?: UnwrapRuleWithParams<DefaultValidators[K]> };
815
+ type RegleEnforceRequiredRules<TRules extends keyof DefaultValidators> = Omit<Partial<DefaultValidatorsTree>, TRules> & { [K in TRules]-?: UnwrapRuleWithParams<DefaultValidators[K]> };
745
816
  /**
746
817
  * Extract a set of custom rules from a global configuration and setting them as required
747
818
 
748
819
  */
749
- type RegleEnforceCustomRequiredRules<T extends useRegleFn<any, any>, TRules$1 extends keyof InferRegleRules<T>> = Omit<Partial<DefaultValidatorsTree>, TRules$1> & { [K in TRules$1]-?: T extends useRegleFn<any, any> ? K extends keyof InferRegleRules<T> ? NonNullable<UnwrapRuleWithParams<InferRegleRules<T>[K]>> : never : K extends keyof T ? NonNullable<T[K]> : never };
820
+ type RegleEnforceCustomRequiredRules<T extends useRegleFn<any, any>, TRules extends keyof InferRegleRules<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 };
750
821
  /**
751
822
  * Extract custom rules and custom shortcuts and apply them to a RegleFieldStatus type
752
823
  */
753
- type RegleCustomFieldStatus<T extends useRegleFn<any, any>, TState$1 extends unknown = any, TRules$1 extends keyof InferRegleRules<T> = never> = RegleFieldStatus<TState$1, [TRules$1] extends [never] ? Partial<InferRegleRules<T>> : RegleEnforceCustomRequiredRules<T, TRules$1>, InferRegleShortcuts<T>>;
824
+ type RegleCustomFieldStatus<T extends useRegleFn<any, any>, TState extends unknown = any, TRules extends keyof InferRegleRules<T> = never> = RegleFieldStatus<TState, [TRules] extends [never] ? Partial<InferRegleRules<T>> : RegleEnforceCustomRequiredRules<T, TRules>, InferRegleShortcuts<T>>;
754
825
  /**
755
826
  * Infer safe output type from a rules object and it's original state type
756
827
  *
@@ -758,7 +829,7 @@ type RegleCustomFieldStatus<T extends useRegleFn<any, any>, TState$1 extends unk
758
829
  * type FormRequest = InferOutput<typeof rules, typeof formState>;
759
830
  * ```
760
831
  */
761
- type InferOutput<TRules$1 extends MaybeRef<ReglePartialRuleTree<Record<string, any>, any>> | ((state: any) => ReglePartialRuleTree<Record<string, any>, any>) | MaybeRef<StandardSchemaV1<any>>, TState$1 extends MaybeRef<unknown> = InferInput<TRules$1>> = isRecordLiteral<TState$1> extends true ? TRules$1 extends MaybeRef<StandardSchemaV1<infer State>> ? State : DeepSafeFormState<JoinDiscriminatedUnions<Unwrap<NonNullable<TState$1>>>, TRules$1 extends MaybeRef<ReglePartialRuleTree<Record<string, any>, any>> ? UnwrapRef<TRules$1> : {}> : TState$1 extends any[] ? TState$1[] : TState$1;
832
+ type InferOutput<TRules extends MaybeRef<ReglePartialRuleTree<Record<string, any>, any>> | ((state: any) => ReglePartialRuleTree<Record<string, any>, any>) | MaybeRef<StandardSchemaV1<any>>, TState extends MaybeRef<unknown> = InferInput<TRules>> = isRecordLiteral<TState> extends true ? TRules extends MaybeRef<StandardSchemaV1<infer State>> ? State : DeepSafeFormState<JoinDiscriminatedUnions<Unwrap<NonNullable<TState>>>, TRules extends MaybeRef<ReglePartialRuleTree<Record<string, any>, any>> ? UnwrapRef<TRules> : {}> : TState extends any[] ? TState[] : TState;
762
833
  /**
763
834
  * Infer input type from a rules object
764
835
  *
@@ -766,15 +837,15 @@ type InferOutput<TRules$1 extends MaybeRef<ReglePartialRuleTree<Record<string, a
766
837
  * type FormRequest = InferInput<typeof rules>;
767
838
  * ```
768
839
  */
769
- type InferInput<TRules$1 extends MaybeRef<ReglePartialRuleTree<Record<string, any>, any>> | ((state: any) => ReglePartialRuleTree<Record<string, any>, any>) | MaybeRef<StandardSchemaV1<any>>, TMarkMaybe extends boolean = true> = TRules$1 extends MaybeRef<StandardSchemaV1<infer State>> ? State : IsUnion<UnwrapSimple<TRules$1>> extends true ? InferTupleUnionInput<UnionToTuple<UnwrapSimple<TRules$1>>>[number] : TMarkMaybe extends true ? Prettify<{ [K in keyof UnwrapSimple<TRules$1> as UnwrapSimple<TRules$1>[K] extends MaybeRef<RegleRuleDecl<any, any>> ? K : never]?: ProcessInputChildren<UnwrapSimple<TRules$1>[K], TMarkMaybe> } & { [K in keyof UnwrapSimple<TRules$1> as UnwrapSimple<TRules$1>[K] extends MaybeRef<RegleRuleDecl<any, any>> ? never : K]: ProcessInputChildren<UnwrapSimple<TRules$1>[K], TMarkMaybe> }> : Prettify<{ [K in keyof UnwrapSimple<TRules$1>]: ProcessInputChildren<UnwrapSimple<TRules$1>[K], TMarkMaybe> }>;
840
+ type InferInput<TRules extends MaybeRef<ReglePartialRuleTree<Record<string, any>, any>> | ((state: any) => ReglePartialRuleTree<Record<string, any>, any>) | MaybeRef<StandardSchemaV1<any>>, TMarkMaybe extends boolean = true> = TRules extends MaybeRef<StandardSchemaV1<infer State>> ? State : IsUnion<UnwrapSimple<TRules>> extends true ? InferTupleUnionInput<UnionToTuple<UnwrapSimple<TRules>>>[number] : TMarkMaybe extends true ? Prettify<{ [K in keyof UnwrapSimple<TRules> as UnwrapSimple<TRules>[K] extends MaybeRef<RegleRuleDecl<any, any>> ? K : never]?: ProcessInputChildren<UnwrapSimple<TRules>[K], TMarkMaybe> } & { [K in keyof UnwrapSimple<TRules> as UnwrapSimple<TRules>[K] extends MaybeRef<RegleRuleDecl<any, any>> ? never : K]: ProcessInputChildren<UnwrapSimple<TRules>[K], TMarkMaybe> }> : Prettify<{ [K in keyof UnwrapSimple<TRules>]: ProcessInputChildren<UnwrapSimple<TRules>[K], TMarkMaybe> }>;
770
841
  type ProcessInputChildren<TRule extends unknown, TMarkMaybe extends boolean> = TRule extends {
771
842
  $each: RegleCollectionEachRules<any, any>;
772
843
  } ? ExtractFromGetter<TRule['$each']> extends ReglePartialRuleTree<any, any> ? InferInput<ExtractFromGetter<TRule['$each']>, TMarkMaybe>[] : any[] : TRule extends MaybeRef<RegleRuleDecl<any, any>> ? [ExtractTypeFromRules<UnwrapRef<TRule>>] extends [never] ? unknown : ExtractTypeFromRules<UnwrapRef<TRule>> : TRule extends ReglePartialRuleTree<any, any> ? InferInput<TRule, TMarkMaybe> : string;
773
- type ExtractTypeFromRules<TRules$1 extends RegleRuleDecl<any, any>> = FilterRulesWithInput<TRules$1> extends {
844
+ type ExtractTypeFromRules<TRules extends RegleRuleDecl<any, any>> = FilterRulesWithInput<TRules> extends {
774
845
  type: infer Input;
775
- } ? Input : [FilterRulesWithSingleType<TRules$1>[keyof FilterRulesWithSingleType<TRules$1>]] extends [never] ? FilterRulesWithInput<TRules$1>[keyof FilterRulesWithInput<TRules$1>] : FilterRulesWithSingleType<TRules$1>[keyof FilterRulesWithSingleType<TRules$1>];
776
- type FilterRulesWithInput<TRules$1 extends RegleRuleDecl<any, any>> = { [K in keyof TRules$1 as TRules$1[K] extends RegleRuleDefinition<unknown, any, any, any, any, infer Input> ? unknown extends Input ? never : K : never]: TRules$1[K] extends RegleRuleDefinition<unknown, any, any, any, any, infer Input> ? Input : unknown };
777
- type FilterRulesWithSingleType<TRules$1 extends RegleRuleDecl<any, any>> = { [K in keyof TRules$1 as TRules$1[K] extends RegleRuleDefinition<unknown, any, any, any, any, infer Input> ? unknown extends Input ? never : IsUnion<NonNullable<Input>> extends true ? never : K : never]: TRules$1[K] extends RegleRuleDefinition<unknown, any, any, any, any, infer Input> ? IsUnion<NonNullable<Input>> extends true ? unknown : Input : unknown };
846
+ } ? Input : [FilterRulesWithSingleType<TRules>[keyof FilterRulesWithSingleType<TRules>]] extends [never] ? FilterRulesWithInput<TRules>[keyof FilterRulesWithInput<TRules>] : FilterRulesWithSingleType<TRules>[keyof FilterRulesWithSingleType<TRules>];
847
+ type FilterRulesWithInput<TRules extends RegleRuleDecl<any, any>> = { [K in keyof TRules as TRules[K] extends RegleRuleDefinition<unknown, any, any, any, any, infer Input> ? unknown extends Input ? never : K : never]: TRules[K] extends RegleRuleDefinition<unknown, any, any, any, any, infer Input> ? Input : unknown };
848
+ type FilterRulesWithSingleType<TRules extends RegleRuleDecl<any, any>> = { [K in keyof TRules as TRules[K] extends RegleRuleDefinition<unknown, any, any, any, any, infer Input> ? unknown extends Input ? never : IsUnion<NonNullable<Input>> extends true ? never : K : never]: TRules[K] extends RegleRuleDefinition<unknown, any, any, any, any, infer Input> ? IsUnion<NonNullable<Input>> extends true ? unknown : Input : unknown };
778
849
  type InferTupleUnionInput<T extends any[]> = T extends [infer F extends ReglePartialRuleTree, ...infer R] ? [InferInput<F, true>, ...InferTupleUnionInput<R>] : [];
779
850
  /**
780
851
  * Infer safe output from any `r$` instance
@@ -832,21 +903,21 @@ type CreateFn<T extends any[]> = (...args: T) => any;
832
903
  *
833
904
  * [foo: string, bar?: number] => [foo: MaybeRef<string> | (() => string), bar?: MaybeRef<number | undefined> | (() => number) | undefined]
834
905
  */
835
- type RegleUniversalParams<T extends any[] = [], F$1 = CreateFn<T>> = [T] extends [[]] ? [] : Parameters<F$1 extends ((...args: infer Args) => any) ? (...args: { [K in keyof Args]: MaybeRefOrGetter<Maybe<Args[K]>> }) => any : never>;
836
- type UnwrapRegleUniversalParams<T extends MaybeRefOrGetter[] = [], F$1 = CreateFn<T>> = [T] extends [[]] ? [] : Parameters<F$1 extends ((...args: infer Args) => any) ? (...args: { [K in keyof Args]: Args[K] extends MaybeRefOrGetter<Maybe<infer U>> ? U : Args[K] }) => any : never>;
906
+ 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>;
907
+ 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>;
837
908
  /**
838
909
  * Internal definition of the rule, this can be used to reset or patch the rule
839
910
  */
840
- type RegleInternalRuleDefs<TValue$1 extends any = any, TParams$1 extends any[] = [], TAsync$1 extends boolean = false, TMetadata$1 extends RegleRuleMetadataDefinition = boolean> = Raw<{
841
- _validator: (value: Maybe<TValue$1>, ...args: TParams$1) => TAsync$1 extends false ? TMetadata$1 : Promise<TMetadata$1>;
842
- _message: string | string[] | ((metadata: PossibleRegleRuleMetadataConsumer<TValue$1>) => string | string[]);
843
- _active?: boolean | ((metadata: PossibleRegleRuleMetadataConsumer<TValue$1>) => boolean);
844
- _tooltip?: string | string[] | ((metadata: PossibleRegleRuleMetadataConsumer<TValue$1>) => string | string[]);
911
+ type RegleInternalRuleDefs<TValue extends any = any, TParams extends any[] = [], TAsync extends boolean = false, TMetadata extends RegleRuleMetadataDefinition = boolean> = Raw<{
912
+ _validator: (value: Maybe<TValue>, ...args: TParams) => TAsync extends false ? TMetadata : Promise<TMetadata>;
913
+ _message: string | string[] | ((metadata: PossibleRegleRuleMetadataConsumer<TValue>) => string | string[]);
914
+ _active?: boolean | ((metadata: PossibleRegleRuleMetadataConsumer<TValue>) => boolean);
915
+ _tooltip?: string | string[] | ((metadata: PossibleRegleRuleMetadataConsumer<TValue>) => string | string[]);
845
916
  _type?: string;
846
917
  _message_patched: boolean;
847
918
  _tooltip_patched: boolean;
848
- _params?: RegleUniversalParams<TParams$1>;
849
- _async: TAsync$1;
919
+ _params?: RegleUniversalParams<TParams>;
920
+ _async: TAsync;
850
921
  readonly _brand: symbol;
851
922
  }>;
852
923
  declare const InternalRuleType: {
@@ -858,26 +929,26 @@ type IsLiteral<T> = string extends T ? false : true;
858
929
  /**
859
930
  * Returned typed of rules created with `createRule`
860
931
  * */
861
- interface RegleRuleDefinition<TType$1 extends string | unknown = unknown, TValue$1 extends unknown = unknown, TParams$1 extends any[] = [], TAsync$1 extends boolean = boolean, TMetaData extends RegleRuleMetadataDefinition = RegleRuleMetadataDefinition, _TInput = unknown, TFilteredValue extends any = (TValue$1 extends Date & File & (infer M) ? M : TValue$1), TNonEmpty extends boolean = boolean> extends RegleInternalRuleDefs<TFilteredValue, TParams$1, TAsync$1, TMetaData> {
862
- validator: RegleRuleDefinitionProcessor<TFilteredValue, TParams$1, TAsync$1 extends false ? TMetaData : Promise<TMetaData>>;
932
+ interface RegleRuleDefinition<TType extends string | unknown = unknown, TValue extends unknown = unknown, TParams extends any[] = [], TAsync extends boolean = boolean, TMetaData extends RegleRuleMetadataDefinition = RegleRuleMetadataDefinition, _TInput = unknown, TFilteredValue extends any = (TValue extends Date & File & (infer M) ? M : TValue), TNonEmpty extends boolean = boolean> extends RegleInternalRuleDefs<TFilteredValue, TParams, TAsync, TMetaData> {
933
+ validator: RegleRuleDefinitionProcessor<TFilteredValue, TParams, TAsync extends false ? TMetaData : Promise<TMetaData>>;
863
934
  message: (metadata: PossibleRegleRuleMetadataConsumer<TFilteredValue>) => string | string[];
864
935
  active: (metadata: PossibleRegleRuleMetadataConsumer<TFilteredValue>) => boolean;
865
936
  tooltip: (metadata: PossibleRegleRuleMetadataConsumer<TFilteredValue>) => string | string[];
866
- type?: TType$1;
867
- _value?: IsLiteral<TValue$1> extends true ? TValue$1 : any;
868
- exec: (value: Maybe<TFilteredValue>) => TAsync$1 extends false ? TMetaData : Promise<TMetaData>;
937
+ type?: TType;
938
+ _value?: IsLiteral<TValue> extends true ? TValue : any;
939
+ exec: (value: Maybe<TFilteredValue>) => TAsync extends false ? TMetaData : Promise<TMetaData>;
869
940
  required: TNonEmpty;
870
941
  }
871
942
  /**
872
943
  * Rules with params created with `createRules` are callable while being customizable
873
944
  */
874
- type RegleRuleWithParamsDefinition<TType$1 extends string | unknown = unknown, TValue$1 extends unknown = unknown, TParams$1 extends any[] = never, TAsync$1 extends boolean = false, TMetadata$1 extends RegleRuleMetadataDefinition = boolean, TInput = unknown, TFilteredValue extends any = (TValue$1 extends Date & File & (infer M) ? M : TValue$1)> = RegleRuleCore<TType$1, TFilteredValue, TParams$1, TAsync$1, TMetadata$1> & RegleInternalRuleDefs<TFilteredValue, TParams$1, TAsync$1, TMetadata$1> & {
875
- (...params: RegleUniversalParams<TParams$1>): RegleRuleDefinition<TType$1, TFilteredValue, TParams$1, TAsync$1, TMetadata$1, TInput>;
876
- } & (TParams$1 extends [param?: any, ...any[]] ? {
877
- exec: (value: Maybe<TFilteredValue>) => TAsync$1 extends false ? TMetadata$1 : Promise<TMetadata$1>;
945
+ type RegleRuleWithParamsDefinition<TType extends string | unknown = unknown, TValue extends unknown = unknown, TParams extends any[] = never, TAsync extends boolean = false, TMetadata extends RegleRuleMetadataDefinition = boolean, TInput = unknown, TFilteredValue extends any = (TValue extends Date & File & (infer M) ? M : TValue)> = RegleRuleCore<TType, TFilteredValue, TParams, TAsync, TMetadata> & RegleInternalRuleDefs<TFilteredValue, TParams, TAsync, TMetadata> & {
946
+ (...params: RegleUniversalParams<TParams>): RegleRuleDefinition<TType, TFilteredValue, TParams, TAsync, TMetadata, TInput>;
947
+ } & (TParams extends [param?: any, ...any[]] ? {
948
+ exec: (value: Maybe<TFilteredValue>) => TAsync extends false ? TMetadata : Promise<TMetadata>;
878
949
  } : {});
879
- type RegleRuleWithParamsDefinitionInput<TType$1 extends string | unknown = unknown, TValue$1 extends any = any, TParams$1 extends any[] = never, TAsync$1 extends boolean = false, TMetadata$1 extends RegleRuleMetadataDefinition = boolean, TFilteredValue extends any = (TValue$1 extends Date & File & (infer M) ? M : TValue$1)> = RegleRuleCore<TType$1, TFilteredValue, TParams$1, TAsync$1, TMetadata$1> & RegleInternalRuleDefs<TFilteredValue, TParams$1, TAsync$1, TMetadata$1> & (TParams$1 extends [param?: any, ...any[]] ? {
880
- exec: (value: Maybe<TFilteredValue>) => TAsync$1 extends false ? TMetadata$1 : Promise<TMetadata$1>;
950
+ type RegleRuleWithParamsDefinitionInput<TType extends string | unknown = unknown, TValue extends any = any, TParams extends any[] = never, TAsync extends boolean = false, TMetadata extends RegleRuleMetadataDefinition = boolean, TFilteredValue extends any = (TValue extends Date & File & (infer M) ? M : TValue)> = RegleRuleCore<TType, TFilteredValue, TParams, TAsync, TMetadata> & RegleInternalRuleDefs<TFilteredValue, TParams, TAsync, TMetadata> & (TParams extends [param?: any, ...any[]] ? {
951
+ exec: (value: Maybe<TFilteredValue>) => TAsync extends false ? TMetadata : Promise<TMetadata>;
881
952
  } : {});
882
953
  type RegleRuleMetadataExtended = {
883
954
  $valid: boolean;
@@ -898,24 +969,24 @@ type DefaultMetadataProperties = DefaultMetadataPropertiesCommon & {
898
969
  /**
899
970
  * Will be used to consume metadata on related helpers and rule status
900
971
  */
901
- type RegleRuleMetadataConsumer<TValue$1 extends any, TParams$1 extends [...any[]] = never, TMetadata$1 extends RegleRuleMetadataDefinition = boolean> = {
902
- $value: Maybe<TValue$1>;
903
- } & DefaultMetadataProperties & (TParams$1 extends never ? {} : {
904
- $params: [...TParams$1];
905
- }) & (Exclude<TMetadata$1, boolean> extends RegleRuleMetadataExtended ? TMetadata$1 extends boolean ? Partial<Omit<Exclude<TMetadata$1, boolean>, '$valid'>> : Omit<Exclude<TMetadata$1, boolean>, '$valid'> : {});
972
+ type RegleRuleMetadataConsumer<TValue extends any, TParams extends [...any[]] = never, TMetadata extends RegleRuleMetadataDefinition = boolean> = {
973
+ $value: Maybe<TValue>;
974
+ } & DefaultMetadataProperties & (TParams extends never ? {} : {
975
+ $params: [...TParams];
976
+ }) & (Exclude<TMetadata, boolean> extends RegleRuleMetadataExtended ? TMetadata extends boolean ? Partial<Omit<Exclude<TMetadata, boolean>, '$valid'>> : Omit<Exclude<TMetadata, boolean>, '$valid'> : {});
906
977
  /**
907
978
  * Will be used to consume metadata on related helpers and rule status
908
979
  */
909
- type PossibleRegleRuleMetadataConsumer<TValue$1> = {
910
- $value: Maybe<TValue$1>;
980
+ type PossibleRegleRuleMetadataConsumer<TValue> = {
981
+ $value: Maybe<TValue>;
911
982
  } & DefaultMetadataProperties & {
912
983
  $params?: [...any[]];
913
984
  };
914
985
  /**
915
986
  * Generic types for a created RegleRule
916
987
  */
917
- type RegleRuleRaw<TType$1 extends string | unknown = unknown, TValue$1 extends any = any, TParams$1 extends [...any[]] = [...any[]], TAsync$1 extends boolean = boolean, TMetaData extends RegleRuleMetadataDefinition = boolean> = RegleRuleDefinition<TType$1, TValue$1, TParams$1, TAsync$1, TMetaData> | RegleRuleWithParamsDefinition<TType$1, TValue$1, TParams$1, TAsync$1, TMetaData>;
918
- type RegleRuleRawInput<TValue$1 extends any = any, TParams$1 extends [...any[]] = [...any[]], TAsync$1 extends boolean = boolean, TMetaData extends RegleRuleMetadataDefinition = boolean> = Omit<RegleRuleDefinition<unknown, TValue$1, TParams$1, TAsync$1, TMetaData> | RegleRuleWithParamsDefinition<unknown, TValue$1, TParams$1, TAsync$1, TMetaData>, 'message' | 'tooltip' | 'active'> & {
988
+ type RegleRuleRaw<TType extends string | unknown = unknown, TValue extends any = any, TParams extends [...any[]] = [...any[]], TAsync extends boolean = boolean, TMetaData extends RegleRuleMetadataDefinition = boolean> = RegleRuleDefinition<TType, TValue, TParams, TAsync, TMetaData> | RegleRuleWithParamsDefinition<TType, TValue, TParams, TAsync, TMetaData>;
989
+ type RegleRuleRawInput<TValue extends any = any, TParams extends [...any[]] = [...any[]], TAsync extends boolean = boolean, TMetaData extends RegleRuleMetadataDefinition = boolean> = Omit<RegleRuleDefinition<unknown, TValue, TParams, TAsync, TMetaData> | RegleRuleWithParamsDefinition<unknown, TValue, TParams, TAsync, TMetaData>, 'message' | 'tooltip' | 'active'> & {
919
990
  message: any;
920
991
  active?: any;
921
992
  tooltip?: any;
@@ -925,43 +996,43 @@ type RegleRuleRawInput<TValue$1 extends any = any, TParams$1 extends [...any[]]
925
996
  * For a rule with params it will return a function
926
997
  * Otherwise it will return the rule definition
927
998
  */
928
- type InferRegleRule<TType$1 extends string | unknown, TValue$1 extends any = any, TParams$1 extends any[] = [], TAsync$1 extends boolean = false, TMetaData extends RegleRuleMetadataDefinition = boolean, TNonEmpty extends boolean = false> = [TParams$1] extends [[]] ? RegleRuleDefinition<TType$1, TValue$1, TParams$1, TAsync$1, TMetaData, TValue$1, TValue$1, TNonEmpty> : RegleRuleWithParamsDefinition<TType$1, TValue$1, TParams$1, TAsync$1, TMetaData, TNonEmpty>;
929
- type RegleRuleDefinitionProcessor<TValue$1 extends any = any, TParams$1 extends any[] = [], TReturn = any> = (value: Maybe<TValue$1>, ...params: TParams$1) => TReturn;
930
- type RegleRuleDefinitionWithMetadataProcessor<TValue$1 extends any, TMetadata$1 extends RegleRuleMetadataConsumer<TValue$1, any[]>, TReturn = any> = ((metadata: TMetadata$1) => TReturn) | TReturn;
931
- type RegleCollectionRuleDefinition<TValue$1 = any[], TCustomRules extends Partial<ExtendedRulesDeclarations> = Partial<ExtendedRulesDeclarations>> = (RegleRuleDecl<NonNullable<TValue$1>, TCustomRules, CollectionRegleBehaviourOptions> & {
932
- $each: MaybeGetter<RegleFormPropertyType<ArrayElement<NonNullable<TValue$1>>, TCustomRules>, ArrayElement<TValue$1>>;
999
+ type InferRegleRule<TType extends string | unknown, TValue extends any = any, TParams extends any[] = [], TAsync extends boolean = false, TMetaData extends RegleRuleMetadataDefinition = boolean, TNonEmpty extends boolean = false> = [TParams] extends [[]] ? RegleRuleDefinition<TType, TValue, TParams, TAsync, TMetaData, TValue, TValue, TNonEmpty> : RegleRuleWithParamsDefinition<TType, TValue, TParams, TAsync, TMetaData, TNonEmpty>;
1000
+ type RegleRuleDefinitionProcessor<TValue extends any = any, TParams extends any[] = [], TReturn = any> = (value: Maybe<TValue>, ...params: TParams) => TReturn;
1001
+ type RegleRuleDefinitionWithMetadataProcessor<TValue extends any, TMetadata extends RegleRuleMetadataConsumer<TValue, any[]>, TReturn = any> = ((metadata: TMetadata) => TReturn) | TReturn;
1002
+ type RegleCollectionRuleDefinition<TValue = any[], TCustomRules extends Partial<ExtendedRulesDeclarations> = Partial<ExtendedRulesDeclarations>> = (RegleRuleDecl<NonNullable<TValue>, TCustomRules, CollectionRegleBehaviourOptions> & {
1003
+ $each: MaybeGetter<RegleFormPropertyType<ArrayElement<NonNullable<TValue>>, TCustomRules>, ArrayElement<TValue>>;
933
1004
  }) | ({
934
- $each: MaybeGetter<RegleFormPropertyType<ArrayElement<NonNullable<TValue$1>>, TCustomRules>, ArrayElement<TValue$1>>;
1005
+ $each: MaybeGetter<RegleFormPropertyType<ArrayElement<NonNullable<TValue>>, TCustomRules>, ArrayElement<TValue>>;
935
1006
  } & CollectionRegleBehaviourOptions);
936
- type RegleInitPropertyGetter<TValue$1, TReturn, TParams$1 extends [...any[]], TMetadata$1 extends RegleRuleMetadataDefinition> = TReturn | ((metadata: RegleRuleMetadataConsumer<TValue$1, TParams$1, TMetadata$1>) => TReturn);
1007
+ type RegleInitPropertyGetter<TValue, TReturn, TParams extends [...any[]], TMetadata extends RegleRuleMetadataDefinition> = TReturn | ((metadata: RegleRuleMetadataConsumer<TValue, TParams, TMetadata>) => TReturn);
937
1008
  /**
938
1009
  * @argument
939
1010
  * createRule arguments options
940
1011
  */
941
- interface RegleRuleInit<TType$1 extends string | unknown = unknown, TValue$1 extends unknown = unknown, TParams$1 extends [...any[]] = [], TReturn extends RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition> = boolean, TMetadata$1 extends RegleRuleMetadataDefinition = RegleRuleMetadataDefinition, TAsync$1 extends boolean = (TReturn extends Promise<any> ? true : false), TNonEmpty extends boolean = false> {
942
- validator: (value: Maybe<TValue$1>, ...args: TParams$1) => TReturn;
943
- message: RegleInitPropertyGetter<TValue$1, string | string[], TParams$1, TMetadata$1>;
944
- active?: RegleInitPropertyGetter<TValue$1, boolean, TParams$1, TMetadata$1>;
945
- tooltip?: RegleInitPropertyGetter<TValue$1, string | string[], TParams$1, TMetadata$1>;
946
- type?: TType$1;
947
- async?: TAsync$1;
1012
+ interface RegleRuleInit<TType extends string | unknown = unknown, TValue extends unknown = unknown, TParams extends [...any[]] = [], TReturn extends RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition> = boolean, TMetadata extends RegleRuleMetadataDefinition = RegleRuleMetadataDefinition, TAsync extends boolean = (TReturn extends Promise<any> ? true : false), TNonEmpty extends boolean = false> {
1013
+ validator: (value: Maybe<TValue>, ...args: TParams) => TReturn;
1014
+ message: RegleInitPropertyGetter<TValue, string | string[], TParams, TMetadata>;
1015
+ active?: RegleInitPropertyGetter<TValue, boolean, TParams, TMetadata>;
1016
+ tooltip?: RegleInitPropertyGetter<TValue, string | string[], TParams, TMetadata>;
1017
+ type?: TType;
1018
+ async?: TAsync;
948
1019
  required?: TNonEmpty;
949
1020
  }
950
1021
  /**
951
1022
  * @argument
952
1023
  * Rule core
953
1024
  */
954
- interface RegleRuleCore<TType$1 extends string | unknown, TValue$1 extends any, TParams$1 extends any[] = [], TAsync$1 extends boolean = false, TMetadata$1 extends RegleRuleMetadataDefinition = boolean> {
955
- validator: (value: Maybe<TValue$1>, ...args: TParams$1) => TAsync$1 extends false ? TMetadata$1 : Promise<TMetadata$1>;
956
- message: RegleInitPropertyGetter<TValue$1, string | string[], TParams$1, TMetadata$1>;
957
- active?: RegleInitPropertyGetter<TValue$1, string | string[], TParams$1, TMetadata$1>;
958
- tooltip?: RegleInitPropertyGetter<TValue$1, string | string[], TParams$1, TMetadata$1>;
959
- type?: TType$1;
1025
+ interface RegleRuleCore<TType extends string | unknown, TValue extends any, TParams extends any[] = [], TAsync extends boolean = false, TMetadata extends RegleRuleMetadataDefinition = boolean> {
1026
+ validator: (value: Maybe<TValue>, ...args: TParams) => TAsync extends false ? TMetadata : Promise<TMetadata>;
1027
+ message: RegleInitPropertyGetter<TValue, string | string[], TParams, TMetadata>;
1028
+ active?: RegleInitPropertyGetter<TValue, string | string[], TParams, TMetadata>;
1029
+ tooltip?: RegleInitPropertyGetter<TValue, string | string[], TParams, TMetadata>;
1030
+ type?: TType;
960
1031
  async?: boolean;
961
1032
  }
962
- type RegleRuleTypeReturn<TValue$1, TParams$1 extends [...any[]]> = {
963
- value: TValue$1;
964
- params: [...TParams$1];
1033
+ type RegleRuleTypeReturn<TValue, TParams extends [...any[]]> = {
1034
+ value: TValue;
1035
+ params: [...TParams];
965
1036
  };
966
1037
  interface CommonComparisonOptions {
967
1038
  /**
@@ -1041,40 +1112,35 @@ type AllRulesDeclarations = ExtendedRulesDeclarations;
1041
1112
  /**
1042
1113
  * @public
1043
1114
  */
1044
- type RegleRoot<TState$1 extends object | Record<string, unknown> = {}, TRules$1 extends ReglePartialRuleTree<TState$1> = Record<string, any>, TValidationGroups extends Record<string, RegleValidationGroupEntry[]> = never, TShortcuts extends RegleShortcutDefinition = {}> = MaybeVariantStatus<TState$1, TRules$1, TShortcuts> & ([TValidationGroups] extends [never] ? {} : {
1115
+ type RegleRoot<TState extends object | Record<string, unknown> = {}, TRules extends ReglePartialRuleTree<TState> = Record<string, any>, TValidationGroups extends Record<string, RegleValidationGroupEntry[]> = never, TShortcuts extends RegleShortcutDefinition = {}> = MaybeVariantStatus<TState, TRules, TShortcuts> & ([TValidationGroups] extends [never] ? {} : {
1045
1116
  /**
1046
1117
  * Collection of validation groups used declared with the `validationGroups` modifier
1047
1118
  */
1048
1119
  $groups: { readonly [TKey in keyof TValidationGroups]: RegleValidationGroupOutput };
1049
1120
  });
1050
- type ProcessNestedFields<TState$1 extends Record<string, any> | undefined, TRules$1 extends ReglePartialRuleTree<NonNullable<TState$1>>, TShortcuts extends RegleShortcutDefinition = {}, TIsFields extends boolean = false> = Or<HasNamedKeys<TState$1>, TIsFields> extends true ? { readonly [TKey in keyof TState$1 as TRules$1[TKey] extends NonNullable<TRules$1[TKey]> ? NonNullable<TRules$1[TKey]> extends MaybeRef<RegleRuleDecl> ? IsEmptyObject<TRules$1[TKey]> extends true ? TKey : never : never : TKey]: IsUnion<NonNullable<TRules$1[TKey]>> extends true ? ExtendOnlyRealRecord<TState$1[TKey]> extends true ? MaybeVariantStatus<NonNullable<TState$1>[TKey], NonNullable<TRules$1[TKey]>, TShortcuts> : InferRegleStatusType<NonNullable<TRules$1[TKey]>, NonNullable<TState$1>, TKey, TShortcuts> : InferRegleStatusType<NonNullable<TRules$1[TKey]>, NonNullable<TState$1>, TKey, TShortcuts> } & { readonly [TKey in keyof TState$1 as TRules$1[TKey] extends NonNullable<TRules$1[TKey]> ? NonNullable<TRules$1[TKey]> extends MaybeRef<RegleRuleDecl> ? IsEmptyObject<TRules$1[TKey]> extends true ? never : TKey : TKey : never]-?: IsUnion<NonNullable<TRules$1[TKey]>> extends true ? ExtendOnlyRealRecord<TState$1[TKey]> extends true ? MaybeVariantStatus<NonNullable<TState$1>[TKey], NonNullable<TRules$1[TKey]>, TShortcuts> : InferRegleStatusType<NonNullable<TRules$1[TKey]>, NonNullable<TState$1>, TKey, TShortcuts> : InferRegleStatusType<NonNullable<TRules$1[TKey]>, NonNullable<TState$1>, TKey, TShortcuts> } : {};
1121
+ type ProcessNestedFields<TState extends Record<string, any> | undefined, TRules extends ReglePartialRuleTree<NonNullable<TState>>, TShortcuts extends RegleShortcutDefinition = {}, TIsFields extends boolean = false> = Or<HasNamedKeys<TState>, TIsFields> extends true ? { readonly [TKey in keyof TState as TRules[TKey] extends NonNullable<TRules[TKey]> ? NonNullable<TRules[TKey]> extends MaybeRef<RegleRuleDecl> ? IsEmptyObject<TRules[TKey]> extends true ? TKey : never : never : TKey]: IsUnion<NonNullable<TRules[TKey]>> extends true ? ExtendOnlyRealRecord<TState[TKey]> extends true ? MaybeVariantStatus<NonNullable<TState>[TKey], NonNullable<TRules[TKey]>, TShortcuts> : InferRegleStatusType<NonNullable<TRules[TKey]>, NonNullable<TState>, TKey, TShortcuts> : InferRegleStatusType<NonNullable<TRules[TKey]>, NonNullable<TState>, TKey, TShortcuts> } & { readonly [TKey in keyof TState as TRules[TKey] extends NonNullable<TRules[TKey]> ? NonNullable<TRules[TKey]> extends MaybeRef<RegleRuleDecl> ? IsEmptyObject<TRules[TKey]> extends true ? never : TKey : TKey : never]-?: IsUnion<NonNullable<TRules[TKey]>> extends true ? ExtendOnlyRealRecord<TState[TKey]> extends true ? MaybeVariantStatus<NonNullable<TState>[TKey], NonNullable<TRules[TKey]>, TShortcuts> : InferRegleStatusType<NonNullable<TRules[TKey]>, NonNullable<TState>, TKey, TShortcuts> : InferRegleStatusType<NonNullable<TRules[TKey]>, NonNullable<TState>, TKey, TShortcuts> } : {};
1051
1122
  /**
1052
1123
  * @public
1053
1124
  */
1054
- type RegleStatus<TState$1 extends object | Record<string, any> | undefined = Record<string, any>, TRules$1 extends ReglePartialRuleTree<NonNullable<TState$1>> = Record<string, any>, TShortcuts extends RegleShortcutDefinition = {}> = RegleCommonStatus<TState$1, TRules$1> & {
1055
- /** Represents all the children of your object. You can access any nested child at any depth to get the relevant data you need for your form. */
1056
- readonly $fields: ProcessNestedFields<TState$1, TRules$1, TShortcuts, true>;
1125
+ type RegleStatus<TState extends object | Record<string, any> | undefined = Record<string, any>, TRules extends ReglePartialRuleTree<NonNullable<TState>> = Record<string, any>, TShortcuts extends RegleShortcutDefinition = {}> = RegleCommonStatus<TState, TRules> & {
1126
+ /** Represents all the children of your object. You can access any nested child at any depth to get the relevant data you need for your form. */readonly $fields: ProcessNestedFields<TState, TRules, TShortcuts, true>;
1057
1127
  /**
1058
1128
  * Collection of all the issues, collected for all children properties and nested forms.
1059
1129
  *
1060
1130
  * Only contains issues from properties where $dirty equals true.
1061
1131
  */
1062
- readonly $issues: RegleIssuesTree<TState$1>;
1132
+ readonly $issues: RegleIssuesTree<TState, false, TRules>;
1063
1133
  /**
1064
1134
  * Collection of all the error messages, collected for all children properties and nested forms.
1065
1135
  *
1066
1136
  * Only contains errors from properties where $dirty equals true.
1067
1137
  * */
1068
- readonly $errors: RegleErrorTree<TState$1>;
1069
- /** Collection of all the error messages, collected for all children properties. */
1070
- readonly $silentErrors: RegleErrorTree<TState$1>;
1071
- /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
1072
- $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TState$1>;
1073
- /** Sets all properties as dirty, triggering all rules. It returns a promise that will either resolve to false or a type safe copy of your form state. Values that had the required rule will be transformed into a non-nullable value (type only). */
1074
- $validate: (forceValues?: JoinDiscriminatedUnions<TState$1> extends EmptyObject ? any : HasNamedKeys<JoinDiscriminatedUnions<TState$1>> extends true ? IsUnknown<JoinDiscriminatedUnions<TState$1>> extends true ? any : JoinDiscriminatedUnions<TState$1> : any) => Promise<RegleResult<JoinDiscriminatedUnions<TState$1>, TRules$1>>;
1075
- } & ProcessNestedFields<TState$1, TRules$1, TShortcuts> & ([TShortcuts['nested']] extends [never] ? {} : { [K in keyof TShortcuts['nested']]: ReturnType<NonNullable<TShortcuts['nested']>[K]> }) & (TRules$1['$self'] extends RegleRuleDecl ? {
1076
- /** Represents the status of the parent object. Status only concern the object itself and not its children */
1077
- readonly $self: RegleFieldStatus<NonNullable<TRules$1['$self']>, NonNullable<TRules$1['$self']>, TShortcuts>;
1138
+ readonly $errors: RegleErrorTree<TState, false>; /** Collection of all the error messages, collected for all children properties. */
1139
+ readonly $silentErrors: RegleErrorTree<TState>; /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
1140
+ $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TState>; /** Sets all properties as dirty, triggering all rules. It returns a promise that will either resolve to false or a type safe copy of your form state. Values that had the required rule will be transformed into a non-nullable value (type only). */
1141
+ $validate: (forceValues?: JoinDiscriminatedUnions<TState> extends EmptyObject ? any : HasNamedKeys<JoinDiscriminatedUnions<TState>> extends true ? IsUnknown<JoinDiscriminatedUnions<TState>> extends true ? any : JoinDiscriminatedUnions<TState> : any) => Promise<RegleResult<JoinDiscriminatedUnions<TState>, TRules>>;
1142
+ } & ProcessNestedFields<TState, TRules, TShortcuts> & ([TShortcuts['nested']] extends [never] ? {} : { [K in keyof TShortcuts['nested']]: ReturnType<NonNullable<TShortcuts['nested']>[K]> }) & (TRules['$self'] extends RegleRuleDecl ? {
1143
+ /** Represents the status of the parent object. Status only concern the object itself and not its children */readonly $self: RegleFieldStatus<NonNullable<TRules['$self']>, NonNullable<TRules['$self']>, TShortcuts>;
1078
1144
  } : {});
1079
1145
  /**
1080
1146
  * @internal
@@ -1096,75 +1162,46 @@ interface $InternalRegleStatus extends $InternalRegleCommonStatus {
1096
1162
  /**
1097
1163
  * @public
1098
1164
  */
1099
- type InferRegleStatusType<TRule extends RegleCollectionRuleDecl | RegleRuleDecl | ReglePartialRuleTree<any>, TState$1 extends Record<PropertyKey, any> = any, TKey$1 extends PropertyKey = string, TShortcuts extends RegleShortcutDefinition = {}> = HasNamedKeys<TState$1> extends true ? [TState$1[TKey$1]] extends [undefined | null] ? RegleFieldStatus<TState$1[TKey$1], TRule, TShortcuts> : NonNullable<TState$1[TKey$1]> extends Array<infer U extends Record<string, any>> ? U extends Record<string, any> ? TRule extends RegleCollectionRuleDefinition<any, any> ? ExtractFromGetter<TRule['$each']> extends ReglePartialRuleTree<any> ? RegleCollectionStatus<TState$1[TKey$1], ExtractFromGetter<TRule['$each']>, TRule, TShortcuts> : RegleFieldStatus<TState$1[TKey$1], TRule, TShortcuts> : RegleCollectionStatus<TState$1[TKey$1], {}, TRule, TShortcuts> : RegleFieldStatus<TState$1[TKey$1], TRule, TShortcuts> : TRule extends ReglePartialRuleTree<any> ? NonNullable<TState$1[TKey$1]> extends Array<any> ? RegleFieldStatus<TState$1[TKey$1], TRule, TShortcuts> : NonNullable<TState$1[TKey$1]> extends Date | File ? RegleFieldStatus<Raw<TState$1[TKey$1]>, TRule, TShortcuts> : unknown extends TState$1[TKey$1] ? RegleFieldStatus<TState$1[TKey$1], TRule, TShortcuts> : NonNullable<TState$1[TKey$1]> extends Record<PropertyKey, any> ? NonNullable<TState$1[TKey$1]> extends RegleStaticImpl<infer U> ? RegleFieldStatus<Raw<U>, TRule, TShortcuts> : TRule extends ReglePartialRuleTree<TState$1[TKey$1]> ? MaybeVariantStatus<TState$1[TKey$1], TRule, TShortcuts> : MaybeVariantStatus<TState$1[TKey$1], {}, TShortcuts> : RegleFieldStatus<TState$1[TKey$1], TRule, TShortcuts> : NonNullable<TState$1[TKey$1]> extends Date | File ? RegleFieldStatus<Raw<NonNullable<TState$1[TKey$1]>>, TRule, TShortcuts> : unknown extends TState$1[TKey$1] ? RegleFieldStatus<TState$1[TKey$1], TRule, TShortcuts> : NonNullable<TState$1[TKey$1]> extends Record<PropertyKey, any> ? NonNullable<TState$1[TKey$1]> extends RegleStaticImpl<infer U> ? RegleFieldStatus<Raw<U>, TRule, TShortcuts> : MaybeVariantStatus<TState$1[TKey$1], ReglePartialRuleTree<TState$1[TKey$1]>, TShortcuts> : RegleFieldStatus<TState$1[TKey$1], TRule, TShortcuts> : RegleCommonStatus<unknown>;
1165
+ type InferRegleStatusType<TRule extends RegleCollectionRuleDecl | RegleRuleDecl | ReglePartialRuleTree<any>, TState extends Record<PropertyKey, any> = any, TKey extends PropertyKey = string, TShortcuts extends RegleShortcutDefinition = {}> = HasNamedKeys<TState> extends true ? [TState[TKey]] extends [undefined | null] ? RegleFieldStatus<TState[TKey], TRule, TShortcuts> : NonNullable<TState[TKey]> extends Array<unknown> ? TRule extends RegleCollectionRuleDefinition<any, any> ? ExtractFromGetter<TRule['$each']> extends ReglePartialRuleTree<any> ? RegleCollectionStatus<TState[TKey], ExtractFromGetter<TRule['$each']>, TRule, TShortcuts> : RegleFieldStatus<TState[TKey], TRule, TShortcuts> : RegleCollectionStatus<TState[TKey], {}, TRule, TShortcuts> : TRule extends ReglePartialRuleTree<any> ? NonNullable<TState[TKey]> extends Array<any> ? RegleFieldStatus<TState[TKey], TRule, TShortcuts> : NonNullable<TState[TKey]> extends Date | File ? RegleFieldStatus<Raw<TState[TKey]>, TRule, TShortcuts> : unknown extends TState[TKey] ? RegleFieldStatus<TState[TKey], TRule, TShortcuts> : NonNullable<TState[TKey]> extends Record<PropertyKey, any> ? NonNullable<TState[TKey]> extends RegleStaticImpl<infer U> ? RegleFieldStatus<Raw<U>, TRule, TShortcuts> : TRule extends ReglePartialRuleTree<TState[TKey]> ? MaybeVariantStatus<TState[TKey], TRule, TShortcuts> : MaybeVariantStatus<TState[TKey], {}, TShortcuts> : RegleFieldStatus<TState[TKey], TRule, TShortcuts> : NonNullable<TState[TKey]> extends Date | File ? RegleFieldStatus<Raw<NonNullable<TState[TKey]>>, TRule, TShortcuts> : unknown extends TState[TKey] ? RegleFieldStatus<TState[TKey], TRule, TShortcuts> : NonNullable<TState[TKey]> extends Record<PropertyKey, any> ? NonNullable<TState[TKey]> extends RegleStaticImpl<infer U> ? RegleFieldStatus<Raw<U>, TRule, TShortcuts> : MaybeVariantStatus<TState[TKey], ReglePartialRuleTree<TState[TKey]>, TShortcuts> : RegleFieldStatus<TState[TKey], TRule, TShortcuts> : RegleCommonStatus<unknown>;
1100
1166
  /**
1101
1167
  * @internal
1102
1168
  * @reference {@link InferRegleStatusType}
1103
1169
  */
1104
1170
  type $InternalRegleStatusType = $InternalRegleCollectionStatus | $InternalRegleStatus | $InternalRegleFieldStatus;
1105
- type RegleFieldIssue<TRules$1 extends RegleFormPropertyType<unknown, Partial<ExtendedRulesDeclarations>> = EmptyObject> = {
1106
- readonly $property: string;
1107
- readonly $type?: string;
1108
- readonly $message: string;
1109
- } & (IsEmptyObject<TRules$1> extends true ? {
1110
- readonly $rule: string;
1111
- } : { [K in keyof ComputeFieldRules<any, TRules$1>]: ComputeFieldRules<any, TRules$1>[K] extends {
1112
- $metadata: infer TMetadata;
1113
- } ? K extends string ? {
1114
- readonly $rule: K;
1115
- } & (TMetadata extends boolean ? {
1116
- readonly $rule: string;
1117
- } : TMetadata) : {
1118
- readonly $rule: string;
1119
- } : {
1120
- readonly $rule: string;
1121
- } }[keyof ComputeFieldRules<any, TRules$1>]);
1122
- type ComputeFieldRules<TState$1 extends any, TRules$1 extends MaybeRef<RegleFormPropertyType<unknown, Partial<ExtendedRulesDeclarations>>>> = IsEmptyObject<UnwrapRef<TRules$1>> extends true ? {
1123
- readonly [x: string]: RegleRuleStatus<TState$1, any[], any>;
1124
- } : { readonly [TRuleKey in keyof Omit<UnwrapRef<TRules$1>, '$each' | keyof FieldRegleBehaviourOptions>]: RegleRuleStatus<TState$1, UnwrapRef<TRules$1>[TRuleKey] extends RegleRuleDefinition<unknown, any, infer TParams, any> ? TParams : [], UnwrapRef<TRules$1>[TRuleKey] extends RegleRuleDefinition<unknown, any, any, any, infer TMetadata> ? TMetadata : UnwrapRef<TRules$1>[TRuleKey] extends InlineRuleDeclaration<any, any[], infer TMetadata> ? TMetadata extends Promise<infer P> ? P : TMetadata : boolean> };
1125
1171
  /**
1126
1172
  * @public
1127
1173
  */
1128
- type RegleFieldStatus<TState$1 extends any = any, TRules$1 extends RegleFormPropertyType<any, Partial<ExtendedRulesDeclarations>> = Record<string, any>, TShortcuts extends RegleShortcutDefinition = never> = Omit<RegleCommonStatus<TState$1, TRules$1>, '$value' | '$silentValue' | '$initialValue' | '$originalValue'> & {
1129
- /** A reference to the original validated model. It can be used to bind your form with v-model.*/
1130
- $value: MaybeOutput<UnwrapNestedRefs<TState$1>>;
1131
- /** $value variant that will not "touch" the field and update the value silently, running only the rules, so you can easily swap values without impacting user interaction. */
1132
- $silentValue: MaybeOutput<UnwrapNestedRefs<TState$1>>;
1174
+ type RegleFieldStatus<TState extends any = any, TRules extends RegleFormPropertyType<any, Partial<ExtendedRulesDeclarations>> = Record<string, any>, TShortcuts extends RegleShortcutDefinition = never> = Omit<RegleCommonStatus<TState, TRules>, '$value' | '$silentValue' | '$initialValue' | '$originalValue'> & {
1175
+ /** A reference to the original validated model. It can be used to bind your form with v-model.*/$value: MaybeOutput<UnwrapNestedRefs<TState>>; /** $value variant that will not "touch" the field and update the value silently, running only the rules, so you can easily swap values without impacting user interaction. */
1176
+ $silentValue: MaybeOutput<UnwrapNestedRefs<TState>>;
1133
1177
  /**
1134
1178
  * This value reflect the current initial value of the field.
1135
1179
  * The initial value is different than the original value as the initial value can be mutated when using `$reset`.
1136
1180
  */
1137
- readonly $initialValue: MaybeOutput<UnwrapNestedRefs<TState$1>>;
1181
+ readonly $initialValue: MaybeOutput<UnwrapNestedRefs<TState>>;
1138
1182
  /**
1139
1183
  * This value reflect the original value of the field at original call. This can't be mutated
1140
1184
  */
1141
- readonly $originalValue: MaybeOutput<UnwrapNestedRefs<TState$1>>;
1185
+ readonly $originalValue: MaybeOutput<UnwrapNestedRefs<TState>>;
1142
1186
  /** Collection of all the error messages, collected for all children properties and nested forms.
1143
1187
  *
1144
1188
  * Only contains errors from properties where $dirty equals true. */
1145
- readonly $errors: string[];
1146
- /** Collection of all the error messages, collected for all children properties and nested forms. */
1189
+ readonly $errors: string[]; /** Collection of all the error messages, collected for all children properties and nested forms. */
1147
1190
  readonly $silentErrors: string[];
1148
1191
  /**
1149
1192
  * Collect all metadata of validators, Only contains metadata from properties where $dirty equals true.
1150
1193
  */
1151
- readonly $issues: RegleFieldIssue<TRules$1>[];
1194
+ readonly $issues: RegleFieldIssue<TRules>[];
1152
1195
  /**
1153
1196
  * Collect all metadata of validators, including the error message.
1154
1197
  */
1155
- readonly $silentIssues: RegleFieldIssue<TRules$1>[];
1156
- /** Stores external errors of the current field */
1157
- readonly $externalErrors: string[];
1158
- /** Stores active tooltips messages of the current field */
1159
- readonly $tooltips: string[];
1160
- /** Represents the inactive status. Is true when this state have empty rules */
1161
- readonly $inactive: boolean;
1162
- /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
1163
- $extractDirtyFields: (filterNullishValues?: boolean) => MaybeOutput<TState$1>;
1164
- /** Sets all properties as dirty, triggering all rules. It returns a promise that will either resolve to false or a type safe copy of your form state. Values that had the required rule will be transformed into a non-nullable value (type only). */
1165
- $validate: (forceValues?: IsUnknown<TState$1> extends true ? any : TState$1) => Promise<RegleFieldResult<TState$1, TRules$1>>;
1166
- /** This is reactive tree containing all the declared rules of your field. To know more about the rule properties check the rules properties section */
1167
- readonly $rules: ComputeFieldRules<TState$1, TRules$1>;
1198
+ readonly $silentIssues: RegleFieldIssue<TRules>[]; /** Stores external errors of the current field */
1199
+ readonly $externalErrors: string[]; /** Stores active tooltips messages of the current field */
1200
+ readonly $tooltips: string[]; /** Represents the inactive status. Is true when this state have empty rules */
1201
+ readonly $inactive: boolean; /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
1202
+ $extractDirtyFields: (filterNullishValues?: boolean) => MaybeOutput<TState>; /** Sets all properties as dirty, triggering all rules. It returns a promise that will either resolve to false or a type safe copy of your form state. Values that had the required rule will be transformed into a non-nullable value (type only). */
1203
+ $validate: (forceValues?: IsUnknown<TState> extends true ? any : TState) => Promise<RegleFieldResult<TState, TRules>>; /** This is reactive tree containing all the declared rules of your field. To know more about the rule properties check the rules properties section */
1204
+ readonly $rules: ComputeFieldRules<TState, TRules>;
1168
1205
  } & ([TShortcuts['fields']] extends [never] ? {} : { [K in keyof TShortcuts['fields']]: ReturnType<NonNullable<TShortcuts['fields']>[K]> });
1169
1206
  /**
1170
1207
  * @internal
@@ -1189,7 +1226,7 @@ interface $InternalRegleFieldStatus extends $InternalRegleCommonStatus {
1189
1226
  /**
1190
1227
  * @public
1191
1228
  */
1192
- interface RegleCommonStatus<TValue$1 = any, TRules$1 extends Record<string, any> = never> extends StandardSchemaV1<TValue$1, [TRules$1] extends [never] ? TValue$1 : InferOutput<TRules$1, TValue$1>> {
1229
+ interface RegleCommonStatus<TValue = any, TRules extends Record<string, any> = never> extends StandardSchemaV1<TValue, [TRules] extends [never] ? TValue : InferOutput<TRules, TValue>> {
1193
1230
  /** Indicates whether the field is invalid. It becomes true if any associated rules return false. */
1194
1231
  readonly $invalid: boolean;
1195
1232
  /**
@@ -1225,20 +1262,20 @@ interface RegleCommonStatus<TValue$1 = any, TRules$1 extends Record<string, any>
1225
1262
  /** Id used to track collections items */
1226
1263
  $id?: string;
1227
1264
  /** A reference to the original validated model. It can be used to bind your form with v-model.*/
1228
- $value: JoinDiscriminatedUnions<UnwrapNestedRefs<TValue$1>>;
1265
+ $value: JoinDiscriminatedUnions<UnwrapNestedRefs<TValue>>;
1229
1266
  /**
1230
1267
  * `$value` variant that will not "touch" the field and update the value silently, running only the rules, so you can easily swap values without impacting user interaction.
1231
1268
  * */
1232
- $silentValue: JoinDiscriminatedUnions<UnwrapNestedRefs<TValue$1>>;
1269
+ $silentValue: JoinDiscriminatedUnions<UnwrapNestedRefs<TValue>>;
1233
1270
  /**
1234
1271
  * This value reflect the current initial value of the field.
1235
1272
  * The initial value is different than the original value as the initial value can be mutated when using `$reset`.
1236
1273
  */
1237
- readonly $initialValue: JoinDiscriminatedUnions<UnwrapNestedRefs<TValue$1>>;
1274
+ readonly $initialValue: JoinDiscriminatedUnions<UnwrapNestedRefs<TValue>>;
1238
1275
  /**
1239
1276
  * This value reflect the original value of the field at original call. This can't be mutated
1240
1277
  */
1241
- readonly $originalValue: JoinDiscriminatedUnions<UnwrapNestedRefs<TValue$1>>;
1278
+ readonly $originalValue: JoinDiscriminatedUnions<UnwrapNestedRefs<TValue>>;
1242
1279
  /** Marks the field and all nested properties as $dirty. */
1243
1280
  $touch(): void;
1244
1281
  /**
@@ -1247,7 +1284,7 @@ interface RegleCommonStatus<TValue$1 = any, TRules$1 extends Record<string, any>
1247
1284
  * Rerun rules if `$lazy` is false
1248
1285
  */
1249
1286
  $reset(): void;
1250
- $reset(options?: ResetOptions<TValue$1>): void;
1287
+ $reset(options?: ResetOptions<TValue>): void;
1251
1288
  /** Clears the $externalErrors state back to an empty object. */
1252
1289
  $clearExternalErrors(): void;
1253
1290
  }
@@ -1261,35 +1298,22 @@ interface $InternalRegleCommonStatus extends Omit<RegleCommonStatus, '$touch' |
1261
1298
  /**
1262
1299
  * @public
1263
1300
  */
1264
- type RegleRuleStatus<TValue$1 = any, TParams$1 extends any[] = any[], TMetadata$1 extends RegleRuleMetadataDefinition = boolean> = {
1265
- /** The name of the rule type. */
1266
- readonly $type: string;
1267
- /** Returns the computed error message or messages for the current rule. */
1268
- readonly $message: string | string[];
1269
- /** Stores the current rule tooltip or tooltips */
1270
- readonly $tooltip: string | string[];
1271
- /** Indicates whether or not the rule is enabled (for rules like requiredIf) */
1272
- readonly $active: boolean;
1273
- /** Indicates the state of validation for this validator. */
1274
- readonly $valid: boolean;
1275
- /** If the rule is async, indicates if it's currently pending. Always false if it's synchronous. */
1276
- readonly $pending: boolean;
1277
- /** Returns the current path of the rule (used internally for tracking) */
1278
- readonly $path: string;
1279
- /** Contains the metadata returned by the validator function. */
1280
- readonly $metadata: TMetadata$1 extends boolean ? TMetadata$1 : Omit<TMetadata$1, '$valid'>;
1281
- /** Run the rule validator and compute its properties like $message and $active */
1282
- $parse(): Promise<boolean>;
1283
- /** Reset the $valid, $metadata and $pending states */
1284
- $reset(): void;
1285
- /** Returns the original rule validator function. */
1286
- $validator: ((value: IsUnknown<TValue$1> extends true ? any : MaybeInput<TValue$1>, ...args: any[]) => RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition>) & ((value: IsUnknown<TValue$1> extends true ? any : TValue$1, ...args: [TParams$1] extends [never[]] ? [] : [unknown[]] extends [TParams$1] ? any[] : TParams$1) => RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition>);
1287
- } & ([TParams$1] extends [never[]] ? {} : [unknown[]] extends [TParams$1] ? {
1288
- /** Contains the rule parameters when the rule accepts arguments. */
1289
- readonly $params?: any[];
1301
+ type RegleRuleStatus<TValue = any, TParams extends any[] = any[], TMetadata extends RegleRuleMetadataDefinition = boolean> = {
1302
+ /** The name of the rule type. */readonly $type: string; /** Returns the computed error message or messages for the current rule. */
1303
+ readonly $message: string | string[]; /** Stores the current rule tooltip or tooltips */
1304
+ readonly $tooltip: string | string[]; /** Indicates whether or not the rule is enabled (for rules like requiredIf) */
1305
+ readonly $active: boolean; /** Indicates the state of validation for this validator. */
1306
+ readonly $valid: boolean; /** If the rule is async, indicates if it's currently pending. Always false if it's synchronous. */
1307
+ readonly $pending: boolean; /** Returns the current path of the rule (used internally for tracking) */
1308
+ readonly $path: string; /** Contains the metadata returned by the validator function. */
1309
+ readonly $metadata: TMetadata extends boolean ? TMetadata : Omit<TMetadata, '$valid'>; /** Run the rule validator and compute its properties like $message and $active */
1310
+ $parse(): Promise<boolean>; /** Reset the $valid, $metadata and $pending states */
1311
+ $reset(): void; /** Returns the original rule validator function. */
1312
+ $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>);
1313
+ } & ([TParams] extends [never[]] ? {} : [unknown[]] extends [TParams] ? {
1314
+ /** Contains the rule parameters when the rule accepts arguments. */readonly $params?: any[];
1290
1315
  } : {
1291
- /** Contains the rule parameters when the rule accepts arguments. */
1292
- readonly $params: [...TParams$1];
1316
+ /** Contains the rule parameters when the rule accepts arguments. */readonly $params: [...TParams];
1293
1317
  });
1294
1318
  /**
1295
1319
  * @internal
@@ -1323,31 +1347,24 @@ interface $InternalRegleRuleStatus {
1323
1347
  /**
1324
1348
  * @public
1325
1349
  */
1326
- type RegleCollectionStatus<TState$1 extends any[] = any[], TRules$1 extends ReglePartialRuleTree<any> = Record<string, any>, TFieldRule extends RegleCollectionRuleDecl<any, any> = never, TShortcuts extends RegleShortcutDefinition = {}> = Omit<RegleCommonStatus<TState$1, TRules$1>, '$value'> & {
1327
- /** A reference to the original validated model. It can be used to bind your form with v-model.*/
1328
- $value: MaybeOutput<TState$1>;
1329
- /** $value variant that will not "touch" the field and update the value silently, running only the rules, so you can easily swap values without impacting user interaction. */
1330
- $silentValue: MaybeOutput<TState$1>;
1331
- /** Collection of status of every item in your collection. Each item will be a field you can access, or map on it to display your elements. */
1332
- readonly $each: Array<InferRegleStatusType<NonNullable<TRules$1>, NonNullable<TState$1>, number, TShortcuts>>;
1333
- /** Represents the status of the collection itself. You can have validation rules on the array like minLength, this field represents the isolated status of the collection. */
1334
- readonly $self: RegleFieldStatus<TState$1, TFieldRule, TShortcuts>;
1350
+ type RegleCollectionStatus<TState extends any[] = any[], TRules extends ReglePartialRuleTree<Record<string, any>> = Record<string, any>, TFieldRule extends RegleCollectionRuleDecl<any, any> = never, TShortcuts extends RegleShortcutDefinition = {}> = Omit<RegleCommonStatus<TState, TRules>, '$value'> & {
1351
+ /** A reference to the original validated model. It can be used to bind your form with v-model.*/$value: MaybeOutput<TState>; /** $value variant that will not "touch" the field and update the value silently, running only the rules, so you can easily swap values without impacting user interaction. */
1352
+ $silentValue: MaybeOutput<TState>; /** Collection of status of every item in your collection. Each item will be a field you can access, or map on it to display your elements. */
1353
+ readonly $each: Array<InferRegleStatusType<NonNullable<TRules>, NonNullable<TState>, number, TShortcuts>>; /** Represents the status of the collection itself. You can have validation rules on the array like minLength, this field represents the isolated status of the collection. */
1354
+ readonly $self: RegleFieldStatus<TState, TFieldRule, TShortcuts>;
1335
1355
  /**
1336
1356
  * Collection of all the issues, collected for all children properties and nested forms.
1337
1357
  *
1338
1358
  * Only contains issues from properties where $dirty equals true.
1339
1359
  */
1340
- readonly $issues: RegleCollectionErrors<TState$1, true>;
1360
+ readonly $issues: RegleCollectionErrors<TState, true>;
1341
1361
  /** Collection of all the error messages, collected for all children properties and nested forms.
1342
1362
  *
1343
1363
  * Only contains errors from properties where $dirty equals true. */
1344
- readonly $errors: RegleCollectionErrors<TState$1>;
1345
- /** Collection of all the error messages, collected for all children properties and nested forms. */
1346
- readonly $silentErrors: RegleCollectionErrors<TState$1>;
1347
- /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
1348
- $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TState$1>;
1349
- /** Sets all properties as dirty, triggering all rules. It returns a promise that will either resolve to false or a type safe copy of your form state. Values that had the required rule will be transformed into a non-nullable value (type only). */
1350
- $validate: (value?: JoinDiscriminatedUnions<TState$1>) => Promise<RegleCollectionResult<TState$1, JoinDiscriminatedUnions<TRules$1>>>;
1364
+ readonly $errors: RegleCollectionErrors<TState>; /** Collection of all the error messages, collected for all children properties and nested forms. */
1365
+ readonly $silentErrors: RegleCollectionErrors<TState>; /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
1366
+ $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TState>; /** Sets all properties as dirty, triggering all rules. It returns a promise that will either resolve to false or a type safe copy of your form state. Values that had the required rule will be transformed into a non-nullable value (type only). */
1367
+ $validate: (value?: JoinDiscriminatedUnions<TState>) => Promise<RegleCollectionResult<TState, JoinDiscriminatedUnions<TRules>>>;
1351
1368
  } & ([TShortcuts['collections']] extends [never] ? {} : { [K in keyof TShortcuts['collections']]: ReturnType<NonNullable<TShortcuts['collections']>[K]> });
1352
1369
  /**
1353
1370
  * @internal
@@ -1385,7 +1402,7 @@ type RegleUnknownRulesTree = {
1385
1402
  /**
1386
1403
  * @public
1387
1404
  */
1388
- type RegleComputedRules<TForm extends MaybeRefOrComputedRef<Record<string, any>> | DeepReactiveState<Record<string, any>>, TCustomRules extends Partial<ExtendedRulesDeclarations> | Regle<any, any> | useRegleFn<any> = Partial<ExtendedRulesDeclarations>, TState$1 = Unwrap<UnwrapMaybeRef<TForm>>, TCustom = (TCustomRules extends Regle<any, infer R> ? R extends ReglePartialRuleTree<any, infer C> ? C : Partial<ExtendedRulesDeclarations> : TCustomRules extends useRegleFn<infer Rules, any> ? Rules : {})> = { [TKey in keyof JoinDiscriminatedUnions<TState$1>]?: RegleFormPropertyType<JoinDiscriminatedUnions<TState$1>[TKey], Omit<Partial<ExtendedRulesDeclarations>, keyof TCustom> & Partial<TCustom>> };
1405
+ type RegleComputedRules<TForm extends MaybeRefOrComputedRef<Record<string, any>> | DeepReactiveState<Record<string, any>>, TCustomRules extends Partial<ExtendedRulesDeclarations> | Regle<any, any> | useRegleFn<any> = Partial<ExtendedRulesDeclarations>, TState = Unwrap<UnwrapMaybeRef<TForm>>, TCustom = (TCustomRules extends Regle<any, infer R> ? R extends ReglePartialRuleTree<any, infer C> ? C : Partial<ExtendedRulesDeclarations> : TCustomRules extends useRegleFn<infer Rules, any> ? Rules : {})> = { [TKey in keyof JoinDiscriminatedUnions<TState>]?: RegleFormPropertyType<JoinDiscriminatedUnions<TState>[TKey], Omit<Partial<ExtendedRulesDeclarations>, keyof TCustom> & Partial<TCustom>> };
1389
1406
  /**
1390
1407
  * @internal
1391
1408
  * @reference {@link ReglePartialRuleTree}
@@ -1398,7 +1415,7 @@ type $InternalReglePartialRuleTree = {
1398
1415
  /**
1399
1416
  * @public
1400
1417
  */
1401
- type RegleFormPropertyType<TValue$1 = any, TCustomRules extends Partial<ExtendedRulesDeclarations> = Partial<ExtendedRulesDeclarations>> = [NonNullable<TValue$1>] extends [never] ? MaybeRefOrComputedRef<RegleRuleDecl<TValue$1, TCustomRules>> : NonNullable<TValue$1> extends Array<any> ? RegleCollectionRuleDecl<TValue$1, TCustomRules> : NonNullable<TValue$1> extends Date ? MaybeRefOrComputedRef<RegleRuleDecl<NonNullable<TValue$1>, TCustomRules>> : NonNullable<TValue$1> extends File ? MaybeRefOrComputedRef<RegleRuleDecl<NonNullable<TValue$1>, TCustomRules>> : NonNullable<TValue$1> extends Ref<infer V> ? RegleFormPropertyType<V, TCustomRules> : NonNullable<TValue$1> extends Record<string, any> ? NonNullable<TValue$1> extends RegleStatic<infer U> ? MaybeRefOrComputedRef<RegleRuleDecl<Raw<U>, TCustomRules>> : ReglePartialRuleTree<NonNullable<TValue$1>, TCustomRules> : MaybeRefOrComputedRef<RegleRuleDecl<NonNullable<TValue$1>, TCustomRules>>;
1418
+ type RegleFormPropertyType<TValue = any, TCustomRules extends Partial<ExtendedRulesDeclarations> = Partial<ExtendedRulesDeclarations>> = [NonNullable<TValue>] extends [never] ? MaybeRefOrComputedRef<RegleRuleDecl<TValue, TCustomRules>> : NonNullable<TValue> extends Array<any> ? RegleCollectionRuleDecl<TValue, TCustomRules> : NonNullable<TValue> extends Date ? MaybeRefOrComputedRef<RegleRuleDecl<NonNullable<TValue>, TCustomRules>> : NonNullable<TValue> extends File ? MaybeRefOrComputedRef<RegleRuleDecl<NonNullable<TValue>, TCustomRules>> : NonNullable<TValue> extends Ref<infer V> ? RegleFormPropertyType<V, TCustomRules> : NonNullable<TValue> extends Record<string, any> ? NonNullable<TValue> extends RegleStatic<infer U> ? MaybeRefOrComputedRef<RegleRuleDecl<Raw<U>, TCustomRules>> : ReglePartialRuleTree<NonNullable<TValue>, TCustomRules> : MaybeRefOrComputedRef<RegleRuleDecl<NonNullable<TValue>, TCustomRules>>;
1402
1419
  /**
1403
1420
  * @internal
1404
1421
  * @reference {@link RegleFormPropertyType}
@@ -1408,8 +1425,8 @@ type $InternalFormPropertyTypes = MaybeRefOrComputedRef<$InternalRegleRuleDecl>
1408
1425
  * @public
1409
1426
  * Rule tree for a form property
1410
1427
  */
1411
- type RegleRuleDecl<TValue$1 extends any = any, TCustomRules extends Partial<ExtendedRulesDeclarations> = Partial<DefaultValidatorsTree>, TOptions extends Record<string, unknown> = FieldRegleBehaviourOptions<TValue$1>> = TOptions & { [TKey in keyof RemoveIndexSignature<TCustomRules>]?: FormRuleDeclaration<TValue$1, any[]> } & {
1412
- [x: string]: FormRuleDeclaration<TValue$1, any[]> | boolean | number | undefined;
1428
+ type RegleRuleDecl<TValue extends any = any, TCustomRules extends Partial<ExtendedRulesDeclarations> = Partial<DefaultValidatorsTree>, TOptions extends Record<string, unknown> = FieldRegleBehaviourOptions<TValue>> = TOptions & { [TKey in keyof RemoveIndexSignature<TCustomRules>]?: FormRuleDeclaration<TValue, any[]> } & {
1429
+ [x: string]: FormRuleDeclaration<TValue, any[]> | boolean | number | undefined;
1413
1430
  };
1414
1431
  /**
1415
1432
  * @internal
@@ -1422,16 +1439,29 @@ type $InternalRegleRuleDecl = FieldRegleBehaviourOptions & CollectionRegleBehavi
1422
1439
  type RegleCollectionRuleDeclKeyProperty = {
1423
1440
  $key?: PropertyKey;
1424
1441
  };
1442
+ type CollectionEachRuleDecl<TValue = any[], TCustomRules extends Partial<ExtendedRulesDeclarations> = Partial<ExtendedRulesDeclarations>> = IsAny<TValue> extends true ? {
1443
+ $each?: RegleCollectionEachRules<TValue, TCustomRules>;
1444
+ } : MaybeNullable<TValue> extends true ? {
1445
+ /**
1446
+ * Rules for each item in the collection
1447
+ *
1448
+ * ⚠️ `$each` is required here because your array is potentially undefined.
1449
+ * Regle can't guess the type of the array if it's undefined.
1450
+ * Having an empty `$each: {}` is the only way to tell Regle that the array is a collection.
1451
+ */
1452
+ $each: RegleCollectionEachRules<TValue, TCustomRules>;
1453
+ } : {
1454
+ /**
1455
+ * Rules for each item in the collection
1456
+ */
1457
+ $each?: RegleCollectionEachRules<TValue, TCustomRules>;
1458
+ };
1425
1459
  /**
1426
1460
  * @public
1427
1461
  */
1428
- type RegleCollectionRuleDecl<TValue$1 = any[], TCustomRules extends Partial<ExtendedRulesDeclarations> = Partial<ExtendedRulesDeclarations>> = ({
1429
- $each?: RegleCollectionEachRules<TValue$1, TCustomRules>;
1430
- } & RegleRuleDecl<NonNullable<TValue$1>, TCustomRules, CollectionRegleBehaviourOptions>) | ({
1431
- $each?: RegleCollectionEachRules<TValue$1, TCustomRules>;
1432
- } & CollectionRegleBehaviourOptions);
1462
+ type RegleCollectionRuleDecl<TValue = any[], TCustomRules extends Partial<ExtendedRulesDeclarations> = Partial<ExtendedRulesDeclarations>> = (CollectionEachRuleDecl<TValue, TCustomRules> & RegleRuleDecl<NonNullable<TValue>, TCustomRules, CollectionRegleBehaviourOptions>) | (CollectionEachRuleDecl<TValue, TCustomRules> & CollectionRegleBehaviourOptions);
1433
1463
  /** @public */
1434
- type RegleCollectionEachRules<TValue$1 = any[], TCustomRules extends Partial<ExtendedRulesDeclarations> = Partial<ExtendedRulesDeclarations>> = MaybeGetter<RegleFormPropertyType<ArrayElement<NonNullable<TValue$1>>, TCustomRules>, ArrayElement<TValue$1>, RegleCollectionRuleDeclKeyProperty, RegleFormPropertyType<ArrayElement<NonNullable<TValue$1>>, TCustomRules>>;
1464
+ type RegleCollectionEachRules<TValue = any[], TCustomRules extends Partial<ExtendedRulesDeclarations> = Partial<ExtendedRulesDeclarations>> = MaybeGetter<RegleFormPropertyType<ArrayElement<NonNullable<TValue>>, TCustomRules>, ArrayElement<TValue>, RegleCollectionRuleDeclKeyProperty, RegleFormPropertyType<ArrayElement<NonNullable<TValue>>, TCustomRules>>;
1435
1465
  /**
1436
1466
  * @internal
1437
1467
  * @reference {@link RegleCollectionRuleDecl}
@@ -1444,31 +1474,51 @@ type $InternalRegleCollectionRuleDecl = $InternalRegleRuleDecl & {
1444
1474
  /**
1445
1475
  * @public
1446
1476
  */
1447
- type InlineRuleDeclaration<TValue$1 extends any = any, TParams$1 extends any[] = any[], TReturn extends RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition> = boolean> = (value: Maybe<TValue$1>, ...args: UnwrapRegleUniversalParams<TParams$1>) => TReturn;
1477
+ type InlineRuleDeclaration<TValue extends any = any, TParams extends any[] = any[], TReturn extends RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition> = boolean> = (value: Maybe<TValue>, ...args: UnwrapRegleUniversalParams<TParams>) => TReturn;
1448
1478
  /**
1449
1479
  * @public
1450
1480
  * Regroup inline and registered rules
1451
1481
  * */
1452
- type FormRuleDeclaration<TValue$1 extends any = unknown, TParams$1 extends any[] = any[], TReturn extends RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition> = RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition>, TMetadata$1 extends RegleRuleMetadataDefinition = (TReturn extends Promise<infer M> ? M : TReturn), TAsync$1 extends boolean = boolean> = InlineRuleDeclaration<TValue$1, TParams$1, TReturn> | RegleRuleDefinition<unknown, TValue$1, TParams$1, TAsync$1, TMetadata$1, any, any, boolean> | RegleRuleWithParamsDefinitionInput<unknown, TValue$1, [param?: any], TAsync$1, TMetadata$1> | RegleRuleWithParamsDefinitionInput<unknown, TValue$1, [param?: any, ...any[]], TAsync$1, TMetadata$1>;
1453
- type RegleErrorTree<TState$1 = MaybeRef<Record<string, any> | any[]>, TIssue extends boolean = false, TSchema extends boolean = false> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState$1>>]: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState$1>>[K], false, TIssue, TSchema> } & {
1482
+ 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<unknown, TValue, TParams, TAsync, TMetadata, any, any, boolean> | RegleRuleWithParamsDefinitionInput<unknown, TValue, [param?: any], TAsync, TMetadata> | RegleRuleWithParamsDefinitionInput<unknown, TValue, [param?: any, ...any[]], TAsync, TMetadata>;
1483
+ type RegleErrorTree<TState = MaybeRef<Record<string, any> | any[]>, TIssue extends boolean = false, TSchema extends boolean = false> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>]: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>[K], false, TIssue, TSchema> } & {
1454
1484
  readonly $self?: string[];
1455
1485
  };
1456
- type RegleIssuesTree<TState$1 = MaybeRef<Record<string, any> | any[]>, TSchema extends boolean = false> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState$1>>]: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState$1>>[K], false, true, TSchema> } & {
1486
+ type RegleIssuesTree<TState = MaybeRef<Record<string, any> | any[]>, TSchema extends boolean = false, TRules extends ReglePartialRuleTree<NonNullable<TState>> = Record<string, any>> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>]: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>[K], false, true, TSchema, K extends keyof TRules ? TRules[K] extends RegleFormPropertyType<Record<string, any>> ? TRules[K] : EmptyObject : EmptyObject> } & {
1457
1487
  readonly $self?: RegleFieldIssue[];
1458
1488
  };
1459
- type RegleExternalErrorTree<TState$1 = MaybeRef<Record<string, any> | any[]>, TSchema extends boolean = false> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState$1>>]?: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState$1>>[K], true, TSchema> } & {
1489
+ type RegleExternalErrorTree<TState = MaybeRef<Record<string, any> | any[]>, TSchema extends boolean = false> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>]?: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>[K], true, TSchema> } & {
1460
1490
  readonly $self?: RegleFieldIssue[];
1461
1491
  };
1462
- type RegleExternalSchemaErrorTree<TState$1 = MaybeRef<Record<string, any> | any[]>, TSchema extends boolean = false> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState$1>>]?: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState$1>>[K], true, true, TSchema> };
1463
- type ErrorMessageOrIssue<TIssue extends boolean> = TIssue extends true ? RegleFieldIssue[] : string[];
1464
- type RegleValidationErrors<TState$1 extends Record<string, any> | any[] | unknown = never, TExternal extends boolean = false, TIssue extends boolean = false, TSchema extends boolean = false> = HasNamedKeys<TState$1> extends true ? IsAny<TState$1> extends true ? any : NonNullable<TState$1> extends Array<infer U> ? TSchema extends false ? U extends Record<string, any> ? TExternal extends false ? RegleCollectionErrors<U, TIssue, TSchema> : RegleExternalCollectionErrors<U, TIssue, TSchema> : ErrorMessageOrIssue<TIssue> : RegleCollectionErrors<U, TIssue, TSchema> : NonNullable<TState$1> extends Date | File ? ErrorMessageOrIssue<TIssue> : NonNullable<TState$1> extends Record<string, any> ? IsRegleStatic<NonNullable<TState$1>> extends true ? ErrorMessageOrIssue<TIssue> : TExternal extends false ? RegleErrorTree<TState$1, TIssue, TSchema> : RegleExternalErrorTree<TState$1, TSchema> : ErrorMessageOrIssue<TIssue> : any;
1465
- type RegleCollectionErrors<TState$1 extends any, TIssue extends boolean = false, TSchema extends boolean = false> = {
1492
+ type RegleExternalSchemaErrorTree<TState = MaybeRef<Record<string, any> | any[]>, TSchema extends boolean = false> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>]?: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>[K], true, true, TSchema> };
1493
+ type ErrorMessageOrIssue<TIssue extends boolean, TRules extends RegleFormPropertyType<Record<string, any>> = EmptyObject> = TIssue extends true ? RegleFieldIssue<TRules>[] : string[];
1494
+ type RegleValidationErrors<TState extends Record<string, any> | any[] | unknown = never, TExternal extends boolean = false, TIssue extends boolean = false, TSchema extends boolean = false, TRules extends RegleFormPropertyType<Record<string, any>> = EmptyObject> = HasNamedKeys<TState> extends true ? IsAny<TState> extends true ? any : NonNullable<TState> extends Array<infer U> ? TSchema extends false ? TExternal extends false ? RegleCollectionErrors<U, TIssue, TSchema> : RegleExternalCollectionErrors<U, TIssue, TSchema> : RegleCollectionErrors<U, TIssue, TSchema> : NonNullable<TState> extends Date | File ? ErrorMessageOrIssue<TIssue, TRules> : NonNullable<TState> extends Record<string, any> ? IsRegleStatic<NonNullable<TState>> extends true ? ErrorMessageOrIssue<TIssue, TRules> : TExternal extends false ? RegleErrorTree<TState, TIssue, TSchema> : RegleExternalErrorTree<TState, TSchema> : ErrorMessageOrIssue<TIssue, TRules> : any;
1495
+ type RegleFieldIssue<TRules extends RegleFormPropertyType<unknown, Partial<ExtendedRulesDeclarations>> = EmptyObject> = {
1496
+ readonly $property: string;
1497
+ readonly $type?: string;
1498
+ readonly $message: string;
1499
+ } & (IsEmptyObject<TRules> extends true ? {
1500
+ readonly $rule: string;
1501
+ } : { [K in keyof ComputeFieldRules<any, TRules>]: ComputeFieldRules<any, TRules>[K] extends {
1502
+ $metadata: infer TMetadata;
1503
+ } ? K extends string ? {
1504
+ readonly $rule: K;
1505
+ } & (TMetadata extends boolean ? {
1506
+ readonly $rule: string;
1507
+ } : TMetadata) : {
1508
+ readonly $rule: string;
1509
+ } : {
1510
+ readonly $rule: string;
1511
+ } }[keyof ComputeFieldRules<any, TRules>]);
1512
+ type ComputeFieldRules<TState extends any, TRules extends MaybeRef<RegleFormPropertyType<unknown, Partial<ExtendedRulesDeclarations>>>> = IsEmptyObject<UnwrapRef<TRules>> extends true ? {
1513
+ readonly [x: string]: RegleRuleStatus<TState, any[], any>;
1514
+ } : { readonly [TRuleKey in keyof Omit<UnwrapRef<TRules>, '$each' | keyof FieldRegleBehaviourOptions>]: RegleRuleStatus<TState, UnwrapRef<TRules>[TRuleKey] extends RegleRuleDefinition<unknown, any, infer TParams, any> ? TParams : [], UnwrapRef<TRules>[TRuleKey] extends RegleRuleDefinition<unknown, any, any, any, infer TMetadata> ? TMetadata : UnwrapRef<TRules>[TRuleKey] extends InlineRuleDeclaration<any, any[], infer TMetadata> ? TMetadata extends Promise<infer P> ? P : TMetadata : boolean> };
1515
+ type RegleCollectionErrors<TState extends any, TIssue extends boolean = false, TSchema extends boolean = false> = {
1466
1516
  readonly $self: TIssue extends true ? RegleFieldIssue[] : string[];
1467
- readonly $each: RegleValidationErrors<TState$1, false, TIssue, TSchema>[];
1517
+ readonly $each: RegleValidationErrors<TState, false, TIssue, TSchema>[];
1468
1518
  };
1469
- type RegleExternalCollectionErrors<TState$1 extends Record<string, any>, TIssue extends boolean = false, TSchema extends boolean = false> = {
1519
+ type RegleExternalCollectionErrors<TState extends unknown, TIssue extends boolean = false, TSchema extends boolean = false> = {
1470
1520
  readonly $self?: TIssue extends true ? RegleFieldIssue[] : string[];
1471
- readonly $each?: RegleValidationErrors<TState$1, true, TIssue, TSchema>[];
1521
+ readonly $each?: RegleValidationErrors<TState, true, TIssue, TSchema>[];
1472
1522
  };
1473
1523
  /** @internal */
1474
1524
  type $InternalRegleCollectionErrors = {
@@ -1487,8 +1537,8 @@ type $InternalRegleCollectionIssues = {
1487
1537
  readonly $self?: RegleFieldIssue[];
1488
1538
  readonly $each?: $InternalRegleIssues[];
1489
1539
  };
1490
- type RegleLike<TState$1 extends Record<string, any>> = {
1491
- $value: TState$1;
1540
+ type RegleLike<TState extends Record<string, any>> = {
1541
+ $value: TState;
1492
1542
  $validate: (...args: any[]) => Promise<SuperCompatibleRegleResult>;
1493
1543
  };
1494
1544
  interface SuperCompatibleRegle {
@@ -1597,51 +1647,37 @@ type SuperCompatibleRegleCollectionIssues = $InternalRegleCollectionIssues;
1597
1647
  *
1598
1648
  * @see {@link https://reglejs.dev/core-concepts/rules/reusable-rules Documentation}
1599
1649
  */
1600
- declare function createRule<const TType$1 extends string | unknown, TValue$1 extends any, TParams$1 extends any[], TReturn extends RegleRuleMetadataDefinition | Promise<RegleRuleMetadataDefinition>, TMetadata$1 extends RegleRuleMetadataDefinition = (TReturn extends Promise<infer M> ? M : TReturn), TAsync$1 extends boolean = (TReturn extends Promise<any> ? true : false), TNonEmpty extends boolean = false>(definition: RegleRuleInit<TType$1, TValue$1, TParams$1, TReturn, TMetadata$1, TAsync$1, TNonEmpty>): InferRegleRule<TType$1, TValue$1, TParams$1, TAsync$1, TMetadata$1, TNonEmpty>;
1650
+ declare function createRule<const TType extends string | unknown, 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), TNonEmpty extends boolean = false>(definition: RegleRuleInit<TType, TValue, TParams, TReturn, TMetadata, TAsync, TNonEmpty>): InferRegleRule<TType, TValue, TParams, TAsync, TMetadata, TNonEmpty>;
1601
1651
  /**
1602
1652
  * Returns a clean list of parameters
1603
1653
  * Removing Ref and executing function to return the unwrapped value
1604
1654
  */
1605
- declare function unwrapRuleParameters<TParams$1 extends any[]>(params: MaybeRefOrGetter[]): TParams$1;
1606
- type MergedRegles<TRegles extends Record<string, SuperCompatibleRegleRoot>, TValue$1 = { [K in keyof TRegles]: TRegles[K]['$value'] }> = Omit<RegleCommonStatus, '$value' | '$silentValue' | '$errors' | '$silentErrors' | '$name' | '$unwatch' | '$watch' | '$extractDirtyFields'> & {
1607
- /** Map of merged Regle instances and their properties */
1608
- readonly $instances: { [K in keyof TRegles]: TRegles[K] };
1609
- /** A reference to the original validated model. It can be used to bind your form with v-model.*/
1610
- $value: TValue$1;
1611
- /** $value variant that will not "touch" the field and update the value silently, running only the rules, so you can easily swap values without impacting user interaction. */
1612
- $silentValue: TValue$1;
1655
+ declare function unwrapRuleParameters<TParams extends any[]>(params: MaybeRefOrGetter[]): TParams;
1656
+ type MergedRegles<TRegles extends Record<string, SuperCompatibleRegleRoot>, TValue = { [K in keyof TRegles]: TRegles[K]['$value'] }> = Omit<RegleCommonStatus, '$value' | '$silentValue' | '$errors' | '$silentErrors' | '$name' | '$unwatch' | '$watch' | '$extractDirtyFields'> & {
1657
+ /** Map of merged Regle instances and their properties */readonly $instances: { [K in keyof TRegles]: TRegles[K] }; /** A reference to the original validated model. It can be used to bind your form with v-model.*/
1658
+ $value: TValue; /** $value variant that will not "touch" the field and update the value silently, running only the rules, so you can easily swap values without impacting user interaction. */
1659
+ $silentValue: TValue;
1613
1660
  /** Collection of all the error messages, collected for all children properties and nested forms.
1614
1661
  *
1615
1662
  * Only contains errors from properties where $dirty equals true. */
1616
- readonly $errors: { [K in keyof TRegles]: TRegles[K]['$errors'] };
1617
- /** Collection of all the error messages, collected for all children properties. */
1663
+ readonly $errors: { [K in keyof TRegles]: TRegles[K]['$errors'] }; /** Collection of all the error messages, collected for all children properties. */
1618
1664
  readonly $silentErrors: { [K in keyof TRegles]: TRegles[K]['$silentErrors'] };
1619
1665
  readonly $issues: { [K in keyof TRegles]: TRegles[K]['$issues'] };
1620
- readonly $silentIssues: { [K in keyof TRegles]: TRegles[K]['$silentIssues'] };
1621
- /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
1622
- $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TValue$1>[];
1623
- /** Sets all properties as dirty, triggering all rules. It returns a promise that will either resolve to false or a type safe copy of your form state. Values that had the required rule will be transformed into a non-nullable value (type only). */
1666
+ readonly $silentIssues: { [K in keyof TRegles]: TRegles[K]['$silentIssues'] }; /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
1667
+ $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TValue>[]; /** Sets all properties as dirty, triggering all rules. It returns a promise that will either resolve to false or a type safe copy of your form state. Values that had the required rule will be transformed into a non-nullable value (type only). */
1624
1668
  $validate: (forceValues?: TRegles['$value']) => Promise<MergedReglesResult<TRegles>>;
1625
1669
  } & (HasNamedKeys<TRegles> extends true ? { [K in keyof TRegles]: TRegles[K] } : {});
1626
- type MergedScopedRegles<TValue$1 extends Record<string, unknown>[] = Record<string, unknown>[]> = Omit<MergedRegles<Record<string, SuperCompatibleRegleRoot>, TValue$1>, '$instances' | '$errors' | '$silentErrors' | '$value' | '$silentValue' | '$validate' | '$extractDirtyFields'> & {
1627
- /** Array of scoped Regles instances */
1628
- readonly $instances: SuperCompatibleRegleRoot[];
1629
- /** Collection of all registered Regles instances values */
1630
- readonly $value: TValue$1;
1631
- /** Collection of all registered Regles instances errors */
1632
- readonly $errors: RegleValidationErrors<Record<string, unknown>>[];
1633
- /** Collection of all registered Regles instances silent errors */
1634
- readonly $silentErrors: RegleValidationErrors<Record<string, unknown>>[];
1635
- /** Collection of all registered Regles instances issues */
1636
- readonly $issues: RegleValidationErrors<Record<string, unknown>, false, true>[];
1637
- /** Collection of all registered Regles instances silent issues */
1638
- readonly $silentIssues: RegleValidationErrors<Record<string, unknown>, false, true>[];
1639
- /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
1640
- $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TValue$1>;
1641
- /** Sets all properties as dirty, triggering all rules. It returns a promise that will either resolve to false or a type safe copy of your form state. Values that had the required rule will be transformed into a non-nullable value (type only). */
1642
- $validate: (forceValues?: TValue$1) => Promise<{
1670
+ type MergedScopedRegles<TValue extends Record<string, unknown>[] = Record<string, unknown>[]> = Omit<MergedRegles<Record<string, SuperCompatibleRegleRoot>, TValue>, '$instances' | '$errors' | '$silentErrors' | '$value' | '$silentValue' | '$validate' | '$extractDirtyFields'> & {
1671
+ /** Array of scoped Regles instances */readonly $instances: SuperCompatibleRegleRoot[]; /** Collection of all registered Regles instances values */
1672
+ readonly $value: TValue; /** Collection of all registered Regles instances errors */
1673
+ readonly $errors: RegleValidationErrors<Record<string, unknown>>[]; /** Collection of all registered Regles instances silent errors */
1674
+ readonly $silentErrors: RegleValidationErrors<Record<string, unknown>>[]; /** Collection of all registered Regles instances issues */
1675
+ readonly $issues: RegleValidationErrors<Record<string, unknown>, false, true>[]; /** Collection of all registered Regles instances silent issues */
1676
+ readonly $silentIssues: RegleValidationErrors<Record<string, unknown>, false, true>[]; /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
1677
+ $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TValue>; /** Sets all properties as dirty, triggering all rules. It returns a promise that will either resolve to false or a type safe copy of your form state. Values that had the required rule will be transformed into a non-nullable value (type only). */
1678
+ $validate: (forceValues?: TValue) => Promise<{
1643
1679
  valid: boolean;
1644
- data: TValue$1;
1680
+ data: TValue;
1645
1681
  errors: RegleValidationErrors<Record<string, unknown>>[];
1646
1682
  issues: RegleValidationErrors<Record<string, unknown>>[];
1647
1683
  }>;
@@ -1700,10 +1736,10 @@ type MergedReglesResult<TRegles extends Record<string, SuperCompatibleRegleRoot>
1700
1736
  * @see {@link https://reglejs.dev/advanced-usage/merge-regles Documentation}
1701
1737
  */
1702
1738
  declare function mergeRegles<TRegles extends Record<string, SuperCompatibleRegleRoot>, TScoped extends boolean = false>(regles: TRegles, _scoped?: TScoped): TScoped extends false ? MergedRegles<TRegles> : MergedScopedRegles;
1703
- type useCollectScopeFn<TNamedScoped extends boolean = false> = TNamedScoped extends true ? <const TValue$1 extends Record<string, Record<string, any>>>(namespace?: MaybeRefOrGetter<string | string[]>) => {
1704
- r$: MergedRegles<{ [K in keyof TValue$1]: RegleRoot<TValue$1[K]> & SuperCompatibleRegleRoot }>;
1705
- } : <TValue$1 extends Record<string, unknown>[] = Record<string, unknown>[]>(namespace?: MaybeRefOrGetter<string | string[]>) => {
1706
- r$: MergedScopedRegles<TValue$1>;
1739
+ type useCollectScopeFn<TNamedScoped extends boolean = false> = TNamedScoped extends true ? <const TValue extends Record<string, Record<string, any>>>(namespace?: MaybeRefOrGetter<string | string[]>) => {
1740
+ r$: MergedRegles<{ [K in keyof TValue]: RegleRoot<TValue[K]> & SuperCompatibleRegleRoot }>;
1741
+ } : <TValue extends Record<string, unknown>[] = Record<string, unknown>[]>(namespace?: MaybeRefOrGetter<string | string[]>) => {
1742
+ r$: MergedScopedRegles<TValue>;
1707
1743
  };
1708
1744
  type UseScopedRegleOptions<TAsRecord extends boolean> = {
1709
1745
  namespace?: MaybeRefOrGetter<string>;
@@ -1796,8 +1832,8 @@ declare function createScopedUseRegle<TCustomRegle extends useRegleFn<any, any>
1796
1832
  *
1797
1833
  * @see {@link https://reglejs.dev/advanced-usage/scoped-validation Documentation}
1798
1834
  */
1799
- declare const useCollectScope: <TValue$1 extends Record<string, unknown>[] = Record<string, unknown>[]>(namespace?: MaybeRefOrGetter<string | string[]>) => {
1800
- r$: MergedScopedRegles<TValue$1>;
1835
+ declare const useCollectScope: <TValue extends Record<string, unknown>[] = Record<string, unknown>[]>(namespace?: MaybeRefOrGetter<string | string[]>) => {
1836
+ r$: MergedScopedRegles<TValue>;
1801
1837
  };
1802
1838
  /**
1803
1839
  * Clone of `useRegle` that automatically registers its instance for collection by `useCollectScope`.
@@ -1897,9 +1933,9 @@ declare function narrowVariant<TRoot extends {
1897
1933
  [x: string]: unknown;
1898
1934
  };
1899
1935
  $value: unknown;
1900
- }, const TKey$1 extends keyof TRoot, const TValue$1 extends (LazyJoinDiscriminatedUnions<Exclude<TRoot[TKey$1], RegleCollectionStatus<any, any, any> | RegleStatus<any, any, any> | NarrowVariantExtracts[keyof NarrowVariantExtracts]>> extends {
1936
+ }, const TKey extends keyof TRoot, const TValue extends (LazyJoinDiscriminatedUnions<Exclude<TRoot[TKey], RegleCollectionStatus<any, any, any> | RegleStatus<any, any, any> | NarrowVariantExtracts[keyof NarrowVariantExtracts]>> extends {
1901
1937
  $value: infer V;
1902
- } ? V : unknown)>(root: TRoot | undefined, discriminantKey: TKey$1, discriminantValue: TValue$1): root is NarrowVariant<TRoot, TKey$1, TValue$1>;
1938
+ } ? V : unknown)>(root: TRoot | undefined, discriminantKey: TKey, discriminantValue: TValue): root is NarrowVariant<TRoot, TKey, TValue>;
1903
1939
  /**
1904
1940
  * Create a reactive reference to a narrowed variant.
1905
1941
  * Useful in templates or when you need a stable ref to the narrowed type.
@@ -1924,17 +1960,17 @@ declare function narrowVariant<TRoot extends {
1924
1960
  *
1925
1961
  * @see {@link https://reglejs.dev/advanced-usage/variants Documentation}
1926
1962
  */
1927
- declare function variantToRef<TRoot extends RegleStatus<{}, any, any>, const TKey$1 extends keyof TRoot['$fields'], const TValue$1 extends (LazyJoinDiscriminatedUnions<Exclude<TRoot['$fields'][TKey$1], RegleCollectionStatus<any, any, any> | RegleStatus<any, any, any> | NarrowVariantExtracts[keyof NarrowVariantExtracts]>> extends {
1963
+ 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> | NarrowVariantExtracts[keyof NarrowVariantExtracts]>> extends {
1928
1964
  $value: infer V;
1929
- } ? V : unknown)>(root: MaybeRef<TRoot>, discriminantKey: TKey$1, discriminantValue: TValue$1, options: {
1965
+ } ? V : unknown)>(root: MaybeRef<TRoot>, discriminantKey: TKey, discriminantValue: TValue, options: {
1930
1966
  /**
1931
1967
  * Assert that the variant is always defined, use with caution
1932
1968
  */
1933
1969
  unsafeAssertion: true;
1934
- }): Ref<NarrowVariant<TRoot, TKey$1, TValue$1>>;
1935
- declare function variantToRef<TRoot extends RegleStatus<{}, any, any>, const TKey$1 extends keyof TRoot['$fields'], const TValue$1 extends (LazyJoinDiscriminatedUnions<Exclude<TRoot['$fields'][TKey$1], RegleCollectionStatus<any, any, any> | RegleStatus<any, any, any> | NarrowVariantExtracts[keyof NarrowVariantExtracts]>> extends {
1970
+ }): Ref<NarrowVariant<TRoot, TKey, TValue>>;
1971
+ 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> | NarrowVariantExtracts[keyof NarrowVariantExtracts]>> extends {
1936
1972
  $value: infer V;
1937
- } ? V : unknown)>(root: MaybeRef<TRoot>, discriminantKey: TKey$1, discriminantValue: TValue$1): Ref<NarrowVariant<TRoot, TKey$1, TValue$1> | undefined>;
1973
+ } ? V : unknown)>(root: MaybeRef<TRoot>, discriminantKey: TKey, discriminantValue: TValue): Ref<NarrowVariant<TRoot, TKey, TValue> | undefined>;
1938
1974
  /**
1939
1975
  * Helper method to wrap a raw rules object with type inference.
1940
1976
  * Provides autocomplete and type-checking without processing.
@@ -1956,7 +1992,7 @@ declare function variantToRef<TRoot extends RegleStatus<{}, any, any>, const TKe
1956
1992
  *
1957
1993
  * @see {@link https://reglejs.dev/common-usage/standard-schema Documentation}
1958
1994
  */
1959
- declare function defineRules<TRules$1 extends RegleUnknownRulesTree>(rules: TRules$1): TRules$1;
1995
+ declare function defineRules<TRules extends RegleUnknownRulesTree>(rules: TRules): TRules;
1960
1996
  /**
1961
1997
  * Refine a rules object to add rules that depend on the state values.
1962
1998
  * Inspired by Zod's `refine`, this allows writing dynamic rules while maintaining type safety.
@@ -1986,7 +2022,7 @@ declare function defineRules<TRules$1 extends RegleUnknownRulesTree>(rules: TRul
1986
2022
  *
1987
2023
  * @see {@link https://reglejs.dev/common-usage/standard-schema#refinerules Documentation}
1988
2024
  */
1989
- declare function refineRules<TRules$1 extends RegleUnknownRulesTree, TRefinement extends ReglePartialRuleTree<InferInput<TRules$1>> & RegleUnknownRulesTree>(rules: TRules$1, refinement: (state: Ref<InferInput<TRules$1>>) => TRefinement): (state: Ref<InferInput<TRules$1>>) => Merge<TRules$1, TRefinement>;
2025
+ 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>;
1990
2026
  /**
1991
2027
  * Vue plugin to enable Regle devtools integration with Vue Devtools.
1992
2028
  * Provides debugging capabilities for inspecting validation trees, states, and actions.
@@ -2010,4 +2046,4 @@ declare function refineRules<TRules$1 extends RegleUnknownRulesTree, TRefinement
2010
2046
  * @see {@link https://reglejs.dev/introduction/devtools Documentation}
2011
2047
  */
2012
2048
  declare const RegleVuePlugin: Plugin;
2013
- export { type $InternalRegleStatus, type AllRulesDeclarations, type ArrayElement, type CommonAlphaOptions, type CommonComparisonOptions, type CreateScopedUseRegleOptions, type DeepMaybeRef, type DeepPartial, type DeepReactiveState, type DefaultValidatorsTree, type DumbJoinDiscriminatedUnions, type ExtendedRulesDeclarations, type FormRuleDeclaration, type GlobalConfigOverrides, type HasNamedKeys, type HaveAnyRequiredProps, type InferInput, type InferOutput, type InferRegleRoot, type InferRegleRule, type InferRegleRules, type InferRegleSettings, type InferRegleShortcuts, type InferRegleStatusType, type InferRegleValidationResult, type InferSafeOutput, type InferValidOutput, type InlineRuleDeclaration, InternalRuleType, type IsRegleStatic, type JoinDiscriminatedUnions, type LazyJoinDiscriminatedUnions, type LocalRegleBehaviourOptions, type Maybe, type MaybeInput, type MaybeOutput, type MaybeReadonly, type MaybeVariantStatus, type MergedRegles, type MergedScopedRegles, type NarrowVariant, type NarrowVariantExtracts, type NarrowVariantFieldExtracts, type NoInferLegacy, type NonEmptyTuple, type Prettify, type PrimitiveTypes, type Regle, type RegleBehaviourOptions, type RegleCollectionErrors, type RegleCollectionRuleDecl, type RegleCollectionRuleDefinition, type RegleCollectionStatus, type RegleCommonStatus, type RegleComputedRules, type RegleCustomFieldStatus, type RegleEnforceCustomRequiredRules, type RegleEnforceRequiredRules, type RegleErrorTree, type RegleExternalCollectionErrors, type RegleExternalErrorTree, type RegleExternalSchemaErrorTree, type RegleFieldIssue, type RegleFieldStatus, type RegleFormPropertyType, type RegleInternalRuleDefs, type RegleIssuesTree, type RegleLike, type ReglePartialRuleTree, type RegleResult, type RegleRoot, type RegleRuleCore, type RegleRuleDecl, type RegleRuleDefinition, type RegleRuleDefinitionProcessor, type RegleRuleDefinitionWithMetadataProcessor, type RegleRuleInit, type RegleRuleMetadataConsumer, type RegleRuleMetadataDefinition, type RegleRuleMetadataExtended, type RegleRuleRaw, type RegleRuleStatus, type RegleRuleTypeReturn, type RegleRuleWithParamsDefinition, type RegleRuleWithParamsDefinitionInput, type RegleShortcutDefinition, type RegleSingleField, type RegleStatic, type RegleStaticImpl, type RegleStatus, type RegleUniversalParams, type RegleUnknownRulesTree, type RegleValidationErrors, type RegleValidationGroupEntry, type RegleValidationGroupOutput, type RegleRuleTree as RegleValidationTree, RegleVuePlugin, type ResolvedRegleBehaviourOptions, type ScopedInstancesRecord, type ScopedInstancesRecordLike, type SuperCompatibleRegle, type SuperCompatibleRegleCollectionErrors, type SuperCompatibleRegleCollectionStatus, type SuperCompatibleRegleFieldStatus, type SuperCompatibleRegleResult, type SuperCompatibleRegleRoot, type SuperCompatibleRegleRuleStatus, type SuperCompatibleRegleStatus, type TupleToPlainObj, type Unwrap, type UnwrapRegleUniversalParams, type UnwrapRuleWithParams, type UnwrapStatic, type UseScopedRegleOptions, createRule, createScopedUseRegle, createVariant, defineRegleConfig, defineRules, extendRegleConfig, flatErrors, inferRules, type inferRulesFn, type isEditedHandlerFn, markStatic, mergeRegles, narrowVariant, refineRules, unwrapRuleParameters, useCollectScope, type useCollectScopeFn, useRegle, type useRegleFn, useRootStorage, useRules, type useRulesFn, useScopedRegle, variantToRef };
2049
+ export { type $InternalRegleStatus, type AllRulesDeclarations, type ArrayElement, type CommonAlphaOptions, type CommonComparisonOptions, type CreateScopedUseRegleOptions, type DeepMaybeRef, type DeepPartial, type DeepReactiveState, type DefaultValidatorsTree, type DumbJoinDiscriminatedUnions, type ExtendedRulesDeclarations, type FormRuleDeclaration, type GlobalConfigOverrides, type HasNamedKeys, type HaveAnyRequiredProps, type InferInput, type InferOutput, type InferRegleRoot, type InferRegleRule, type InferRegleRules, type InferRegleSettings, type InferRegleShortcuts, type InferRegleStatusType, type InferRegleValidationResult, type InferSafeOutput, type InferValidOutput, type InlineRuleDeclaration, InternalRuleType, type IsRegleStatic, type JoinDiscriminatedUnions, type LazyJoinDiscriminatedUnions, type LocalRegleBehaviourOptions, type Maybe, type MaybeInput, type MaybeOutput, type MaybeReadonly, type MaybeVariantStatus, type MergedRegles, type MergedScopedRegles, type NarrowVariant, type NarrowVariantExtracts, type NarrowVariantFieldExtracts, type NoInferLegacy, type NonEmptyTuple, type Prettify, type PrimitiveTypes, type Regle, type RegleBehaviourOptions, type RegleCollectionErrors, type RegleCollectionRuleDecl, type RegleCollectionRuleDefinition, type RegleCollectionStatus, type RegleCommonStatus, type RegleComputedRules, type RegleCustomFieldStatus, type RegleEnforceCustomRequiredRules, type RegleEnforceRequiredRules, type RegleErrorTree, type RegleExternalCollectionErrors, type RegleExternalErrorTree, type RegleExternalSchemaErrorTree, type RegleFieldIssue, type RegleFieldStatus, type RegleFormPropertyType, type RegleInternalRuleDefs, type RegleIssuesTree, type RegleLike, type ReglePartialRuleTree, type RegleResult, type RegleRoot, type RegleRuleCore, type RegleRuleDecl, type RegleRuleDefinition, type RegleRuleDefinitionProcessor, type RegleRuleDefinitionWithMetadataProcessor, type RegleRuleInit, type RegleRuleMetadataConsumer, type RegleRuleMetadataDefinition, type RegleRuleMetadataExtended, type RegleRuleRaw, type RegleRuleStatus, type RegleRuleTypeReturn, type RegleRuleWithParamsDefinition, type RegleRuleWithParamsDefinitionInput, type RegleShortcutDefinition, type RegleSingleField, type RegleStatic, type RegleStaticImpl, type RegleStatus, type RegleUniversalParams, type RegleUnknownRulesTree, type RegleValidationErrors, type RegleValidationGroupEntry, type RegleValidationGroupOutput, type RegleRuleTree as RegleValidationTree, RegleVuePlugin, type ResolvedRegleBehaviourOptions, type ScopedInstancesRecord, type ScopedInstancesRecordLike, type SuperCompatibleRegle, type SuperCompatibleRegleCollectionErrors, type SuperCompatibleRegleCollectionStatus, type SuperCompatibleRegleFieldStatus, type SuperCompatibleRegleResult, type SuperCompatibleRegleRoot, type SuperCompatibleRegleRuleStatus, type SuperCompatibleRegleStatus, type TupleToPlainObj, type Unwrap, type UnwrapRegleUniversalParams, type UnwrapRuleWithParams, type UnwrapStatic, type UseScopedRegleOptions, createRule, createScopedUseRegle, createVariant, defineRegleConfig, defineRules, extendRegleConfig, flatErrors, getErrors, getIssues, inferRules, type inferRulesFn, type isEditedHandlerFn, markStatic, mergeRegles, narrowVariant, refineRules, unwrapRuleParameters, useCollectScope, type useCollectScopeFn, useRegle, type useRegleFn, useRootStorage, useRules, type useRulesFn, useScopedRegle, variantToRef };