@@ -11,6 +11,7 @@ import {
1111 ConvertedObjectIDsParams ,
1212 InsightsClient ,
1313 InsightsClientMethod ,
14+ WithArbitraryParams ,
1415 InsightsParamsWithItems ,
1516 ViewedFiltersParams ,
1617 ViewedObjectIDsParams ,
@@ -83,13 +84,17 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
8384 */
8485 clickedObjectIDsAfterSearch (
8586 ...params : Array <
86- InsightsParamsWithItems < ClickedObjectIDsAfterSearchParams >
87+ WithArbitraryParams <
88+ InsightsParamsWithItems < ClickedObjectIDsAfterSearchParams >
89+ >
8790 >
8891 ) {
8992 if ( params . length > 0 ) {
9093 sendToInsights (
9194 'clickedObjectIDsAfterSearch' ,
92- mapToInsightsParamsApi ( params ) ,
95+ mapToInsightsParamsApi <
96+ InsightsParamsWithItems < ClickedObjectIDsAfterSearchParams >
97+ > ( params ) ,
9398 params [ 0 ] . items
9499 ) ;
95100 }
@@ -100,12 +105,16 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
100105 * @link https://www.algolia.com/doc/api-reference/api-methods/clicked-object-ids/
101106 */
102107 clickedObjectIDs (
103- ...params : Array < InsightsParamsWithItems < ClickedObjectIDsParams > >
108+ ...params : Array <
109+ WithArbitraryParams < InsightsParamsWithItems < ClickedObjectIDsParams > >
110+ >
104111 ) {
105112 if ( params . length > 0 ) {
106113 sendToInsights (
107114 'clickedObjectIDs' ,
108- mapToInsightsParamsApi ( params ) ,
115+ mapToInsightsParamsApi <
116+ InsightsParamsWithItems < ClickedObjectIDsParams >
117+ > ( params ) ,
109118 params [ 0 ] . items
110119 ) ;
111120 }
@@ -115,7 +124,9 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
115124 *
116125 * @link https://www.algolia.com/doc/api-reference/api-methods/clicked-filters/
117126 */
118- clickedFilters ( ...params : ClickedFiltersParams [ ] ) {
127+ clickedFilters (
128+ ...params : Array < WithArbitraryParams < ClickedFiltersParams > >
129+ ) {
119130 if ( params . length > 0 ) {
120131 searchInsights ( 'clickedFilters' , ...params ) ;
121132 }
@@ -127,13 +138,17 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
127138 */
128139 convertedObjectIDsAfterSearch (
129140 ...params : Array <
130- InsightsParamsWithItems < ConvertedObjectIDsAfterSearchParams >
141+ WithArbitraryParams <
142+ InsightsParamsWithItems < ConvertedObjectIDsAfterSearchParams >
143+ >
131144 >
132145 ) {
133146 if ( params . length > 0 ) {
134147 sendToInsights (
135148 'convertedObjectIDsAfterSearch' ,
136- mapToInsightsParamsApi ( params ) ,
149+ mapToInsightsParamsApi <
150+ InsightsParamsWithItems < ConvertedObjectIDsAfterSearchParams >
151+ > ( params ) ,
137152 params [ 0 ] . items
138153 ) ;
139154 }
@@ -144,12 +159,16 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
144159 * @link https://www.algolia.com/doc/api-reference/api-methods/converted-object-ids/
145160 */
146161 convertedObjectIDs (
147- ...params : Array < InsightsParamsWithItems < ConvertedObjectIDsParams > >
162+ ...params : Array <
163+ WithArbitraryParams < InsightsParamsWithItems < ConvertedObjectIDsParams > >
164+ >
148165 ) {
149166 if ( params . length > 0 ) {
150167 sendToInsights (
151168 'convertedObjectIDs' ,
152- mapToInsightsParamsApi ( params ) ,
169+ mapToInsightsParamsApi <
170+ InsightsParamsWithItems < ConvertedObjectIDsParams >
171+ > ( params ) ,
153172 params [ 0 ] . items
154173 ) ;
155174 }
@@ -159,7 +178,9 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
159178 *
160179 * @link https://www.algolia.com/doc/api-reference/api-methods/converted-filters/
161180 */
162- convertedFilters ( ...params : ConvertedFiltersParams [ ] ) {
181+ convertedFilters (
182+ ...params : Array < WithArbitraryParams < ConvertedFiltersParams > >
183+ ) {
163184 if ( params . length > 0 ) {
164185 searchInsights ( 'convertedFilters' , ...params ) ;
165186 }
@@ -170,7 +191,9 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
170191 * @link https://www.algolia.com/doc/api-reference/api-methods/viewed-object-ids/
171192 */
172193 viewedObjectIDs (
173- ...params : Array < InsightsParamsWithItems < ViewedObjectIDsParams > >
194+ ...params : Array <
195+ WithArbitraryParams < InsightsParamsWithItems < ViewedObjectIDsParams > >
196+ >
174197 ) {
175198 if ( params . length > 0 ) {
176199 params
@@ -202,7 +225,7 @@ export function createSearchInsightsApi(searchInsights: InsightsClient) {
202225 *
203226 * @link https://www.algolia.com/doc/api-reference/api-methods/viewed-filters/
204227 */
205- viewedFilters ( ...params : ViewedFiltersParams [ ] ) {
228+ viewedFilters ( ...params : Array < WithArbitraryParams < ViewedFiltersParams > > ) {
206229 if ( params . length > 0 ) {
207230 searchInsights ( 'viewedFilters' , ...params ) ;
208231 }
0 commit comments