@gravitywiz/types 0.0.15 → 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 +35 -13
  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'
@@ -19,13 +21,13 @@ declare global {
19
21
  type GFInputType =
20
22
  | 'text'
21
23
  | 'number'
22
- | 'email'
23
- | 'fileupload'
24
- | 'date'
25
- | 'website'
26
- | 'total'
27
- | 'rating'
28
- | 'radio'
24
+ | 'email'
25
+ | 'fileupload'
26
+ | 'date'
27
+ | 'website'
28
+ | 'total'
29
+ | 'rating'
30
+ | 'radio'
29
31
  | 'select'
30
32
  | 'singleproduct'
31
33
  | 'hiddenproduct'
@@ -62,13 +64,13 @@ declare global {
62
64
  id: number;
63
65
  formId: number;
64
66
  type: GFFieldType;
65
- inputs?: GFFieldInput[] | null;
67
+ inputs?: GFFieldInput[] | null;
66
68
  choices?: GFChoice[];
67
69
  label: string;
68
70
  adminLabel?: string;
69
71
  enableEnhancedUI?: boolean;
70
72
  inputType: GFInputType;
71
- productId: string;
73
+ productId: string;
72
74
  validateState?: boolean;
73
75
  }
74
76
 
@@ -141,8 +143,8 @@ declare global {
141
143
  symbol_left: string;
142
144
  symbol_right: string;
143
145
  symbol_padding: string;
144
- thousand_separator: string;
145
- decimal_separator: string;
146
+ thousand_separator: GFCurrencySeparator;
147
+ decimal_separator: GFCurrencySeparator;
146
148
  decimals: number
147
149
  code: string;
148
150
  }
@@ -151,6 +153,25 @@ declare global {
151
153
  constructor(currency: GFCurrencyConfig);
152
154
  toNumber(text: string): number;
153
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;
154
175
  }
155
176
 
156
177
  interface GFConditionalLogicRuleField {
@@ -255,7 +276,8 @@ declare global {
255
276
  event?: string,
256
277
  native?: boolean,
257
278
  }) => void;
258
- }
279
+ };
280
+ Currency: typeof GFCurrency;
259
281
  };
260
282
 
261
283
  ConditionalLogic: typeof GFConditionalLogic;
@@ -349,4 +371,4 @@ declare global {
349
371
 
350
372
  }
351
373
 
352
- export {};
374
+ 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.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",