Skip to content

Commit

Permalink
fix(shared): import adequate FacetHit types for v4 and v5 search clie…
Browse files Browse the repository at this point in the history
…nt (#1280)
  • Loading branch information
dhayab authored Oct 15, 2024
1 parent 38883fc commit 7d14539
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/autocomplete-shared/src/core/AutocompleteSource.ts
Original file line number Diff line number Diff line change
@@ -1,7 1,10 @@
import type { FacetHit, Hit } from '@algolia/client-search';
import type { Hit } from '@algolia/client-search';

import type { MaybePromise } from '../MaybePromise';
import type { SearchForFacetValuesResponse } from '../preset-algolia/algoliasearch';
import type {
FacetHit,
SearchForFacetValuesResponse,
} from '../preset-algolia/algoliasearch';
import type { RequesterDescription } from '../preset-algolia/createRequester';
import type { SearchResponse } from '../SearchResponse';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 71,10 @@ export type SnippetResult<THit> = PickForClient<{
/** @ts-ignore */
v5: AlgoliaSearch.SnippetResult; // should be generic, but isn't yet in the client
}>;

export type FacetHit = PickForClient<{
/** @ts-ignore */
v4: ClientSearch.FacetHit;
/** @ts-ignore */
v5: AlgoliaSearch.FacetHits;
}>;

0 comments on commit 7d14539

Please sign in to comment.