@regle/schemas 1.24.4-beta.1 → 1.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @regle/schemas v1.24.4-beta.1
2
+ * @regle/schemas v1.25.1
3
3
  * (c) 2026 Victor Garcia
4
4
  * @license MIT
5
5
  */
@@ -41,7 +41,9 @@ type RegleSchemaResult<TSchema extends unknown> = {
41
41
  issues: EmptyObject;
42
42
  errors: EmptyObject;
43
43
  };
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 } : {};
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]: RegleSchemaCommonStatus<unknown, unknown>;
46
+ };
45
47
  /**
46
48
  * @public
47
49
  */
@@ -59,7 +61,7 @@ type RegleSchemaStatus<TInput extends Record<string, any> | undefined = Record<s
59
61
  readonly $silentErrors: RegleErrorTree<TInput, false, true>; /** Sets the external errors for the field. */
60
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). */
61
63
  $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TInput>;
62
- } & ProcessNestedFields<JoinDiscriminatedUnions<TInput>, JoinDiscriminatedUnions<TOutput>, TShortcuts> & (IsRoot extends true ? {
64
+ } & (HasNamedKeys<TInput> extends true ? ProcessNestedFields<JoinDiscriminatedUnions<TInput>, JoinDiscriminatedUnions<TOutput>, TShortcuts> : {}) & (IsRoot extends true ? {
63
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>>>;
64
66
  } : {}) & ([TShortcuts['nested']] extends [never] ? {} : { [K in keyof TShortcuts['nested']]: ReturnType<NonNullable<TShortcuts['nested']>[K]> });
65
67
  /**
@@ -103,6 +105,7 @@ type RegleSchemaFieldStatus<TInput = any, TOutput = TInput, TShortcuts extends R
103
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). */
104
106
  $extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TInput>;
105
107
  } & ([TShortcuts['fields']] extends [never] ? {} : { [K in keyof TShortcuts['fields']]: ReturnType<NonNullable<TShortcuts['fields']>[K]> });
108
+ type RegleSchemaCommonStatus<TInput extends unknown, TOutput = TInput> = Omit<RegleCommonStatus<TInput, TOutput>, '$pending'>;
106
109
  /**
107
110
  * @public
108
111
  */
@@ -339,4 +342,4 @@ declare module '@regle/core' {
339
342
  'regle-schemas-field-status': RegleSchemaFieldStatus<T, any>;
340
343
  }
341
344
  }
342
- export { type InferRegleSchemaStatusType, type MaybeSchemaVariantStatus, type RegleSchema, type RegleSchemaBehaviourOptions, type RegleSchemaCollectionStatus, type RegleSchemaFieldStatus, type RegleSchemaResult, type RegleSchemaStatus, type RegleSingleFieldSchema, createScopedUseRegleSchema, defineRegleSchemaConfig, inferSchema, useCollectSchemaScope, useRegleSchema, useScopedRegleSchema, withDeps };
345
+ export { type InferRegleSchemaStatusType, type MaybeSchemaVariantStatus, type RegleSchema, type RegleSchemaBehaviourOptions, type RegleSchemaCollectionStatus, type RegleSchemaCommonStatus, type RegleSchemaFieldStatus, type RegleSchemaResult, type RegleSchemaStatus, type RegleSingleFieldSchema, createScopedUseRegleSchema, defineRegleSchemaConfig, inferSchema, useCollectSchemaScope, useRegleSchema, useScopedRegleSchema, withDeps };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @regle/schemas v1.24.4-beta.1
2
+ * @regle/schemas v1.25.1
3
3
  * (c) 2026 Victor Garcia
4
4
  * @license MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @regle/schemas v1.24.4-beta.1
2
+ * @regle/schemas v1.25.1
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.4-beta.1",
3
+ "version": "1.25.1",
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/rules": "1.24.4-beta.1",
41
- "@regle/core": "1.24.4-beta.1"
40
+ "@regle/core": "1.25.1",
41
+ "@regle/rules": "1.25.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@total-typescript/ts-reset": "0.6.1",