Skip to content

Commit

Permalink
Fix StripeResource.extend type (#1245)
Browse files Browse the repository at this point in the history
* Fix StripeResource.extend type
  • Loading branch information
rattrayalex authored Sep 16, 2021
1 parent 0015c01 commit fbf94a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion types/lib.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ declare module 'stripe' {
'create' | 'retrieve' | 'update' | 'list' | 'del'
>;
}
>(spec: T): StripeResource & T;
>(spec: T): typeof StripeResource & T;
static method(spec: {
method: string;
path?: string;
Expand Down
3 changes: 2 additions & 1 deletion types/test/typescriptTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const stripeCardError: Stripe.StripeCardError = Stripe.errors.generate({
charge: 'ch_123',
});

Stripe.StripeResource.extend({
const Foo = Stripe.StripeResource.extend({
includeBasic: ['retrieve'],
foo: Stripe.StripeResource.method({
method: 'create',
Expand All @@ -191,6 +191,7 @@ Stripe.StripeResource.extend({
methodType: 'search',
}),
});
new Foo();

const maxBufferedRequestMetrics: number =
Stripe.StripeResource.MAX_BUFFERED_REQUEST_METRICS;
Expand Down

0 comments on commit fbf94a9

Please sign in to comment.