import type { Duration, ClocksState, RelativeTime, TimeStamp, ValueHistory } from '@openobserve/browser-core'; import { Observable } from '@openobserve/browser-core'; import type { FrustrationType } from '../../rawRumEvent.types'; import { ActionType } from '../../rawRumEvent.types'; import type { LifeCycle } from '../lifeCycle'; import type { RumConfiguration } from '../configuration'; import type { RumMutationRecord } from '../../browser/domMutationObservable'; import type { ActionNameSource } from './actionNameConstants'; import type { MouseEventOnElement, UserActivity } from './listenActionEvents'; interface ActionCounts { errorCount: number; longTaskCount: number; resourceCount: number; } export interface ClickAction { type: typeof ActionType.CLICK; id: string; name: string; nameSource: ActionNameSource; target?: { selector: string | undefined; width: number; height: number; }; position?: { x: number; y: number; }; startClocks: ClocksState; duration?: Duration; counts: ActionCounts; event: MouseEventOnElement; frustrationTypes: FrustrationType[]; events: Event[]; } export interface ActionContexts { findActionId: (startTime?: RelativeTime) => string | string[] | undefined; } type ClickActionIdHistory = ValueHistory; export declare const ACTION_CONTEXT_TIME_OUT_DELAY: number; export declare function trackClickActions(lifeCycle: LifeCycle, domMutationObservable: Observable, windowOpenObservable: Observable, configuration: RumConfiguration): { stop: () => void; actionContexts: ActionContexts; }; type ClickActionBase = Pick; export type Click = ReturnType; declare function newClick(lifeCycle: LifeCycle, history: ClickActionIdHistory, getUserActivity: () => UserActivity, clickActionBase: ClickActionBase, startEvent: MouseEventOnElement): { event: MouseEventOnElement; stop: (newActivityEndTime?: TimeStamp) => void; stopObservable: Observable; readonly hasError: boolean; readonly hasPageActivity: boolean; getUserActivity: () => UserActivity; addFrustration: (frustrationType: FrustrationType) => void; startClocks: { relative: RelativeTime; timeStamp: TimeStamp; }; isStopped: () => boolean; clone: () => { event: MouseEventOnElement; stop: (newActivityEndTime?: TimeStamp) => void; stopObservable: Observable; readonly hasError: boolean; readonly hasPageActivity: boolean; getUserActivity: () => UserActivity; addFrustration: (frustrationType: FrustrationType) => void; startClocks: { relative: RelativeTime; timeStamp: TimeStamp; }; isStopped: () => boolean; clone: /*elided*/ any; validate: (domEvents?: Event[]) => void; discard: () => void; }; validate: (domEvents?: Event[]) => void; discard: () => void; }; export declare function finalizeClicks(clicks: Click[], rageClick: Click): void; export {};