import type { Middleware } from 'openapi-fetch';
/**
 * Recursively strips sensitive fields from an object to prevent token leakage in error contexts.
 * Returns a shallow copy with sensitive keys replaced by '[REDACTED]'.
 */
export declare function sanitizeErrorContext(obj: unknown): unknown;
/**
 * Base error class for all Amigo SDK errors.
 * Provides common functionality and error identification.
 */
export declare class AmigoError extends Error {
    /** Unique error code for programmatic error handling */
    readonly errorCode?: string;
    /** HTTP status code if applicable */
    readonly statusCode?: number;
    /** Additional context data */
    readonly context?: Record<string, unknown>;
    constructor(message: string, options?: {
        statusCode?: number;
        errorCode?: string;
        context?: Record<string, unknown>;
    });
    /**
     * Returns a JSON-serializable representation of the error.
     * Sensitive fields (tokens, keys) are redacted to prevent leakage.
     */
    toJSON(): Record<string, unknown>;
}
export declare class BadRequestError extends AmigoError {
}
export declare class AuthenticationError extends AmigoError {
}
export declare class PermissionError extends AmigoError {
}
export declare class NotFoundError extends AmigoError {
}
export declare class ConflictError extends AmigoError {
}
export declare class RateLimitError extends AmigoError {
}
export declare class ServerError extends AmigoError {
}
export declare class ServiceUnavailableError extends ServerError {
}
export declare class ConfigurationError extends AmigoError {
    readonly field?: string | undefined;
    constructor(message: string, field?: string | undefined);
}
export declare class ValidationError extends BadRequestError {
    fieldErrors?: Record<string, string> | undefined;
    constructor(msg: string, fieldErrors?: Record<string, string> | undefined);
}
export declare class NetworkError extends AmigoError {
    readonly originalError?: Error | undefined;
    readonly request?: {
        url?: string;
        method?: string;
    } | undefined;
    constructor(message: string, originalError?: Error | undefined, request?: {
        url?: string;
        method?: string;
    } | undefined);
}
export declare class ParseError extends AmigoError {
    readonly parseType: 'json' | 'response' | 'other';
    readonly originalError?: Error | undefined;
    constructor(message: string, parseType: 'json' | 'response' | 'other', originalError?: Error | undefined);
}
export declare function isAmigoError(error: unknown): error is AmigoError;
export declare function createApiError(response: Response, body?: unknown): AmigoError;
export declare function createErrorMiddleware(): Middleware;
