Skip to content

Commit 007d187

Browse files
Merge #738
738: Fix facetsDistribution type on SearchResponse r=bidoubiwa a=Nick-Mazuk Fixes issue #737 Co-authored-by: Nick Mazuk <[email protected]>
2 parents b2435ea + 19d816f commit 007d187

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ export interface GetSearchRequest {
9090

9191
export type Hit<T> = T & { _formatted?: T }
9292

93+
export type CategoriesDistribution = {
94+
[category: string]: number
95+
}
96+
97+
export type Facet = string
98+
9399
// The second generic P is used to capture the SearchParams type
94100
export interface SearchResponse<T, P extends SearchParams<T>> {
95101
// P represents the SearchParams
@@ -101,7 +107,7 @@ export interface SearchResponse<T, P extends SearchParams<T>> {
101107
offset: number
102108
limit: number
103109
processingTimeMs: number
104-
facetsDistribution?: object
110+
facetsDistribution?: Record<Facet, CategoriesDistribution>
105111
exhaustiveFacetsCount?: boolean
106112
query: string
107113
nbHits: number

0 commit comments

Comments
 (0)