import { ErrorMessage } from '@cloudsnorkel/datadog-browser-core'; import { RumPerformanceEntry } from './performanceCollection'; import { RequestCompleteEvent, RequestStartEvent } from './requestCollection'; import { AutoActionCreatedEvent, AutoUserAction, CustomUserAction } from './userActionCollection'; import { View, ViewCreatedEvent } 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: RumPerformanceEntry): 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: AutoActionCreatedEvent): void; notify(eventType: LifeCycleEventType.VIEW_CREATED, data: ViewCreatedEvent): 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: RumPerformanceEntry) => 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: AutoActionCreatedEvent) => void): Subscription; subscribe(eventType: LifeCycleEventType.CUSTOM_ACTION_COLLECTED, callback: (data: CustomUserAction) => void): Subscription; subscribe(eventType: LifeCycleEventType.VIEW_CREATED, callback: (data: ViewCreatedEvent) => 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; }