@regle/schemas 1.24.4-beta.1 → 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.
package/dist/regle-schemas.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @regle/schemas v1.
|
|
2
|
+
* @regle/schemas v1.25.0
|
|
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]: RegleCommonStatus<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
|
/**
|
package/dist/regle-schemas.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regle/schemas",
|
|
3
|
-
"version": "1.
|
|
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/
|
|
41
|
-
"@regle/
|
|
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",
|