diff --git a/types/stripe-checkout/index.d.ts b/types/stripe-checkout/index.d.ts index b546ef1851..601559ee82 100644 --- a/types/stripe-checkout/index.d.ts +++ b/types/stripe-checkout/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Stripe Checkout +// Type definitions for Stripe Checkout 1.0 // Project: https://stripe.com/checkout // Definitions by: Chris Wrench // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// interface StripeCheckoutStatic { configure(options: StripeCheckoutOptions): StripeCheckoutHandler; @@ -16,7 +16,7 @@ interface StripeCheckoutHandler { interface StripeCheckoutOptions { key?: string; - token?: (token: StripeTokenResponse) => void; + token?(token: stripe.StripeTokenResponse): void; image?: string; name?: string; description?: string; @@ -33,8 +33,8 @@ interface StripeCheckoutOptions { bitcoin?: boolean; alipay?: boolean | 'auto'; alipayReusable?: boolean; - opened?: () => void; - closed?: () => void; + opened?(): void; + closed?(): void; } declare var StripeCheckout: StripeCheckoutStatic; diff --git a/types/stripe-checkout/stripe-checkout-tests.ts b/types/stripe-checkout/stripe-checkout-tests.ts index f4f3d67600..6cd221debf 100644 --- a/types/stripe-checkout/stripe-checkout-tests.ts +++ b/types/stripe-checkout/stripe-checkout-tests.ts @@ -1,7 +1,7 @@ // Test the minimum amount of configuration required. -var handler = StripeCheckout.configure({ +let handler = StripeCheckout.configure({ key: "my-secret-key", - token: function(token: StripeTokenResponse) { + token: (token: stripe.StripeTokenResponse) => { console.log(token.id); } }); @@ -11,9 +11,9 @@ handler.open(); handler.close(); // Test all configuration options. -var options: StripeCheckoutOptions = { +const options: StripeCheckoutOptions = { key: "my-secret-key", - token: function(token: StripeTokenResponse) { + token: (token: stripe.StripeTokenResponse) => { console.log(token.id); }, image: "http://placehold.it/128x128", @@ -31,9 +31,9 @@ var options: StripeCheckoutOptions = { alipay: "auto", alipayReusable: false, shippingAddress: false, - opened: function() {}, - closed: function() {} -} + opened: () => {}, + closed: () => {} +}; handler = StripeCheckout.configure(options); diff --git a/types/stripe-checkout/tslint.json b/types/stripe-checkout/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/stripe-checkout/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }