import { addEventType } from "./_addEventType"; import type AlgoliaAnalytics from "./insights"; import type { WithAdditionalParams } from "./utils"; import { extractAdditionalParams } from "./utils"; export interface InsightsSearchClickEvent { eventName: string; userToken?: string; authenticatedUserToken?: string; timestamp?: number; index: string; queryID: string; objectIDs: string[]; positions: number[]; } export function clickedObjectIDsAfterSearch( this: AlgoliaAnalytics, ...params: Array> ): ReturnType { const { events, additionalParams } = extractAdditionalParams(params); return this.sendEvents(addEventType("click", events), additionalParams); } export interface InsightsClickObjectIDsEvent { eventName: string; userToken?: string; authenticatedUserToken?: string; timestamp?: number; index: string; objectIDs: string[]; } export function clickedObjectIDs( this: AlgoliaAnalytics, ...params: Array> ): ReturnType { const { events, additionalParams } = extractAdditionalParams(params); return this.sendEvents(addEventType("click", events), additionalParams); } export interface InsightsClickFiltersEvent { eventName: string; userToken?: string; authenticatedUserToken?: string; timestamp?: number; index: string; filters: string[]; } export function clickedFilters( this: AlgoliaAnalytics, ...params: Array> ): ReturnType { const { events, additionalParams } = extractAdditionalParams(params); return this.sendEvents(addEventType("click", events), additionalParams); }