mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
types/stripe-v3: add elements.Elements.getElement (#40970)
This commit is contained in:
2
types/stripe-v3/index.d.ts
vendored
2
types/stripe-v3/index.d.ts
vendored
@@ -11,6 +11,7 @@
|
||||
// Thomas Marek <https://github.com/ttmarek>
|
||||
// Kim Ehrenpohl <https://github.com/kimehrenpohl>
|
||||
// Krishna Pravin <https://github.com/KrishnaPravin>
|
||||
// Hiroshi Ioka <https://github.com/hirochachacha>
|
||||
// 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 {
|
||||
|
||||
@@ -300,4 +300,10 @@ describe("Stripe elements", () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it("should get card element", () => {
|
||||
elements.create('card');
|
||||
const card = elements.getElement('card');
|
||||
console.log(card);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user