graphql-form 0.0.7 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/models.d.ts +7 -5
- package/package.json +1 -1
- package/src/models.ts +9 -5
package/lib/models.d.ts
CHANGED
@@ -15,14 +15,15 @@ export declare type SavedWidgets = {
|
|
15
15
|
export declare type SavedForms = {
|
16
16
|
[selector: string]: FormObject;
|
17
17
|
};
|
18
|
-
export declare type
|
18
|
+
export declare type ReturnedDictType = any;
|
19
|
+
export declare type PassedFormProps<WidgetData = ReturnedDictType> = {
|
19
20
|
f: ParserField;
|
20
21
|
nodes: ParserField[];
|
21
22
|
formObject: FormObject;
|
22
23
|
onChange: (formObject: FormObject) => void;
|
23
24
|
changeWidget: (widgetData: WidgetSavedData | undefined, path: string) => void;
|
24
25
|
required?: boolean;
|
25
|
-
runQuery: (q: string) => Promise<
|
26
|
+
runQuery: (q: string) => Promise<ReturnedDictType>;
|
26
27
|
widgetComponents: WidgetType[];
|
27
28
|
currentPath: string;
|
28
29
|
widgets?: SavedWidgets;
|
@@ -52,14 +53,15 @@ export declare type FormDisplayerProps = Omit<PassedFormProps, 'formObject' | 'o
|
|
52
53
|
onChange: (o: FormFile, query: string) => void;
|
53
54
|
};
|
54
55
|
export declare type FormLibraryProps = Omit<FormDisplayerProps, 'required' | 'components'>;
|
55
|
-
export declare type CastToWidgetSettingsPassedForm<WidgetData> = PassedFormProps<Partial<WidgetData>> & {
|
56
|
+
export declare type CastToWidgetSettingsPassedForm<WidgetData = ReturnedDictType> = PassedFormProps<Partial<WidgetData>> & {
|
56
57
|
widgetSettingsChange: (data: WidgetData) => void;
|
57
58
|
};
|
58
59
|
export declare type WidgetType = {
|
59
60
|
Component: React.FC<PassedFormProps>;
|
60
|
-
Settings: React.FC<CastToWidgetSettingsPassedForm
|
61
|
+
Settings: React.FC<CastToWidgetSettingsPassedForm> | undefined;
|
62
|
+
Description?: React.FC;
|
61
63
|
requirements: (props: PassedFormProps) => boolean;
|
62
|
-
props?:
|
64
|
+
props?: ReturnedDictType;
|
63
65
|
name: string;
|
64
66
|
};
|
65
67
|
export declare type FormValue = {
|
package/package.json
CHANGED
package/src/models.ts
CHANGED
@@ -17,14 +17,17 @@ export type SavedForms = {
|
|
17
17
|
[selector: string]: FormObject;
|
18
18
|
};
|
19
19
|
|
20
|
-
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
21
|
+
export type ReturnedDictType = any;
|
22
|
+
|
23
|
+
export type PassedFormProps<WidgetData = ReturnedDictType> = {
|
21
24
|
f: ParserField;
|
22
25
|
nodes: ParserField[];
|
23
26
|
formObject: FormObject;
|
24
27
|
onChange: (formObject: FormObject) => void;
|
25
28
|
changeWidget: (widgetData: WidgetSavedData | undefined, path: string) => void;
|
26
29
|
required?: boolean;
|
27
|
-
runQuery: (q: string) => Promise<
|
30
|
+
runQuery: (q: string) => Promise<ReturnedDictType>;
|
28
31
|
widgetComponents: WidgetType[];
|
29
32
|
currentPath: string;
|
30
33
|
widgets?: SavedWidgets;
|
@@ -64,15 +67,16 @@ export type FormDisplayerProps = Omit<
|
|
64
67
|
|
65
68
|
export type FormLibraryProps = Omit<FormDisplayerProps, 'required' | 'components'>;
|
66
69
|
|
67
|
-
export type CastToWidgetSettingsPassedForm<WidgetData> = PassedFormProps<Partial<WidgetData>> & {
|
70
|
+
export type CastToWidgetSettingsPassedForm<WidgetData = ReturnedDictType> = PassedFormProps<Partial<WidgetData>> & {
|
68
71
|
widgetSettingsChange: (data: WidgetData) => void;
|
69
72
|
};
|
70
73
|
|
71
74
|
export type WidgetType = {
|
72
75
|
Component: React.FC<PassedFormProps>;
|
73
|
-
Settings: React.FC<CastToWidgetSettingsPassedForm
|
76
|
+
Settings: React.FC<CastToWidgetSettingsPassedForm> | undefined;
|
77
|
+
Description?: React.FC;
|
74
78
|
requirements: (props: PassedFormProps) => boolean;
|
75
|
-
props?:
|
79
|
+
props?: ReturnedDictType;
|
76
80
|
name: string;
|
77
81
|
};
|
78
82
|
|