@hashbrownai/react
Version:
React components for Hashbrown AI
37 lines (36 loc) • 1.08 kB
TypeScript
/**
* The options for the Hashbrown provider.
*/
export interface HashbrownProviderOptions {
/**
* The URL of the Hashbrown server endpoint.
*/
url: string;
/**
* The headers to send with the POST request to the Hashbrown endpoint.
*/
middleware?: Array<(request: RequestInit) => RequestInit | Promise<RequestInit>>;
}
interface HashbrownProviderContext {
url: string;
middleware?: Array<(request: RequestInit) => RequestInit | Promise<RequestInit>>;
}
export declare const HashbrownContext: import("react").Context<HashbrownProviderContext | undefined>;
/**
* The context for the Hashbrown provider. This is used to store the URL and middleware for contacting the Hashbrown endpoint.
*
* @example
* ```ts
* <HashbrownProvider url="https://your.api.local/chat">
* <App />
* </HashbrownProvider>
* ```
*/
export declare const HashbrownProvider: (
/**
* The options for the Hashbrown provider.
*/
props: HashbrownProviderOptions & {
children: React.ReactNode;
}) => import("react/jsx-runtime").JSX.Element;
export {};