import { URL } from 'node:url'; import type { Segment, Subsegment } from 'aws-xray-sdk-core'; import type { DiagnosticsChannel } from 'undici-types'; import type { IncomingHttpHeaders } from 'undici-types/header.js'; import type { HttpSubsegment } from '../types/ProviderService.js'; /** * Finds the header with the given key and return its value as a string. * * Over HTTP/1, `undici` publishes the headers as a flat array of encoded key-value pairs; * over HTTP/2 it publishes them as an object with lowercase keys. * * @param headers The response headers published by `undici` * @param key The lowercase key to search for */ declare const findHeaderAndDecode: (headers: Uint8Array[] | IncomingHttpHeaders, key: string) => string | null; /** * Type guard to check if the given subsegment is an `HttpSubsegment` * * @param subsegment The subsegment to check */ declare const isHttpSubsegment: (subsegment: Segment | Subsegment | undefined) => subsegment is HttpSubsegment; /** * Convert the origin url to a URL object when it is a string and append the path if provided * * @param origin The request object containing the origin url and path */ declare const getRequestURL: (request: DiagnosticsChannel.Request) => URL | undefined; export { findHeaderAndDecode, getRequestURL, isHttpSubsegment }; //# sourceMappingURL=utilities.d.ts.map