From 02549c083e9d62b604091d770c4568d47282cdd0 Mon Sep 17 00:00:00 2001 From: hirochachacha Date: Fri, 13 Dec 2019 18:35:33 +0900 Subject: [PATCH] types/react-stripe-elements: add InjectedStripeProps.elements (#40971) --- types/react-stripe-elements/index.d.ts | 6 ++++-- types/react-stripe-elements/react-stripe-elements-tests.tsx | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/types/react-stripe-elements/index.d.ts b/types/react-stripe-elements/index.d.ts index 664bf16b84..0aed8b20ff 100644 --- a/types/react-stripe-elements/index.d.ts +++ b/types/react-stripe-elements/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-stripe-elements 1.3 +// Type definitions for react-stripe-elements 6.0 // Project: https://github.com/stripe/react-stripe-elements#readme // Definitions by: dan-j // Santiago Doldan @@ -9,6 +9,7 @@ // Victor Irzak // Alex Price // Maciej Dabek +// Hiroshi Ioka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -64,7 +65,8 @@ export namespace ReactStripeElements { } interface InjectedStripeProps { - stripe?: StripeProps; + stripe: StripeProps | null; + elements: stripe.elements.Elements | null; } interface ElementProps extends ElementsOptions { diff --git a/types/react-stripe-elements/react-stripe-elements-tests.tsx b/types/react-stripe-elements/react-stripe-elements-tests.tsx index 2fd3b52b88..a757bb9ac4 100644 --- a/types/react-stripe-elements/react-stripe-elements-tests.tsx +++ b/types/react-stripe-elements/react-stripe-elements-tests.tsx @@ -139,6 +139,8 @@ class WrappedComponent extends React.Component { + const elements = this.props.elements; + this.props .stripe!.createToken({ name: '',