import { Hook } from '../hooks/hook.js'; import { Request } from '../transport/request.js'; import { HttpResponse, RequestHandler } from '../types.js'; /** * Request handler that invokes custom hooks before requests and after responses. * Enables request/response interception and custom error handling. */ export declare class HookHandler implements RequestHandler { private readonly hook; /** Next handler in the chain */ next?: RequestHandler; constructor(hook: Hook); /** * Handles a standard HTTP request with hook invocation. * Calls beforeRequest hook, processes the request, and calls afterResponse or onError hooks. * @template T - The expected response data type * @param request - The HTTP request to process * @returns A promise that resolves to the HTTP response * @throws Error if no next handler is set, or if error handling fails */ handle(request: Request): Promise>; /** * Handles a streaming HTTP request with hook invocation. * Calls beforeRequest hook and afterResponse/onError hooks for each chunk. * @template T - The expected response data type for each chunk * @param request - The HTTP request to process * @returns An async generator that yields HTTP responses * @throws Error if no next handler is set, or if error handling fails */ stream(request: Request): AsyncGenerator>; /** * Extracts hook parameters from the request configuration. * @template T - The response data type * @param request - The HTTP request * @returns A map of hook parameter names to values */ private getHookParams; } //# sourceMappingURL=hook-handler.d.ts.map