@assistant-ui/react
Version:
React components for AI chat.
16 lines • 560 B
TypeScript
import { Context } from "react";
/**
* Creates a context hook with optional support.
* @param context - The React context to consume.
* @param providerName - The name of the provider for error messages.
* @returns A hook function that provides the context value.
*/
export declare function createContextHook<T>(context: Context<T | null>, providerName: string): {
(options?: {
optional?: false | undefined;
}): T;
(options?: {
optional?: boolean | undefined;
}): T | null;
};
//# sourceMappingURL=createContextHook.d.ts.map