export type APIRequestOptions = { url: string; /** GET when nothing says otherwise. */ method?: "GET" | "POST" | "PATCH" | "DELETE"; /** Sent as JSON. A route that takes no body is called without one. */ body?: unknown; /** What the caller was trying to do, for the message a failure carries. */ action: string; }; /** * One call to a JSON route, with the failure turned into a `ButlerBotAPIError`. * * The body is read as text once and parsed here rather than through `response.json()`, because * a failing route's body has to be readable both as the parsed `error`/`errormessage` and as * whatever else it carries — the job on a rejected cancel, the delivery on a rejected answer — * and a response body can only be consumed once. */ export declare function requestAPI(options: APIRequestOptions): Promise;