@gravitywiz/types 0.0.15 → 0.0.17

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 (2) hide show
  1. package/index.d.ts +65 -14
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import * as Plupload from "plupload";
2
2
 
3
+
3
4
  declare global {
4
5
  type GFFieldID = number | string;
5
6
  type GFFormID = number | string;
6
7
 
7
8
  // TODO type ...any better (e.g. provide a way to for the caller to declare what these arguments should be).
8
9
  type GFHookCallback = (...args: any[]) => void;
10
+ type GFCurrencySeparator = '.' | ',';
9
11
 
10
12
  type GFFieldType =
11
13
  | 'text'
@@ -14,18 +16,47 @@ declare global {
14
16
  | 'website'
15
17
  | 'email'
16
18
  | 'phone'
17
- | 'survey';
19
+ | 'survey'
20
+ | 'name'
21
+ | 'radio'
22
+ | 'checkbox'
23
+ | 'textarea'
24
+ | 'select'
25
+ | 'number'
26
+ | 'hidden'
27
+ | 'html'
28
+ | 'section'
29
+ | 'page'
30
+ | 'multi_choice'
31
+ | 'image_choice'
32
+ | 'address'
33
+ | 'fileupload'
34
+ | 'captcha'
35
+ | 'consent'
36
+ | 'multiselect'
37
+ | 'list'
38
+ | 'post_title'
39
+ | 'post_content'
40
+ | 'post_excerpt'
41
+ | 'post_category'
42
+ | 'post_tags'
43
+ | 'post_custom_field'
44
+ | 'product'
45
+ | 'quantity'
46
+ | 'option'
47
+ | 'total'
48
+ | 'shipping';
18
49
 
19
50
  type GFInputType =
20
51
  | 'text'
21
52
  | 'number'
22
- | 'email'
23
- | 'fileupload'
24
- | 'date'
25
- | 'website'
26
- | 'total'
27
- | 'rating'
28
- | 'radio'
53
+ | 'email'
54
+ | 'fileupload'
55
+ | 'date'
56
+ | 'website'
57
+ | 'total'
58
+ | 'rating'
59
+ | 'radio'
29
60
  | 'select'
30
61
  | 'singleproduct'
31
62
  | 'hiddenproduct'
@@ -62,13 +93,13 @@ declare global {
62
93
  id: number;
63
94
  formId: number;
64
95
  type: GFFieldType;
65
- inputs?: GFFieldInput[] | null;
96
+ inputs?: GFFieldInput[] | null;
66
97
  choices?: GFChoice[];
67
98
  label: string;
68
99
  adminLabel?: string;
69
100
  enableEnhancedUI?: boolean;
70
101
  inputType: GFInputType;
71
- productId: string;
102
+ productId: string;
72
103
  validateState?: boolean;
73
104
  }
74
105
 
@@ -141,8 +172,8 @@ declare global {
141
172
  symbol_left: string;
142
173
  symbol_right: string;
143
174
  symbol_padding: string;
144
- thousand_separator: string;
145
- decimal_separator: string;
175
+ thousand_separator: GFCurrencySeparator;
176
+ decimal_separator: GFCurrencySeparator;
146
177
  decimals: number
147
178
  code: string;
148
179
  }
@@ -151,6 +182,25 @@ declare global {
151
182
  constructor(currency: GFCurrencyConfig);
152
183
  toNumber(text: string): number;
153
184
  toMoney(number: string | number, isNumeric?: boolean): string;
185
+ getCode(): boolean;
186
+ numberFormat(
187
+ number: number,
188
+ decimals: number,
189
+ decPoint: GFCurrencySeparator,
190
+ thousandsSep: GFCurrencySeparator,
191
+ padded: boolean
192
+ ): string;
193
+ static cleanNumber(
194
+ text: string,
195
+ symbolRight: string,
196
+ symbolLeft: string,
197
+ decimalSeparator: GFCurrencySeparator,
198
+ ): number;
199
+ static isNumeric(val: string | number): boolean;
200
+ static getDecimalSeparator(
201
+ numberFormat: 'currency' | 'decimal_comma' | 'decimal_dot' | string
202
+ ): GFCurrencySeparator;
203
+ static htmlDecode(text: string): string;
154
204
  }
155
205
 
156
206
  interface GFConditionalLogicRuleField {
@@ -255,7 +305,8 @@ declare global {
255
305
  event?: string,
256
306
  native?: boolean,
257
307
  }) => void;
258
- }
308
+ };
309
+ Currency: typeof GFCurrency;
259
310
  };
260
311
 
261
312
  ConditionalLogic: typeof GFConditionalLogic;
@@ -349,4 +400,4 @@ declare global {
349
400
 
350
401
  }
351
402
 
352
- export {};
403
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitywiz/types",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
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",