/** * Calls `globalThis.fetch` and determines which type of error to show for non-200 responses. */ export declare function fetch(...args: Parameters): Promise; /** * Calls `globalThis.fetch` and throws a `FetchError` on non-200 responses, but also * decodes the response body as JSON, casting it to type `T`. Returns the * decoded body. */ export declare function fetchJson(...args: Parameters): Promise; export interface StatusError extends Error { status: number; } /** * Error thrown when fetch returns a non-200 response. */ export declare class FetchError extends Error implements StatusError { status: number; constructor(response: Readonly); } /** * General error type for an error that has a message that is OK to show to the end user. */ export declare class UserFriendlyError extends Error implements StatusError { status: number; constructor(message: string, status: number); } //# sourceMappingURL=fetch.d.ts.map