import type { ClocksState, Duration, FetchResolveContext, FetchStartContext, XhrCompleteContext, XhrStartContext } from '@octopus-sdk/browser-core'; import { RequestType } from '@octopus-sdk/browser-core'; import type { RumConfiguration } from './configuration/configuration'; import type { LifeCycle } from './lifeCycle'; import type { RumSessionManager } from './rumSessionManager'; import type { TraceIdentifier, Tracer } from './tracing/tracer'; import type { PropagatorType } from './tracing/tracer.type'; export interface CustomContext { requestIndex: number; segmentId?: TraceIdentifier; traceId?: TraceIdentifier; tracePropagatorTypes?: PropagatorType[]; } export interface RumFetchStartContext extends FetchStartContext, CustomContext { } export interface RumFetchResolveContext extends FetchResolveContext, CustomContext { } export interface RumXhrStartContext extends XhrStartContext, CustomContext { } export interface RumXhrCompleteContext extends XhrCompleteContext, CustomContext { } export interface RequestStartEvent { requestIndex: number; url: string; requestBody: Document | Request | BodyInit | null | undefined; requestHeaders: Record | Headers | undefined; } export interface RequestCompleteEvent { requestIndex: number; type: RequestType; method: string; url: string; status: number; responseType?: string; startClocks: ClocksState; duration: Duration; segmentId?: TraceIdentifier; traceId?: TraceIdentifier; tracePropagatorTypes: PropagatorType[] | undefined; xhr?: XMLHttpRequest; response?: Response; input?: unknown; init?: RequestInit; error?: Error; isAborted: boolean; handlingStack?: string; requestBody: Document | Request | BodyInit | null | undefined; requestHeaders: HeadersInit | undefined; } export declare function startRequestCollection(lifeCycle: LifeCycle, configuration: RumConfiguration, sessionManager: RumSessionManager): void; export declare function trackXhr(lifeCycle: LifeCycle, configuration: RumConfiguration, tracer: Tracer): { stop: () => void; }; export declare function trackFetch(lifeCycle: LifeCycle, configuration: RumConfiguration, tracer: Tracer): { stop: () => void; };