@gravitywiz/types 0.0.14 → 0.0.16

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 +36 -13
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,15 +1,18 @@
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'
12
14
  | 'date'
15
+ | 'time'
13
16
  | 'website'
14
17
  | 'email'
15
18
  | 'phone'
@@ -18,13 +21,13 @@ declare global {
18
21
  type GFInputType =
19
22
  | 'text'
20
23
  | 'number'
21
- | 'email'
22
- | 'fileupload'
23
- | 'date'
24
- | 'website'
25
- | 'total'
26
- | 'rating'
27
- | 'radio'
24
+ | 'email'
25
+ | 'fileupload'
26
+ | 'date'
27
+ | 'website'
28
+ | 'total'
29
+ | 'rating'
30
+ | 'radio'
28
31
  | 'select'
29
32
  | 'singleproduct'
30
33
  | 'hiddenproduct'
@@ -61,13 +64,13 @@ declare global {
61
64
  id: number;
62
65
  formId: number;
63
66
  type: GFFieldType;
64
- inputs?: GFFieldInput[] | null;
67
+ inputs?: GFFieldInput[] | null;
65
68
  choices?: GFChoice[];
66
69
  label: string;
67
70
  adminLabel?: string;
68
71
  enableEnhancedUI?: boolean;
69
72
  inputType: GFInputType;
70
- productId: string;
73
+ productId: string;
71
74
  validateState?: boolean;
72
75
  }
73
76
 
@@ -140,8 +143,8 @@ declare global {
140
143
  symbol_left: string;
141
144
  symbol_right: string;
142
145
  symbol_padding: string;
143
- thousand_separator: string;
144
- decimal_separator: string;
146
+ thousand_separator: GFCurrencySeparator;
147
+ decimal_separator: GFCurrencySeparator;
145
148
  decimals: number
146
149
  code: string;
147
150
  }
@@ -150,6 +153,25 @@ declare global {
150
153
  constructor(currency: GFCurrencyConfig);
151
154
  toNumber(text: string): number;
152
155
  toMoney(number: string | number, isNumeric?: boolean): string;
156
+ getCode(): boolean;
157
+ numberFormat(
158
+ number: number,
159
+ decimals: number,
160
+ decPoint: GFCurrencySeparator,
161
+ thousandsSep: GFCurrencySeparator,
162
+ padded: boolean
163
+ ): string;
164
+ static cleanNumber(
165
+ text: string,
166
+ symbolRight: string,
167
+ symbolLeft: string,
168
+ decimalSeparator: GFCurrencySeparator,
169
+ ): number;
170
+ static isNumeric(val: string | number): boolean;
171
+ static getDecimalSeparator(
172
+ numberFormat: 'currency' | 'decimal_comma' | 'decimal_dot' | string
173
+ ): GFCurrencySeparator;
174
+ static htmlDecode(text: string): string;
153
175
  }
154
176
 
155
177
  interface GFConditionalLogicRuleField {
@@ -254,7 +276,8 @@ declare global {
254
276
  event?: string,
255
277
  native?: boolean,
256
278
  }) => void;
257
- }
279
+ };
280
+ Currency: typeof GFCurrency;
258
281
  };
259
282
 
260
283
  ConditionalLogic: typeof GFConditionalLogic;
@@ -348,4 +371,4 @@ declare global {
348
371
 
349
372
  }
350
373
 
351
- export {};
374
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitywiz/types",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
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",