import { JsonObj } from "../../utils"; export type HttpMethod = 'DELETE' | 'GET' | 'POST' | 'PUT'; /** * Api Dependency */ export interface Api { /** * make a request * return an ApiResponse on any 2xx status * throw ApiError otherwise * * @param httpMethod * @param url * @param urlParameters * @param httpHeaders * @param body */ request(httpMethod: HttpMethod, url: string, urlParameters?: Map, httpHeaders?: Map, body?: string | Record): Promise>; } export declare class ApiRequest { readonly url: URL; readonly headers: Headers; readonly params: URLSearchParams; method: HttpMethod; body?: string | JsonObj; constructor(url: URL); } export declare class ApiResponse { readonly body: T; readonly status: number; readonly statusText: string; readonly headers: Headers; constructor(body: T, status: number, statusText?: string, headersInit?: Record); get httpStatus(): number; } export declare class ApiError extends Error { readonly status: number; readonly statusText: string; readonly body: any; constructor(status: number, statusText: string, body: any); }