cross-state 1.9.6 → 1.9.8

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.
Files changed (109) hide show
  1. package/dist/{diff-Bcr0h7-x.d.cts → diff-BzE2cDaU.d.cts} +2 -2
  2. package/dist/{diff-CwiTYAVK.d.ts → diff-Cvc-z20n.d.ts} +2 -2
  3. package/dist/{extendedJson-DA3RQ_ly.js → extendedJson-BOmrkRrD.js} +2 -2
  4. package/dist/{extendedJson-DA3RQ_ly.js.map → extendedJson-BOmrkRrD.js.map} +1 -1
  5. package/dist/{extendedJson-DzXMFE1P.cjs → extendedJson-pbOLcymB.cjs} +2 -2
  6. package/dist/{extendedJson-DzXMFE1P.cjs.map → extendedJson-pbOLcymB.cjs.map} +1 -1
  7. package/dist/index.cjs +9 -8
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +6 -6
  10. package/dist/index.d.ts +6 -6
  11. package/dist/index.js +8 -8
  12. package/dist/index.js.map +1 -1
  13. package/dist/mutative/index.cjs +2 -1
  14. package/dist/mutative/index.d.cts +1 -1
  15. package/dist/mutative/index.d.ts +1 -1
  16. package/dist/mutative/index.js +1 -1
  17. package/dist/mutative/register.cjs +2 -2
  18. package/dist/mutative/register.cjs.map +1 -1
  19. package/dist/mutative/register.d.cts +2 -2
  20. package/dist/mutative/register.d.ts +2 -2
  21. package/dist/mutative/register.js +2 -2
  22. package/dist/mutative/register.js.map +1 -1
  23. package/dist/{mutativeMethods-CwDMtUNs.cjs → mutativeMethods-AiKkraqx.cjs} +1 -1
  24. package/dist/mutativeMethods-AiKkraqx.cjs.map +1 -0
  25. package/dist/{mutativeMethods-Do8JiJ5A.d.cts → mutativeMethods-BHPlSHBi.d.cts} +2 -2
  26. package/dist/{mutativeMethods-t67Kp1uA.d.ts → mutativeMethods-COQxFB3B.d.ts} +2 -2
  27. package/dist/{mutativeMethods-BrDU8SwY.js → mutativeMethods-qVJ36MY5.js} +1 -1
  28. package/dist/mutativeMethods-qVJ36MY5.js.map +1 -0
  29. package/dist/{patchMethods-C21iQqML.d.ts → patchMethods--ekCkYUF.d.ts} +4 -4
  30. package/dist/{patchMethods-CZje49Dk.cjs → patchMethods-BBQDDqwe.cjs} +9 -9
  31. package/dist/patchMethods-BBQDDqwe.cjs.map +1 -0
  32. package/dist/{patchMethods-Cui462lc.js → patchMethods-D3cdG80W.js} +9 -9
  33. package/dist/patchMethods-D3cdG80W.js.map +1 -0
  34. package/dist/{patchMethods-Cyb6MEOG.d.cts → patchMethods-R3f7HxTy.d.cts} +4 -4
  35. package/dist/patches/index.cjs +2 -1
  36. package/dist/patches/index.d.cts +1 -1
  37. package/dist/patches/index.d.ts +1 -1
  38. package/dist/patches/index.js +1 -1
  39. package/dist/patches/register.cjs +2 -2
  40. package/dist/patches/register.cjs.map +1 -1
  41. package/dist/patches/register.d.cts +2 -2
  42. package/dist/patches/register.d.ts +2 -2
  43. package/dist/patches/register.js +2 -2
  44. package/dist/patches/register.js.map +1 -1
  45. package/dist/{path-Il5r4PV4.cjs → path-B9-Z0127.cjs} +1 -1
  46. package/dist/{path-Il5r4PV4.cjs.map → path-B9-Z0127.cjs.map} +1 -1
  47. package/dist/{path-CCEtQjMB.js → path-C-5jTZu5.js} +1 -1
  48. package/dist/{path-CCEtQjMB.js.map → path-C-5jTZu5.js.map} +1 -1
  49. package/dist/persist/register.cjs +2 -2
  50. package/dist/persist/register.cjs.map +1 -1
  51. package/dist/persist/register.d.cts +2 -2
  52. package/dist/persist/register.d.ts +2 -2
  53. package/dist/persist/register.js +2 -2
  54. package/dist/persist/register.js.map +1 -1
  55. package/dist/{persist-CG1WHP6D.cjs → persist-B341lrOA.cjs} +43 -45
  56. package/dist/persist-B341lrOA.cjs.map +1 -0
  57. package/dist/{persist-CkZ7CzW8.d.cts → persist-CoSWtRt0.d.cts} +3 -3
  58. package/dist/{persist-3Nff6j1f.d.ts → persist-XVT4fROX.d.ts} +3 -3
  59. package/dist/{persist-CNA2sYtB.js → persist-xv73m7UR.js} +43 -45
  60. package/dist/persist-xv73m7UR.js.map +1 -0
  61. package/dist/{propAccess-BxCKNeOj.js → propAccess-CsUaG5V_.js} +8 -8
  62. package/dist/propAccess-CsUaG5V_.js.map +1 -0
  63. package/dist/{propAccess-udIdjqwY.cjs → propAccess-DdLF12Jq.cjs} +8 -8
  64. package/dist/propAccess-DdLF12Jq.cjs.map +1 -0
  65. package/dist/react/index.cjs +118 -117
  66. package/dist/react/index.cjs.map +1 -1
  67. package/dist/react/index.d.cts +98 -98
  68. package/dist/react/index.d.ts +97 -97
  69. package/dist/react/index.js +119 -119
  70. package/dist/react/index.js.map +1 -1
  71. package/dist/react/register.cjs +3 -3
  72. package/dist/react/register.cjs.map +1 -1
  73. package/dist/react/register.d.cts +2 -2
  74. package/dist/react/register.d.ts +2 -2
  75. package/dist/react/register.js +3 -3
  76. package/dist/react/register.js.map +1 -1
  77. package/dist/{scope-DkX72a-2.cjs → scope-8MUrzqlS.cjs} +60 -60
  78. package/dist/scope-8MUrzqlS.cjs.map +1 -0
  79. package/dist/{scope-8uUaV6I8.d.cts → scope-BQjncWGt.d.cts} +25 -25
  80. package/dist/{scope-CQE3HDNI.js → scope-BfaweXvz.js} +61 -61
  81. package/dist/scope-BfaweXvz.js.map +1 -0
  82. package/dist/{scope-qdOAlRWQ.d.ts → scope-BztVo2P8.d.ts} +25 -25
  83. package/dist/{store-D4q5zD7q.js → store-BmlnyYal.js} +81 -81
  84. package/dist/store-BmlnyYal.js.map +1 -0
  85. package/dist/{store-Cq1PqvEo.d.ts → store-dThvqc0k.d.cts} +55 -55
  86. package/dist/{store-21GsOOLS.d.cts → store-dThvqc0k.d.ts} +55 -55
  87. package/dist/{store-CPqOf4y5.cjs → store-fmAYV5hy.cjs} +80 -80
  88. package/dist/store-fmAYV5hy.cjs.map +1 -0
  89. package/dist/{storeMethods-BjuI0joo.d.cts → storeMethods-CYX3AAnA.d.ts} +4 -4
  90. package/dist/{storeMethods-BZb4k7Ma.cjs → storeMethods-DYgUGHSk.cjs} +14 -14
  91. package/dist/storeMethods-DYgUGHSk.cjs.map +1 -0
  92. package/dist/{storeMethods-CK9-Q17H.d.ts → storeMethods-DrMQ7hqX.d.cts} +4 -4
  93. package/dist/{storeMethods-CWeGkXoz.js → storeMethods-pGlt0zfb.js} +14 -14
  94. package/dist/storeMethods-pGlt0zfb.js.map +1 -0
  95. package/package.json +46 -63
  96. package/dist/mutativeMethods-BrDU8SwY.js.map +0 -1
  97. package/dist/mutativeMethods-CwDMtUNs.cjs.map +0 -1
  98. package/dist/patchMethods-CZje49Dk.cjs.map +0 -1
  99. package/dist/patchMethods-Cui462lc.js.map +0 -1
  100. package/dist/persist-CG1WHP6D.cjs.map +0 -1
  101. package/dist/persist-CNA2sYtB.js.map +0 -1
  102. package/dist/propAccess-BxCKNeOj.js.map +0 -1
  103. package/dist/propAccess-udIdjqwY.cjs.map +0 -1
  104. package/dist/scope-CQE3HDNI.js.map +0 -1
  105. package/dist/scope-DkX72a-2.cjs.map +0 -1
  106. package/dist/store-CPqOf4y5.cjs.map +0 -1
  107. package/dist/store-D4q5zD7q.js.map +0 -1
  108. package/dist/storeMethods-BZb4k7Ma.cjs.map +0 -1
  109. package/dist/storeMethods-CWeGkXoz.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { A as GetKeys, B as Value, C as Selector, F as PathAsString, G as MaybePromise, H as WildcardPathAsString, I as SettablePath, K as Constrain, N as Path$1, T as Update, U as WildcardValue, W as Object_, b as Duration, j as Join, r as Store } from "../store-21GsOOLS.cjs";
