@copilotkit/react-core
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
28 lines (25 loc) • 924 B
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { GraphQLError } from '@copilotkit/runtime-client-gql';
import React from 'react';
import { PartialBy, CopilotKitError } from '@copilotkit/shared';
interface Toast {
id: string;
message: string | React.ReactNode;
type: "info" | "success" | "warning" | "error";
duration?: number;
}
interface ToastContextValue {
toasts: Toast[];
addToast: (toast: PartialBy<Toast, "id">) => void;
addGraphQLErrorsToast: (errors: GraphQLError[]) => void;
removeToast: (id: string) => void;
enabled: boolean;
bannerError: CopilotKitError | null;
setBannerError: (error: CopilotKitError | null) => void;
}
declare function useToast(): ToastContextValue;
declare function ToastProvider({ enabled, children, }: {
enabled: boolean;
children: React.ReactNode;
}): react_jsx_runtime.JSX.Element;
export { ToastProvider, useToast };