UNPKG

@sajari/sdk-react

Version:
40 lines (39 loc) 1.16 kB
import { RequestError } from "@sajari/sdk-js"; import * as React from "react"; import { ResultProps, ResultStyles } from "../Result"; import { CSSObject } from "@emotion/core"; export interface ResultsProps { ResultRenderer?: React.ComponentType<ResultProps>; fields?: { title?: string; description?: string; url?: string; image?: string; }; showImages?: boolean; styles?: { container?: CSSObject; item?: CSSObject; result?: ResultStyles; }; } export interface ResultsContainerProps { children: ResultsRenderFn; fields?: { title?: string; description?: string; url?: string; image?: string; }; } export declare type ResultsRenderFn = (props: ResultsRenderFnProps) => React.ReactNode; export interface ResultsRenderFnProps { error: RequestError | null; results?: Array<{ key: string; } & ResultProps>; } export declare const ResultsContainer: React.SFC<ResultsContainerProps>; export declare class Results extends React.Component<ResultsProps, {}> { render(): JSX.Element; }