/** A failure the explorer describes itself, so its message is already in the reader's words. */ export declare class ShownError extends Error { constructor(message: string); } /** The host's words for an error, such as a localized message for an API error's code. */ export type ErrorMessage = (error: unknown) => string | undefined; export declare const ErrorMessageContext: import("react").Context; /** What went wrong: why, in the reader's words when that is known, and the error's own text. */ export interface Failure { /** The explorer's or the host's sentence, or the storage service's refusal by its code. */ reason?: string | undefined; /** The error's own text, from a storage service or the browser, shown as technical detail. */ detail?: string | undefined; } export type CloudErrorKind = 'accessDenied' | 'notFound' | 'credentials' | 'throttled' | 'network'; /** * Why a storage service refused, from its SDK error's code or HTTP status, never from its * message: S3's `name` and `$metadata.httpStatusCode`, Azure's `RestError` `code` and * `statusCode`, an axios error's `response.status`, and a fetch that never got a response. * Undefined for anything else, such as an API error, which the host words. */ export declare function cloudErrorKind(error: unknown): CloudErrorKind | undefined; /** * Returns what to show for an error. The reason is the explorer's own message, the storage * service's refusal named by its code, or the host's `errorMessage`, such as an API error's * localized message. The error's own text stays as detail unless the host has worded it, so * nothing the error said is lost; a place shows its own sentence when there is no reason. */ export declare function useErrorText(): (error: unknown) => Failure; /** A failure's sentence, then the error's own text as technical detail with a copy button. */ export declare function FailureText({ summary, failure, className, }: { /** The place's sentence, such as "Failed to generate download link", over the reason. */ summary?: string | undefined; failure: Failure; className?: string | undefined; }): import("react").JSX.Element; /** A place's sentence around the reason, such as "Failed to delete item(s): …", then the * error's own text. Without a reason, the storage service's generic one fills the sentence. */ export declare function FailureLine({ failure, sentence, }: { failure: Failure; sentence: (reason: string) => string; }): import("react").JSX.Element; /** The error's own text: muted, monospace and wrapped, with a button that copies it. */ export declare function FailureDetail({ detail }: { detail: string; }): import("react").JSX.Element;