@sajari/sdk-react
Version:
React SDK for the Sajari API
40 lines (39 loc) • 1.16 kB
TypeScript
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;
}