diff --git a/types/stripe-v3/index.d.ts b/types/stripe-v3/index.d.ts index 9254880b38..5f8d9f4d0b 100644 --- a/types/stripe-v3/index.d.ts +++ b/types/stripe-v3/index.d.ts @@ -11,6 +11,7 @@ // Thomas Marek // Kim Ehrenpohl // Krishna Pravin +// Hiroshi Ioka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var Stripe: stripe.StripeStatic; @@ -702,6 +703,7 @@ declare namespace stripe { type elementsType = 'card' | 'cardNumber' | 'cardExpiry' | 'cardCvc' | 'postalCode' | 'paymentRequestButton' | 'iban' | 'idealBank'; interface Elements { create(type: elementsType, options?: ElementsOptions): Element; + getElement(type: elementsType): Element | null; } interface ElementsOptions { diff --git a/types/stripe-v3/stripe-v3-tests.ts b/types/stripe-v3/stripe-v3-tests.ts index f11a464cee..f93cfcbee4 100644 --- a/types/stripe-v3/stripe-v3-tests.ts +++ b/types/stripe-v3/stripe-v3-tests.ts @@ -300,4 +300,10 @@ describe("Stripe elements", () => { } }); }); + + it("should get card element", () => { + elements.create('card'); + const card = elements.getElement('card'); + console.log(card); + }); });