@stripe/stripe-js 3.0.10 → 3.2.0

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 (133) hide show
  1. package/dist/api/bank-accounts.d.mts +61 -0
  2. package/dist/api/bank-accounts.d.ts +61 -0
  3. package/dist/api/cards.d.mts +130 -0
  4. package/dist/api/cards.d.ts +130 -0
  5. package/dist/api/confirmation-tokens.d.mts +191 -0
  6. package/dist/api/confirmation-tokens.d.ts +191 -0
  7. package/dist/api/financial-connections.d.mts +232 -0
  8. package/dist/api/financial-connections.d.ts +232 -0
  9. package/dist/api/index.d.mts +12 -0
  10. package/dist/api/index.d.ts +12 -0
  11. package/dist/api/orders.d.mts +122 -0
  12. package/dist/api/orders.d.ts +122 -0
  13. package/dist/api/payment-intents.d.mts +330 -0
  14. package/dist/api/payment-intents.d.ts +330 -0
  15. package/dist/api/payment-methods.d.mts +452 -0
  16. package/dist/api/payment-methods.d.ts +452 -0
  17. package/dist/api/setup-intents.d.mts +184 -0
  18. package/dist/api/setup-intents.d.ts +184 -0
  19. package/dist/api/shared.d.mts +125 -0
  20. package/dist/api/shared.d.ts +125 -0
  21. package/dist/api/sources.d.mts +1045 -0
  22. package/dist/api/sources.d.ts +1045 -0
  23. package/dist/api/tokens.d.mts +639 -0
  24. package/dist/api/tokens.d.ts +639 -0
  25. package/dist/api/verification-sessions.d.mts +9 -0
  26. package/dist/api/verification-sessions.d.ts +9 -0
  27. package/dist/index.d.mts +4 -12792
  28. package/dist/index.d.ts +4 -12792
  29. package/dist/{stripe.js → index.js} +1 -1
  30. package/dist/{stripe.mjs → index.mjs} +1 -1
  31. package/dist/pure.d.mts +5 -0
  32. package/dist/pure.d.ts +5 -0
  33. package/dist/pure.js +204 -0
  34. package/dist/pure.mjs +200 -0
  35. package/dist/shared.d.mts +6 -0
  36. package/dist/shared.d.ts +6 -0
  37. package/dist/stripe-js/checkout.d.mts +153 -0
  38. package/dist/stripe-js/checkout.d.ts +153 -0
  39. package/dist/stripe-js/confirmation-tokens.d.mts +1 -0
  40. package/dist/stripe-js/confirmation-tokens.d.ts +1 -0
  41. package/dist/stripe-js/custom-checkout.d.mts +402 -0
  42. package/dist/stripe-js/custom-checkout.d.ts +402 -0
  43. package/dist/stripe-js/elements/address.d.mts +261 -0
  44. package/dist/stripe-js/elements/address.d.ts +261 -0
  45. package/dist/stripe-js/elements/affirm-message.d.mts +65 -0
  46. package/dist/stripe-js/elements/affirm-message.d.ts +65 -0
  47. package/dist/stripe-js/elements/afterpay-clearpay-message.d.mts +119 -0
  48. package/dist/stripe-js/elements/afterpay-clearpay-message.d.ts +119 -0
  49. package/dist/stripe-js/elements/apple-pay.d.mts +156 -0
  50. package/dist/stripe-js/elements/apple-pay.d.ts +156 -0
  51. package/dist/stripe-js/elements/au-bank-account.d.mts +138 -0
  52. package/dist/stripe-js/elements/au-bank-account.d.ts +138 -0
  53. package/dist/stripe-js/elements/base.d.mts +264 -0
  54. package/dist/stripe-js/elements/base.d.ts +264 -0
  55. package/dist/stripe-js/elements/card-cvc.d.mts +119 -0
  56. package/dist/stripe-js/elements/card-cvc.d.ts +119 -0
  57. package/dist/stripe-js/elements/card-expiry.d.mts +119 -0
  58. package/dist/stripe-js/elements/card-expiry.d.ts +119 -0
  59. package/dist/stripe-js/elements/card-number.d.mts +200 -0
  60. package/dist/stripe-js/elements/card-number.d.ts +200 -0
  61. package/dist/stripe-js/elements/card.d.mts +226 -0
  62. package/dist/stripe-js/elements/card.d.ts +226 -0
  63. package/dist/stripe-js/elements/cart.d.mts +224 -0
  64. package/dist/stripe-js/elements/cart.d.ts +224 -0
  65. package/dist/stripe-js/elements/eps-bank.d.mts +140 -0
  66. package/dist/stripe-js/elements/eps-bank.d.ts +140 -0
  67. package/dist/stripe-js/elements/express-checkout.d.mts +446 -0
  68. package/dist/stripe-js/elements/express-checkout.d.ts +446 -0
  69. package/dist/stripe-js/elements/fpx-bank.d.mts +134 -0
  70. package/dist/stripe-js/elements/fpx-bank.d.ts +134 -0
  71. package/dist/stripe-js/elements/iban.d.mts +135 -0
  72. package/dist/stripe-js/elements/iban.d.ts +135 -0
  73. package/dist/stripe-js/elements/ideal-bank.d.mts +140 -0
  74. package/dist/stripe-js/elements/ideal-bank.d.ts +140 -0
  75. package/dist/stripe-js/elements/index.d.mts +22 -0
  76. package/dist/stripe-js/elements/index.d.ts +22 -0
  77. package/dist/stripe-js/elements/issuing/index.d.mts +5 -0
  78. package/dist/stripe-js/elements/issuing/index.d.ts +5 -0
  79. package/dist/stripe-js/elements/issuing/issuing-card-copy-button.d.mts +37 -0
  80. package/dist/stripe-js/elements/issuing/issuing-card-copy-button.d.ts +37 -0
  81. package/dist/stripe-js/elements/issuing/issuing-card-cvc-display.d.mts +32 -0
  82. package/dist/stripe-js/elements/issuing/issuing-card-cvc-display.d.ts +32 -0
  83. package/dist/stripe-js/elements/issuing/issuing-card-expiry-display.d.mts +32 -0
  84. package/dist/stripe-js/elements/issuing/issuing-card-expiry-display.d.ts +32 -0
  85. package/dist/stripe-js/elements/issuing/issuing-card-number-display.d.mts +40 -0
  86. package/dist/stripe-js/elements/issuing/issuing-card-number-display.d.ts +40 -0
  87. package/dist/stripe-js/elements/issuing/issuing-card-pin-display.d.mts +32 -0
  88. package/dist/stripe-js/elements/issuing/issuing-card-pin-display.d.ts +32 -0
  89. package/dist/stripe-js/elements/link-authentication.d.mts +158 -0
  90. package/dist/stripe-js/elements/link-authentication.d.ts +158 -0
  91. package/dist/stripe-js/elements/p24-bank.d.mts +140 -0
  92. package/dist/stripe-js/elements/p24-bank.d.ts +140 -0
  93. package/dist/stripe-js/elements/payment-method-messaging.d.mts +98 -0
  94. package/dist/stripe-js/elements/payment-method-messaging.d.ts +98 -0
  95. package/dist/stripe-js/elements/payment-request-button.d.mts +151 -0
  96. package/dist/stripe-js/elements/payment-request-button.d.ts +151 -0
  97. package/dist/stripe-js/elements/payment.d.mts +275 -0
  98. package/dist/stripe-js/elements/payment.d.ts +275 -0
  99. package/dist/stripe-js/elements/shipping-address.d.mts +215 -0
  100. package/dist/stripe-js/elements/shipping-address.d.ts +215 -0
  101. package/dist/stripe-js/elements-group.d.mts +1143 -0
  102. package/dist/stripe-js/elements-group.d.ts +1143 -0
  103. package/dist/stripe-js/embedded-checkout.d.mts +35 -0
  104. package/dist/stripe-js/embedded-checkout.d.ts +35 -0
  105. package/dist/stripe-js/ephemeral-keys.d.mts +3 -0
  106. package/dist/stripe-js/ephemeral-keys.d.ts +3 -0
  107. package/dist/stripe-js/financial-connections.d.mts +19 -0
  108. package/dist/stripe-js/financial-connections.d.ts +19 -0
  109. package/dist/stripe-js/index.d.mts +13 -0
  110. package/dist/stripe-js/index.d.ts +13 -0
  111. package/dist/stripe-js/orders.d.mts +9 -0
  112. package/dist/stripe-js/orders.d.ts +9 -0
  113. package/dist/stripe-js/payment-intents.d.mts +1473 -0
  114. package/dist/stripe-js/payment-intents.d.ts +1473 -0
  115. package/dist/stripe-js/payment-request.d.mts +529 -0
  116. package/dist/stripe-js/payment-request.d.ts +529 -0
  117. package/dist/stripe-js/setup-intents.d.mts +250 -0
  118. package/dist/stripe-js/setup-intents.d.ts +250 -0
  119. package/dist/stripe-js/stripe.d.mts +1486 -0
  120. package/dist/stripe-js/stripe.d.ts +1486 -0
  121. package/dist/stripe-js/token-and-sources.d.mts +110 -0
  122. package/dist/stripe-js/token-and-sources.d.ts +110 -0
  123. package/dist/utils.d.mts +2 -0
  124. package/dist/utils.d.ts +2 -0
  125. package/lib/index.d.mts +1 -0
  126. package/lib/index.d.ts +1 -0
  127. package/lib/index.js +2 -0
  128. package/lib/index.mjs +1 -0
  129. package/package.json +11 -10
  130. package/pure/index.d.mts +1 -12771
  131. package/pure/index.d.ts +1 -12771
  132. package/pure/index.js +1 -204
  133. package/pure/index.mjs +1 -200
