Skip to content

Commit

Permalink
Remove BASIC_METHODS from TS definitions (#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe committed Dec 5, 2022
1 parent 247c35e commit dae38f9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 28 deletions.
1 change: 0 additions & 1 deletion src/Types.d.ts
Expand Up @@ -193,7 +193,6 @@ type StripeResourceObject = {
basePath: UrlInterpolator;
path: UrlInterpolator;
resourcePath: string;
includeBasic?: Array<string>;
createResourcePathWithSymbols: (path: string | null | undefined) => string;
createFullPath: (
interpolator: UrlInterpolator,
Expand Down
27 changes: 1 addition & 26 deletions types/lib.d.ts
Expand Up @@ -15,11 +15,7 @@ declare module 'stripe' {
export class StripeResource {
static extend<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
T extends {[prop: string]: any} & {
includeBasic?: Array<
'create' | 'retrieve' | 'update' | 'list' | 'del'
>;
}
T extends {[prop: string]: any}
>(spec: T): StripeResourceExtension<T>;
static method<ResponseObject = object>(spec: {
method: string;
Expand All @@ -29,27 +25,6 @@ declare module 'stripe' {
// change/removal at any time.
methodType?: 'list' | 'search';
}): (...args: any[]) => Response<ResponseObject>; //eslint-disable-line @typescript-eslint/no-explicit-any
static BASIC_METHODS: {
create<T>(
params: CouponCreateParams,
options?: RequestOptions
): Promise<T>;
retrieve<T>(
id: string,
params?: CouponRetrieveParams,
options?: RequestOptions
): Promise<T>;
update<T>(
id: string,
params?: CouponUpdateParams,
options?: RequestOptions
): Promise<T>;
list<T>(
params?: CouponListParams,
options?: RequestOptions
): ApiListPromise<T>;
del<T>(id: string, options?: RequestOptions): Promise<T>;
};
static MAX_BUFFERED_REQUEST_METRICS: number;
}
export type LatestApiVersion = '2022-11-15';
Expand Down
1 change: 0 additions & 1 deletion types/test/typescriptTest.ts
Expand Up @@ -170,7 +170,6 @@ stripe = new Stripe('sk_test_123', {
})();

const Foo = Stripe.StripeResource.extend({
includeBasic: ['retrieve'],
foo: Stripe.StripeResource.method({
method: 'create',
path: 'foo',
Expand Down

0 comments on commit dae38f9

Please sign in to comment.