@@ -11,6 +11,7 @@ import {
11
11
ConvertedObjectIDsParams ,
12
12
InsightsClient ,
13
13
InsightsClientMethod ,
14
+ WithArbitraryParams ,
14
15
InsightsParamsWithItems ,
15
16
ViewedFiltersParams ,
16
17
ViewedObjectIDsParams ,
@@ -83,13 +84,17 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
83
84
*/
84
85
clickedObjectIDsAfterSearch (
85
86
...params : Array <
86
- InsightsParamsWithItems < ClickedObjectIDsAfterSearchParams >
87
+ WithArbitraryParams <
88
+ InsightsParamsWithItems < ClickedObjectIDsAfterSearchParams >
89
+ >
87
90
>
88
91
) {
89
92
if ( params . length > 0 ) {
90
93
sendToInsights (
91
94
'clickedObjectIDsAfterSearch' ,
92
- mapToInsightsParamsApi ( params ) ,
95
+ mapToInsightsParamsApi <
96
+ InsightsParamsWithItems < ClickedObjectIDsAfterSearchParams >
97
+ > ( params ) ,
93
98
params [ 0 ] . items
94
99
) ;
95
100
}
@@ -100,12 +105,16 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
100
105
* @link https://www.algolia.com/doc/api-reference/api-methods/clicked-object-ids/
101
106
*/
102
107
clickedObjectIDs (
103
- ...params : Array < InsightsParamsWithItems < ClickedObjectIDsParams > >
108
+ ...params : Array <
109
+ WithArbitraryParams < InsightsParamsWithItems < ClickedObjectIDsParams > >
110
+ >
104
111
) {
105
112
if ( params . length > 0 ) {
106
113
sendToInsights (
107
114
'clickedObjectIDs' ,
108
- mapToInsightsParamsApi ( params ) ,
115
+ mapToInsightsParamsApi <
116
+ InsightsParamsWithItems < ClickedObjectIDsParams >
117
+ > ( params ) ,
109
118
params [ 0 ] . items
110
119
) ;
111
120
}
@@ -115,7 +124,9 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
115
124
*
116
125
* @link https://www.algolia.com/doc/api-reference/api-methods/clicked-filters/
117
126
*/
118
- clickedFilters ( ...params : ClickedFiltersParams [ ] ) {
127
+ clickedFilters (
128
+ ...params : Array < WithArbitraryParams < ClickedFiltersParams > >
129
+ ) {
119
130
if ( params . length > 0 ) {
120
131
searchInsights ( 'clickedFilters' , ...params ) ;
121
132
}
@@ -127,13 +138,17 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
127
138
*/
128
139
convertedObjectIDsAfterSearch (
129
140
...params : Array <
130
- InsightsParamsWithItems < ConvertedObjectIDsAfterSearchParams >
141
+ WithArbitraryParams <
142
+ InsightsParamsWithItems < ConvertedObjectIDsAfterSearchParams >
143
+ >
131
144
>
132
145
) {
133
146
if ( params . length > 0 ) {
134
147
sendToInsights (
135
148
'convertedObjectIDsAfterSearch' ,
136
- mapToInsightsParamsApi ( params ) ,
149
+ mapToInsightsParamsApi <
150
+ InsightsParamsWithItems < ConvertedObjectIDsAfterSearchParams >
151
+ > ( params ) ,
137
152
params [ 0 ] . items
138
153
) ;
139
154
}
@@ -144,12 +159,16 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
144
159
* @link https://www.algolia.com/doc/api-reference/api-methods/converted-object-ids/
145
160
*/
146
161
convertedObjectIDs (
147
- ...params : Array < InsightsParamsWithItems < ConvertedObjectIDsParams > >
162
+ ...params : Array <
163
+ WithArbitraryParams < InsightsParamsWithItems < ConvertedObjectIDsParams > >
164
+ >
148
165
) {
149
166
if ( params . length > 0 ) {
150
167
sendToInsights (
151
168
'convertedObjectIDs' ,
152
- mapToInsightsParamsApi ( params ) ,
169
+ mapToInsightsParamsApi <
170
+ InsightsParamsWithItems < ConvertedObjectIDsParams >
171
+ > ( params ) ,
153
172
params [ 0 ] . items
154
173
) ;
155
174
}
@@ -159,7 +178,9 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
159
178
*
160
179
* @link https://www.algolia.com/doc/api-reference/api-methods/converted-filters/
161
180
*/
162
- convertedFilters ( ...params : ConvertedFiltersParams [ ] ) {
181
+ convertedFilters (
182
+ ...params : Array < WithArbitraryParams < ConvertedFiltersParams > >
183
+ ) {
163
184
if ( params . length > 0 ) {
164
185
searchInsights ( 'convertedFilters' , ...params ) ;
165
186
}
@@ -170,7 +191,9 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
170
191
* @link https://www.algolia.com/doc/api-reference/api-methods/viewed-object-ids/
171
192
*/
172
193
viewedObjectIDs (
173
- ...params : Array < InsightsParamsWithItems < ViewedObjectIDsParams > >
194
+ ...params : Array <
195
+ WithArbitraryParams < InsightsParamsWithItems < ViewedObjectIDsParams > >
196
+ >
174
197
) {
175
198
if ( params . length > 0 ) {
176
199
params
@@ -202,7 +225,7 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
202
225
*
203
226
* @link https://www.algolia.com/doc/api-reference/api-methods/viewed-filters/
204
227
*/
205
- viewedFilters ( ...params : ViewedFiltersParams [ ] ) {
228
+ viewedFilters ( ...params : Array < WithArbitraryParams < ViewedFiltersParams > > ) {
206
229
if ( params . length > 0 ) {
207
230
searchInsights ( 'viewedFilters' , ...params ) ;
208
231
}
0 commit comments