import type { HttpMethod } from '@scalar/helpers/http/http-methods';
import { type ClientPlugin } from '@scalar/oas-utils/helpers';
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
import { type ErrorResponse } from '../../../../libs/errors.js';
/** A single set of populated values for a sent request */
export type ResponseInstance = Omit<Response, 'headers'> & {
    /** Store headers as an object to match what we had with axios */
    headers: Record<string, string>;
    /** Keys of headers which set cookies */
    cookieHeaderKeys: string[];
    /** Time in ms the request took */
    duration: number;
    /** The response status */
    status: number;
    /** The response status text */
    statusText: string;
    /** The response method */
    method: HttpMethod;
    /** The request path */
    path: string;
} & ({
    /** The response data */
    data: string | Blob;
    /** The response size in bytes */
    size: number;
} | {
    /** A stream reader for a streamable response body */
    reader: ReadableStreamDefaultReader<Uint8Array>;
});
/**
 * Execute the built fetch request and return a structured response.
 *
 * This function handles the complete request lifecycle including plugin hooks,
 * response processing, streaming detection, and error handling. It supports both
 * standard responses and server-sent event streams.
 *
 * @param request - The request built by the buildRequest helper
 * @param operation - The OpenAPI operation being executed
 * @param plugins - Array of client plugins to execute hooks
 * @param isUsingProxy - Whether the request is being proxied for header handling
 * @returns A tuple with either an error or the response data
 */
export declare const sendRequest: ({ isUsingProxy, operation, request, plugins, }: {
    isUsingProxy: boolean;
    operation: OperationObject;
    plugins: ClientPlugin[];
    request: Request;
}) => Promise<ErrorResponse<{
    response: ResponseInstance;
    request: Request;
    timestamp: number;
    originalResponse: Response;
}>>;
//# sourceMappingURL=send-request.d.ts.map