@gravitywiz/types 0.0.9 → 0.0.11
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/index.d.ts +26 -7
- package/package.json +5 -1
package/index.d.ts
CHANGED
|
@@ -7,19 +7,31 @@ declare global {
|
|
|
7
7
|
// TODO type ...any better (e.g. provide a way to for the caller to declare what these arguments should be).
|
|
8
8
|
type GFHookCallback = (...args: any[]) => void;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
type GFFieldType = 'text' | 'date' | 'website' | 'email' | 'phone' | 'survey';
|
|
11
|
+
|
|
12
|
+
type GFInputType = 'text' | 'email' | 'fileupload' | 'date' | 'website' | 'total' | 'rating';
|
|
13
|
+
|
|
14
|
+
interface GFBaseField {
|
|
15
|
+
inputs: any;
|
|
16
|
+
choices?: GFChoice[];
|
|
13
17
|
label: string;
|
|
14
18
|
adminLabel?: string;
|
|
15
19
|
id: number;
|
|
16
20
|
formId: number;
|
|
17
|
-
type:
|
|
21
|
+
type: GFFieldType;
|
|
18
22
|
enableEnhancedUI?: boolean;
|
|
19
|
-
inputType:
|
|
20
|
-
|
|
23
|
+
inputType: GFInputType;
|
|
24
|
+
productId: string;
|
|
21
25
|
}
|
|
22
26
|
|
|
27
|
+
type GFSurveyField = GFBaseField & {
|
|
28
|
+
gsurveyLikertEnableMultipleRows?: boolean;
|
|
29
|
+
gsurveyLikertEnableScoring?: boolean;
|
|
30
|
+
gsurveyLikertRows?: { text: string; value: string }[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type GFField = GFBaseField | GFSurveyField;
|
|
34
|
+
|
|
23
35
|
interface GFChoice {
|
|
24
36
|
isSelected?: boolean;
|
|
25
37
|
price?: string;
|
|
@@ -209,7 +221,14 @@ declare global {
|
|
|
209
221
|
};
|
|
210
222
|
|
|
211
223
|
gfMergeTags: {
|
|
212
|
-
getMergeTags: (
|
|
224
|
+
getMergeTags: (
|
|
225
|
+
fields: GFField[],
|
|
226
|
+
elementId?: string,
|
|
227
|
+
hideAllFields?: boolean,
|
|
228
|
+
excludeFieldTypes?: string[],
|
|
229
|
+
isPrepop?: boolean,
|
|
230
|
+
option?: string,
|
|
231
|
+
) => {
|
|
213
232
|
custom: MergeTagGroup;
|
|
214
233
|
optional: MergeTagGroup;
|
|
215
234
|
other: MergeTagGroup;
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravitywiz/types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "TypesScript type definitions for Gravity Forms and Gravity Wiz.",
|
|
5
5
|
"author": "Gravity Wiz",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
7
7
|
"main": "",
|
|
8
8
|
"types": "index.d.ts",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
11
|
+
"format": "yarn lint --fix"
|
|
12
|
+
},
|
|
9
13
|
"dependencies": {
|
|
10
14
|
"@types/jquery": "^3.5.16",
|
|
11
15
|
"@types/plupload": "^2.0.10"
|