Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aymeric-giraudet committed Apr 5, 2024
1 parent 61ba925 commit 49f9efe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
16 changes: 1 addition & 15 deletions packages/algoliasearch-helper/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@ declare namespace algoliasearchHelper {
| RelatedProductsQuery
| TrendingFacetsQuery
| TrendingItemsQuery;

export type RecommendParametersWithId<
T extends PlainRecommendParameters = PlainRecommendParameters
> = T & {
Expand Down Expand Up @@ -1568,20 +1568,6 @@ declare namespace algoliasearchHelper {

[index: number]: RecommendResultItem<T>;
}

type RecommendResponse<TObject> =
RecommendQueriesResponse<TObject>['results'];

type RecommendResultItem<TObject = any> = RecommendResponse<TObject>[0];

export class RecommendResults<T = any> {
constructor(state: RecommendParameters, results: RecommendResponse<T>);

_state: RecommendParameters;
_rawResults: RecommendResponse<T>;

[index: number]: RecommendResultItem<T>;
}
}

export = algoliasearchHelper;
2 changes: 1 addition & 1 deletion packages/algoliasearch-helper/src/algoliasearch.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@ AlgoliaSearchHelper.prototype._recommend = function () {
return param.$$id;
})
);

derivedHelper.emit('fetch', {
recommend: {
state: derivedState,
Expand Down
5 changes: 1 addition & 4 deletions packages/instantsearch.js/src/types/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,7 @@ type RequiredUiStateLifeCycle<TWidgetDescription extends WidgetDescription> = {
>;
}
) => SearchParameters;
} & (
| SearchWidgetLifeCycle<TWidgetDescription>
| RecommendWidgetLifeCycle<TWidgetDescription>
);
};

type UiStateLifeCycle<TWidgetDescription extends WidgetDescription> =
TWidgetDescription extends RequiredKeys<WidgetDescription, 'indexUiState'>
Expand Down

0 comments on commit 49f9efe

Please sign in to comment.