20 lines
717 B
TypeScript
20 lines
717 B
TypeScript
import type { AuthMode, HttpMethod, JsonObject } from "./types.js";
|
|
export type QueryParamValue = string | number | boolean | readonly (string | number | boolean)[] | undefined;
|
|
export interface RequestOptions {
|
|
method?: HttpMethod;
|
|
query?: Record<string, QueryParamValue>;
|
|
body?: JsonObject;
|
|
}
|
|
export declare class HttpClient {
|
|
private baseUrl;
|
|
private auth;
|
|
constructor(baseUrl: string, auth: AuthMode);
|
|
getBaseUrl(): string;
|
|
setBaseUrl(baseUrl: string): void;
|
|
setAuth(auth: AuthMode): void;
|
|
getAuth(): AuthMode;
|
|
private authorizationHeader;
|
|
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
private executeOnce;
|
|
}
|
|
//# sourceMappingURL=http.d.ts.map
|