@@ -0,0 +1,264 @@
1
+ import {StripeElementType} from '../elements-group';
2
+
3
+ export type StripeElementBase = {
4
+ /**
5
+ * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
6
+ * `element.mount` accepts either a CSS Selector (e.g., `'#card-element'`) or a DOM element.
7
+ *
8
+ * You need to create a container DOM element to mount an `Element`.
9
+ * If the container DOM element has a label, the `Element` is automatically focused when its label is clicked.
10
+ * There are two ways to do this:
11
+ *
12
+ * 1. Mount the instance within a `<label>`.
13
+ * 2. Create a `<label>` with a `for` attribute, referencing the ID of your container.
14
+ */
15
+ mount(domElement: string | HTMLElement): void;
16
+
17
+ /**
18
+ * Blurs the element.
19
+ */
20
+ blur(): void;
21
+
22
+ /**
23
+ * Clears the value(s) of the element.
24
+ */
25
+ clear(): void;
26
+
27
+ /**
28
+ * Removes the element from the DOM and destroys it.
29
+ * A destroyed element can not be re-activated or re-mounted to the DOM.
30
+ */
31
+ destroy(): void;
32
+
33
+ /**
34
+ * Focuses the element.
35
+ */
36
+ focus(): void;
37
+
38
+ /**
39
+ * Unmounts the element from the DOM.
40
+ * Call `element.mount` to re-attach it to the DOM.
41
+ */
42
+ unmount(): void;
43
+ };
44
+
45
+ /**
46
+ * Customize the appearance of an element using CSS properties passed in a `Style` object, which consists of CSS properties nested under objects for each variant.
47
+ */
48
+ export interface StripeElementStyle {
49
+ /**
50
+ * Base variant—all other variants inherit from these styles.
51
+ */
52
+ base?: StripeElementStyleVariant;
53
+
54
+ /**
55
+ * Applied when the element has valid input.
56
+ */
57
+ complete?: StripeElementStyleVariant;
58
+
59
+ /**
60
+ * Applied when the element has no customer input.
61
+ */
62
+ empty?: StripeElementStyleVariant;
63
+
64
+ /**
65
+ * Applied when the element has invalid input.
66
+ */
67
+ invalid?: StripeElementStyleVariant;
68
+ }
69
+
70
+ /**
71
+ * An object with `CSSProperties` supported by Stripe.js.
72
+ * Pseudo-classes and pseudo-elements can also be styled using a nested object inside of a variant.
73
+ */
74
+ export interface StripeElementStyleVariant extends StripeElementCSSProperties {
75
+ ':hover'?: StripeElementCSSProperties;
76
+
77
+ ':focus'?: StripeElementCSSProperties;
78
+
79
+ '::placeholder'?: StripeElementCSSProperties;
80
+
81
+ '::selection'?: StripeElementCSSProperties;
82
+
83
+ ':-webkit-autofill'?: StripeElementCSSProperties;
84
+
85
+ /**
86
+ * Available for all elements except the `paymentRequestButton` element
87
+ */
88
+ ':disabled'?: StripeElementCSSProperties;
89
+
90
+ /**
91
+ * Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements.
92
+ */
93
+ '::-ms-clear'?: StripeElementCSSProperties & {display: string};
94
+ }
95
+
96
+ /**
97
+ * CSS properties supported by Stripe.js.
98
+ */
99
+ export interface StripeElementCSSProperties {
100
+ /**
101
+ * The [background-color](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color) CSS property.
102
+ *
103
+ * This property works best with the `::selection` pseudo-class.
104
+ * In other cases, consider setting the background color on the element's container instaed.
105
+ */
106
+ backgroundColor?: string;
107
+
108
+ /**
109
+ * The [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS property.
110
+ */
111
+ color?: string;
112
+
113
+ /**
114
+ * The [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) CSS property.
115
+ */
116
+ fontFamily?: string;
117
+
118
+ /**
119
+ * The [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size) CSS property.
120
+ */
121
+ fontSize?: string;
122
+
123
+ /**
124
+ * The [font-smoothing](https://developer.mozilla.org/en-US/docs/Web/CSS/font-smoothing) CSS property.
125
+ */
126
+ fontSmoothing?: string;
127
+
128
+ /**
129
+ * The [font-style](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style) CSS property.
130
+ */
131
+ fontStyle?: string;
132
+
133
+ /**
134
+ * The [font-variant](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant) CSS property.
135
+ */
136
+ fontVariant?: string;
137
+
138
+ /**
139
+ * The [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight) CSS property.
140
+ */
141
+ fontWeight?: string | number;
142
+
143
+ /**
144
+ * A custom property, used to set the color of the icons that are rendered in an element.
145
+ */
146
+ iconColor?: string;
147
+
148
+ /**
149
+ * The [line-height](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height) CSS property.
150
+ *
151
+ * To avoid cursors being rendered inconsistently across browsers, consider using a padding on the element's container instead.
152
+ */
153
+ lineHeight?: string;
154
+
155
+ /**
156
+ * The [letter-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) CSS property.
157
+ */
158
+ letterSpacing?: string;
159
+
160
+ /**
161
+ * The [text-align](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) CSS property.
162
+ *
163
+ * Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements.
164
+ */
165
+ textAlign?: string;
166
+
167
+ /**
168
+ * The [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding) CSS property.
169
+ *
170
+ * Available for the `idealBank` element.
171
+ * Accepts integer length with `px` unit as values.
172
+ */
173
+ padding?: string;
174
+
175
+ /**
176
+ * The [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration) CSS property.
177
+ */
178
+ textDecoration?: string;
179
+
180
+ /**
181
+ * The [text-shadow](https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow) CSS property.
182
+ */
183
+ textShadow?: string;
184
+
185
+ /**
186
+ * The [text-transform](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform) CSS property.
187
+ */
188
+ textTransform?: string;
189
+ }
190
+
191
+ /**
192
+ * Use `Classes` to set custom class names on the container DOM element when the Stripe element is in a particular state.
193
+ */
194
+ export interface StripeElementClasses {
195
+ /**
196
+ * The base class applied to the container.
197
+ * Defaults to `StripeElement`.
198
+ */
199
+ base?: string;
200
+
201
+ /**
202
+ * The class name to apply when the `Element` is complete.
203
+ * Defaults to `StripeElement--complete`.
204
+ */
205
+ complete?: string;
206
+
207
+ /**
208
+ * The class name to apply when the `Element` is empty.
209
+ * Defaults to `StripeElement--empty`.
210
+ */
211
+ empty?: string;
212
+
213
+ /**
214
+ * The class name to apply when the `Element` is focused.
215
+ * Defaults to `StripeElement--focus`.
216
+ */
217
+ focus?: string;
218
+
219
+ /**
220
+ * The class name to apply when the `Element` is invalid.
221
+ * Defaults to `StripeElement--invalid`.
222
+ */
223
+ invalid?: string;
224
+
225
+ /**
226
+ * The class name to apply when the `Element` has its value autofilled by the browser (only on Chrome and Safari).
227
+ * Defaults to `StripeElement--webkit-autofill`.
228
+ */
229
+ webkitAutofill?: string;
230
+ }
231
+
232
+ export interface StripeElementChangeEvent {
233
+ /**
234
+ * The type of element that emitted this event.
235
+ */
236
+ elementType: StripeElementType;
237
+
238
+ /**
239
+ * `true` if the value is empty.
240
+ */
241
+ empty: boolean;
242
+
243
+ /**
244
+ * `true` if the value is well-formed and potentially complete.
245
+ * The `complete` value can be used to progressively disclose the next parts of your form or to enable form submission.
246
+ *
247
+ * It is not an indicator of whether a customer is done with their input—it only indicates that the Element contains a potentially complete, well-formed value.
248
+ * In many cases the customer could still add further input.
249
+ *
250
+ * The `complete` value should not be used to perform an action such as advancing the cursor to a subsequent field or performing a tokenization request.
251
+ */
252
+ complete: boolean;
253
+
254
+ /**
255
+ * The current validation error, if any.
256
+ */
257
+ error:
258
+ | undefined
259
+ | {
260
+ type: 'validation_error';
261
+ code: string;
262
+ message: string;
263
+ };
264
+ }
@@ -0,0 +1,264 @@
1
+ import {StripeElementType} from '../elements-group';
2
+
3
+ export type StripeElementBase = {
4
+ /**
5
+ * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
6
+ * `element.mount` accepts either a CSS Selector (e.g., `'#card-element'`) or a DOM element.
7
+ *
8
+ * You need to create a container DOM element to mount an `Element`.
9
+ * If the container DOM element has a label, the `Element` is automatically focused when its label is clicked.
10
+ * There are two ways to do this:
11
+ *
12
+ * 1. Mount the instance within a `<label>`.
13
+ * 2. Create a `<label>` with a `for` attribute, referencing the ID of your container.
14
+ */
15
+ mount(domElement: string | HTMLElement): void;
16
+
17
+ /**
18
+ * Blurs the element.
19
+ */
20
+ blur(): void;
21
+
22
+ /**
23
+ * Clears the value(s) of the element.
24
+ */
25
+ clear(): void;
26
+
27
+ /**
28
+ * Removes the element from the DOM and destroys it.
29
+ * A destroyed element can not be re-activated or re-mounted to the DOM.
30
+ */
31
+ destroy(): void;
32
+
33
+ /**
34
+ * Focuses the element.
35
+ */
36
+ focus(): void;
37
+
38
+ /**
39
+ * Unmounts the element from the DOM.
40
+ * Call `element.mount` to re-attach it to the DOM.
41
+ */
42
+ unmount(): void;
43
+ };
44
+
45
+ /**
46
+ * Customize the appearance of an element using CSS properties passed in a `Style` object, which consists of CSS properties nested under objects for each variant.
47
+ */
48
+ export interface StripeElementStyle {
49
+ /**
50
+ * Base variant—all other variants inherit from these styles.
51
+ */
52
+ base?: StripeElementStyleVariant;
53
+
54
+ /**
55
+ * Applied when the element has valid input.
56
+ */
57
+ complete?: StripeElementStyleVariant;
58
+
59
+ /**
60
+ * Applied when the element has no customer input.
61
+ */
62
+ empty?: StripeElementStyleVariant;
63
+
64
+ /**
65
+ * Applied when the element has invalid input.
66
+ */
67
+ invalid?: StripeElementStyleVariant;
68
+ }
69
+
70
+ /**
71
+ * An object with `CSSProperties` supported by Stripe.js.
72
+ * Pseudo-classes and pseudo-elements can also be styled using a nested object inside of a variant.
73
+ */
74
+ export interface StripeElementStyleVariant extends StripeElementCSSProperties {
75
+ ':hover'?: StripeElementCSSProperties;
76
+
77
+ ':focus'?: StripeElementCSSProperties;
78
+
79
+ '::placeholder'?: StripeElementCSSProperties;
80
+
81
+ '::selection'?: StripeElementCSSProperties;
82
+
83
+ ':-webkit-autofill'?: StripeElementCSSProperties;
84
+
85
+ /**
86
+ * Available for all elements except the `paymentRequestButton` element
87
+ */
88
+ ':disabled'?: StripeElementCSSProperties;
89
+
90
+ /**
91
+ * Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements.
92
+ */
93
+ '::-ms-clear'?: StripeElementCSSProperties & {display: string};
94
+ }
95
+
96
+ /**
97
+ * CSS properties supported by Stripe.js.
98
+ */
99
+ export interface StripeElementCSSProperties {
100
+ /**
101
+ * The [background-color](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color) CSS property.
102
+ *
103
+ * This property works best with the `::selection` pseudo-class.
104
+ * In other cases, consider setting the background color on the element's container instaed.
105
+ */
106
+ backgroundColor?: string;
107
+
108
+ /**
109
+ * The [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS property.
110
+ */
111
+ color?: string;
112
+
113
+ /**
114
+ * The [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) CSS property.
115
+ */
116
+ fontFamily?: string;
117
+
118
+ /**
119
+ * The [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size) CSS property.
120
+ */
121
+ fontSize?: string;
122
+
123
+ /**
124
+ * The [font-smoothing](https://developer.mozilla.org/en-US/docs/Web/CSS/font-smoothing) CSS property.
125
+ */
126
+ fontSmoothing?: string;
127
+
128
+ /**
129
+ * The [font-style](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style) CSS property.
130
+ */
131
+ fontStyle?: string;
132
+
133
+ /**
134
+ * The [font-variant](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant) CSS property.
135
+ */
136
+ fontVariant?: string;
137
+
138
+ /**
139
+ * The [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight) CSS property.
140
+ */
141
+ fontWeight?: string | number;
142
+
143
+ /**
144
+ * A custom property, used to set the color of the icons that are rendered in an element.
145
+ */
146
+ iconColor?: string;
147
+
148
+ /**
149
+ * The [line-height](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height) CSS property.
150
+ *
151
+ * To avoid cursors being rendered inconsistently across browsers, consider using a padding on the element's container instead.
152
+ */
153
+ lineHeight?: string;
154
+
155
+ /**
156
+ * The [letter-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) CSS property.
157
+ */
158
+ letterSpacing?: string;
159
+
160
+ /**
161
+ * The [text-align](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) CSS property.
162
+ *
163
+ * Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements.
164
+ */
165
+ textAlign?: string;
166
+
167
+ /**
168
+ * The [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding) CSS property.
169
+ *
170
+ * Available for the `idealBank` element.
171
+ * Accepts integer length with `px` unit as values.
172
+ */
173
+ padding?: string;
174
+
175
+ /**
176
+ * The [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration) CSS property.
177
+ */
178
+ textDecoration?: string;
179
+
180
+ /**
181
+ * The [text-shadow](https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow) CSS property.
182
+ */
183
+ textShadow?: string;
184
+
185
+ /**
186
+ * The [text-transform](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform) CSS property.
187
+ */
188
+ textTransform?: string;
189
+ }
190
+
191
+ /**
192
+ * Use `Classes` to set custom class names on the container DOM element when the Stripe element is in a particular state.
193
+ */
194
+ export interface StripeElementClasses {
195
+ /**
196
+ * The base class applied to the container.
197
+ * Defaults to `StripeElement`.
198
+ */
199
+ base?: string;
200
+
201
+ /**
202
+ * The class name to apply when the `Element` is complete.
203
+ * Defaults to `StripeElement--complete`.
204
+ */
205
+ complete?: string;
206
+
207
+ /**
208
+ * The class name to apply when the `Element` is empty.
209
+ * Defaults to `StripeElement--empty`.
210
+ */
211
+ empty?: string;
212
+
213
+ /**
214
+ * The class name to apply when the `Element` is focused.
215
+ * Defaults to `StripeElement--focus`.
216
+ */
217
+ focus?: string;
218
+
219
+ /**
220
+ * The class name to apply when the `Element` is invalid.
221
+ * Defaults to `StripeElement--invalid`.
222
+ */
223
+ invalid?: string;
224
+
225
+ /**
226
+ * The class name to apply when the `Element` has its value autofilled by the browser (only on Chrome and Safari).
227
+ * Defaults to `StripeElement--webkit-autofill`.
228
+ */
229
+ webkitAutofill?: string;
230
+ }
231
+
232
+ export interface StripeElementChangeEvent {
233
+ /**
234
+ * The type of element that emitted this event.
235
+ */
236
+ elementType: StripeElementType;
237
+
238
+ /**
239
+ * `true` if the value is empty.
240
+ */
241
+ empty: boolean;
242
+
243
+ /**
244
+ * `true` if the value is well-formed and potentially complete.
245
+ * The `complete` value can be used to progressively disclose the next parts of your form or to enable form submission.
246
+ *
247
+ * It is not an indicator of whether a customer is done with their input—it only indicates that the Element contains a potentially complete, well-formed value.
248
+ * In many cases the customer could still add further input.
249
+ *
250
+ * The `complete` value should not be used to perform an action such as advancing the cursor to a subsequent field or performing a tokenization request.
251
+ */
252
+ complete: boolean;
253
+
254
+ /**
255
+ * The current validation error, if any.
256
+ */
257
+ error:
258
+ | undefined
259
+ | {
260
+ type: 'validation_error';
261
+ code: string;
262
+ message: string;
263
+ };
264
+ }
@@ -0,0 +1,119 @@
1
+ import {
2
+ StripeElementBase,
3
+ StripeElementStyle,
4
+ StripeElementClasses,
5
+ StripeElementChangeEvent,
6
+ } from './base';
7
+
8
+ export type StripeCardCvcElement = StripeElementBase & {
9
+ /**
10
+ * The change event is triggered when the `Element`'s value changes.
11
+ */
12
+ on(
13
+ eventType: 'change',
14
+ handler: (event: StripeCardCvcElementChangeEvent) => any
15
+ ): StripeCardCvcElement;
16
+ once(
17
+ eventType: 'change',
18
+ handler: (event: StripeCardCvcElementChangeEvent) => any
19
+ ): StripeCardCvcElement;
20
+ off(
21
+ eventType: 'change',
22
+ handler?: (event: StripeCardCvcElementChangeEvent) => any
23
+ ): StripeCardCvcElement;
24
+
25
+ /**
26
+ * Triggered when the element is fully rendered and can accept `element.focus` calls.
27
+ */
28
+ on(
29
+ eventType: 'ready',
30
+ handler: (event: {elementType: 'cardCvc'}) => any
31
+ ): StripeCardCvcElement;
32
+ once(
33
+ eventType: 'ready',
34
+ handler: (event: {elementType: 'cardCvc'}) => any
35
+ ): StripeCardCvcElement;
36
+ off(
37
+ eventType: 'ready',
38
+ handler?: (event: {elementType: 'cardCvc'}) => any
39
+ ): StripeCardCvcElement;
40
+
41
+ /**
42
+ * Triggered when the element gains focus.
43
+ */
44
+ on(
45
+ eventType: 'focus',
46
+ handler: (event: {elementType: 'cardCvc'}) => any
47
+ ): StripeCardCvcElement;
48
+ once(
49
+ eventType: 'focus',
50
+ handler: (event: {elementType: 'cardCvc'}) => any
51
+ ): StripeCardCvcElement;
52
+ off(
53
+ eventType: 'focus',
54
+ handler?: (event: {elementType: 'cardCvc'}) => any
55
+ ): StripeCardCvcElement;
56
+
57
+ /**
58
+ * Triggered when the element loses focus.
59
+ */
60
+ on(
61
+ eventType: 'blur',
62
+ handler: (event: {elementType: 'cardCvc'}) => any
63
+ ): StripeCardCvcElement;
64
+ once(
65
+ eventType: 'blur',
66
+ handler: (event: {elementType: 'cardCvc'}) => any
67
+ ): StripeCardCvcElement;
68
+ off(
69
+ eventType: 'blur',
70
+ handler?: (event: {elementType: 'cardCvc'}) => any
71
+ ): StripeCardCvcElement;
72
+
73
+ /**
74
+ * Triggered when the escape key is pressed within the element.
75
+ */
76
+ on(
77
+ eventType: 'escape',
78
+ handler: (event: {elementType: 'cardCvc'}) => any
79
+ ): StripeCardCvcElement;
80
+ once(
81
+ eventType: 'escape',
82
+ handler: (event: {elementType: 'cardCvc'}) => any
83
+ ): StripeCardCvcElement;
84
+ off(
85
+ eventType: 'escape',
86
+ handler?: (event: {elementType: 'cardCvc'}) => any
87
+ ): StripeCardCvcElement;
88
+
89
+ /**
90
+ * Updates the options the `CardCvcElement` was initialized with.
91
+ * Updates are merged into the existing configuration.
92
+ *
93
+ * The styles of an `CardCvcElement` can be dynamically changed using `element.update`.
94
+ * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
95
+ */
96
+ update(options: Partial<StripeCardCvcElementOptions>): void;
97
+ };
98
+
99
+ export interface StripeCardCvcElementOptions {
100
+ classes?: StripeElementClasses;
101
+
102
+ style?: StripeElementStyle;
103
+
104
+ placeholder?: string;
105
+
106
+ /**
107
+ * Applies a disabled state to the Element such that user input is not accepted.
108
+ * Default is false.
109
+ */
110
+ disabled?: boolean;
111
+ }
112
+
113
+ export interface StripeCardCvcElementChangeEvent
114
+ extends StripeElementChangeEvent {
115
+ /**
116
+ * The type of element that emitted this event.
117
+ */
118
+ elementType: 'cardCvc';
119
+ }