/**
 * HTTP Client for Management Operations
 *
 * Provides typed HTTP client for SDK management endpoints.
 */
import type { ManagementClientConfig, ApiResponse } from './types';
export interface ManagementApiErrorRequest {
    method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
    /** Request path relative to the management API base URL (e.g. "/entries/post") */
    path: string;
    /** Full URL requested */
    url: string;
    /** Base URL for management API requests (e.g. "https://dashboard/.../api/sdk/<siteId>") */
    baseUrl: string;
    /** Dashboard origin (e.g. "https://dashboard.riverbankcms.com") */
    dashboardUrl: string;
    /** Site ID used for the request */
    siteId: string;
}
/**
 * Error thrown when management API request fails
 */
export declare class ManagementApiError extends Error {
    readonly code: string;
    readonly details?: unknown;
    readonly statusCode?: number;
    readonly request?: ManagementApiErrorRequest;
    constructor(message: string, code: string, details?: unknown, statusCode?: number, request?: ManagementApiErrorRequest);
}
/**
 * Type guard to check if an error is a 404 Not Found response.
 * Use this to handle "resource not found" scenarios gracefully.
 *
 * @example
 * ```ts
 * try {
 *   return await http.get<Entry>(`/entries/${type}/${id}`);
 * } catch (error) {
 *   if (is404Error(error)) {
 *     return null;
 *   }
 *   throw error;
 * }
 * ```
 */
export declare function is404Error(error: unknown): error is ManagementApiError;
/**
 * HTTP client interface for management operations
 */
export interface HttpClient {
    get<T>(path: string, params?: Record<string, string>): Promise<T>;
    post<T>(path: string, body?: unknown): Promise<T>;
    patch<T>(path: string, body?: unknown): Promise<T>;
    delete(path: string, body?: unknown): Promise<void>;
}
export declare function buildRequestInfo(options: {
    method: ManagementApiErrorRequest['method'];
    path: string;
    url: string;
    baseUrl: string;
    dashboardUrl: string;
    siteId: string;
}): ManagementApiErrorRequest;
export declare function readApiResponse<T>(response: Response, requestInfo: ManagementApiErrorRequest, options?: {
    allowNonJsonOk?: false;
}): Promise<ApiResponse<T>>;
export declare function readApiResponse<T>(response: Response, requestInfo: ManagementApiErrorRequest, options: {
    allowNonJsonOk: true;
}): Promise<ApiResponse<T> | undefined>;
/**
 * Create HTTP client for management API
 */
export declare function createHttpClient(config: ManagementClientConfig): HttpClient;
