export interface TrackingData { [ key ] : any ; } /**
 * Describing a handler for A/B test events
 */ export interface Tracking { param event param trackingData track ( event , trackingData ) : void ; param element param event param trackingData trackLink ( element , event , trackingData ) : void ; } /**
 * A function that extends a tracking data object with even more data
 */ export type TrackingDataExtender = ( trackingData : TrackingData , event : string ) => TrackingData ; export declare type TrackEventType = 'ExperimentViewed' | 'ExperimentActionPerformed' ; export declare type TrackEventActionType = 'Click' | 'Type' ; param newTrackingData export function trackingDataExtenderFactory ( newTrackingData ) { return ( trackingData ) => ( { ... trackingData , ... newTrackingData , } ) ; } export class ConsoleTracking implements Tracking { public track ( event , trackingData ) { console . log ( 'Split testing event: ' + event , trackingData ) ; } public trackLink ( element , event , trackingData ) { element . addEventListener ( 'click' , ( ) => { this . track ( event , trackingData ) ; } ) ; } }