@getopenpay/openpay-js-react 0.0.1-alpha.7d1dabb → 0.0.1-alpha.e54f3b1

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/dist/index.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import { FC } from 'react';
2
2
  import { z } from 'zod';
3
3
 
4
+ declare const AllFieldNames: z.ZodUnion<[z.ZodNativeEnum<typeof FieldName>, z.ZodNativeEnum<typeof PrivateFieldName>]>;
5
+
6
+ declare type AllFieldNames = z.infer<typeof AllFieldNames>;
7
+
4
8
  export declare const CardCvcElement: FC<ElementProps>;
5
9
 
6
10
  export declare const CardElement: FC<ElementProps>;
@@ -9,7 +13,7 @@ export declare const CardExpiryElement: FC<ElementProps>;
9
13
 
10
14
  export declare const CardNumberElement: FC<ElementProps>;
11
15
 
12
- declare type ElementProps = {
16
+ export declare type ElementProps = {
13
17
  styles?: ElementsStyle;
14
18
  };
15
19
 
@@ -27,7 +31,7 @@ declare type ElementsFormChildrenProps = {
27
31
  submit: () => void;
28
32
  };
29
33
 
30
- declare type ElementsFormProps = {
34
+ export declare type ElementsFormProps = {
31
35
  className?: string;
32
36
  checkoutSecureToken?: string;
33
37
  children: (props: ElementsFormChildrenProps) => JSX.Element;
@@ -36,7 +40,7 @@ declare type ElementsFormProps = {
36
40
  onChange?: (elementId: string) => void;
37
41
  onLoad?: (totalAmountAtoms: number, currency?: string) => void;
38
42
  onLoadError?: (message: string) => void;
39
- onValidationError?: (field: FieldName, errors: string[], elementId?: string) => void;
43
+ onValidationError?: (field: AllFieldNames, errors: string[], elementId?: string) => void;
40
44
  onCheckoutStarted?: () => void;
41
45
  onCheckoutSuccess?: (invoiceUrls: string[]) => void;
42
46
  onCheckoutError?: (message: string) => void;
@@ -77,9 +81,6 @@ declare type ElementsStyle = z.infer<typeof ElementsStyle>;
77
81
  * Expected input fields
78
82
  */
79
83
  export declare enum FieldName {
80
- CARD_NUMBER = "cardNumber",
81
- CARD_EXPIRY = "cardExpiry",
82
- CARD_CVC = "cardCvc",
83
84
  FIRST_NAME = "firstName",
84
85
  LAST_NAME = "lastName",
85
86
  EMAIL = "email",
@@ -91,6 +92,12 @@ export declare enum FieldName {
91
92
  PHONE = "phone"
92
93
  }
93
94
 
95
+ declare enum PrivateFieldName {
96
+ CARD_NUMBER = "cardNumber",
97
+ CARD_EXPIRY = "cardExpiry",
98
+ CARD_CVC = "cardCvc"
99
+ }
100
+
94
101
  export declare const useOpenPayElements: () => ElementsContextValue;
95
102
 
96
103
  export { }