import { type CapturedTrace, type CapturedTransaction, type HttpParticipantRole } from '@thymian/core'; type HeaderValue = string | string[] | undefined; export type ForwardingHop = { /** * Transaction on the user-agent side of the forwarding participant * (`trace[i - 1]`): its request is the message the participant received, * its response is the message the participant sent back downstream. */ inbound: CapturedTransaction; /** * Transaction on the origin side of the forwarding participant * (`trace[i]`): its request is the message the participant forwarded * onward, its response is the message it received from upstream. */ outbound: CapturedTransaction; }; /** * Pairs adjacent transactions of a captured trace into forwarding hops. * * Captured traces are ordered root-first (see `sortTraceTransactions` in * plugin-http-analyzer): `trace[0]` is the transaction observed at the edge, * closest to the user agent, and each later entry is the onward transaction * produced by the forwarding participant between it and its predecessor. * Because `meta.role` names the participant that produced a message, that * middle participant is identified by `outbound.request.meta.role` (it sent * the onward request) or `inbound.response.meta.role` (it sent the downstream * response). * * Only hops whose middle participant matches one of the given roles are * returned; umbrella roles are expanded, so the default `['intermediary']` * also matches concrete `proxy`, `gateway` and `tunnel` stamps. Traces with * fewer than two transactions (e.g. single-transaction HAR imports) yield no * hops. */ export declare function forwardingHops(trace: CapturedTrace, roles?: readonly HttpParticipantRole[]): ForwardingHop[]; export declare function headerValues(value: HeaderValue): string[]; /** * Splits a comma-separated header value on top-level commas only, ignoring * commas inside parenthesised comments. Via entries may carry `(...)` comments * that themselves contain commas, so a naive `split(',')` would corrupt the * received-by tokens. Nested comments and quoted-pairs (`\)`) are handled. */ export declare function splitTopLevelCommas(value: string): string[]; export declare function equalHeaderValues(a: HeaderValue, b: HeaderValue): boolean; export declare function connectionOptionNames(value: HeaderValue): string[]; export declare function parseMaxForwards(value: HeaderValue): number | undefined; export {}; //# sourceMappingURL=forwarding.d.ts.map