UNPKG

@liveblocks/react

Version:

A set of React hooks and providers to use Liveblocks declaratively. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.

83 lines (79 loc) 4.9 kB
import { R as RegisterAiKnowledgeProps, z as RegisterAiToolProps } from './room-Qo6boT5Q.js'; export { A as AiChatStatus, C as ClientContext, L as LiveblocksProvider, M as MutationContext, B as RoomContext, _ as RoomProvider, S as SendAiMessageOptions, U as UseSendAiMessageOptions, D as UseThreadsOptions, E as createLiveblocksContext, F as createRoomContext, H as useAddReaction, I as useAiChat, J as useAiChatMessages, K as useAiChatStatus, N as useAiChats, O as useAttachmentUrl, P as useBroadcastEvent, Q as useCanRedo, T as useCanUndo, V as useClient, W as useCreateAiChat, X as useCreateComment, Y as useCreateFeed, Z as useCreateFeedMessage, $ as useCreateThread, a0 as useDeleteAiChat, a1 as useDeleteAllInboxNotifications, a2 as useDeleteComment, a3 as useDeleteFeed, a4 as useDeleteFeedMessage, a5 as useDeleteHistoryVersion, a6 as useDeleteInboxNotification, a7 as useDeleteThread, a8 as useEditComment, a9 as useEditCommentMetadata, aa as useEditThreadMetadata, ab as useErrorListener, ac as useEventListener, ad as useFeedMessages, ae as useFeeds, af as useGroupInfo, ag as useHistory, ah as useHistoryVersionData, ai as useHistoryVersionStorageData, aj as useHistoryVersionYjsData, ak as useHistoryVersions, al as useInboxNotificationThread, am as useInboxNotifications, an as useIsInsideRoom, ao as useLostConnectionListener, ap as useMarkAllInboxNotificationsAsRead, aq as useMarkInboxNotificationAsRead, ar as useMarkThreadAsRead, as as useMarkThreadAsResolved, at as useMarkThreadAsUnresolved, au as useMutation, av as useMyPresence, aw as useNotificationSettings, ax as useOther, ay as useOthers, az as useOthersConnectionIds, aA as useOthersListener, aB as useOthersMapped, aC as useRedo, aD as useRemoveReaction, aE as useRestoreToStorageVersion, aF as useRoom, aG as useRoomInfo, aH as useRoomSubscriptionSettings, aI as useSearchComments, aJ as useSelf, aK as useSendAiMessage, aL as useStatus, aM as useStorage, aN as useStorageRoot, aO as useSubscribeToThread, aP as useSyncStatus, aQ as useThreadSubscription, aR as useThreads, aS as useUndo, aT as useUnreadInboxNotificationsCount, aU as useUnsubscribeFromThread, aV as useUpdateFeedMessage, aW as useUpdateFeedMetadata, aX as useUpdateMyPresence, aY as useUpdateNotificationSettings, aZ as useUpdateRoomSubscriptionSettings, a_ as useUrlMetadata, a$ as useUser, b0 as useUserThreads_experimental } from './room-Qo6boT5Q.js'; export { Json, JsonObject, isNotificationChannelEnabled, shallow } from '@liveblocks/client'; import * as react_jsx_runtime from 'react/jsx-runtime'; import * as react from 'react'; import { ReactNode } from 'react'; import '@liveblocks/core'; type Props = { fallback: ReactNode; children: (() => ReactNode | undefined) | ReactNode | undefined; }; /** * Almost like a normal <Suspense> component, except that for server-side * renders, the fallback will be used. * * The child props will have to be provided in a function, i.e. change: * * <Suspense fallback={<Loading />}> * <MyRealComponent a={1} /> * </Suspense> * * To: * * <ClientSideSuspense fallback={<Loading />}> * <MyRealComponent a={1} /> * </ClientSideSuspense> * */ declare function ClientSideSuspense(props: Props): react_jsx_runtime.JSX.Element; /** * Make knowledge about your application state available to any AI used in * a chat or a one-off request. * * For example: * * <RegisterAiKnowledge * description="The current mode of my application" * value="dark" /> * * Or scoped to a specific chat: * * <RegisterAiKnowledge * description="The current list of todos" * value={todos} * chatId="chat-1234" /> * * By mounting this component, the AI will get access to this knwoledge. * By unmounting this component, the AI will no longer have access to it. * It can choose to use or ignore this knowledge in its responses. */ declare const RegisterAiKnowledge: react.NamedExoticComponent<RegisterAiKnowledgeProps>; /** * Make a tool available to your AI chat or a one-off request. * A tool is a piece of functionality that the AI can call to perform an action * or look up information on the user's behalf. * * Also, tools are used to render custom UIs for tool invocations, which are * embedded inside the AI chat. * * For example: * * <RegisterAiTool * name="list-todos" * tool={defineAiTool()({ ... })} * /> * * Or scoped to a specific chat: * * <RegisterAiTool * name="list-todos" * tool={defineAiTool()({ ... })} * chatId="chat-1234" * /> * * By mounting this component, the tool is made available. * By unmounting this component, the tool will no longer be available. */ declare const RegisterAiTool: react.NamedExoticComponent<RegisterAiToolProps>; export { ClientSideSuspense, RegisterAiKnowledge, RegisterAiKnowledgeProps, RegisterAiTool, RegisterAiToolProps };