UNPKG

1.06 kBTypeScriptView Raw
1import type { InfiniteHitsProps as InfiniteHitsUiComponentProps } from '../ui/InfiniteHits';
2import type { BaseHit, Hit } from 'instantsearch.js';
3import type { UseInfiniteHitsProps } from 'react-instantsearch-core';
4type UiProps<THit extends BaseHit = BaseHit> = Pick<InfiniteHitsUiComponentProps<Hit<THit>>, 'hits' | 'sendEvent' | 'onShowPrevious' | 'onShowMore' | 'isFirstPage' | 'isLastPage' | 'translations'>;
5export type InfiniteHitsProps<THit extends BaseHit = BaseHit> = Omit<InfiniteHitsUiComponentProps<Hit<THit>>, keyof UiProps<THit>> & UseInfiniteHitsProps<THit> & {
6 /**
7 * Displays the "Show Previous" button when the UI is loaded from a page
8 * beyond the first one.
9 * @default true
10 */
11 showPrevious?: boolean;
12 translations?: Partial<UiProps<THit>['translations']>;
13};
14export declare function InfiniteHits<THit extends BaseHit = BaseHit>({ showPrevious: shouldShowPrevious, cache, escapeHTML, showPrevious: userShowPrevious, transformItems, translations, ...props }: InfiniteHitsProps<THit>): JSX.Element;
15export {};