@algolia/autocomplete-plugin-algolia-insights 1.8.3 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,11 @@
1
- import { AutocompleteState } from '@algolia/autocomplete-js';
2
- import { ClickedObjectIDsAfterSearchParams, ViewedObjectIDsParams } from './AutocompleteInsightsApi';
3
- import { AlgoliaInsightsHit, AutocompleteInsightsApi } from '.';
1
+ import type { AutocompleteState } from '@algolia/autocomplete-shared';
2
+ import type { ClickedObjectIDsAfterSearchParams, InsightsParamsWithItems, ViewedObjectIDsParams } from './AutocompleteInsightsApi';
3
+ import type { AlgoliaInsightsHit, AutocompleteInsightsApi } from '.';
4
4
  export declare type OnSelectParams = {
5
5
  insights: AutocompleteInsightsApi;
6
- insightsEvents: ClickedObjectIDsAfterSearchParams[];
6
+ insightsEvents: Array<InsightsParamsWithItems<ClickedObjectIDsAfterSearchParams & {
7
+ algoliaSource?: string[];
8
+ }>>;
7
9
  item: AlgoliaInsightsHit;
8
10
  state: AutocompleteState<any>;
9
11
  event: any;
@@ -11,6 +13,8 @@ export declare type OnSelectParams = {
11
13
  export declare type OnActiveParams = OnSelectParams;
12
14
  export declare type OnItemsChangeParams = {
13
15
  insights: AutocompleteInsightsApi;
14
- insightsEvents: ViewedObjectIDsParams[];
16
+ insightsEvents: Array<InsightsParamsWithItems<ViewedObjectIDsParams & {
17
+ algoliaSource?: string[];
18
+ }>>;
15
19
  state: AutocompleteState<any>;
16
20
  };
@@ -1 +1,16 @@
1
- export declare type InsightsClient = any;
1
+ import type { InsightsMethodMap, InsightsClient as _InsightsClient } from 'search-insights';
2
+ export type { Init as InsightsInit, AddAlgoliaAgent as InsightsAddAlgoliaAgent, SetUserToken as InsightsSetUserToken, GetUserToken as InsightsGetUserToken, OnUserTokenChange as InsightsOnUserTokenChange, } from 'search-insights';
3
+ export declare type InsightsClientMethod = keyof InsightsMethodMap;
4
+ export declare type InsightsClientPayload = {
5
+ eventName: string;
6
+ queryID: string;
7
+ index: string;
8
+ objectIDs: string[];
9
+ positions?: number[];
10
+ };
11
+ declare type QueueItemMap = Record<string, unknown>;
12
+ declare type QueueItem = QueueItemMap[keyof QueueItemMap];
13
+ export declare type InsightsClient = _InsightsClient & {
14
+ queue?: QueueItem[];
15
+ version?: string;
16
+ };