2
- import { a as useScope, c as UseCacheValue, d as useStore, i as ScopeProvider, l as useCache, n as scopeMethods, o as cacheMethods, r as ScopeProps, s as UseCacheArray, t as storeMethods, u as UseStoreOptions } from "../storeMethods-BjuI0joo.cjs";
1
+ import { B as Selector, C as Value, D as Object_, E as WildcardValue, H as Update, K as MaybePromise, L as Duration, O as Constrain, T as WildcardPathAsString, g as Path$1, m as Join, p as GetKeys, r as Store, v as PathAsString, y as SettablePath } from "../store-dThvqc0k.cjs";
2
+ import { a as useScope, c as UseCacheValue, d as useStore, i as ScopeProvider, l as useCache, n as scopeMethods, o as cacheMethods, r as ScopeProps, s as UseCacheArray, t as storeMethods, u as UseStoreOptions } from "../storeMethods-DrMQ7hqX.cjs";
3
3
  import { Draft } from "mutative";
4
4
  import { Component, ComponentPropsWithoutRef, Context, FormEvent, FunctionComponent, HTMLProps, ReactNode } from "react";
5
5
 
@@ -15,8 +15,8 @@ declare function CustomInput({
15
15
  }: CustomInputProps): React.JSX.Element;
16
16
  //#endregion
