Skip to content

Commit 84bd433

Browse files
authored
Add MultiSearchQuery and MultiSearchResult types (#1464)
1 parent 6a72b08 commit 84bd433

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/types/types.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ export type SearchRequestGET = Pagination &
106106
showMatchesPosition?: boolean
107107
}
108108

109+
export type MultiSearchQuery = SearchParams & { indexUid: string }
110+
109111
export type MultiSearchParams = {
110-
queries: Array<SearchParams & { indexUid: string }>
112+
queries: MultiSearchQuery[]
111113
}
112114

113115
export type CategoriesDistribution = {
@@ -173,8 +175,10 @@ type HasPage<S extends SearchParams> = undefined extends S['page']
173175
? false
174176
: true
175177

178+
export type MultiSearchResult<T> = SearchResponse<T> & { indexUid: string }
179+
176180
export type MultiSearchResponse<T = Record<string, any>> = {
177-
results: Array<SearchResponse<T> & { indexUid: string }>
181+
results: Array<MultiSearchResult<T>>
178182
}
179183

180184
export type FieldDistribution = {

0 commit comments

Comments
 (0)