import { AnalyticsPlugin } from 'analytics'; import { AnalyticsInstance } from './AnalyticsInstance'; import { HasComponentViewTrackingThreshold } from './types/interfaces/HasComponentViewTrackingThreshold'; import { ElementClickedPayload, ElementHoveredPayload, ElementSeenPayload, VariableSeenPayload } from './ElementPayload'; import { HAS_CLICKED_ELEMENT, HAS_HOVERED_ELEMENT, HAS_SEEN_ELEMENT, HAS_SEEN_VARIABLE } from './constants'; export type EventHandlerParams = { payload: Payload; instance: AnalyticsInstance; abort: (reason?: string) => unknown; }; type PayloadMetaProperties = { /** * A randomly generated UUID that identifies the event. */ rid: string; /** * A timestamp representing when the event was dispatched. */ ts: string; }; type PayloadPrivateProperties = { originalAction: string; }; /** * Represents the `payload` object of an event dispatched by the analytics library. */ type Payload = CustomPayload & { /** * This object is automatically injected by the analytics library when events are dispatched. * * Note: When comparing two payloads, make sure the `meta` object is not included. * Its properties will be different even for events that are otherwise identical. */ meta: PayloadMetaProperties; /** * This object is automatically injected by the analytics library when events are dispatched. * * Note: When comparing two payloads, make sure the `_` object is not included. * It's meant for internal use inside the analytics library only, and its properties should not affect event equality. */ _: PayloadPrivateProperties; }; export type EventHandler = (params: EventHandlerParams>) => void; export declare abstract class NinetailedPlugin implements AnalyticsPlugin, HasComponentViewTrackingThreshold { [x: string]: unknown; private componentViewTrackingThreshold; abstract readonly name: string; [HAS_SEEN_ELEMENT]: EventHandler; [HAS_SEEN_VARIABLE]: EventHandler; [HAS_CLICKED_ELEMENT]: EventHandler; [HAS_HOVERED_ELEMENT]: EventHandler; protected onHasSeenElement: EventHandler; protected onHasSeenVariable: EventHandler; protected onHasClickedElement: EventHandler; protected onHasHoveredElement: EventHandler; setComponentViewTrackingThreshold: (threshold: number) => void; getComponentViewTrackingThreshold: () => number; } export {};