UNPKG

next-instantsearch

Version:

Server side rendering with Next.js and React InstantSearch

22 lines (21 loc) 874 B
import { SearchClient } from "@algolia/client-search"; import hoistNonReactStatics from "hoist-non-react-statics"; import { NextComponentType, NextPageContext } from "next"; import { NextRouter } from "next/router"; import { ReactElement } from "react"; export declare type WithInstantSearchOptions = { indexName?: string; searchClient: SearchClient; decorate?: (args: { ctx: NextPageContext; component: () => ReactElement; }) => ReactElement; onSearchStateChange?: (searchState: any, router: NextRouter) => any; }; declare const withInstantSearch: (options: WithInstantSearchOptions) => (WrappedComponent: NextComponentType | any) => { (props: any): JSX.Element; getInitialProps(ctx: NextPageContext): Promise<any>; } & hoistNonReactStatics.NonReactStatics<any, { getInitialProps: true; }>; export default withInstantSearch;