import type { ClocksState, Duration, RelativeTime, ValueHistoryEntry } from '@datadog/browser-core'; import type { RumActionEvent, RumErrorEvent, RumLongTaskEvent, RumResourceEvent } from '../rumEvent.types'; import type { LifeCycle } from './lifeCycle'; import type { EventCounts } from './trackEventCounts'; import { trackEventCounts } from './trackEventCounts'; export declare const EVENT_CONTEXT_TIME_OUT_DELAY: number; type BaseTrackedEvent = TData & { id: string; startClocks: ClocksState; counts?: EventCounts; }; export type StoppedEvent = BaseTrackedEvent & { duration: Duration; }; export type DiscardedEvent = BaseTrackedEvent; export interface StartOptions { isChildEvent?: (id: string) => (event: RumActionEvent | RumErrorEvent | RumLongTaskEvent | RumResourceEvent) => boolean; } export interface EventTracker { start: (key: string, startClocks: ClocksState, data: TData, options?: StartOptions) => TrackedEventData; stop: (key: string, stopClocks: ClocksState, data?: Partial) => StoppedEvent | undefined; discard: (key: string) => DiscardedEvent | undefined; getCounts: (key: string) => EventCounts | undefined; findId: (startTime?: RelativeTime) => string[]; stopAll: () => void; } export interface TrackedEventData { id: string; key: string; startClocks: ClocksState; data: TData; historyEntry: ValueHistoryEntry; eventCounts?: ReturnType; } export declare function startEventTracker(lifeCycle: LifeCycle): EventTracker; export {};