@hygraph/app-sdk 0.0.2 → 0.0.3
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.
|
@@ -10,9 +10,17 @@ export interface SubmissionErrors extends AnyObject {
|
|
|
10
10
|
export declare type Subscriber<V = Record<string, any>> = (value: V) => void;
|
|
11
11
|
export declare type Form = {
|
|
12
12
|
change: <Value = any>(name: string, value: Value) => Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Gets the state of the whole form.
|
|
15
|
+
* @deprecated Please use {@link Form.getFieldState} instead.
|
|
16
|
+
*/
|
|
13
17
|
getState: <Values = Record<string, any>>() => Promise<FormState<Values>>;
|
|
14
18
|
getFieldState: <Value = any>(fieldName: string) => Promise<FieldState<Value> | undefined>;
|
|
15
19
|
subscribeToFieldState: <Value = any>(name: string, callback: (state: FieldState<Value>) => any, subscription: FieldSubscription) => Promise<() => any>;
|
|
20
|
+
/**
|
|
21
|
+
* Subscribes to the state of the whole form.
|
|
22
|
+
* @deprecated Please use {@link Form.subscribeToFieldState} instead.
|
|
23
|
+
*/
|
|
16
24
|
subscribeToFormState: <Values = Record<string, any>>(callback: FormSubscriber<Values>, subscription: FormSubscription) => Promise<() => any>;
|
|
17
25
|
setFieldsVisibility: SetFieldsVisibility;
|
|
18
26
|
changeBulk: (flatValues: Record<string, any>) => Promise<any>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hygraph/app-sdk",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"author": "Hygraph",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"tslib": "^2.3.0",
|
|
38
38
|
"typescript": "^4.3.5"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "440fde4e830994492c6e68fcbfb37ee0a76ef092"
|
|
41
41
|
}
|
package/src/type-helpers/form.ts
CHANGED
|
@@ -18,6 +18,10 @@ export type Subscriber<V = Record<string, any>> = (value: V) => void;
|
|
|
18
18
|
|
|
19
19
|
export type Form = {
|
|
20
20
|
change: <Value = any>(name: string, value: Value) => Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Gets the state of the whole form.
|
|
23
|
+
* @deprecated Please use {@link Form.getFieldState} instead.
|
|
24
|
+
*/
|
|
21
25
|
getState: <Values = Record<string, any>>() => Promise<FormState<Values>>;
|
|
22
26
|
getFieldState: <Value = any>(
|
|
23
27
|
fieldName: string
|
|
@@ -27,6 +31,10 @@ export type Form = {
|
|
|
27
31
|
callback: (state: FieldState<Value>) => any,
|
|
28
32
|
subscription: FieldSubscription
|
|
29
33
|
) => Promise<() => any>;
|
|
34
|
+
/**
|
|
35
|
+
* Subscribes to the state of the whole form.
|
|
36
|
+
* @deprecated Please use {@link Form.subscribeToFieldState} instead.
|
|
37
|
+
*/
|
|
30
38
|
subscribeToFormState: <Values = Record<string, any>>(
|
|
31
39
|
callback: FormSubscriber<Values>,
|
|
32
40
|
subscription: FormSubscription
|