17
17
  //#region src/react/form/formField.d.ts
18
- interface FormFieldComponentProps<TValue, TPath$1> {
19
- name: TPath$1;
18
+ interface FormFieldComponentProps<TValue, TPath> {
19
+ name: TPath;
20
20
  value: TValue;
21
21
  onChange: (event: {
22
22
  target: {
@@ -26,77 +26,43 @@ interface FormFieldComponentProps<TValue, TPath$1> {
26
26
  onBlur: (...args: any[]) => void;
27
27
  "data-invalid"?: boolean;
28
28
  }
29
- type FormFieldInfos<TDraft, TOriginal, TPath$1 extends string> = Field<TDraft, TOriginal, TPath$1> & {
29
+ type FormFieldInfos<TDraft, TOriginal, TPath extends string> = Field<TDraft, TOriginal, TPath> & {
30
30
  hasTriggeredValidations: boolean;
31
31
  };
32
32
  type NativeInputType = "input" | "select" | "textarea";
33
33
  type PartialComponentType<P> = (new (props: P, context?: any) => Component<P, any>) | ((props: P, context?: any) => ReactNode);
34
34
  type FormFieldComponent = NativeInputType | PartialComponentType<any>;
35
- interface FormFieldProps<TPath$1, TDraft> extends FieldOptions {
36
- name: TPath$1 extends PathAsString<TDraft> ? TPath$1 : PathAsString<TDraft>;
35
+ interface FormFieldProps<TPath, TDraft> extends FieldOptions {
36
+ name: TPath extends PathAsString<TDraft> ? TPath : PathAsString<TDraft>;
37
37
  commitOnBlur?: boolean;
38
38
  commitDebounce?: Duration;
39
39
  }
40
- interface FormFieldPropsWithRender<TDraft, TOriginal, TPath$1 extends string> extends FormFieldProps<TPath$1, TDraft> {
41
- render: NoInfer<(props: FormFieldComponentProps<Value<TDraft, TPath$1>, TPath$1>, info: FormFieldInfos<TDraft, TOriginal, TPath$1>, form: FormContext<TDraft, TOriginal>) => ReactNode>;
40
+ interface FormFieldPropsWithRender<TDraft, TOriginal, TPath extends string> extends FormFieldProps<TPath, TDraft> {
41
+ render: NoInfer<(props: FormFieldComponentProps<Value<TDraft, TPath>, TPath>, info: FormFieldInfos<TDraft, TOriginal, TPath>, form: FormContext<TDraft, TOriginal>) => ReactNode>;
42
42
  children?: undefined;
43
43
  }
44
- interface FormFieldPropsWithChildren<TDraft, TOriginal, TPath$1 extends string> extends FormFieldProps<TPath$1, TDraft> {
44
+ interface FormFieldPropsWithChildren<TDraft, TOriginal, TPath extends string> extends FormFieldProps<TPath, TDraft> {
45
45
  render?: undefined;
46
- children: NoInfer<(props: FormFieldComponentProps<Value<TDraft, TPath$1>, TPath$1>, info: FormFieldInfos<TDraft, TOriginal, TPath$1>, form: FormContext<TDraft, TOriginal>) => ReactNode>;
46
+ children: NoInfer<(props: FormFieldComponentProps<Value<TDraft, TPath>, TPath>, info: FormFieldInfos<TDraft, TOriginal, TPath>, form: FormContext<TDraft, TOriginal>) => ReactNode>;
47
47
  }
48
48
  //#endregion
49
- //#region src/react/form/legacyFormField.d.ts
50
- type FieldValue<T$1 extends FormFieldComponent> = ComponentPropsWithoutRef<T$1>["value"];
51
- type FieldChangeValue<T$1 extends FormFieldComponent> = ComponentPropsWithoutRef<T$1> extends {
52
- onChange?: (update: infer U) => void;
53
- } ? U extends {
54
- target: {
55
- value: infer V;
56
- };
57
- } ? V : U : never;
58
- type MakeOptional<T$1, Keys extends string> = Omit<T$1, Keys> & Partial<Pick<T$1, Keys & keyof T$1>>;
59
- type Serialize<TDraft, TOriginal, TPath$1, TComponent extends FormFieldComponent> = (value: Value<TDraft, TPath$1>, formState: FormInstance<TDraft, TOriginal>) => FieldValue<TComponent>;
60
- type Deserialize<TDraft, TOriginal, TPath$1, TComponent extends FormFieldComponent> = (value: FieldChangeValue<TComponent>, formState: FormInstance<TDraft, TOriginal>) => Value<TDraft, TPath$1>;
61
- type FormFieldPropsWithComponent<TDraft, TOriginal, TPath$1 extends string, TComponent extends FormFieldComponent> = FormFieldProps<TPath$1, TDraft> & {
62
- component: TComponent;
63
- render?: undefined;
64
- } & NoInfer<{
65
- inputFilter?: (value: FieldChangeValue<TComponent>) => boolean;
66
- } & MakeOptional<Omit<ComponentPropsWithoutRef<TComponent>, "id" | "name" | "value" | "defaultValue">, "onChange" | "onBlur"> & (Value<TDraft, TPath$1> extends Exclude<FieldValue<TComponent>, undefined> ? {
67
- defaultValue?: FieldValue<TComponent>;
68
- serialize?: Serialize<TDraft, TOriginal, TPath$1, TComponent>;
69
- } : Value<TDraft, TPath$1> extends FieldValue<TComponent> ? {
70
- defaultValue: FieldValue<TComponent>;
71
- serialize?: Serialize<TDraft, TOriginal, TPath$1, TComponent>;
72
- } | {
73
- defaultValue?: FieldValue<TComponent>;
74
- serialize: Serialize<TDraft, TOriginal, TPath$1, TComponent>;
75
- } : {
76
- serialize: Serialize<TDraft, TOriginal, TPath$1, TComponent>;
77
- }) & (FieldChangeValue<TComponent> extends Value<TDraft, TPath$1> ? {
78
- deserialize?: Deserialize<TDraft, TOriginal, TPath$1, TComponent>;
79
- } : {
80
- deserialize: Deserialize<TDraft, TOriginal, TPath$1, TComponent>;
81
- })>;
82
- //#endregion
83
49
  //#region src/react/form/formForEach.d.ts
84
- type ElementName<TDraft, TPath$1 extends string> = keyof { [Path in TPath$1 as Join<Path, GetKeys<NonNullable<Value<TDraft, Path>>> & (string | number)>]: 1 };
85
- type ItemValue<T$1> = T$1 extends readonly (infer U)[] ? U : T$1[keyof T$1];
86
- interface FormForEachProps<TDraft, TPath$1 extends string> {
87
- name: TPath$1 extends PathAsString<TDraft> ? TPath$1 : PathAsString<TDraft>;
50
+ type ElementName<TDraft, TPath extends string> = keyof { [Path in TPath as Join<Path, GetKeys<NonNullable<Value<TDraft, Path>>> & (string | number)>]: 1 };
51
+ type ItemValue<T> = T extends readonly (infer U)[] ? U : T[keyof T];
52
+ interface FormForEachProps<TDraft, TPath extends string> {
53
+ name: TPath extends PathAsString<TDraft> ? TPath : PathAsString<TDraft>;
88
54
  renderElement?: (props: {
89
- name: ElementName<TDraft, TPath$1>;
90
- key: `${GetKeys<NonNullable<Value<TDraft, TPath$1>>> & (string | number)}`;
55
+ name: ElementName<TDraft, TPath>;
56
+ key: `${GetKeys<NonNullable<Value<TDraft, TPath>>> & (string | number)}`;
91
57
  index: number;
92
58
  remove: () => void;
93
59
  count: number;
94
60
  }) => ReactNode;
95
- renderAdditionalElement?: NonNullable<Value<TDraft, TPath$1>> extends readonly any[] ? boolean : never;
96
- filter?: (item: ItemValue<NonNullable<Value<TDraft, TPath$1>>>, key: GetKeys<NonNullable<Value<TDraft, TPath$1>>>, parent: NonNullable<Value<TDraft, TPath$1>>) => boolean;
61
+ renderAdditionalElement?: NonNullable<Value<TDraft, TPath>> extends readonly any[] ? boolean : never;
62
+ filter?: (item: ItemValue<NonNullable<Value<TDraft, TPath>>>, key: GetKeys<NonNullable<Value<TDraft, TPath>>>, parent: NonNullable<Value<TDraft, TPath>>) => boolean;
97
63
  children?: (props: {
98
- setValue: (value: Value<TDraft, TPath$1> | ((value: Value<TDraft, TPath$1>) => Value<TDraft, TPath$1>)) => void;
99
- } & FieldHelperMethods<TDraft, TPath$1>) => ReactNode;
64
+ setValue: (value: Value<TDraft, TPath> | ((value: Value<TDraft, TPath>) => Value<TDraft, TPath>)) => void;
65
+ } & FieldHelperMethods<TDraft, TPath>) => ReactNode;
100
66
  }
101
67
  //#endregion
102
68
  //#region src/react/form/formOnOriginalChange.d.ts
@@ -116,6 +82,40 @@ interface FormAutosaveOptions<TDraft, TOriginal> {
116
82
  equals?: (a: any, b: any) => boolean;
117
83
  }
118
84
  //#endregion
85
+ //#region src/react/form/legacyFormField.d.ts
86
+ type FieldValue<T extends FormFieldComponent> = ComponentPropsWithoutRef<T>["value"];
87
+ type FieldChangeValue<T extends FormFieldComponent> = ComponentPropsWithoutRef<T> extends {
88
+ onChange?: (update: infer U) => void;
89
+ } ? U extends {
90
+ target: {
91
+ value: infer V;
92
+ };
93
+ } ? V : U : never;
94
+ type MakeOptional<T, Keys extends string> = Omit<T, Keys> & Partial<Pick<T, Keys & keyof T>>;
95
+ type Serialize<TDraft, TOriginal, TPath, TComponent extends FormFieldComponent> = (value: Value<TDraft, TPath>, formState: FormInstance<TDraft, TOriginal>) => FieldValue<TComponent>;
96
+ type Deserialize<TDraft, TOriginal, TPath, TComponent extends FormFieldComponent> = (value: FieldChangeValue<TComponent>, formState: FormInstance<TDraft, TOriginal>) => Value<TDraft, TPath>;
97
+ type FormFieldPropsWithComponent<TDraft, TOriginal, TPath extends string, TComponent extends FormFieldComponent> = FormFieldProps<TPath, TDraft> & {
98
+ component: TComponent;
99
+ render?: undefined;
100
+ } & NoInfer<{
101
+ inputFilter?: (value: FieldChangeValue<TComponent>) => boolean;
102
+ } & MakeOptional<Omit<ComponentPropsWithoutRef<TComponent>, "id" | "name" | "value" | "defaultValue">, "onChange" | "onBlur"> & (Value<TDraft, TPath> extends Exclude<FieldValue<TComponent>, undefined> ? {
103
+ defaultValue?: FieldValue<TComponent>;
104
+ serialize?: Serialize<TDraft, TOriginal, TPath, TComponent>;
105
+ } : Value<TDraft, TPath> extends FieldValue<TComponent> ? {
106
+ defaultValue: FieldValue<TComponent>;
107
+ serialize?: Serialize<TDraft, TOriginal, TPath, TComponent>;
108
+ } | {
109
+ defaultValue?: FieldValue<TComponent>;
110
+ serialize: Serialize<TDraft, TOriginal, TPath, TComponent>;
111
+ } : {
112
+ serialize: Serialize<TDraft, TOriginal, TPath, TComponent>;
113
+ }) & (FieldChangeValue<TComponent> extends Value<TDraft, TPath> ? {
114
+ deserialize?: Deserialize<TDraft, TOriginal, TPath, TComponent>;
115
+ } : {
116
+ deserialize: Deserialize<TDraft, TOriginal, TPath, TComponent>;
117
+ })>;
118
+ //#endregion
119
119
  //#region src/react/form/form.d.ts
120
120
  interface Transform<TDraft, TOriginal> {
121
121
  (value: Draft<TDraft>, context: TransformContext<TDraft, TOriginal>): void | TDraft;
@@ -135,7 +135,7 @@ interface FormOptions<TDraft, TOriginal> {
135
135
  original?: TOriginal;
136
136
  onSubmit?: (event: FormEvent<HTMLFormElement>, form: FormInstance<TDraft, TOriginal>) => void;
137
137
  reportValidity?: boolean | "browser" | "scrollTo";
138
- transformFieldProps?: <TPath$1 extends string>(props: FormFieldComponentProps<Value<TDraft, TPath$1>, TPath$1>, info: FormFieldInfos<TDraft, TOriginal, TPath$1>, form: FormContext<TDraft, TOriginal>) => FormFieldComponentProps<Value<TDraft, TPath$1>, TPath$1>;
138
+ transformFieldProps?: <TPath extends string>(props: FormFieldComponentProps<Value<TDraft, TPath>, TPath>, info: FormFieldInfos<TDraft, TOriginal, TPath>, form: FormContext<TDraft, TOriginal>) => FormFieldComponentProps<Value<TDraft, TPath>, TPath>;
139
139
  onOriginalChange?: OnOriginalChange<TDraft, TOriginal>;
140
140
  }
141
141
  type Validations<TDraft, TOriginal> = ((context: {
@@ -145,23 +145,23 @@ type Validations<TDraft, TOriginal> = ((context: {
145
145
  name: string;
146
146
  error: string;
147
147
  }>) | ({ [TPath in WildcardPathAsString<TDraft>]?: Record<string, Validation<TDraft, TOriginal, TPath>> } & Record<string, Record<string, Validation<TDraft, TOriginal, any>>>);
148
- type Validation<TDraft, TOriginal, TPath$1> = (value: WildcardValue<TDraft, TPath$1>, context: {
148
+ type Validation<TDraft, TOriginal, TPath> = (value: WildcardValue<TDraft, TPath>, context: {
149
149
  draft: TDraft;
150
150
  original: TOriginal;
151
151
  field: PathAsString<TDraft> | "";
152
152
  }) => boolean;
153
- type Field<TDraft, TOriginal, TPath$1 extends string> = {
154
- originalValue: Value<TOriginal, TPath$1> | undefined;
155
- value: Value<TDraft, TPath$1>;
156
- setValue: (value: Update<Value<TDraft, TPath$1>>) => void;
153
+ type Field<TDraft, TOriginal, TPath extends string> = {
154
+ originalValue: Value<TOriginal, TPath> | undefined;
155
+ value: Value<TDraft, TPath>;
156
+ setValue: (value: Update<Value<TDraft, TPath>>) => void;
157
157
  removeValue: () => void;
158
158
  hasChange: boolean;
159
159
  errors: string[];
160
- } & (Value<TDraft, TPath$1> extends Object_ ? FieldHelperMethods<TDraft, TPath$1> : {});
161
- type FieldHelperMethods<TDraft, TPath$1 extends string> = {
162
- names: ElementName<TDraft, TPath$1>[];
163
- add: NonNullable<Value<TDraft, TPath$1>> extends readonly (infer T)[] ? (element: T) => void : NonNullable<Value<TDraft, TPath$1>> extends Record<infer K, infer V> ? (key: K, value: V) => void : never;
164
- remove: NonNullable<Value<TDraft, TPath$1>> extends readonly any[] ? (index: number) => void : (key: string) => void;
160
+ } & (Value<TDraft, TPath> extends Object_ ? FieldHelperMethods<TDraft, TPath> : {});
161
+ type FieldHelperMethods<TDraft, TPath extends string> = {
162
+ names: ElementName<TDraft, TPath>[];
163
+ add: NonNullable<Value<TDraft, TPath>> extends readonly (infer T)[] ? (element: T) => void : NonNullable<Value<TDraft, TPath>> extends Record<infer K, infer V> ? (key: K, value: V) => void : never;
164
+ remove: NonNullable<Value<TDraft, TPath>> extends readonly any[] ? (index: number) => void : (key: string) => void;
165
165
  };
166
166
  interface FormState<TDraft> {
167
167
  draft: TDraft | undefined;
@@ -180,7 +180,7 @@ interface FormContext<TDraft, TOriginal> {
180
180
  formState: Store<FormState<TDraft>>;
181
181
  options: FormOptions<TDraft, TOriginal>;
182
182
  original: TOriginal | undefined;
183
- getField: <TPath$1 extends string>(name: TPath$1 extends PathAsString<TDraft> ? TPath$1 : PathAsString<TDraft>, options?: FieldOptions) => Field<TDraft, TOriginal, TPath$1>;
183
+ getField: <TPath extends string>(name: TPath extends PathAsString<TDraft> ? TPath : PathAsString<TDraft>, options?: FieldOptions) => Field<TDraft, TOriginal, TPath>;
184
184
  getDraft: () => TDraft;
185
185
  hasTriggeredValidations: () => boolean;
186
186
  saveInProgress: () => boolean;
@@ -206,11 +206,11 @@ declare class Form<TDraft, TOriginal extends TDraft = TDraft> {
206
206
  constructor(options: FormOptions<TDraft, TOriginal>);
207
207
  useForm(): FormContext<TDraft, TOriginal>;
208
208
  useFormState<S>(selector: (state: FormInstance<TDraft, TOriginal>) => S, useStoreOptions?: UseStoreOptions<S>): S;
209
- useField<TPath$1 extends string>(name: TPath$1 extends PathAsString<TDraft> ? TPath$1 : PathAsString<TDraft>, {
209
+ useField<TPath extends string>(name: TPath extends PathAsString<TDraft> ? TPath : PathAsString<TDraft>, {
210
210
  includeNestedErrors,
211
211
  ...useStoreOptions
212
- }?: FieldOptions & UseStoreOptions<unknown>): Field<TDraft, TOriginal, TPath$1>;
213
- useFieldProps<TPath$1 extends string>(name: TPath$1 extends PathAsString<TDraft> ? TPath$1 : PathAsString<TDraft>, options?: Omit<FormFieldProps<TPath$1, TDraft>, "name">): FormFieldComponentProps<Value<TDraft, TPath$1>, TPath$1>;
212
+ }?: FieldOptions & UseStoreOptions<unknown>): Field<TDraft, TOriginal, TPath>;
213
+ useFieldProps<TPath extends string>(name: TPath extends PathAsString<TDraft> ? TPath : PathAsString<TDraft>, options?: Omit<FormFieldProps<TPath, TDraft>, "name">): FormFieldComponentProps<Value<TDraft, TPath>, TPath>;
214
214
  Form({
215
215
  defaultValue,
216
216
  validations,
@@ -233,11 +233,11 @@ declare class Form<TDraft, TOriginal extends TDraft = TDraft> {
233
233
  selector: (form: FormInstance<TDraft, TOriginal>) => S;
234
234
  children: (selectedState: S) => ReactNode;
235
235
  }): React.JSX.Element;
236
- Field<const TPath$1 extends string>(props: FormFieldPropsWithRender<TDraft, TOriginal, TPath$1>): React.JSX.Element;
237
- Field<const TPath$1 extends string>(props: FormFieldPropsWithChildren<TDraft, TOriginal, TPath$1>): React.JSX.Element;
236
+ Field<const TPath extends string>(props: FormFieldPropsWithRender<TDraft, TOriginal, TPath>): React.JSX.Element;
237
+ Field<const TPath extends string>(props: FormFieldPropsWithChildren<TDraft, TOriginal, TPath>): React.JSX.Element;
238
238
  /** @deprecated */
239
- Field<const TPath$1 extends string, const TComponent extends FormFieldComponent = "input">(props: FormFieldPropsWithComponent<TDraft, TOriginal, TPath$1, TComponent>): React.JSX.Element;
240
- ForEach<const TPath$1 extends string>(props: FormForEachProps<TDraft, TPath$1>): React.JSX.Element;
239
+ Field<const TPath extends string, const TComponent extends FormFieldComponent = "input">(props: FormFieldPropsWithComponent<TDraft, TOriginal, TPath, TComponent>): React.JSX.Element;
240
+ ForEach<const TPath extends string>(props: FormForEachProps<TDraft, TPath>): React.JSX.Element;
241
241
  withForm<TProps extends Record<string, unknown>>(Component: React.ComponentType<TProps>, formProps?: Parameters<this["Form"]>[0]): FunctionComponent<TProps>;
242
242
  }
243
243
  declare function createForm<TDraft, TOriginal extends TDraft = TDraft>(options: FormOptions<TDraft, TOriginal>): Form<TDraft, TOriginal>;
@@ -272,34 +272,34 @@ declare function LoadingBoundary({
272
272
  declare function useLoadingBoundary(isLoading: boolean | undefined, label?: ReactNode): void;
273
273
  //#endregion
274
274
  //#region src/react/url/urlOptions.d.ts
275
- interface UrlOptions<T$1> {
275
+ interface UrlOptions<T> {
276
276
  key: string;
277
277
  type?: "search" | "hash";
278
- serialize?: (value: T$1) => string;
279
- deserialize?: (value: string) => T$1;
280
- defaultValue: T$1;
278
+ serialize?: (value: T) => string;
279
+ deserialize?: (value: string) => T;
280
+ defaultValue: T;
281
281
  writeDefaultValue?: boolean;
282
- onCommit?: (value: T$1) => void;
282
+ onCommit?: (value: T) => void;
283
283
  persist?: {
284
284
  id: string;
285
285
  } | null;
286
286
  path?: string | RegExp | (string | RegExp)[] | null;
287
287
  }
288
- interface UrlOptionsWithoutDefaults<T$1> extends Omit<UrlOptions<T$1 | undefined>, "defaultValue"> {
289
- defaultValue?: T$1 | undefined;
288
+ interface UrlOptionsWithoutDefaults<T> extends Omit<UrlOptions<T | undefined>, "defaultValue"> {
289
+ defaultValue?: T | undefined;
290
290
  }
291
- declare function createUrlOptions<T$1>(options: UrlOptions<T$1>): Required<UrlOptions<T$1>>;
292
- declare function createUrlOptions<T$1>(options: UrlOptionsWithoutDefaults<T$1>): Required<UrlOptions<T$1 | undefined>>;
291
+ declare function createUrlOptions<T>(options: UrlOptions<T>): Required<UrlOptions<T>>;
292
+ declare function createUrlOptions<T>(options: UrlOptionsWithoutDefaults<T>): Required<UrlOptions<T | undefined>>;
293
293
  //#endregion
294
294
  //#region src/react/url/urlParamStore.d.ts
295
295
  declare const urlStore: Store<string>;
296
- declare class UrlParamStore<T$1> extends Store<T$1> {
297
- readonly urlOptions: Required<UrlOptions<T$1>>;
296
+ declare class UrlParamStore<T> extends Store<T> {
297
+ readonly urlOptions: Required<UrlOptions<T>>;
298
298
  readonly storageKey: string | null;
299
299
  private lastHref?;
300
300
  private lastStorageValue?;
301
301
  private lastValue?;
302
- constructor(urlOptions: Required<UrlOptions<T$1>>);
302
+ constructor(urlOptions: Required<UrlOptions<T>>);
303
303
  private watch;
304
304
  private getUrlValue;
305
305
  private getStorageValue;
@@ -307,25 +307,25 @@ declare class UrlParamStore<T$1> extends Store<T$1> {
307
307
  private calc;
308
308
  private updateUrl;
309
309
  private updateStorage;
310
- set(update: Update<T$1>): void;
311
- set<const P>(path: Constrain<P, Path$1<T$1>>, update: Update<Value<T$1, P>>): void;
312
- parse(path: string): T$1;
310
+ set(update: Update<T>): void;
311
+ set<const P>(path: Constrain<P, Path$1<T>>, update: Update<Value<T, P>>): void;
312
+ parse(path: string): T;
313
313
  }
314
- declare function createUrlParam<T$1>(options: UrlOptions<T$1>): UrlParamStore<T$1>;
315
- declare function createUrlParam<T$1>(options: UrlOptionsWithoutDefaults<T$1>): UrlParamStore<T$1 | undefined>;
314
+ declare function createUrlParam<T>(options: UrlOptions<T>): UrlParamStore<T>;
315
+ declare function createUrlParam<T>(options: UrlOptionsWithoutDefaults<T>): UrlParamStore<T | undefined>;
316
316
  //#endregion
317
317
  //#region src/react/useDecoupledState.d.ts
318
- interface UseDecoupledStateOptions<T$1> {
318
+ interface UseDecoupledStateOptions<T> {
319
319
  debounce?: Duration;
320
320
  throttle?: Duration;
321
- onCommit?: (value: T$1) => void;
321
+ onCommit?: (value: T) => void;
322
322
  }
323
- declare function useDecoupledState<T$1>(value: T$1, onChange: (value: T$1) => MaybePromise<void>, options?: UseDecoupledStateOptions<T$1>): [state: T$1, setState: (value: T$1) => void];
323
+ declare function useDecoupledState<T>(value: T, onChange: (value: T) => MaybePromise<void>, options?: UseDecoupledStateOptions<T>): [state: T, setState: (value: T) => void];
324
324
  //#endregion
325
325
  //#region src/react/useProp.d.ts
326
- declare function useProp<T$1, S>(store: Store<T$1>, selector: Selector<T$1, S>, updater: (value: S) => Update<T$1>, options?: UseStoreOptions<S>): [value: S, setValue: Store<S>["set"]];
327
- declare function useProp<T$1, const P>(store: Store<T$1>, selector: Constrain<P, SettablePath<T$1>>, options?: UseStoreOptions<Value<T$1, P>>): [value: Value<T$1, P>, setValue: Store<Value<T$1, P>>["set"]];
328
- declare function useProp<T$1>(store: Store<T$1>, options?: UseStoreOptions<T$1>): [value: T$1, setValue: Store<T$1>["set"]];
326
+ declare function useProp<T, S>(store: Store<T>, selector: Selector<T, S>, updater: (value: S) => Update<T>, options?: UseStoreOptions<S>): [value: S, setValue: Store<S>["set"]];
327
+ declare function useProp<T, const P>(store: Store<T>, selector: Constrain<P, SettablePath<T>>, options?: UseStoreOptions<Value<T, P>>): [value: Value<T, P>, setValue: Store<Value<T, P>>["set"]];
328
+ declare function useProp<T>(store: Store<T>, options?: UseStoreOptions<T>): [value: T, setValue: Store<T>["set"]];
329
329
  //#endregion
330
- export { CustomInput, CustomInputProps, Field, Form, FormContext, FormDerivedState, FormFieldComponent, FormFieldComponentProps, FormFieldInfos, FormFieldProps, FormFieldPropsWithChildren, FormFieldPropsWithRender, FormInstance, FormOptions, FormState, LoadingBoundary, type LoadingBoundaryEntry, type LoadingBoundaryProps, type ScopeProps, ScopeProvider, Transform, type UrlOptions, type UrlOptionsWithoutDefaults, type UrlParamStore, type UseCacheArray, type UseCacheValue, type UseDecoupledStateOptions, type UseStoreOptions, Validation, Validations, cacheMethods, createForm, createUrlOptions, createUrlParam, scopeMethods, storeMethods, urlStore, useCache, useClosestForm, useDecoupledState, useLoadingBoundary, useProp, useScope, useStore };
330
+ export { CustomInput, type CustomInputProps, type Field, Form, type FormContext, type FormDerivedState, type FormFieldComponent, type FormFieldComponentProps, type FormFieldInfos, type FormFieldProps, type FormFieldPropsWithChildren, type FormFieldPropsWithRender, type FormInstance, type FormOptions, type FormState, LoadingBoundary, type LoadingBoundaryEntry, type LoadingBoundaryProps, type ScopeProps, ScopeProvider, type Transform, type UrlOptions, type UrlOptionsWithoutDefaults, type UrlParamStore, type UseCacheArray, type UseCacheValue, type UseDecoupledStateOptions, type UseStoreOptions, type Validation, type Validations, cacheMethods, createForm, createUrlOptions, createUrlParam, scopeMethods, storeMethods, urlStore, useCache, useClosestForm, useDecoupledState, useLoadingBoundary, useProp, useScope, useStore };
331
331
  //# sourceMappingURL=index.d.cts.map