File tree 4 files changed +23
-1
lines changed
packages/recommend/src/types
4 files changed +23
-1
lines changed Original file line number Diff line number Diff line change
1
+ export type TrendingFacetHit < TObject > = {
2
+ readonly _score : number ;
3
+ readonly facetName : string ;
4
+ readonly facetValue : TObject ;
5
+ } ;
Original file line number Diff line number Diff line change
1
+ import { SearchResponse } from '@algolia/client-search' ;
2
+
3
+ import { TrendingFacetHit } from './TrendingFacetHit' ;
4
+
5
+ export type TrendingFacetsResponse < TObject > = Omit < SearchResponse < TObject > , 'hits' > & {
6
+ readonly hits : ReadonlyArray < TrendingFacetHit < TObject > > ;
7
+ } ;
Original file line number Diff line number Diff line change @@ -6,9 +6,17 @@ import { LookingSimilarQuery } from './LookingSimilarQuery';
6
6
import { RecommendationsQuery } from './RecommendationsQuery' ;
7
7
import { RelatedProductsQuery } from './RelatedProductsQuery' ;
8
8
import { TrendingFacetsQuery } from './TrendingFacetsQuery' ;
9
+ import { TrendingFacetsResponse } from './TrendingFacetsResponse' ;
9
10
import { TrendingItemsQuery } from './TrendingItemsQuery' ;
10
11
import { TrendingQuery } from './TrendingQuery' ;
11
12
13
+ export type RecommendTrendingFacetsQueriesResponse < TObject > = {
14
+ /**
15
+ * The list of results.
16
+ */
17
+ readonly results : ReadonlyArray < TrendingFacetsResponse < TObject > > ;
18
+ } ;
19
+
12
20
export type RecommendQueriesResponse < TObject > = {
13
21
/**
14
22
* The list of results.
@@ -55,7 +63,7 @@ export type WithRecommendMethods<TType> = TType & {
55
63
readonly getTrendingFacets : < TObject > (
56
64
queries : readonly TrendingFacetsQuery [ ] ,
57
65
requestOptions ?: RequestOptions & SearchOptions
58
- ) => Readonly < Promise < RecommendQueriesResponse < TObject > > > ;
66
+ ) => Readonly < Promise < RecommendTrendingFacetsQueriesResponse < TObject > > > ;
59
67
60
68
/**
61
69
* Returns Looking Similar
Original file line number Diff line number Diff line change @@ -15,3 +15,5 @@ export * from './TrendingItemsQuery';
15
15
export * from './TrendingQuery' ;
16
16
export * from './WithRecommendMethods' ;
17
17
export * from './LookingSimilarQuery' ;
18
+ export * from './TrendingFacetHit' ;
19
+ export * from './TrendingFacetsResponse' ;
You can’t perform that action at this time.
0 commit comments