import type { Csp, Duration, ErrorHandling, ErrorSource, RawErrorCause, ResourceType, ServerDuration, TimeStamp } from '@octopus-sdk/browser-core'; import type { PageState } from './domain/contexts/pageStateHistory'; interface Count { count: number; } export declare const enum RumEventType { VIEW = "view", ERROR = "error", ACTION = "action", RESOURCE = "resource" } export interface RawRumResourceEvent { timestamp: TimeStamp; type: RumEventType.RESOURCE; resource: { type: ResourceType; id: string; duration?: ServerDuration; url: string; method?: string; status_code?: number; size?: number; encoded_body_size?: number; decoded_body_size?: number; transfer_size?: number; render_blocking_status?: string; redirect?: PerformanceResourceDetailsElement; dns?: PerformanceResourceDetailsElement; connect?: PerformanceResourceDetailsElement; ssl?: PerformanceResourceDetailsElement; first_byte?: PerformanceResourceDetailsElement; download?: PerformanceResourceDetailsElement; }; _oc: { trace_id?: string; span_id?: string; discarded: boolean; page_states?: PageStateServerEntry[]; }; } export interface PerformanceResourceDetailsElement { duration: ServerDuration; start: ServerDuration; } export interface ResourceEntryDetailsElement { duration: ServerDuration; start: ServerDuration; } export type RawRumEvent = RawRumErrorEvent | RawRumActionEvent | RawRumViewEvent | RawRumResourceEvent; export declare const enum ActionType { CLICK = "click", CUSTOM = "custom" } export interface RawRumActionEvent { timestamp: TimeStamp; type: RumEventType.ACTION; action: { id: string | string[]; type: ActionType; loading_time?: ServerDuration; error?: Count; long_task?: Count; resource?: Count; target: { name: string; }; }; view?: { in_foreground: boolean; }; _oc?: { action?: { target?: { selector?: string; width?: number; height?: number; }; position?: { x: number; y: number; }; pointer_up_delay?: Duration; }; }; } export interface RawRumErrorEvent { timestamp: TimeStamp; type: RumEventType.ERROR; error: { id: string; type?: string; stack?: string; handling_stack?: string; fingerprint?: string; source: ErrorSource; message: string; handling?: ErrorHandling; causes?: RawErrorCause[]; source_type: 'browser'; csp?: Csp; }; view?: { in_foreground: boolean; }; } export declare const enum ViewLoadingType { INITIAL_LOAD = "initial_load", ROUTE_CHANGE = "route_change" } export interface ViewCustomTimings { [key: string]: Duration; } export interface RawRumViewEvent { timestamp: TimeStamp; type: RumEventType.VIEW; view: { loading_type: ViewLoadingType; time_spent: ServerDuration; is_active: boolean; name?: string; action: Count; error: Count; resource: Count; load_event?: ServerDuration; loading_time?: ServerDuration; first_byte?: ServerDuration; first_contentful_paint?: ServerDuration; first_input_delay?: ServerDuration; first_input_time?: ServerDuration; first_input_target_selector?: string; interaction_to_next_paint?: ServerDuration; interaction_to_next_paint_time?: ServerDuration; interaction_to_next_paint_target_selector?: string; cumulative_layout_shift?: number; cumulative_layout_shift_time?: ServerDuration; cumulative_layout_shift_target_selector?: string; largest_contentful_paint?: ServerDuration; largest_contentful_paint_target_selector?: string; dom_interactive?: ServerDuration; dom_content_loaded?: ServerDuration; dom_complete?: ServerDuration; }; _oc: { document_version: number; page_states?: PageStateServerEntry[]; }; } export type PageStateServerEntry = { state: PageState; start: ServerDuration; }; export {};