///
import { IncomingMessage, ServerResponse } from 'http';
import { Segment } from './types.js';
export declare class ReqResInfo {
private xrayHttp;
segment: Partial;
constructor(xrayHttp: XRayHttp, req: IncomingMessage);
init(req: IncomingMessage): void;
getClientIp(req: IncomingMessage): string | undefined;
/**
* Closes the local and automatically captures the response data.
* @param res - The response object from the HTTP/HTTPS call.
*/
close(res: ServerResponse): void;
}
export declare class XRayHttp {
/**
* Splits out the data from the trace id format. Used by the middleware.
* @param {String} traceData - The additional trace data (typically in
* req.headers.x-amzn-trace-id).
*/
processTraceData(traceData?: string | string[]): Record;
/**
* Splits out the 'x-amzn-trace-id' header params from the incoming request.
* @param {http.IncomingMessage|https.IncomingMessage} req - The request
* object from the incoming call.
*/
getTraceData(req: IncomingMessage): Record;
/**
* Traces the request/response cycle of an http IncomingMessage/ServerResponse
* pair. Creates a segment, adds the core request / response data adding
* throttling / error / fault flags based on the response status code.
* @param req - The incoming request.
* @param res - The server response.
*/
traceRequest(req: IncomingMessage): ReqResInfo;
traceResponse(reqResInfo: ReqResInfo, res: ServerResponse): ReqResInfo;
}