UNPKG

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