@regle/schemas 1.9.3 → 1.9.5

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.
@@ -1467,72 +1467,6 @@ interface useRegleFn<TCustomRules extends Partial<AllRulesDeclarations>, TShortc
1467
1467
  * Docs: {@link https://reglejs.dev/core-concepts/}
1468
1468
  */
1469
1469
 
1470
- //#endregion
1471
- //#region ../../node_modules/.pnpm/@standard-schema+spec@1.0.0/node_modules/@standard-schema/spec/dist/index.d.ts
1472
- /** The Standard Schema interface. */
1473
- interface StandardSchemaV1$1<Input = unknown, Output = Input> {
1474
- /** The Standard Schema properties. */
1475
- readonly "~standard": StandardSchemaV1$1.Props<Input, Output>;
1476
- }
1477
- declare namespace StandardSchemaV1$1 {
1478
- /** The Standard Schema properties interface. */
1479
- export interface Props<Input = unknown, Output = Input> {
1480
- /** The version number of the standard. */
1481
- readonly version: 1;
1482
- /** The vendor name of the schema library. */
1483
- readonly vendor: string;
1484
- /** Validates unknown input values. */
1485
- readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
1486
- /** Inferred types associated with the schema. */
1487
- readonly types?: Types<Input, Output> | undefined;
1488
- }
1489
- /** The result interface of the validate function. */
1490
- export type Result<Output> = SuccessResult<Output> | FailureResult;
1491
- /** The result interface if validation succeeds. */
1492
- export interface SuccessResult<Output> {
1493
- /** The typed output value. */
1494
- readonly value: Output;
1495
- /** The non-existent issues. */
1496
- readonly issues?: undefined;
1497
- }
1498
- /** The result interface if validation fails. */
1499
- export interface FailureResult {
1500
- /** The issues of failed validation. */
1501
- readonly issues: ReadonlyArray<Issue>;
1502
- }
1503
- /** The issue interface of the failure output. */
1504
- export interface Issue {
1505
- /** The error message of the issue. */
1506
- readonly message: string;
1507
- /** The path of the issue, if any. */
1508
- readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
1509
- }
1510
- /** The path segment interface of the issue. */
1511
- export interface PathSegment {
1512
- /** The key representing a path segment. */
1513
- readonly key: PropertyKey;
1514
- }
1515
- /** The Standard Schema types interface. */
1516
- export interface Types<Input = unknown, Output = Input> {
1517
- /** The input type of the schema. */
1518
- readonly input: Input;
1519
- /** The output type of the schema. */
1520
- readonly output: Output;
1521
- }
1522
- /** Infers the input type of a Standard Schema. */
1523
- export type InferInput<Schema extends StandardSchemaV1$1> = NonNullable<Schema["~standard"]["types"]>["input"];
1524
- /** Infers the output type of a Standard Schema. */
1525
- export type InferOutput<Schema extends StandardSchemaV1$1> = NonNullable<Schema["~standard"]["types"]>["output"];
1526
- export {};
1527
- }
1528
- //#endregion
1529
- //#region src/core/useRegle/useErrors.d.ts
1530
- /**
1531
- * Converts a nested $errors object to a flat array of string errors
1532
- *
1533
- * Can also flatten to an array containing the path of each error with the options.includePath
1534
- */
1535
-
1536
1470
  //#endregion
1537
1471
  //#region src/types/utils/mismatch.types.d.ts
1538
1472
  /**
@@ -1959,7 +1893,7 @@ type RegleFieldStatus<TState extends any = any, TRules extends RegleFormProperty
1959
1893
  /**
1960
1894
  * @public
1961
1895
  */
1962
- interface RegleCommonStatus<TValue = any> extends StandardSchemaV1$1<TValue> {
1896
+ interface RegleCommonStatus<TValue = any> extends StandardSchemaV1<TValue> {
1963
1897
  /** Indicates whether the field is invalid. It becomes true if any associated rules return false. */
1964
1898
  readonly $invalid: boolean;
1965
1899
  /**
@@ -2120,7 +2054,8 @@ type RegleCollectionStatus<TState extends any[] = any[], TRules extends ReglePar
2120
2054
  type RegleErrorTree<TState = MaybeRef<Record<string, any> | any[]>, TIssue extends boolean = false> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>]: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>[K], false, TIssue> };
2121
2055
  type RegleIssuesTree<TState = MaybeRef<Record<string, any> | any[]>> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>]: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>[K], false, true> };
2122
2056
  type RegleExternalErrorTree<TState = MaybeRef<Record<string, any> | any[]>> = { readonly [K in keyof JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>]?: RegleValidationErrors<JoinDiscriminatedUnions<UnwrapMaybeRef<TState>>[K], true> };
2123
- type RegleValidationErrors<TState extends Record<string, any> | any[] | unknown = never, TExternal extends boolean = false, TIssue extends boolean = false> = NonNullable<TState> extends Array<infer U extends Record<string, any>> ? ExtendOnlyRealRecord<U> extends true ? TExternal extends false ? RegleCollectionErrors<U, TIssue> : RegleExternalCollectionErrors<U, TIssue> : TIssue extends true ? RegleFieldIssue[] : string[] : NonNullable<TState> extends Date | File ? TIssue extends true ? RegleFieldIssue[] : string[] : NonNullable<TState> extends Record<string, any> ? TExternal extends false ? RegleErrorTree<TState, TIssue> : RegleExternalErrorTree<TState> : TIssue extends true ? RegleFieldIssue[] : string[];
2057
+ type ErrorMessageOrIssue<TIssue extends boolean> = TIssue extends true ? RegleFieldIssue[] : string[];
2058
+ type RegleValidationErrors<TState extends Record<string, any> | any[] | unknown = never, TExternal extends boolean = false, TIssue extends boolean = false> = HasNamedKeys<TState> extends true ? IsAny$1<TState> extends true ? any : NonNullable<TState> extends Array<infer U> ? U extends Record<string, any> ? TExternal extends false ? ExtendOnlyRealRecord<U> extends true ? RegleCollectionErrors<U, TIssue> : ErrorMessageOrIssue<TIssue> : RegleExternalCollectionErrors<U, TIssue> : ErrorMessageOrIssue<TIssue> : NonNullable<TState> extends Date | File ? ErrorMessageOrIssue<TIssue> : NonNullable<TState> extends Record<string, any> ? TExternal extends false ? RegleErrorTree<TState, TIssue> : RegleExternalErrorTree<TState> : ErrorMessageOrIssue<TIssue> : any;
2124
2059
  type RegleCollectionErrors<TState extends Record<string, any>, TIssue extends boolean = false> = {
2125
2060
  readonly $self: TIssue extends true ? RegleFieldIssue[] : string[];
2126
2061
  readonly $each: RegleValidationErrors<TState, false, TIssue>[];
@@ -3022,7 +2957,7 @@ type RegleSchemaStatus<TState extends Record<string, any> = Record<string, any>,
3022
2957
  /**
3023
2958
  * @public
3024
2959
  */
3025
- type InferRegleSchemaStatusType<TSchema extends unknown, TState extends unknown, TShortcuts extends RegleShortcutDefinition = {}> = NonNullable<TSchema> extends Array<infer A extends Record<string, any>> ? RegleSchemaCollectionStatus<A, TState extends Array<any> ? TState : [], TShortcuts> : NonNullable<TState> extends Date | File ? RegleSchemaFieldStatus<TSchema, TState, TShortcuts> : unknown extends TState ? RegleSchemaFieldStatus<TSchema extends EmptyObject ? unknown : TSchema, TState, TShortcuts> : NonNullable<TSchema> extends Record<string, any> ? RegleSchemaStatus<NonNullable<TState> extends Record<string, any> ? NonNullable<TState> : {}, NonNullable<TSchema>, TShortcuts> : RegleSchemaFieldStatus<TSchema, TState, TShortcuts>;
2960
+ type InferRegleSchemaStatusType<TSchema extends unknown, TState extends unknown, TShortcuts extends RegleShortcutDefinition = {}> = NonNullable<TSchema> extends Array<infer A> ? A extends Record<string, any> ? RegleSchemaCollectionStatus<A, TState extends Array<any> ? TState : [], TShortcuts> : RegleSchemaFieldStatus<TSchema, TState, TShortcuts> : NonNullable<TState> extends Date | File ? RegleSchemaFieldStatus<TSchema, TState, TShortcuts> : unknown extends TState ? RegleSchemaFieldStatus<TSchema extends EmptyObject ? unknown : TSchema, TState, TShortcuts> : NonNullable<TSchema> extends Record<string, any> ? RegleSchemaStatus<NonNullable<TState> extends Record<string, any> ? NonNullable<TState> : {}, NonNullable<TSchema>, TShortcuts> : RegleSchemaFieldStatus<TSchema, TState, TShortcuts>;
3026
2961
  /**
3027
2962
  * @public
3028
2963
  */
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@regle/schemas",
3
- "version": "1.9.3",
3
+ "version": "1.9.5",
4
4
  "description": "Schemas adapter for Regle",
5
5
  "dependencies": {
6
6
  "@standard-schema/spec": "1.0.0",
7
- "@regle/rules": "1.9.3",
8
- "@regle/core": "1.9.3"
7
+ "@regle/rules": "1.9.5",
8
+ "@regle/core": "1.9.5"
9
9
  },
10
10
  "peerDependencies": {
11
11
  "valibot": "^1.0.0",