Skip to content

Commit 7d14539

Browse files
authoredOct 15, 2024··
fix(shared): import adequate FacetHit types for v4 and v5 search client (#1280)
1 parent 38883fc commit 7d14539

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
 

‎packages/autocomplete-shared/src/core/AutocompleteSource.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import type { FacetHit, Hit } from '@algolia/client-search';
1+
import type { Hit } from '@algolia/client-search';
22

33
import type { MaybePromise } from '../MaybePromise';
4-
import type { SearchForFacetValuesResponse } from '../preset-algolia/algoliasearch';
4+
import type {
5+
FacetHit,
6+
SearchForFacetValuesResponse,
7+
} from '../preset-algolia/algoliasearch';
58
import type { RequesterDescription } from '../preset-algolia/createRequester';
69
import type { SearchResponse } from '../SearchResponse';
710

‎packages/autocomplete-shared/src/preset-algolia/algoliasearch.ts

+7
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,10 @@ export type SnippetResult<THit> = PickForClient<{
7171
/** @ts-ignore */
7272
v5: AlgoliaSearch.SnippetResult; // should be generic, but isn't yet in the client
7373
}>;
74+
75+
export type FacetHit = PickForClient<{
76+
/** @ts-ignore */
77+
v4: ClientSearch.FacetHit;
78+
/** @ts-ignore */
79+
v5: AlgoliaSearch.FacetHits;
80+
}>;

0 commit comments

Comments
 (0)
Please sign in to comment.