Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More consistent type definitions #1107

Merged
merged 1 commit into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
More consistent type definitions
  • Loading branch information
richardm-stripe committed Jan 12, 2021
commit 7807566b2789bbec62bc2e0d63a664be9e22a57b
21 changes: 7 additions & 14 deletions types/2020-08-27/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ declare module 'stripe' {
id: string,
params: CustomerSourceCreateParams,
options?: RequestOptions
): Promise<Stripe.Response<CustomerSource>>;
): Promise<Stripe.Response<Stripe.CustomerSource>>;

/**
* Retrieve a specified source for a given customer.
Expand All @@ -708,12 +708,12 @@ declare module 'stripe' {
id: string,
params?: CustomerSourceRetrieveParams,
options?: RequestOptions
): Promise<Stripe.Response<CustomerSource>>;
): Promise<Stripe.Response<Stripe.CustomerSource>>;
retrieveSource(
customerId: string,
id: string,
options?: RequestOptions
): Promise<Stripe.Response<CustomerSource>>;
): Promise<Stripe.Response<Stripe.CustomerSource>>;

/**
* Update a specified source for a given customer.
Expand All @@ -726,13 +726,6 @@ declare module 'stripe' {
): Promise<
Stripe.Response<Stripe.Card | Stripe.BankAccount | Stripe.Source>
>;
updateSource(
customerId: string,
id: string,
options?: RequestOptions
): Promise<
Stripe.Response<Stripe.Card | Stripe.BankAccount | Stripe.Source>
>;

/**
* List sources for a specified customer.
Expand All @@ -741,11 +734,11 @@ declare module 'stripe' {
id: string,
params?: CustomerSourceListParams,
options?: RequestOptions
): ApiListPromise<CustomerSource>;
): ApiListPromise<Stripe.CustomerSource>;
listSources(
id: string,
options?: RequestOptions
): ApiListPromise<CustomerSource>;
): ApiListPromise<Stripe.CustomerSource>;

/**
* Delete a specified source for a given customer.
Expand All @@ -757,7 +750,7 @@ declare module 'stripe' {
options?: RequestOptions
): Promise<
Stripe.Response<
| CustomerSource
| Stripe.CustomerSource
| Stripe.DeletedAlipayAccount
| Stripe.DeletedBankAccount
| Stripe.DeletedBitcoinReceiver
Expand All @@ -770,7 +763,7 @@ declare module 'stripe' {
options?: RequestOptions
): Promise<
Stripe.Response<
| CustomerSource
| Stripe.CustomerSource
| Stripe.DeletedAlipayAccount
| Stripe.DeletedBankAccount
| Stripe.DeletedBitcoinReceiver
Expand Down
39 changes: 0 additions & 39 deletions types/2020-08-27/Refunds.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,6 @@ declare module 'stripe' {
expand?: Array<string>;
}

interface RefundRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

interface RefundUpdateParams {
/**
* Specifies which fields in the response should be expanded.
Expand All @@ -146,13 +139,6 @@ declare module 'stripe' {
metadata?: Stripe.Emptyable<Stripe.MetadataParam>;
}

interface RefundListParams extends PaginationParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

interface RefundListParams extends PaginationParams {
/**
* Only return refunds for the charge specified by this charge ID.
Expand Down Expand Up @@ -182,21 +168,6 @@ declare module 'stripe' {
): Promise<Stripe.Response<Stripe.Refund>>;
create(options?: RequestOptions): Promise<Stripe.Response<Stripe.Refund>>;

/**
* Retrieves the details of an existing refund.
*/
retrieve(
chargeId: string,
id: string,
params?: RefundRetrieveParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Refund>>;
retrieve(
chargeId: string,
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Refund>>;

/**
* Retrieves the details of an existing refund.
*/
Expand All @@ -221,16 +192,6 @@ declare module 'stripe' {
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Refund>>;

/**
* You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds.
*/
list(
id: string,
params?: RefundListParams,
options?: RequestOptions
): ApiListPromise<Stripe.Refund>;
list(id: string, options?: RequestOptions): ApiListPromise<Stripe.Refund>;

/**
* Returns a list of all refunds you've previously created. The refunds are returned in sorted order, with the most recent refunds appearing first. For convenience, the 10 most recent refunds are always available by default on the charge object.
*/
Expand Down