import type { CloudflareApiErrorPayload } from "./api-response";
/**
 * Custom error class for Cloudflare API errors
 * Includes HTTP status information from the Response
 */
export declare class CloudflareApiError extends Error {
    /**
     * HTTP status code
     */
    status: number;
    /**
     * HTTP status text
     */
    statusText: string;
    /**
     * Raw error data from the API
     */
    errorData?: any;
    /**
     * Create a new CloudflareApiError
     */
    constructor(message: string, response: Response, errorData?: any);
}
/**
 * Helper function to handle API errors
 *
 * @param response The fetch Response object
 * @param action The action being performed (e.g., "creating", "deleting")
 * @param resourceType The type of resource being acted upon (e.g., "R2 bucket", "Worker")
 * @param resourceName The name/identifier of the specific resource
 * @returns Never returns - always throws an error
 */
export declare function handleApiError(response: Response, action: string, resourceType: string, resourceName?: string): Promise<never>;
/**
 * Helper function to check if an error is a Cloudflare API error.
 * Optional match criteria can be provided to check for a specific HTTP status code or error code.
 */
export declare function isCloudflareApiError(error: unknown, match?: {
    status?: number;
    code?: number;
}): error is CloudflareApiError & {
    errorData: CloudflareApiErrorPayload[];
};
//# sourceMappingURL=api-error.d.ts.map