import { BrowserPlugin, FilterCriterion } from '@snowplow/browser-tracker-core'; import { CommonEventProperties, DynamicContext, LinkClickEvent } from '@snowplow/tracker-core'; type TrackableElement = HTMLAnchorElement | HTMLAreaElement; /** * Link click tracking. * * Will automatically track link clicks once enabled with `enableLinkClickTracking` * or you can manually track link clicks with `trackLinkClick`. * * @returns Plugin instance */ declare function LinkClickTrackingPlugin(): BrowserPlugin; /** The configuration for automatic link click tracking */ interface LinkClickTrackingConfiguration { /** The filter options for the link click tracking */ options?: FilterCriterion | null; /** * Captures middle click events in browsers that don't generate standard click * events for middle click actions */ pseudoClicks?: boolean; /** Whether the content of the links should be tracked */ trackContent?: boolean; /** The dynamic context which will be evaluated for each link click event */ context?: DynamicContext | null; } /** * Enable link click tracking. * * @remarks * The default behaviour is to use actual click events. However, some browsers * (e.g., Firefox, Opera, and Konqueror) don't generate click events for the middle mouse button. * * To capture more "clicks", the pseudo click-handler uses mousedown + mouseup events. * This is not industry standard and is vulnerable to false positives (e.g., drag events). * * @param configuration The link tracking configuration to use for the new click handlers * @param trackers List of tracker IDs that should track the click events */ declare function enableLinkClickTracking(configuration?: LinkClickTrackingConfiguration, trackers?: Array): void; /** * Disable link click tracking. * * Removes all document-level click event handlers installed by the plugin for * provided tracker instances. * * @param trackers The tracker identifiers that will have their listeners removed */ declare function disableLinkClickTracking(trackers?: Array): void; /** * Add click event listeners to links which have been added to the page since the * last time `enableLinkClickTracking` or `refreshLinkClickTracking` was called. * * @deprecated v4.0 moved to event delegation and this is no longer required * @param trackers The tracker identifiers which the have their link click state refreshed */ declare function refreshLinkClickTracking(_trackers?: Array): void; /** * Manually log a click. * * @param event The event or element information * @param trackers The tracker identifiers which the event will be sent to */ declare function trackLinkClick(event: (LinkClickEvent | { element: TrackableElement; trackContent?: boolean; }) & CommonEventProperties, trackers?: Array): void; export { LinkClickTrackingPlugin, LinkClickTrackingConfiguration, enableLinkClickTracking, disableLinkClickTracking, refreshLinkClickTracking, trackLinkClick };