Skip to content

Commit 9137cc8

Browse files
committed
fix v4 type issue (for real?)
1 parent bc997e5 commit 9137cc8

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed

packages/algoliasearch-helper/types/algoliasearch.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,20 @@ export type RecommendResponses<T> = PickForClient<{
182182
v5: AlgoliaSearch.GetRecommendationsResponse;
183183
}>;
184184

185+
export type TrendingFacetHit = PickForClient<{
186+
v3: any;
187+
// @ts-ignore
188+
v4: RecommendClient.TrendingFacetHit & {
189+
__position: number;
190+
__queryID?: string;
191+
};
192+
// @ts-ignore
193+
v5: RecommendClient.TrendingFacetHit & {
194+
__position: number;
195+
__queryID?: string;
196+
};
197+
}>;
198+
185199
// We remove `indexName` from the Recommend query types as the helper
186200
// will fill in this value before sending the queries
187201
type _OptionalKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;

packages/instantsearch-ui-components/src/components/Carousel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/** @jsx createElement */
2+
23
import { cx } from '../lib';
34

45
import { createDefaultItemComponent } from './recommend-shared';
@@ -12,7 +13,7 @@ import type {
1213
Renderer,
1314
SendEventForHits,
1415
} from '../types';
15-
import type { TrendingFacetHit } from './TrendingFacets';
16+
import type { TrendingFacetHit } from 'algoliasearch';
1617

1718
export type CarouselProps<
1819
TObject,

packages/instantsearch-ui-components/src/components/TrendingFacets.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@ import type {
1919
Renderer,
2020
SendEventForHits,
2121
} from '../types';
22-
import type { TrendingFacetHit as Base } from 'algoliasearch/lite';
23-
24-
export type TrendingFacetHit = Base & {
25-
__position: number;
26-
__queryID?: string;
27-
};
22+
import type { TrendingFacetHit } from 'algoliasearch';
2823

2924
type TrendingFacetLayoutProps<TClassNames extends Record<string, string>> = {
3025
classNames: TClassNames;

packages/instantsearch.js/src/connectors/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ export { default as connectRelevantSort } from './relevant-sort/connectRelevantS
5555
export { default as connectFrequentlyBoughtTogether } from './frequently-bought-together/connectFrequentlyBoughtTogether';
5656
export { default as connectLookingSimilar } from './looking-similar/connectLookingSimilar';
5757
export { default as connectTrendingFacets } from './trending-facets/connectTrendingFacets';
58-
export type { TrendingFacetHit } from './trending-facets/connectTrendingFacets';

packages/instantsearch.js/src/connectors/trending-facets/connectTrendingFacets.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import type {
1414
Unmounter,
1515
UnknownWidgetParams,
1616
RecommendResponse,
17+
TrendingFacetHit,
1718
} from '../../types';
18-
import type { TrendingFacetHit } from './types';
1919

2020
const withUsage = createDocumentationMessageGenerator({
2121
name: 'trending-facets',
@@ -171,5 +171,3 @@ export default (function connectTrendingFacets<
171171
};
172172
};
173173
} satisfies TrendingFacetsConnector);
174-
175-
export type { TrendingFacetHit } from './types';

packages/instantsearch.js/src/connectors/trending-facets/types.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/instantsearch.js/src/widgets/trending-facets/trending-facets.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import type {
1515
TrendingFacetsWidgetDescription,
1616
TrendingFacetsConnectorParams,
1717
TrendingFacetsRenderState,
18-
TrendingFacetHit,
1918
} from '../../connectors/trending-facets/connectTrendingFacets';
2019
import type { PreparedTemplateProps } from '../../lib/templating';
2120
import type {
@@ -24,6 +23,7 @@ import type {
2423
Renderer,
2524
RecommendResponse,
2625
TemplateWithBindEvent,
26+
TrendingFacetHit,
2727
} from '../../types';
2828
import type {
2929
RecommendClassNames,

0 commit comments

Comments
 (0)