import { ErrorMessage } from '@keitoaino/datadog-browser-core'; import { RequestCompleteEvent, RequestStartEvent } from './requestCollection'; import { AutoUserAction, CustomUserAction } from './userActionCollection'; import { View } from './viewCollection'; export declare enum LifeCycleEventType { ERROR_COLLECTED = 0, PERFORMANCE_ENTRY_COLLECTED = 1, CUSTOM_ACTION_COLLECTED = 2, AUTO_ACTION_CREATED = 3, AUTO_ACTION_COMPLETED = 4, AUTO_ACTION_DISCARDED = 5, VIEW_CREATED = 6, VIEW_UPDATED = 7, REQUEST_STARTED = 8, REQUEST_COMPLETED = 9, SESSION_RENEWED = 10, RESOURCE_ADDED_TO_BATCH = 11, DOM_MUTATED = 12, BEFORE_UNLOAD = 13 } export interface Subscription { unsubscribe(): void; } export declare class LifeCycle { private callbacks; notify(eventType: LifeCycleEventType.ERROR_COLLECTED, data: ErrorMessage): void; notify(eventType: LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, data: PerformanceEntry): void; notify(eventType: LifeCycleEventType.REQUEST_STARTED, data: RequestStartEvent): void; notify(eventType: LifeCycleEventType.REQUEST_COMPLETED, data: RequestCompleteEvent): void; notify(eventType: LifeCycleEventType.AUTO_ACTION_COMPLETED, data: AutoUserAction): void; notify(eventType: LifeCycleEventType.CUSTOM_ACTION_COLLECTED, data: CustomUserAction): void; notify(eventType: LifeCycleEventType.AUTO_ACTION_CREATED, data: { id: string; startTime: number; }): void; notify(eventType: LifeCycleEventType.VIEW_CREATED, data: { id: string; startTime: number; location: Location; }): void; notify(eventType: LifeCycleEventType.VIEW_UPDATED, data: View): void; notify(eventType: LifeCycleEventType.SESSION_RENEWED | LifeCycleEventType.RESOURCE_ADDED_TO_BATCH | LifeCycleEventType.DOM_MUTATED | LifeCycleEventType.BEFORE_UNLOAD | LifeCycleEventType.AUTO_ACTION_DISCARDED): void; subscribe(eventType: LifeCycleEventType.ERROR_COLLECTED, callback: (data: ErrorMessage) => void): Subscription; subscribe(eventType: LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, callback: (data: PerformanceEntry) => void): Subscription; subscribe(eventType: LifeCycleEventType.REQUEST_STARTED, callback: (data: RequestStartEvent) => void): Subscription; subscribe(eventType: LifeCycleEventType.REQUEST_COMPLETED, callback: (data: RequestCompleteEvent) => void): Subscription; subscribe(eventType: LifeCycleEventType.AUTO_ACTION_COMPLETED, callback: (data: AutoUserAction) => void): Subscription; subscribe(eventType: LifeCycleEventType.AUTO_ACTION_CREATED, callback: (data: { id: string; startTime: number; }) => void): Subscription; subscribe(eventType: LifeCycleEventType.CUSTOM_ACTION_COLLECTED, callback: (data: CustomUserAction) => void): Subscription; subscribe(eventType: LifeCycleEventType.VIEW_CREATED, callback: (data: { id: string; startTime: number; location: Location; }) => void): Subscription; subscribe(eventType: LifeCycleEventType.VIEW_UPDATED, callback: (data: View) => void): Subscription; subscribe(eventType: LifeCycleEventType.SESSION_RENEWED | LifeCycleEventType.RESOURCE_ADDED_TO_BATCH | LifeCycleEventType.DOM_MUTATED | LifeCycleEventType.BEFORE_UNLOAD | LifeCycleEventType.AUTO_ACTION_DISCARDED, callback: () => void): Subscription; }