interface ServiceErrorOptions { type: "unauthorized" | "server-error" | "bad-request" | "anomaly"; message?: string; } interface ServiceErrorPayload extends ServiceErrorOptions { ___service_error___: true; } declare class ServiceError extends Error { static fromError(err: unknown): ServiceError; static fromPayload(payload: unknown): ServiceError | undefined; private options; constructor(options: ServiceErrorOptions); get type(): ServiceErrorOptions["type"]; get payload(): ServiceErrorPayload; } export default ServiceError;