From 9e885fc76c80dcea371069d1a9a9872224ebd657 Mon Sep 17 00:00:00 2001 From: hirochachacha Date: Fri, 13 Dec 2019 19:45:33 +0900 Subject: [PATCH] types/stripe-v3: add elements.Elements.getElement (#40970) --- types/stripe-v3/index.d.ts | 2 ++ types/stripe-v3/stripe-v3-tests.ts | 6 ++++++ 2 files changed, 8 insertions(+) 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); + }); });