import { type StaticHandler, type unstable_DataStrategyFunction as DataStrategyFunction, type StaticHandlerContext } from "../router";
import { type SingleFetchRedirectResult, type SingleFetchResult, type SingleFetchResults, SingleFetchRedirectSymbol } from "../dom/ssr/single-fetch";
import type { AppLoadContext } from "./data";
import { ServerMode } from "./mode";
export type { SingleFetchResult, SingleFetchResults };
export { SingleFetchRedirectSymbol };
export type DataStrategyCtx = {
    response: ResponseStub;
};
export declare const ResponseStubOperationsSymbol: unique symbol;
export type ResponseStubOperation = [
    "set" | "append" | "delete",
    string,
    string?
];
/**
 * A stubbed response to let you set the status/headers of your response from
 * loader/action functions
 */
export type ResponseStub = {
    status: number | undefined;
    headers: Headers;
};
export type ResponseStubImpl = ResponseStub & {
    [ResponseStubOperationsSymbol]: ResponseStubOperation[];
};
export declare function getSingleFetchDataStrategy(responseStubs: ReturnType<typeof getResponseStubs>, { isActionDataRequest, loadRouteIds, }?: {
    isActionDataRequest?: boolean;
    loadRouteIds?: string[];
}): DataStrategyFunction;
export declare function getSingleFetchResourceRouteDataStrategy({ responseStubs, }: {
    responseStubs: ReturnType<typeof getResponseStubs>;
}): DataStrategyFunction;
export declare function singleFetchAction(serverMode: ServerMode, staticHandler: StaticHandler, request: Request, handlerUrl: URL, loadContext: AppLoadContext, handleError: (err: unknown) => void): Promise<{
    result: SingleFetchResult;
    headers: Headers;
    status: number;
}>;
export declare function singleFetchLoaders(serverMode: ServerMode, staticHandler: StaticHandler, request: Request, handlerUrl: URL, loadContext: AppLoadContext, handleError: (err: unknown) => void): Promise<{
    result: SingleFetchResults;
    headers: Headers;
    status: number;
}>;
export declare function isResponseStub(value: any): value is ResponseStubImpl;
export declare function getResponseStubs(): Record<string | symbol, ResponseStubImpl>;
export declare function mergeResponseStubs(context: StaticHandlerContext, responseStubs: ReturnType<typeof getResponseStubs>, { isActionDataRequest }?: {
    isActionDataRequest?: boolean;
}): {
    statusCode: number;
    headers: Headers;
};
export declare function getSingleFetchRedirect(status: number, headers: Headers): SingleFetchRedirectResult;
export declare function encodeViaTurboStream(data: any, requestSignal: AbortSignal, streamTimeout: number | undefined, serverMode: ServerMode): ReadableStream<Uint8Array>;
