import { Http, Subsegment, XRayTraceEvent } from '../../events/xray-trace-event'; export declare const byteToHex: string[]; export declare const X_AMZN_TRACE_ID = "X-Amzn-Trace-Id"; export declare const W3C_TRACEPARENT_HEADER_NAME = "traceparent"; export declare const TRACEPARENT_VERSION_LENGTH = 2; export declare const TRACEPARENT_TRACE_ID_LENGTH = 32; export declare const TRACEPARENT_PARENT_ID_LENGTH = 16; export declare const TRACEPARENT_NUMBER_OF_FIELDS = 4; export type HttpPluginConfig = { logicalServiceName: string; urlsToInclude: RegExp[]; urlsToExclude: RegExp[]; stackTraceLength: number; recordAllRequests: boolean; addXRayTraceIdHeader: boolean | RegExp[]; }; export declare const isTraceIdHeaderEnabled: (url: string, addXrayTraceIdHeader: boolean | RegExp[]) => boolean; export type TraceHeader = { traceId?: string; segmentId?: string; }; export declare const defaultConfig: HttpPluginConfig; export declare const is2xx: (status: number) => boolean; export declare const is4xx: (status: number) => boolean; export declare const is5xx: (status: number) => boolean; export declare const is429: (status: number) => boolean; export declare const isUrlAllowed: (url: string, config: HttpPluginConfig) => boolean; /** * Returns the current time, in floating point seconds in epoch time, accurate to milliseconds. */ export declare const epochTime: () => number; export declare const createXRayTraceEventHttp: (input: RequestInfo | URL | string, init: RequestInit | undefined, traced: boolean) => Http; export declare const createXRayTraceEvent: (name: string, startTime: number, w3cTraceId: boolean, http?: Http) => XRayTraceEvent; export declare const createXRaySubsegment: (name: string, startTime: number, http?: Http) => Subsegment; export declare const requestInfoToHostname: (request: Request | URL | string) => string; export declare const addAmznTraceIdHeaderToInit: (init: RequestInit, traceId: string, segmentId: string, w3cTraceIdEnabled: boolean) => void; export declare const addAmznTraceIdHeaderToHeaders: (headers: Headers, traceId: string, segmentId: string, w3cTraceIdEnabled: boolean) => void; export declare const getAmznTraceIdHeaderValue: (traceId: string, segmentId: string) => string; export declare const getW3CTraceIdHeaderValue: (traceId: string, segmentId: string) => string; /** * Check if the header is a valid w3c traceparent header. * * See https://www.w3.org/TR/trace-context/#traceparent-header-field-values * * @returns true if the header is a valid w3c traceparent header */ export declare const isValidW3CHeader: (headerComponents: string[]) => boolean; export declare const getTraceHeader: (headers: Headers, w3cTraceIdEnabled: boolean) => TraceHeader; /** * Extracts an URL string from the fetch resource parameter. */ export declare const resourceToUrlString: (resource: Request | URL | string) => string;