/**
 * Error hierarchy for the Amigo Platform SDK.
 * All errors extend AmigoError which can be caught with a single catch.
 */
export interface ErrorContext {
    statusCode?: number;
    errorCode?: string;
    requestId?: string;
    detail?: string;
    context?: Record<string, unknown>;
}
/** Base class for all Amigo Platform SDK errors */
export declare class AmigoError extends Error {
    readonly statusCode?: number;
    readonly errorCode?: string;
    readonly requestId?: string;
    readonly detail?: string;
    readonly context?: Record<string, unknown>;
    constructor(message: string, ctx?: ErrorContext);
    toJSON(): Record<string, unknown>;
}
/** 400 Bad Request */
export declare class BadRequestError extends AmigoError {
    constructor(message: string, ctx?: ErrorContext);
}
/** 401 Unauthorized — invalid or missing API key */
export declare class AuthenticationError extends AmigoError {
    constructor(message: string, ctx?: ErrorContext);
}
/** 403 Forbidden — insufficient permissions */
export declare class PermissionError extends AmigoError {
    constructor(message: string, ctx?: ErrorContext);
}
/** 404 Not Found */
export declare class NotFoundError extends AmigoError {
    constructor(message: string, ctx?: ErrorContext);
}
/** 409 Conflict — duplicate slug or resource version conflict */
export declare class ConflictError extends AmigoError {
    constructor(message: string, ctx?: ErrorContext);
}
/** 422 Unprocessable Entity — validation failure */
export declare class ValidationError extends AmigoError {
    constructor(message: string, ctx?: ErrorContext);
}
/** 429 Too Many Requests */
export declare class RateLimitError extends AmigoError {
    readonly retryAfter?: number;
    constructor(message: string, ctx?: ErrorContext & {
        retryAfter?: number;
    });
}
/** 5xx Server Error */
export declare class ServerError extends AmigoError {
    constructor(message: string, ctx?: ErrorContext);
}
/** 503 Service Unavailable */
export declare class ServiceUnavailableError extends ServerError {
    constructor(message: string, ctx?: ErrorContext);
}
/** Network or fetch failure (no HTTP status available) */
export declare class NetworkError extends AmigoError {
    constructor(message: string, cause?: unknown);
}
/** Request timed out before receiving a response */
export declare class RequestTimeoutError extends NetworkError {
    readonly timeoutMs?: number;
    constructor(message: string, timeoutMs?: number, cause?: unknown);
}
/** Failed to parse response body */
export declare class ParseError extends AmigoError {
    readonly body?: string;
    constructor(message: string, body?: string);
}
/** SDK misconfiguration */
export declare class ConfigurationError extends AmigoError {
    constructor(message: string);
}
export declare function createApiError(response: Response): Promise<AmigoError>;
export declare function isAmigoError(err: unknown): err is AmigoError;
export declare function isNotFoundError(err: unknown): err is NotFoundError;
export declare function isRateLimitError(err: unknown): err is RateLimitError;
export declare function isAuthenticationError(err: unknown): err is AuthenticationError;
export declare function isRequestTimeoutError(err: unknown): err is RequestTimeoutError;
//# sourceMappingURL=errors.d.ts.map