UNPKG

@sumup/sdk

Version:

The official TypeScript SDK for the SumUp API

34 lines 1.95 kB
import * as Core from "./core"; export type APIConfig = { apiKey?: string; host?: string; baseParams?: Core.RequestOptions; maxRetries?: number; timeout?: number; }; export declare class HTTPClient { host: string; apiKey?: string; baseParams: Core.RequestOptions; constructor({ apiKey, host, baseParams, maxRetries, timeout, }?: APIConfig); get<R>({ ...params }: Omit<Core.FullRequestOptions, "method">): Promise<R>; getWithResponse<R>({ ...params }: Omit<Core.FullRequestOptions, "method">): Promise<Core.WithResponse<R>>; post<R>({ ...params }: Omit<Core.FullRequestOptions, "method">): Promise<R>; postWithResponse<R>({ ...params }: Omit<Core.FullRequestOptions, "method">): Promise<Core.WithResponse<R>>; put<R>({ ...params }: Omit<Core.FullRequestOptions, "method">): Promise<R>; putWithResponse<R>({ ...params }: Omit<Core.FullRequestOptions, "method">): Promise<Core.WithResponse<R>>; patch<R>({ ...params }: Omit<Core.FullRequestOptions, "method">): Promise<R>; patchWithResponse<R>({ ...params }: Omit<Core.FullRequestOptions, "method">): Promise<Core.WithResponse<R>>; delete<R>({ ...params }: Omit<Core.FullRequestOptions, "method">): Promise<R>; deleteWithResponse<R>({ ...params }: Omit<Core.FullRequestOptions, "method">): Promise<Core.WithResponse<R>>; request<T>({ ...params }: Core.FullRequestOptions): Promise<T>; requestWithResponse<T>({ body, path, query, host: hostOverride, ...requestOptions }: Core.FullRequestOptions): Promise<Core.WithResponse<T>>; protected do(input: URL, init: RequestInit, options: { maxRetries?: number; signal?: AbortSignal | null; timeout?: number; }): Promise<Response>; protected stringifyQuery(query: Record<string, unknown>): string; } export declare function mergeParams(a: Core.RequestOptions, b: Core.RequestOptions): Core.RequestOptions; //# sourceMappingURL=client.d.ts.map