@regle/schemas 1.24.3 → 1.25.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,5 +1,5 @@
1
1
  /**
2
- * @regle/schemas v1.24.3
2
+ * @regle/schemas v1.25.0
3
3
  * (c) 2026 Victor Garcia
4
4
  * @license MIT
5
5
  */
@@ -8,26 +8,26 @@ import { ArrayElement, CreateScopedUseRegleOptions, DeepMaybeRef, DeepPartial, D
8
8
  import { MaybeRef, MaybeRefOrGetter, Raw, UnwrapNestedRefs } from "vue";
9
9
  import { StandardSchemaV1 } from "@standard-schema/spec";
10
10
  import { EmptyObject, IsAny, IsUnion, IsUnknown, UnionToTuple } from "type-fest";
11
- type MaybeSchemaVariantStatus<TState extends Record<string, any> | undefined = Record<string, any>, TSchema extends StandardSchemaV1 = StandardSchemaV1, TShortcuts extends RegleShortcutDefinition = {}, TRoot extends boolean = false> = IsUnion<NonNullable<TState>> extends true ? Omit<RegleSchemaStatus<TState, TSchema, TShortcuts, TRoot>, '$fields'> & {
12
- $fields: ProcessChildrenFields<TState, TShortcuts>[keyof ProcessChildrenFields<TState, TShortcuts>];
13
- } & (HasNamedKeys<TState> extends true ? ProcessChildrenFields<TState, TShortcuts>[keyof ProcessChildrenFields<TState, TShortcuts>] : {}) : RegleSchemaStatus<TState, TSchema, TShortcuts, TRoot>;
14
- type ProcessChildrenFields<TState extends Record<string, any> | undefined, TShortcuts extends RegleShortcutDefinition = {}> = { [TIndex in keyof TupleToPlainObj<UnionToTuple<TState>>]: TIndex extends `${infer TIndexInt extends number}` ? { [TKey in keyof UnionToTuple<TState>[TIndexInt] as NonNullable<UnionToTuple<TState>[TIndexInt]>[TKey] extends UnionToTuple<TState>[TIndexInt][TKey] ? TKey : never]-?: InferRegleSchemaStatusType<NonNullable<UnionToTuple<TState>[TIndexInt]>[TKey], TShortcuts> } & { [TKey in keyof UnionToTuple<TState>[TIndexInt] as NonNullable<UnionToTuple<TState>[TIndexInt]>[TKey] extends UnionToTuple<TState>[TIndexInt][TKey] ? never : TKey]?: InferRegleSchemaStatusType<NonNullable<UnionToTuple<TState>[TIndexInt]>[TKey], TShortcuts> } : {} };
15
- type RegleSchema<TState extends Record<string, any>, TSchema extends StandardSchemaV1 = StandardSchemaV1, TShortcuts extends RegleShortcutDefinition = {}, TAdditionalReturnProperties extends Record<string, any> = {}> = {
11
+ type MaybeSchemaVariantStatus<TInput extends Record<string, any> | undefined = Record<string, any>, TOutput extends Record<string, any> | undefined = TInput, TSchema extends StandardSchemaV1 = StandardSchemaV1, TShortcuts extends RegleShortcutDefinition = {}, TRoot extends boolean = false> = IsUnion<NonNullable<TInput>> extends true ? Omit<RegleSchemaStatus<TInput, TOutput, TSchema, TShortcuts, TRoot>, '$fields'> & {
12
+ $fields: ProcessChildrenFields<TInput, TOutput, TShortcuts>[keyof ProcessChildrenFields<TInput, TOutput, TShortcuts>];
13
+ } & (HasNamedKeys<TInput> extends true ? ProcessChildrenFields<TInput, TOutput, TShortcuts>[keyof ProcessChildrenFields<TInput, TOutput, TShortcuts>] : {}) : RegleSchemaStatus<TInput, TOutput, TSchema, TShortcuts, TRoot>;
14
+ type ProcessChildrenFields<TInput extends Record<string, any> | undefined, TOutput = TInput, TShortcuts extends RegleShortcutDefinition = {}> = { [TIndex in keyof TupleToPlainObj<UnionToTuple<TInput>>]: TIndex extends `${infer TIndexInt extends number}` ? { [TKey in keyof UnionToTuple<TInput>[TIndexInt] as NonNullable<UnionToTuple<TInput>[TIndexInt]>[TKey] extends UnionToTuple<TInput>[TIndexInt][TKey] ? TKey : never]-?: InferRegleSchemaStatusType<NonNullable<UnionToTuple<TInput>[TIndexInt]>[TKey], NonNullable<UnionToTuple<TOutput>[TIndexInt]>[TKey], TShortcuts> } & { [TKey in keyof UnionToTuple<TInput>[TIndexInt] as NonNullable<UnionToTuple<TInput>[TIndexInt]>[TKey] extends UnionToTuple<TInput>[TIndexInt][TKey] ? never : TKey]?: InferRegleSchemaStatusType<NonNullable<UnionToTuple<TInput>[TIndexInt]>[TKey], NonNullable<UnionToTuple<TOutput>[TIndexInt]>[TKey], TShortcuts> } : {} };
15
+ type RegleSchema<TInput extends Record<string, any>, TOutput extends Record<string, any> = TInput, TSchema extends StandardSchemaV1 = StandardSchemaV1, TShortcuts extends RegleShortcutDefinition = {}, TAdditionalReturnProperties extends Record<string, any> = {}> = {
16
16
  /**
17
17
  * r$ is a reactive object containing the values, errors, dirty state and all the necessary validations properties you'll need to display information.
18
18
  *
19
19
  * To see the list of properties: {@link https://reglejs.dev/core-concepts/validation-properties}
20
20
  */
21
- r$: Raw<MaybeSchemaVariantStatus<TState, TSchema, TShortcuts, true>>;
21
+ r$: Raw<MaybeSchemaVariantStatus<TInput, TOutput, TSchema, TShortcuts, true>>;
22
22
  } & TAdditionalReturnProperties;
23
- type RegleSingleFieldSchema<TState extends Maybe<PrimitiveTypes>, TSchema extends StandardSchemaV1 = StandardSchemaV1, TShortcuts extends RegleShortcutDefinition = {}, TAdditionalReturnProperties extends Record<string, any> = {}> = {
23
+ type RegleSingleFieldSchema<TInput extends Maybe<PrimitiveTypes>, TOutput = TInput, TSchema extends StandardSchemaV1 = StandardSchemaV1, TShortcuts extends RegleShortcutDefinition = {}, TAdditionalReturnProperties extends Record<string, any> = {}> = {
24
24
  /**
25
25
  * r$ is a reactive object containing the values, errors, dirty state and all the necessary validations properties you'll need to display information.
26
26
  *
27
27
  * To see the list of properties: {@link https://reglejs.dev/core-concepts/validation-properties}
28
28
  */
29
- r$: Raw<RegleSchemaFieldStatus<TState, TShortcuts> & {
30
- /** 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). */$validate: (forceValues?: TState extends EmptyObject ? any : HasNamedKeys<TState> extends true ? TState : any) => Promise<RegleSchemaResult<StandardSchemaV1.InferOutput<TSchema>>>;
29
+ r$: Raw<RegleSchemaFieldStatus<TInput, TOutput, TShortcuts> & {
30
+ /** 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). */$validate: (forceValues?: TInput extends EmptyObject ? any : HasNamedKeys<TInput> extends true ? TInput : any) => Promise<RegleSchemaResult<StandardSchemaV1.InferOutput<TSchema>>>;
31
31
  }>;
32
32
  } & TAdditionalReturnProperties;
33
33
  type RegleSchemaResult<TSchema extends unknown> = {
@@ -41,45 +41,48 @@ type RegleSchemaResult<TSchema extends unknown> = {
41
41
  issues: EmptyObject;
42
42
  errors: EmptyObject;
43
43
  };
44
- type ProcessNestedFields<TState extends Record<string, any> | undefined, TShortcuts extends RegleShortcutDefinition> = HasNamedKeys<TState> extends true ? { readonly [TKey in keyof JoinDiscriminatedUnions<TState>]: TKey extends keyof JoinDiscriminatedUnions<TState> ? InferRegleSchemaStatusType<NonNullable<JoinDiscriminatedUnions<TState>[TKey]>, TShortcuts> : never } & { readonly [TKey in keyof JoinDiscriminatedUnions<TState> as TKey extends keyof JoinDiscriminatedUnions<TState> ? JoinDiscriminatedUnions<TState>[TKey] extends NonNullable<JoinDiscriminatedUnions<TState>[TKey]> ? TKey : never : never]-?: TKey extends keyof JoinDiscriminatedUnions<TState> ? InferRegleSchemaStatusType<NonNullable<JoinDiscriminatedUnions<TState>[TKey]>, TShortcuts> : never } : {};
44
+ type ProcessNestedFields<TInput extends Record<string, any> | undefined, TOutput extends Record<string, any> | undefined = TInput, TShortcuts extends RegleShortcutDefinition = {}> = HasNamedKeys<TInput> extends true ? { readonly [TKey in keyof JoinDiscriminatedUnions<TInput>]: TKey extends keyof JoinDiscriminatedUnions<TInput> ? InferRegleSchemaStatusType<NonNullable<JoinDiscriminatedUnions<TInput>[TKey]>, TKey extends keyof JoinDiscriminatedUnions<TOutput> ? NonNullable<JoinDiscriminatedUnions<TOutput>[TKey]> : undefined, TShortcuts> : never } & { readonly [TKey in keyof JoinDiscriminatedUnions<TInput> as TKey extends keyof JoinDiscriminatedUnions<TInput> ? JoinDiscriminatedUnions<TInput>[TKey] extends NonNullable<JoinDiscriminatedUnions<TInput>[TKey]> ? TKey : never : never]-?: TKey extends keyof JoinDiscriminatedUnions<TInput> ? InferRegleSchemaStatusType<NonNullable<JoinDiscriminatedUnions<TInput>[TKey]>, TKey extends keyof JoinDiscriminatedUnions<TOutput> ? NonNullable<JoinDiscriminatedUnions<TOutput>[TKey]> : undefined, TShortcuts> : never } : {
45
+ [x: string]: RegleCommonStatus<unknown, unknown>;
46
+ };
45
47
  /**
46
48
  * @public
47
49
  */
48
- type RegleSchemaStatus<TState extends Record<string, any> | undefined = Record<string, any>, TSchema extends StandardSchemaV1 = StandardSchemaV1, TShortcuts extends RegleShortcutDefinition = {}, IsRoot extends boolean = false> = Omit<RegleCommonStatus<TState>, IsRoot extends false ? '$pending' : ''> & {
49
- /** 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<JoinDiscriminatedUnions<TState>, TShortcuts>;
50
+ type RegleSchemaStatus<TInput extends Record<string, any> | undefined = Record<string, any>, TOutput extends Record<string, any> | undefined = TInput, TSchema extends StandardSchemaV1 = StandardSchemaV1, TShortcuts extends RegleShortcutDefinition = {}, IsRoot extends boolean = false> = Omit<RegleCommonStatus<TInput, TOutput>, IsRoot extends false ? '$pending' : ''> & {
51
+ /** 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<JoinDiscriminatedUnions<TInput>, JoinDiscriminatedUnions<TOutput>, TShortcuts>;
50
52
  /** Collection of all issues, collected for all children properties and nested forms.
51
53
  *
52
54
  * Only contains errors from properties where $dirty equals true. */
53
- readonly $issues: RegleIssuesTree<TState, true>;
55
+ readonly $issues: RegleIssuesTree<TInput, true>;
54
56
  /** Collection of all the error messages, collected for all children properties and nested forms.
55
57
  *
56
58
  * Only contains errors from properties where $dirty equals true. */
57
- readonly $errors: RegleErrorTree<TState, false, true>; /** Collection of all the error messages, collected for all children properties. */
58
- readonly $silentErrors: RegleErrorTree<TState, false, true>; /** Sets the external errors for the field. */
59
- $setExternalErrors(errors: RegleExternalSchemaErrorTree<TState>): void; /** 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). */
60
- $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TState>;
61
- } & ProcessNestedFields<JoinDiscriminatedUnions<TState>, TShortcuts> & (IsRoot extends true ? {
62
- /** 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). */$validate: (forceValues?: TState extends EmptyObject ? (HasNamedKeys<TState> extends true ? TState : any) : TState) => Promise<RegleSchemaResult<StandardSchemaV1.InferOutput<TSchema>>>;
59
+ readonly $errors: RegleErrorTree<TInput, false, true>;
60
+ readonly $output: TOutput; /** Collection of all the error messages, collected for all children properties. */
61
+ readonly $silentErrors: RegleErrorTree<TInput, false, true>; /** Sets the external errors for the field. */
62
+ $setExternalErrors(errors: RegleExternalSchemaErrorTree<TInput>): void; /** 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). */
63
+ $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TInput>;
64
+ } & (HasNamedKeys<TInput> extends true ? ProcessNestedFields<JoinDiscriminatedUnions<TInput>, JoinDiscriminatedUnions<TOutput>, TShortcuts> : {}) & (IsRoot extends true ? {
65
+ /** 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). */$validate: (forceValues?: TInput extends EmptyObject ? (HasNamedKeys<TInput> extends true ? TInput : any) : TInput) => Promise<RegleSchemaResult<StandardSchemaV1.InferOutput<TSchema>>>;
63
66
  } : {}) & ([TShortcuts['nested']] extends [never] ? {} : { [K in keyof TShortcuts['nested']]: ReturnType<NonNullable<TShortcuts['nested']>[K]> });
64
67
  /**
65
68
  * @public
66
69
  */
67
- type InferRegleSchemaStatusType<TState extends unknown, TShortcuts extends RegleShortcutDefinition = {}> = IsAny<TState> extends true ? RegleSchemaFieldStatus<any, TShortcuts> : IsUnknown<TState> extends true ? RegleCommonStatus<unknown> : NonNullable<TState> extends Array<any> ? RegleSchemaCollectionStatus<NonNullable<TState>, TShortcuts> : NonNullable<TState> extends Date | File ? RegleSchemaFieldStatus<TState, TShortcuts> : unknown extends TState ? RegleSchemaFieldStatus<TState extends EmptyObject ? unknown : TState, TShortcuts> : NonNullable<TState> extends Record<string, any> ? NonNullable<NonNullable<TState>> extends RegleStaticImpl<infer U> ? RegleSchemaFieldStatus<Raw<U>, TShortcuts> : MaybeSchemaVariantStatus<NonNullable<TState> extends Record<string, any> ? NonNullable<TState> : {}, StandardSchemaV1, TShortcuts> : RegleSchemaFieldStatus<TState, TShortcuts>;
70
+ type InferRegleSchemaStatusType<TInput extends unknown, TOutput = TInput, TShortcuts extends RegleShortcutDefinition = {}> = IsAny<TInput> extends true ? RegleSchemaFieldStatus<any, any, TShortcuts> : IsUnknown<TInput> extends true ? RegleCommonStatus<unknown, unknown> : NonNullable<TInput> extends Array<any> ? RegleSchemaCollectionStatus<NonNullable<TInput>, NonNullable<TOutput>, TShortcuts> : NonNullable<TInput> extends Date | File ? RegleSchemaFieldStatus<TInput, TOutput, TShortcuts> : unknown extends TInput ? RegleSchemaFieldStatus<TInput extends EmptyObject ? unknown : TInput, TOutput extends EmptyObject ? unknown : TOutput, TShortcuts> : NonNullable<TInput> extends Record<string, any> ? NonNullable<NonNullable<TInput>> extends RegleStaticImpl<infer U> ? RegleSchemaFieldStatus<Raw<U>, Raw<U>, TShortcuts> : MaybeSchemaVariantStatus<NonNullable<TInput> extends Record<string, any> ? NonNullable<TInput> : {}, NonNullable<TOutput> extends Record<string, any> ? NonNullable<TOutput> : {}, StandardSchemaV1, TShortcuts> : RegleSchemaFieldStatus<TInput, TOutput, TShortcuts>;
68
71
  /**
69
72
  * @public
70
73
  */
71
- type RegleSchemaFieldStatus<TState = any, TShortcuts extends RegleShortcutDefinition = {}> = Omit<RegleCommonStatus<TState>, '$pending' | '$value' | '$silentValue' | '$initialValue' | '$originalValue'> & {
72
- /** 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. */
73
- $silentValue: MaybeOutput<UnwrapNestedRefs<TState>>;
74
+ type RegleSchemaFieldStatus<TInput = any, TOutput = TInput, TShortcuts extends RegleShortcutDefinition = {}> = Omit<RegleCommonStatus<TInput, TOutput>, '$pending' | '$value' | '$silentValue' | '$initialValue' | '$originalValue'> & {
75
+ /** A reference to the original validated model. It can be used to bind your form with v-model.*/$value: MaybeOutput<UnwrapNestedRefs<TInput>>; /** $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. */
76
+ $silentValue: MaybeOutput<UnwrapNestedRefs<TInput>>;
74
77
  /**
75
78
  * This value reflect the current initial value of the field.
76
79
  * The initial value is different than the original value as the initial value can be mutated when using `$reset`.
77
80
  */
78
- readonly $initialValue: MaybeOutput<UnwrapNestedRefs<TState>>;
81
+ readonly $initialValue: MaybeOutput<UnwrapNestedRefs<TInput>>;
79
82
  /**
80
83
  * This value reflect the original value of the field at original call. This can't be mutated
81
84
  */
82
- readonly $originalValue: MaybeOutput<UnwrapNestedRefs<TState>>;
85
+ readonly $originalValue: MaybeOutput<UnwrapNestedRefs<TInput>>;
83
86
  /** Collection of all the error messages, collected for all children properties and nested forms.
84
87
  *
85
88
  * Only contains errors from properties where $dirty equals true. */
@@ -96,32 +99,34 @@ type RegleSchemaFieldStatus<TState = any, TShortcuts extends RegleShortcutDefini
96
99
  readonly $externalErrors: string[]; /** Represents the inactive status. Is true when this state have empty rules */
97
100
  readonly $inactive: boolean; /** This is reactive tree containing all the declared rules of your field. To know more about the rule properties check the rules properties section */
98
101
  readonly $rules: {
99
- [`~validator`]: RegleRuleStatus<IsUnion<TState> extends true ? any : TState, []>;
100
- }; /** Sets the external errors for the field. */
102
+ [`~validator`]: RegleRuleStatus<IsUnion<TInput> extends true ? any : TInput, []>;
103
+ };
104
+ readonly $output: TOutput; /** Sets the external errors for the field. */
101
105
  $setExternalErrors(errors: string[]): void; /** 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). */
102
- $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TState>;
106
+ $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TInput>;
103
107
  } & ([TShortcuts['fields']] extends [never] ? {} : { [K in keyof TShortcuts['fields']]: ReturnType<NonNullable<TShortcuts['fields']>[K]> });
104
108
  /**
105
109
  * @public
106
110
  */
107
- type RegleSchemaCollectionStatus<TState extends any[], TShortcuts extends RegleShortcutDefinition = {}> = Omit<RegleSchemaFieldStatus<TState, TShortcuts>, '$errors' | '$silentErrors'> & {
108
- /** Collection of status for every item in your collection. Each item will be a field you can access or iterate to display your elements. */readonly $each: Array<InferRegleSchemaStatusType<ArrayElement<TState>, 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. */
109
- readonly $self: RegleSchemaFieldStatus<TState, TShortcuts>;
111
+ type RegleSchemaCollectionStatus<TInput extends any[], TOutput = TInput, TShortcuts extends RegleShortcutDefinition = {}> = Omit<RegleSchemaFieldStatus<TInput, TOutput, TShortcuts>, '$errors' | '$silentErrors'> & {
112
+ /** Collection of status for every item in your collection. Each item will be a field you can access or iterate to display your elements. */readonly $each: Array<InferRegleSchemaStatusType<ArrayElement<TInput>, ArrayElement<TOutput>, 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. */
113
+ readonly $self: RegleSchemaFieldStatus<TInput, TOutput, TShortcuts>;
110
114
  /**
111
115
  * Collection of all the issues, collected for all children properties and nested forms.
112
116
  *
113
117
  * Only contains issues from properties where $dirty equals true.
114
118
  */
115
- readonly $issues: RegleCollectionErrors<TState, true>;
119
+ readonly $issues: RegleCollectionErrors<TInput, true>;
116
120
  /** Collection of all the error messages, collected for all children properties and nested forms.
117
121
  *
118
122
  * Only contains errors from properties where $dirty equals true. */
119
- readonly $errors: RegleCollectionErrors<TState>; /** Collection of all the error messages, collected for all children properties and nested forms. */
120
- readonly $silentErrors: RegleCollectionErrors<TState>;
123
+ readonly $errors: RegleCollectionErrors<TInput>; /** Collection of all the error messages, collected for all children properties and nested forms. */
124
+ readonly $silentErrors: RegleCollectionErrors<TInput>;
125
+ readonly $output: TOutput;
121
126
  /** 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). */
122
127
  /** Sets the external errors for the field. */
123
- $setExternalErrors(errors: RegleExternalCollectionErrors<TState>): void; /** 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). */
124
- $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TState>;
128
+ $setExternalErrors(errors: RegleExternalCollectionErrors<TInput>): void; /** 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). */
129
+ $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TInput>;
125
130
  } & ([TShortcuts['collections']] extends [never] ? {} : { [K in keyof TShortcuts['collections']]: ReturnType<NonNullable<TShortcuts['collections']>[K]> });
126
131
  type RegleSchemaBehaviourOptions = {
127
132
  /**
@@ -140,7 +145,7 @@ type RegleSchemaBehaviourOptions = {
140
145
  };
141
146
  type useRegleSchemaFnOptions<TSchema extends Record<string, any>, TAdditionalOptions extends Record<string, any>> = Omit<Partial<DeepMaybeRef<RegleBehaviourOptions>> & LocalRegleBehaviourOptions<TSchema, {}, never>, 'validationGroups' | 'lazy'> & RegleSchemaBehaviourOptions & TAdditionalOptions;
142
147
  interface useRegleSchemaFn<TShortcuts extends RegleShortcutDefinition<any> = never, TAdditionalReturnProperties extends Record<string, any> = {}, TAdditionalOptions extends Record<string, any> = {}> {
143
- <TSchema extends StandardSchemaV1, TState extends StandardSchemaV1.InferInput<TSchema> | undefined>(...params: [state: MaybeRef<DeepPartial<NoInferLegacy<TState>>> | DeepReactiveState<DeepPartial<NoInferLegacy<TState>>>, rulesFactory: MaybeRef<TSchema>, ...(HaveAnyRequiredProps<useRegleSchemaFnOptions<NoInferLegacy<NonNullable<TState>>, TAdditionalOptions>> extends true ? [options: useRegleSchemaFnOptions<NoInferLegacy<NonNullable<TState>>, TAdditionalOptions>] : [options?: useRegleSchemaFnOptions<NoInferLegacy<NonNullable<TState>>, TAdditionalOptions>])]): NonNullable<TState> extends PrimitiveTypes ? RegleSingleFieldSchema<NonNullable<TState>, TSchema, TShortcuts, TAdditionalReturnProperties> : RegleSchema<UnwrapNestedRefs<NonNullable<TState>>, TSchema, TShortcuts, TAdditionalReturnProperties>;
148
+ <TSchema extends StandardSchemaV1, TInput extends StandardSchemaV1.InferInput<TSchema> | undefined, TOutput extends StandardSchemaV1.InferOutput<TSchema> = StandardSchemaV1.InferOutput<TSchema>>(...params: [state: MaybeRef<DeepPartial<NoInferLegacy<TInput>>> | DeepReactiveState<DeepPartial<NoInferLegacy<TInput>>>, rulesFactory: MaybeRef<TSchema>, ...(HaveAnyRequiredProps<useRegleSchemaFnOptions<NoInferLegacy<NonNullable<TInput>>, TAdditionalOptions>> extends true ? [options: useRegleSchemaFnOptions<NoInferLegacy<NonNullable<TInput>>, TAdditionalOptions>] : [options?: useRegleSchemaFnOptions<NoInferLegacy<NonNullable<TInput>>, TAdditionalOptions>])]): NonNullable<TInput> extends PrimitiveTypes ? RegleSingleFieldSchema<NonNullable<TInput>, NonNullable<TOutput>, TSchema, TShortcuts, TAdditionalReturnProperties> : RegleSchema<UnwrapNestedRefs<NonNullable<TInput>>, UnwrapNestedRefs<NonNullable<TOutput>>, TSchema, TShortcuts, TAdditionalReturnProperties>;
144
149
  }
145
150
  /**
146
151
  * `useRegleSchema` enables validation using Standard Schema compatible libraries
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @regle/schemas v1.24.3
2
+ * @regle/schemas v1.25.0
3
3
  * (c) 2026 Victor Garcia
4
4
  * @license MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @regle/schemas v1.24.3
2
+ * @regle/schemas v1.25.0
3
3
  * (c) 2026 Victor Garcia
4
4
  * @license MIT
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regle/schemas",
3
- "version": "1.24.3",
3
+ "version": "1.25.0",
4
4
  "description": "Schemas adapter for Regle",
5
5
  "homepage": "https://reglejs.dev/",
6
6
  "license": "MIT",
@@ -37,8 +37,8 @@
37
37
  "dependencies": {
38
38
  "@standard-schema/spec": "1.1.0",
39
39
  "type-fest": "5.6.0",
40
- "@regle/core": "1.24.3",
41
- "@regle/rules": "1.24.3"
40
+ "@regle/core": "1.25.0",
41
+ "@regle/rules": "1.25.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@total-typescript/ts-reset": "0.6.1",