@mobx-ecosystem/mobx-form 2.3.22 → 2.3.23
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/form-service.d.ts +4 -4
- package/dist/types.d.ts +4 -15
- package/package.json +1 -1
package/dist/form-service.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare class FormService<T extends Record<string, FieldService<unknown>
|
|
|
31
31
|
*
|
|
32
32
|
* @returns Object of field values
|
|
33
33
|
*/
|
|
34
|
-
getValues: () => FormValues<
|
|
34
|
+
getValues: () => FormValues<T>;
|
|
35
35
|
private getValue;
|
|
36
36
|
/**
|
|
37
37
|
* Set fields by this
|
|
@@ -42,11 +42,11 @@ export declare class FormService<T extends Record<string, FieldService<unknown>
|
|
|
42
42
|
/**
|
|
43
43
|
* Set object to init values by form service keys
|
|
44
44
|
*/
|
|
45
|
-
setInitValues: (values: FormValues<
|
|
45
|
+
setInitValues: (values: FormValues<T>) => void;
|
|
46
46
|
/**
|
|
47
47
|
* Set object to values by form service keys
|
|
48
48
|
*/
|
|
49
|
-
setValues: (values: FormValues<
|
|
49
|
+
setValues: (values: FormValues<T>) => void;
|
|
50
50
|
/**
|
|
51
51
|
* Set field errors to undefined
|
|
52
52
|
*/
|
|
@@ -55,7 +55,7 @@ export declare class FormService<T extends Record<string, FieldService<unknown>
|
|
|
55
55
|
* Set errors for fields
|
|
56
56
|
* @param errors object of string which provides errors for fields
|
|
57
57
|
*/
|
|
58
|
-
setErrors(error: FormErrors<
|
|
58
|
+
setErrors(error: FormErrors<T>): void;
|
|
59
59
|
/**
|
|
60
60
|
* Set field values to init values
|
|
61
61
|
*/
|
package/dist/types.d.ts
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import { FieldService } from "field-service";
|
|
2
|
-
type
|
|
3
|
-
-readonly [Property in keyof Type]:
|
|
2
|
+
export type FormValues<Type> = Type extends FieldService<unknown> ? Type['value'] : {
|
|
3
|
+
-readonly [Property in keyof Type]: FormValues<Type[Property]>;
|
|
4
4
|
};
|
|
5
|
-
type
|
|
6
|
-
-readonly [Property in keyof Type]:
|
|
5
|
+
export type FormErrors<Type> = Type extends FieldService<unknown> ? Type['error'] : {
|
|
6
|
+
-readonly [Property in keyof Type]: FormErrors<Type[Property]>;
|
|
7
7
|
};
|
|
8
|
-
export type FormValues<Type extends {
|
|
9
|
-
fields: Record<string, unknown>;
|
|
10
|
-
}> = {
|
|
11
|
-
-readonly [Property in keyof Type['fields']]: RecursiveFormValues<Type['fields'][Property]>;
|
|
12
|
-
};
|
|
13
|
-
export type FormErrors<Type extends {
|
|
14
|
-
fields: Record<string, unknown>;
|
|
15
|
-
}> = {
|
|
16
|
-
-readonly [Property in keyof Type['fields']]: RecursiveFormErrors<Type['fields'][Property]>;
|
|
17
|
-
};
|
|
18
|
-
export {};
|
package/package.json
CHANGED