import { HttpBodyCaptureConfig } from "./types.mjs"; import { Span } from "@opentelemetry/api"; import { ClientRequest, IncomingMessage, ServerResponse } from "node:http"; //#region src/http/body/capture.d.ts type HttpRequestHook = (span: Span, request: ClientRequest | IncomingMessage | object) => void; type HttpResponseHook = (span: Span, response: IncomingMessage | ServerResponse | object) => void; /** * Shared entry point for HTTP body capture across Node agents. */ declare class HttpBodyCapture { #private; constructor(config?: false | HttpBodyCaptureConfig); /** * Builds the request hook consumed by the HTTP instrumentation. */ createRequestHook(): HttpRequestHook | undefined; /** * Preserves the old request-hook entry point while delegating to the shared hook. */ createIncomingRequestHook(): HttpRequestHook | undefined; /** * Builds the response hook consumed by the HTTP instrumentation. */ createResponseHook(): HttpResponseHook | undefined; /** * Flushes any deferred writable captures right before the HTTP instrumentation closes the span. */ applyCustomAttributesOnSpan(options: { request: ClientRequest | IncomingMessage; response: IncomingMessage | ServerResponse; span: Span; }): void; } //#endregion export { HttpBodyCapture };