@sumup/sdk
Version:
The official TypeScript SDK for the SumUp API
45 lines • 1.37 kB
TypeScript
import type { SumUp } from "./index";
export declare class APIResource {
protected _client: SumUp;
constructor(client: SumUp);
}
type QueryParams = Record<string, any>;
type HTTPMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
/**
* SDK-specific options that can be passed to any generated request method.
*/
export type RequestOptions = {
/**
* Optional bearer authorization value to apply to the request, for example
* `Bearer <access-token>`. When provided, it overrides any default
* Authorization header configured on the client.
*/
authorization?: string;
headers?: HeadersInit;
host?: string;
maxRetries?: number;
signal?: AbortSignal | null;
timeout?: number;
};
/** All arguments to `request()` */
export type FullRequestOptions = RequestOptions & {
path: string;
query?: QueryParams;
body?: unknown;
method?: HTTPMethod;
};
export declare class SumUpError extends Error {
}
export declare class APIError<T> extends SumUpError {
readonly status: number;
readonly error: T | string;
readonly response: Response;
constructor(status: number, error: T | string, response: Response);
}
export type WithResponse<T> = {
data: T;
response: Response;
};
export declare function parseResponse<T>(res: Response): Promise<T>;
export {};
//# sourceMappingURL=core.d.ts.map