import { HttpError } from '../hooks/hook.js'; import { HttpResponse } from '../types.js'; import { Request } from './request.js'; /** * Adapter that bridges between the internal Request representation and the Hook interface. * Converts Request objects to HttpRequest format for hook processing, then converts * modified HttpRequest objects back to Request format. * * @template T - The expected response type */ export declare class TransportHookAdapter { private hook; /** * Invokes the custom hook before sending the request. * Converts the Request to HttpRequest format, calls the hook, then converts back. * * @param request - The internal Request object * @param params - Additional parameters to pass to the hook * @returns The modified Request after hook processing */ beforeRequest(request: Request, params: Map): Promise; /** * Invokes the custom hook after receiving a response. * Converts the Request to HttpRequest format and calls the hook with the response. * * @param request - The internal Request object * @param response - The HTTP response received * @param params - Additional parameters to pass to the hook * @returns The potentially modified response after hook processing */ afterResponse(request: Request, response: HttpResponse, params: Map): Promise>; /** * Invokes the custom hook when an error occurs. * Converts the Request to HttpRequest format and calls the error hook. * * @param request - The internal Request object * @param response - The HTTP response that triggered the error * @param params - Additional parameters to pass to the hook * @returns The HttpError from the hook */ onError(request: Request, response: HttpResponse, params: Map): Promise; /** * Converts the internal Request representation to the hook's HttpRequest format. * Extracts parameter values from RequestParameter wrappers. * * @param request - The internal Request object * @returns An HttpRequest object for hook processing */ private requestToHookRequest; /** * Converts hook parameter maps back to RequestParameter format. * Preserves serialization metadata from the original parameters. * * @template T - The parameter value type * @param hookParams - The parameter map from hook processing * @param originalTransportParams - The original RequestParameter map for metadata * @param encode - Whether to encode the parameters * @returns A map of RequestParameter objects for transport */ private hookParamsToTransportParams; } //# sourceMappingURL=transport-hook-adapter.d.ts.map