@liveblocks/react 2.8.0-beta3 → 2.8.0-beta4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { b as ClientContext, C as ClientSideSuspense, X as CreateThreadError, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, U as UseStorageStatusOptions, a as UseThreadsOptions, c as createLiveblocksContext, h as createRoomContext, ac as getUmbrellaStoreForClient, ad as selectThreads, j as useAddReaction, a5 as useAttachmentUrl, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, W as useCommentsErrorListener, o as useCreateComment, p as useCreateThread, f as useDeleteAllInboxNotifications, q as useDeleteComment, g as useDeleteInboxNotification, r as useDeleteThread, s as useEditComment, t as useEditThreadMetadata, x as useErrorListener, y as useEventListener, z as useHistory, V as useHistoryVersionData, a6 as useHistoryVersions, _ as useInboxNotificationThread, a7 as useInboxNotifications, A as useIsInsideRoom, B as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, D as useMarkThreadAsRead, v as useMarkThreadAsResolved, w as useMarkThreadAsUnresolved, E as useMutation, F as useMyPresence, Y as useOther, Z as useOthers, $ as useOthersConnectionIds, G as useOthersListener, a0 as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, a9 as useRoomInfo, K as useRoomNotificationSettings, a1 as useSelf, N as useStatus, a2 as useStorage, O as useStorageRoot, a3 as useStorageStatus, P as useThreadSubscription, a4 as useThreads, Q as useUndo, aa as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, ab as useUser, a8 as useUserThreads_experimental } from './suspense-FX3HjuPs.mjs';
1
+ export { b as ClientContext, C as ClientSideSuspense, X as CreateThreadError, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, U as UseStorageStatusOptions, a as UseThreadsOptions, c as createLiveblocksContext, h as createRoomContext, ac as getUmbrellaStoreForClient, ad as selectThreads, j as useAddReaction, a5 as useAttachmentUrl, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, W as useCommentsErrorListener, o as useCreateComment, p as useCreateThread, f as useDeleteAllInboxNotifications, q as useDeleteComment, g as useDeleteInboxNotification, r as useDeleteThread, s as useEditComment, t as useEditThreadMetadata, x as useErrorListener, y as useEventListener, z as useHistory, V as useHistoryVersionData, a6 as useHistoryVersions, _ as useInboxNotificationThread, a7 as useInboxNotifications, A as useIsInsideRoom, B as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, D as useMarkThreadAsRead, v as useMarkThreadAsResolved, w as useMarkThreadAsUnresolved, E as useMutation, F as useMyPresence, Y as useOther, Z as useOthers, $ as useOthersConnectionIds, G as useOthersListener, a0 as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, a9 as useRoomInfo, K as useRoomNotificationSettings, a1 as useSelf, N as useStatus, a2 as useStorage, O as useStorageRoot, a3 as useStorageStatus, P as useThreadSubscription, a4 as useThreads, Q as useUndo, aa as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, ab as useUser, a8 as useUserThreads_experimental } from './suspense-DJOhRXB2.mjs';
2
2
  export { Json, JsonObject, shallow } from '@liveblocks/client';
3
3
  import 'react';
4
4
  import '@liveblocks/core';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { b as ClientContext, C as ClientSideSuspense, X as CreateThreadError, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, U as UseStorageStatusOptions, a as UseThreadsOptions, c as createLiveblocksContext, h as createRoomContext, ac as getUmbrellaStoreForClient, ad as selectThreads, j as useAddReaction, a5 as useAttachmentUrl, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, W as useCommentsErrorListener, o as useCreateComment, p as useCreateThread, f as useDeleteAllInboxNotifications, q as useDeleteComment, g as useDeleteInboxNotification, r as useDeleteThread, s as useEditComment, t as useEditThreadMetadata, x as useErrorListener, y as useEventListener, z as useHistory, V as useHistoryVersionData, a6 as useHistoryVersions, _ as useInboxNotificationThread, a7 as useInboxNotifications, A as useIsInsideRoom, B as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, D as useMarkThreadAsRead, v as useMarkThreadAsResolved, w as useMarkThreadAsUnresolved, E as useMutation, F as useMyPresence, Y as useOther, Z as useOthers, $ as useOthersConnectionIds, G as useOthersListener, a0 as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, a9 as useRoomInfo, K as useRoomNotificationSettings, a1 as useSelf, N as useStatus, a2 as useStorage, O as useStorageRoot, a3 as useStorageStatus, P as useThreadSubscription, a4 as useThreads, Q as useUndo, aa as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, ab as useUser, a8 as useUserThreads_experimental } from './suspense-FX3HjuPs.js';
1
+ export { b as ClientContext, C as ClientSideSuspense, X as CreateThreadError, L as LiveblocksProvider, M as MutationContext, R as RoomContext, i as RoomProvider, U as UseStorageStatusOptions, a as UseThreadsOptions, c as createLiveblocksContext, h as createRoomContext, ac as getUmbrellaStoreForClient, ad as selectThreads, j as useAddReaction, a5 as useAttachmentUrl, k as useBatch, l as useBroadcastEvent, m as useCanRedo, n as useCanUndo, u as useClient, W as useCommentsErrorListener, o as useCreateComment, p as useCreateThread, f as useDeleteAllInboxNotifications, q as useDeleteComment, g as useDeleteInboxNotification, r as useDeleteThread, s as useEditComment, t as useEditThreadMetadata, x as useErrorListener, y as useEventListener, z as useHistory, V as useHistoryVersionData, a6 as useHistoryVersions, _ as useInboxNotificationThread, a7 as useInboxNotifications, A as useIsInsideRoom, B as useLostConnectionListener, d as useMarkAllInboxNotificationsAsRead, e as useMarkInboxNotificationAsRead, D as useMarkThreadAsRead, v as useMarkThreadAsResolved, w as useMarkThreadAsUnresolved, E as useMutation, F as useMyPresence, Y as useOther, Z as useOthers, $ as useOthersConnectionIds, G as useOthersListener, a0 as useOthersMapped, H as useRedo, I as useRemoveReaction, J as useRoom, a9 as useRoomInfo, K as useRoomNotificationSettings, a1 as useSelf, N as useStatus, a2 as useStorage, O as useStorageRoot, a3 as useStorageStatus, P as useThreadSubscription, a4 as useThreads, Q as useUndo, aa as useUnreadInboxNotificationsCount, S as useUpdateMyPresence, T as useUpdateRoomNotificationSettings, ab as useUser, a8 as useUserThreads_experimental } from './suspense-DJOhRXB2.js';
2
2
  export { Json, JsonObject, shallow } from '@liveblocks/client';
3
3
  import 'react';
4
4
  import '@liveblocks/core';
package/dist/index.js CHANGED
@@ -67,12 +67,12 @@
67
67
 
68
68
 
69
69
 
70
- var _chunkD54QUPHFjs = require('./chunk-D54QUPHF.js');
70
+ var _chunkG4SKKVCKjs = require('./chunk-G4SKKVCK.js');
71
71
 
72
72
  // src/index.ts
73
73
  var _core = require('@liveblocks/core');
74
74
  var _client = require('@liveblocks/client');
75
- _core.detectDupes.call(void 0, _chunkD54QUPHFjs.PKG_NAME, _chunkD54QUPHFjs.PKG_VERSION, _chunkD54QUPHFjs.PKG_FORMAT);
75
+ _core.detectDupes.call(void 0, _chunkG4SKKVCKjs.PKG_NAME, _chunkG4SKKVCKjs.PKG_VERSION, _chunkG4SKKVCKjs.PKG_FORMAT);
76
76
 
77
77
 
78
78
 
@@ -140,5 +140,5 @@ _core.detectDupes.call(void 0, _chunkD54QUPHFjs.PKG_NAME, _chunkD54QUPHFjs.PKG_V
140
140
 
141
141
 
142
142
 
143
- exports.ClientContext = _chunkD54QUPHFjs.ClientContext; exports.ClientSideSuspense = _chunkD54QUPHFjs.ClientSideSuspense; exports.CreateThreadError = _chunkD54QUPHFjs.CreateThreadError; exports.LiveblocksProvider = _chunkD54QUPHFjs.LiveblocksProvider; exports.RoomContext = _chunkD54QUPHFjs.RoomContext; exports.RoomProvider = _chunkD54QUPHFjs._RoomProvider; exports.createLiveblocksContext = _chunkD54QUPHFjs.createLiveblocksContext; exports.createRoomContext = _chunkD54QUPHFjs.createRoomContext; exports.getUmbrellaStoreForClient = _chunkD54QUPHFjs.getUmbrellaStoreForClient; exports.selectThreads = _chunkD54QUPHFjs.selectThreads; exports.shallow = _client.shallow; exports.useAddReaction = _chunkD54QUPHFjs._useAddReaction; exports.useAttachmentUrl = _chunkD54QUPHFjs.useAttachmentUrl; exports.useBatch = _chunkD54QUPHFjs.useBatch; exports.useBroadcastEvent = _chunkD54QUPHFjs._useBroadcastEvent; exports.useCanRedo = _chunkD54QUPHFjs.useCanRedo; exports.useCanUndo = _chunkD54QUPHFjs.useCanUndo; exports.useClient = _chunkD54QUPHFjs.useClient; exports.useCommentsErrorListener = _chunkD54QUPHFjs.useCommentsErrorListener; exports.useCreateComment = _chunkD54QUPHFjs.useCreateComment; exports.useCreateThread = _chunkD54QUPHFjs._useCreateThread; exports.useDeleteAllInboxNotifications = _chunkD54QUPHFjs.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkD54QUPHFjs.useDeleteComment; exports.useDeleteInboxNotification = _chunkD54QUPHFjs.useDeleteInboxNotification; exports.useDeleteThread = _chunkD54QUPHFjs._useDeleteThread; exports.useEditComment = _chunkD54QUPHFjs.useEditComment; exports.useEditThreadMetadata = _chunkD54QUPHFjs._useEditThreadMetadata; exports.useErrorListener = _chunkD54QUPHFjs.useErrorListener; exports.useEventListener = _chunkD54QUPHFjs._useEventListener; exports.useHistory = _chunkD54QUPHFjs.useHistory; exports.useHistoryVersionData = _chunkD54QUPHFjs.useHistoryVersionData; exports.useHistoryVersions = _chunkD54QUPHFjs._useHistoryVersions; exports.useInboxNotificationThread = _chunkD54QUPHFjs._useInboxNotificationThread; exports.useInboxNotifications = _chunkD54QUPHFjs.useInboxNotifications; exports.useIsInsideRoom = _chunkD54QUPHFjs._useIsInsideRoom; exports.useLostConnectionListener = _chunkD54QUPHFjs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkD54QUPHFjs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkD54QUPHFjs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkD54QUPHFjs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkD54QUPHFjs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkD54QUPHFjs.useMarkThreadAsUnresolved; exports.useMutation = _chunkD54QUPHFjs._useMutation; exports.useMyPresence = _chunkD54QUPHFjs._useMyPresence; exports.useOther = _chunkD54QUPHFjs._useOther; exports.useOthers = _chunkD54QUPHFjs._useOthers; exports.useOthersConnectionIds = _chunkD54QUPHFjs.useOthersConnectionIds; exports.useOthersListener = _chunkD54QUPHFjs._useOthersListener; exports.useOthersMapped = _chunkD54QUPHFjs._useOthersMapped; exports.useRedo = _chunkD54QUPHFjs.useRedo; exports.useRemoveReaction = _chunkD54QUPHFjs.useRemoveReaction; exports.useRoom = _chunkD54QUPHFjs._useRoom; exports.useRoomInfo = _chunkD54QUPHFjs.useRoomInfo; exports.useRoomNotificationSettings = _chunkD54QUPHFjs.useRoomNotificationSettings; exports.useSelf = _chunkD54QUPHFjs._useSelf; exports.useStatus = _chunkD54QUPHFjs.useStatus; exports.useStorage = _chunkD54QUPHFjs._useStorage; exports.useStorageRoot = _chunkD54QUPHFjs._useStorageRoot; exports.useStorageStatus = _chunkD54QUPHFjs.useStorageStatus; exports.useThreadSubscription = _chunkD54QUPHFjs.useThreadSubscription; exports.useThreads = _chunkD54QUPHFjs._useThreads; exports.useUndo = _chunkD54QUPHFjs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkD54QUPHFjs.useUnreadInboxNotificationsCount; exports.useUpdateMyPresence = _chunkD54QUPHFjs._useUpdateMyPresence; exports.useUpdateRoomNotificationSettings = _chunkD54QUPHFjs.useUpdateRoomNotificationSettings; exports.useUser = _chunkD54QUPHFjs._useUser; exports.useUserThreads_experimental = _chunkD54QUPHFjs._useUserThreads_experimental;
143
+ exports.ClientContext = _chunkG4SKKVCKjs.ClientContext; exports.ClientSideSuspense = _chunkG4SKKVCKjs.ClientSideSuspense; exports.CreateThreadError = _chunkG4SKKVCKjs.CreateThreadError; exports.LiveblocksProvider = _chunkG4SKKVCKjs.LiveblocksProvider; exports.RoomContext = _chunkG4SKKVCKjs.RoomContext; exports.RoomProvider = _chunkG4SKKVCKjs._RoomProvider; exports.createLiveblocksContext = _chunkG4SKKVCKjs.createLiveblocksContext; exports.createRoomContext = _chunkG4SKKVCKjs.createRoomContext; exports.getUmbrellaStoreForClient = _chunkG4SKKVCKjs.getUmbrellaStoreForClient; exports.selectThreads = _chunkG4SKKVCKjs.selectThreads; exports.shallow = _client.shallow; exports.useAddReaction = _chunkG4SKKVCKjs._useAddReaction; exports.useAttachmentUrl = _chunkG4SKKVCKjs.useAttachmentUrl; exports.useBatch = _chunkG4SKKVCKjs.useBatch; exports.useBroadcastEvent = _chunkG4SKKVCKjs._useBroadcastEvent; exports.useCanRedo = _chunkG4SKKVCKjs.useCanRedo; exports.useCanUndo = _chunkG4SKKVCKjs.useCanUndo; exports.useClient = _chunkG4SKKVCKjs.useClient; exports.useCommentsErrorListener = _chunkG4SKKVCKjs.useCommentsErrorListener; exports.useCreateComment = _chunkG4SKKVCKjs.useCreateComment; exports.useCreateThread = _chunkG4SKKVCKjs._useCreateThread; exports.useDeleteAllInboxNotifications = _chunkG4SKKVCKjs.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkG4SKKVCKjs.useDeleteComment; exports.useDeleteInboxNotification = _chunkG4SKKVCKjs.useDeleteInboxNotification; exports.useDeleteThread = _chunkG4SKKVCKjs._useDeleteThread; exports.useEditComment = _chunkG4SKKVCKjs.useEditComment; exports.useEditThreadMetadata = _chunkG4SKKVCKjs._useEditThreadMetadata; exports.useErrorListener = _chunkG4SKKVCKjs.useErrorListener; exports.useEventListener = _chunkG4SKKVCKjs._useEventListener; exports.useHistory = _chunkG4SKKVCKjs.useHistory; exports.useHistoryVersionData = _chunkG4SKKVCKjs.useHistoryVersionData; exports.useHistoryVersions = _chunkG4SKKVCKjs._useHistoryVersions; exports.useInboxNotificationThread = _chunkG4SKKVCKjs._useInboxNotificationThread; exports.useInboxNotifications = _chunkG4SKKVCKjs.useInboxNotifications; exports.useIsInsideRoom = _chunkG4SKKVCKjs._useIsInsideRoom; exports.useLostConnectionListener = _chunkG4SKKVCKjs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkG4SKKVCKjs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkG4SKKVCKjs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkG4SKKVCKjs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkG4SKKVCKjs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkG4SKKVCKjs.useMarkThreadAsUnresolved; exports.useMutation = _chunkG4SKKVCKjs._useMutation; exports.useMyPresence = _chunkG4SKKVCKjs._useMyPresence; exports.useOther = _chunkG4SKKVCKjs._useOther; exports.useOthers = _chunkG4SKKVCKjs._useOthers; exports.useOthersConnectionIds = _chunkG4SKKVCKjs.useOthersConnectionIds; exports.useOthersListener = _chunkG4SKKVCKjs._useOthersListener; exports.useOthersMapped = _chunkG4SKKVCKjs._useOthersMapped; exports.useRedo = _chunkG4SKKVCKjs.useRedo; exports.useRemoveReaction = _chunkG4SKKVCKjs.useRemoveReaction; exports.useRoom = _chunkG4SKKVCKjs._useRoom; exports.useRoomInfo = _chunkG4SKKVCKjs.useRoomInfo; exports.useRoomNotificationSettings = _chunkG4SKKVCKjs.useRoomNotificationSettings; exports.useSelf = _chunkG4SKKVCKjs._useSelf; exports.useStatus = _chunkG4SKKVCKjs.useStatus; exports.useStorage = _chunkG4SKKVCKjs._useStorage; exports.useStorageRoot = _chunkG4SKKVCKjs._useStorageRoot; exports.useStorageStatus = _chunkG4SKKVCKjs.useStorageStatus; exports.useThreadSubscription = _chunkG4SKKVCKjs.useThreadSubscription; exports.useThreads = _chunkG4SKKVCKjs._useThreads; exports.useUndo = _chunkG4SKKVCKjs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkG4SKKVCKjs.useUnreadInboxNotificationsCount; exports.useUpdateMyPresence = _chunkG4SKKVCKjs._useUpdateMyPresence; exports.useUpdateRoomNotificationSettings = _chunkG4SKKVCKjs.useUpdateRoomNotificationSettings; exports.useUser = _chunkG4SKKVCKjs._useUser; exports.useUserThreads_experimental = _chunkG4SKKVCKjs._useUserThreads_experimental;
144
144
  //# sourceMappingURL=index.js.map
package/dist/index.mjs CHANGED
@@ -67,7 +67,7 @@ import {
67
67
  useUndo,
68
68
  useUnreadInboxNotificationsCount,
69
69
  useUpdateRoomNotificationSettings
70
- } from "./chunk-76MOGPE3.mjs";
70
+ } from "./chunk-G35ZEFD6.mjs";
71
71
 
72
72
  // src/index.ts
73
73
  import { detectDupes } from "@liveblocks/core";
@@ -1,7 +1,7 @@
1
- import { JsonObject, LsonObject, BaseUserMeta, LiveObject, User, Json, RoomNotificationSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1, ThreadData as ThreadData$1, Client as Client$1, ClientOptions, StorageStatus as StorageStatus$1, CommentData as CommentData$1 } from '@liveblocks/client';
1
+ import { JsonObject, LsonObject, BaseUserMeta, LiveObject, User, RoomNotificationSettings, Json, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1, ThreadData as ThreadData$1, Client as Client$1, ClientOptions, StorageStatus as StorageStatus$1, CommentData as CommentData$1 } from '@liveblocks/client';
2
2
  import * as React$1 from 'react';
3
3
  import React__default, { ReactNode, PropsWithChildren } from 'react';
4
- import { BaseMetadata, CommentBody, Patchable, StorageStatus, QueryMetadata, AsyncResultWithDataField, DRI, Resolve, CommentAttachment, ToImmutable, ThreadData, InboxNotificationData, HistoryVersion, Client, LiveblocksError, RoomEventMessage, CommentData, PartialUnless, ThreadDataWithDeleteInfo, RoomNotificationSettings as RoomNotificationSettings$1, CommentUserReaction, ThreadDeleteInfo, InboxNotificationDeleteInfo, DistributiveOmit, AsyncResult, OpaqueClient, DU, DM, OpaqueRoom, DP, DS, DE } from '@liveblocks/core';
4
+ import { BaseMetadata, CommentBody, Patchable, StorageStatus, QueryMetadata, AsyncResult, DRI, AsyncSuccess, CommentAttachment, Resolve, ToImmutable, ThreadData, InboxNotificationData, HistoryVersion, Client, LiveblocksError, RoomEventMessage, CommentData, PartialUnless, ThreadDataWithDeleteInfo, RoomNotificationSettings as RoomNotificationSettings$1, CommentUserReaction, ThreadDeleteInfo, InboxNotificationDeleteInfo, DistributiveOmit, OpaqueClient, DU, DM, OpaqueRoom, DP, DS, DE } from '@liveblocks/core';
5
5
 
6
6
  declare type Props = {
7
7
  fallback: ReactNode;
@@ -166,21 +166,12 @@ declare type UseThreadsOptions<M extends BaseMetadata> = {
166
166
  */
167
167
  scrollOnLoad?: boolean;
168
168
  };
169
- declare type UserAsyncResult<T> = AsyncResultWithDataField<T, "user">;
170
- declare type UserAsyncSuccess<T> = Resolve<UserAsyncResult<T> & {
171
- readonly isLoading: false;
172
- readonly error?: undefined;
173
- }>;
174
- declare type RoomInfoAsyncResult = AsyncResultWithDataField<DRI, "info">;
175
- declare type RoomInfoAsyncSuccess = Resolve<RoomInfoAsyncResult & {
176
- readonly isLoading: false;
177
- readonly error?: undefined;
178
- }>;
179
- declare type AttachmentUrlAsyncResult = AsyncResultWithDataField<string, "url">;
180
- declare type AttachmentUrlAsyncSuccess = Resolve<AttachmentUrlAsyncResult & {
181
- readonly isLoading: false;
182
- readonly error?: undefined;
183
- }>;
169
+ declare type UserAsyncResult<T> = AsyncResult<T, "user">;
170
+ declare type UserAsyncSuccess<T> = AsyncSuccess<T, "user">;
171
+ declare type RoomInfoAsyncResult = AsyncResult<DRI, "info">;
172
+ declare type RoomInfoAsyncSuccess = AsyncSuccess<DRI, "info">;
173
+ declare type AttachmentUrlAsyncResult = AsyncResult<string, "url">;
174
+ declare type AttachmentUrlAsyncSuccess = AsyncSuccess<string, "url">;
184
175
  declare type CreateThreadOptions<M extends BaseMetadata> = Resolve<{
185
176
  body: CommentBody;
186
177
  attachments?: CommentAttachment[];
@@ -211,102 +202,17 @@ declare type CommentReactionOptions = {
211
202
  commentId: string;
212
203
  emoji: string;
213
204
  };
214
- declare type ThreadsStateLoading = {
215
- isLoading: true;
216
- threads?: never;
217
- error?: never;
218
- };
219
- declare type ThreadsStateResolved<M extends BaseMetadata> = {
220
- isLoading: false;
221
- threads: ThreadData<M>[];
222
- error?: Error;
223
- };
224
- declare type ThreadsStateSuccess<M extends BaseMetadata> = {
225
- isLoading: false;
226
- threads: ThreadData<M>[];
227
- error?: never;
228
- };
229
- declare type ThreadsState<M extends BaseMetadata> = ThreadsStateLoading | ThreadsStateResolved<M>;
230
- declare type InboxNotificationsStateLoading = {
231
- isLoading: true;
232
- inboxNotifications?: never;
233
- error?: never;
234
- };
235
- declare type InboxNotificationsStateSuccess = {
236
- isLoading: false;
237
- inboxNotifications: InboxNotificationData[];
238
- error?: never;
239
- };
240
- declare type InboxNotificationsStateError = {
241
- isLoading: false;
242
- inboxNotifications?: never;
243
- error: Error;
244
- };
245
- declare type InboxNotificationsState = InboxNotificationsStateLoading | InboxNotificationsStateSuccess | InboxNotificationsStateError;
246
- declare type UnreadInboxNotificationsCountStateLoading = {
247
- isLoading: true;
248
- count?: never;
249
- error?: never;
250
- };
251
- declare type UnreadInboxNotificationsCountStateSuccess = {
252
- isLoading: false;
253
- count: number;
254
- error?: never;
255
- };
256
- declare type UnreadInboxNotificationsCountStateError = {
257
- isLoading: false;
258
- count?: never;
259
- error: Error;
260
- };
261
- declare type UnreadInboxNotificationsCountState = UnreadInboxNotificationsCountStateLoading | UnreadInboxNotificationsCountStateSuccess | UnreadInboxNotificationsCountStateError;
262
- declare type RoomNotificationSettingsStateLoading = {
263
- isLoading: true;
264
- settings?: never;
265
- error?: never;
266
- };
267
- declare type RoomNotificationSettingsStateError = {
268
- isLoading: false;
269
- settings?: never;
270
- error: Error;
271
- };
272
- declare type RoomNotificationSettingsStateSuccess = {
273
- isLoading: false;
274
- settings: RoomNotificationSettings;
275
- error?: never;
276
- };
277
- declare type RoomNotificationSettingsState = RoomNotificationSettingsStateLoading | RoomNotificationSettingsStateError | RoomNotificationSettingsStateSuccess;
278
- declare type HistoryVersionDataStateLoading = {
279
- isLoading: true;
280
- data?: never;
281
- error?: never;
282
- };
283
- declare type HistoryVersionDataStateResolved = {
284
- isLoading: false;
285
- data: Uint8Array;
286
- error?: Error;
287
- };
288
- declare type HistoryVersionDataStateError = {
289
- isLoading: false;
290
- data?: never;
291
- error: Error;
292
- };
293
- declare type HistoryVersionDataState = HistoryVersionDataStateLoading | HistoryVersionDataStateResolved | HistoryVersionDataStateError;
294
- declare type HistoryVersionsStateLoading = {
295
- isLoading: true;
296
- versions?: never;
297
- error?: never;
298
- };
299
- declare type HistoryVersionsStateResolved = {
300
- isLoading: false;
301
- versions: HistoryVersion[];
302
- error?: Error;
303
- };
304
- declare type HistoryVersionsStateError = {
305
- isLoading: false;
306
- versions?: never;
307
- error: Error;
308
- };
309
- declare type HistoryVersionsState = HistoryVersionsStateLoading | HistoryVersionsStateResolved | HistoryVersionsStateError;
205
+ declare type ThreadsAsyncSuccess<M extends BaseMetadata> = AsyncSuccess<ThreadData<M>[], "threads">;
206
+ declare type ThreadsAsyncResult<M extends BaseMetadata> = AsyncResult<ThreadData<M>[], "threads">;
207
+ declare type InboxNotificationsAsyncSuccess = AsyncSuccess<InboxNotificationData[], "inboxNotifications">;
208
+ declare type InboxNotificationsAsyncResult = AsyncResult<InboxNotificationData[], "inboxNotifications">;
209
+ declare type UnreadInboxNotificationsCountAsyncSuccess = AsyncSuccess<number, "count">;
210
+ declare type UnreadInboxNotificationsCountAsyncResult = AsyncResult<number, "count">;
211
+ declare type RoomNotificationSettingsAsyncSuccess = AsyncSuccess<RoomNotificationSettings, "settings">;
212
+ declare type RoomNotificationSettingsAsyncResult = AsyncResult<RoomNotificationSettings, "settings">;
213
+ declare type HistoryVersionDataAsyncResult = AsyncResult<Uint8Array>;
214
+ declare type HistoryVersionsAsyncSuccess = AsyncSuccess<HistoryVersion[], "versions">;
215
+ declare type HistoryVersionsAsyncResult = AsyncResult<HistoryVersion[], "versions">;
310
216
  declare type RoomProviderProps<P extends JsonObject, S extends LsonObject> = Resolve<{
311
217
  /**
312
218
  * The id of the room you want to connect to
@@ -917,7 +823,7 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
917
823
  * @example
918
824
  * const { threads, error, isLoading } = useThreads();
919
825
  */
920
- useThreads(options?: UseThreadsOptions<M>): ThreadsState<M>;
826
+ useThreads(options?: UseThreadsOptions<M>): ThreadsAsyncResult<M>;
921
827
  /**
922
828
  * Returns the user's notification settings for the current room
923
829
  * and a function to update them.
@@ -926,7 +832,7 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
926
832
  * const [{ settings }, updateSettings] = useRoomNotificationSettings();
927
833
  */
928
834
  useRoomNotificationSettings(): [
929
- RoomNotificationSettingsState,
835
+ RoomNotificationSettingsAsyncResult,
930
836
  (settings: Partial<RoomNotificationSettings>) => void
931
837
  ];
932
838
  /**
@@ -942,14 +848,14 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
942
848
  * @example
943
849
  * const { versions, error, isLoading } = useHistoryVersions();
944
850
  */
945
- useHistoryVersions(): HistoryVersionsState;
851
+ useHistoryVersions(): HistoryVersionsAsyncResult;
946
852
  /**
947
853
  * (Private beta) Returns the data of a specific version of the current room.
948
854
  *
949
855
  * @example
950
856
  * const { data, error, isLoading } = useHistoryVersionData(version.id);
951
857
  */
952
- useHistoryVersionData(id: string): HistoryVersionDataState;
858
+ useHistoryVersionData(id: string): HistoryVersionDataAsyncResult;
953
859
  suspense: Resolve<RoomContextBundleCommon<P, S, U, E, M> & SharedContextBundle<U>["suspense"] & {
954
860
  /**
955
861
  * Returns the current storage status for the Room, and triggers
@@ -1011,14 +917,14 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
1011
917
  * @example
1012
918
  * const { threads } = useThreads();
1013
919
  */
1014
- useThreads(options?: UseThreadsOptions<M>): ThreadsStateSuccess<M>;
920
+ useThreads(options?: UseThreadsOptions<M>): ThreadsAsyncSuccess<M>;
1015
921
  /**
1016
922
  * (Private beta) Returns a history of versions of the current room.
1017
923
  *
1018
924
  * @example
1019
925
  * const { versions } = useHistoryVersions();
1020
926
  */
1021
- useHistoryVersions(): HistoryVersionsStateResolved;
927
+ useHistoryVersions(): HistoryVersionsAsyncSuccess;
1022
928
  /**
1023
929
  * Returns the user's notification settings for the current room
1024
930
  * and a function to update them.
@@ -1027,7 +933,7 @@ declare type RoomContextBundle<P extends JsonObject, S extends LsonObject, U ext
1027
933
  * const [{ settings }, updateSettings] = useRoomNotificationSettings();
1028
934
  */
1029
935
  useRoomNotificationSettings(): [
1030
- RoomNotificationSettingsStateSuccess,
936
+ RoomNotificationSettingsAsyncSuccess,
1031
937
  (settings: Partial<RoomNotificationSettings>) => void
1032
938
  ];
1033
939
  /**
@@ -1104,21 +1010,21 @@ declare type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetad
1104
1010
  * @example
1105
1011
  * const { inboxNotifications, error, isLoading } = useInboxNotifications();
1106
1012
  */
1107
- useInboxNotifications(): InboxNotificationsState;
1013
+ useInboxNotifications(): InboxNotificationsAsyncResult;
1108
1014
  /**
1109
1015
  * Returns the number of unread inbox notifications for the current user.
1110
1016
  *
1111
1017
  * @example
1112
1018
  * const { count, error, isLoading } = useUnreadInboxNotificationsCount();
1113
1019
  */
1114
- useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountState;
1020
+ useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountAsyncResult;
1115
1021
  /**
1116
1022
  * @experimental
1117
1023
  *
1118
1024
  * This hook is experimental and could be removed or changed at any time!
1119
1025
  * Do not use unless explicitly recommended by the Liveblocks team.
1120
1026
  */
1121
- useUserThreads_experimental(options?: UseUserThreadsOptions<M>): ThreadsState<M>;
1027
+ useUserThreads_experimental(options?: UseUserThreadsOptions<M>): ThreadsAsyncResult<M>;
1122
1028
  suspense: Resolve<LiveblocksContextBundleCommon<M> & SharedContextBundle<U>["suspense"] & {
1123
1029
  /**
1124
1030
  * Returns the inbox notifications for the current user.
@@ -1126,21 +1032,21 @@ declare type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetad
1126
1032
  * @example
1127
1033
  * const { inboxNotifications } = useInboxNotifications();
1128
1034
  */
1129
- useInboxNotifications(): InboxNotificationsStateSuccess;
1035
+ useInboxNotifications(): InboxNotificationsAsyncSuccess;
1130
1036
  /**
1131
1037
  * Returns the number of unread inbox notifications for the current user.
1132
1038
  *
1133
1039
  * @example
1134
1040
  * const { count } = useUnreadInboxNotificationsCount();
1135
1041
  */
1136
- useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountStateSuccess;
1042
+ useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountAsyncSuccess;
1137
1043
  /**
1138
1044
  * @experimental
1139
1045
  *
1140
1046
  * This hook is experimental and could be removed or changed at any time!
1141
1047
  * Do not use unless explicitly recommended by the Liveblocks team.
1142
1048
  */
1143
- useUserThreads_experimental(options?: UseUserThreadsOptions<M>): ThreadsStateSuccess<M>;
1049
+ useUserThreads_experimental(options?: UseUserThreadsOptions<M>): ThreadsAsyncSuccess<M>;
1144
1050
  }>;
1145
1051
  }>;
1146
1052
 
@@ -1239,7 +1145,7 @@ declare type UpdateNotificationSettingsOptimisticUpdate = {
1239
1145
  roomId: string;
1240
1146
  settings: Partial<RoomNotificationSettings$1>;
1241
1147
  };
1242
- declare type QueryState = AsyncResult<undefined>;
1148
+ declare type QueryAsyncResult = AsyncResult<undefined>;
1243
1149
  /**
1244
1150
  * Externally observable state of the store, which will have:
1245
1151
  * - Optimistic updates applied
@@ -1251,7 +1157,9 @@ declare type UmbrellaStoreState<M extends BaseMetadata> = {
1251
1157
  * e.g. 'room-abc-{"color":"red"}' - ok
1252
1158
  * e.g. 'room-abc-{}' - loading
1253
1159
  */
1254
- queries: Record<string, QueryState>;
1160
+ queries2: Record<string, QueryAsyncResult>;
1161
+ queries3: Record<string, QueryAsyncResult>;
1162
+ queries4: Record<string, QueryAsyncResult>;
1255
1163
  /**
1256
1164
  * All threads in a sorted array, optimistic updates applied, without deleted
1257
1165
  * threads.
@@ -1292,11 +1200,17 @@ declare class UmbrellaStore<M extends BaseMetadata> {
1292
1200
  private _stateCached;
1293
1201
  constructor();
1294
1202
  private get;
1295
- getThreads(): UmbrellaStoreState<M>;
1296
- getInboxNotifications(): UmbrellaStoreState<M>;
1297
- getInboxNotificationsAsync(): AsyncResultWithDataField<InboxNotificationData[], "inboxNotifications">;
1298
- getNotificationSettingsAsync(roomId: string): AsyncResultWithDataField<RoomNotificationSettings$1, "settings">;
1299
- getVersions(): UmbrellaStoreState<M>;
1203
+ batch(callback: () => void): void;
1204
+ getFullState(): UmbrellaStoreState<M>;
1205
+ /**
1206
+ * Returns the async result of the given queryKey. If the query is success,
1207
+ * then it will return the entire store's state in the payload.
1208
+ */
1209
+ getThreadsAsync(queryKey: string): AsyncResult<UmbrellaStoreState<M>, "fullState">;
1210
+ getUserThreadsAsync(queryKey: string): AsyncResult<UmbrellaStoreState<M>, "fullState">;
1211
+ getInboxNotificationsAsync(): AsyncResult<InboxNotificationData[], "inboxNotifications">;
1212
+ getNotificationSettingsAsync(roomId: string): RoomNotificationSettingsAsyncResult;
1213
+ getVersionsAsync(roomId: string): AsyncResult<HistoryVersion[], "versions">;
1300
1214
  /**
1301
1215
  * @private Only used by the E2E test suite.
1302
1216
  */
@@ -1307,14 +1221,18 @@ declare class UmbrellaStore<M extends BaseMetadata> {
1307
1221
  */
1308
1222
  _subscribeOptimisticUpdates(callback: () => void): () => void;
1309
1223
  subscribeThreads(callback: () => void): () => void;
1310
- subscribeInboxNotifications(callback: () => void): () => void;
1224
+ subscribeUserThreads(callback: () => void): () => void;
1225
+ subscribeThreadsOrInboxNotifications(callback: () => void): () => void;
1311
1226
  subscribeNotificationSettings(callback: () => void): () => void;
1312
1227
  subscribeVersions(callback: () => void): () => void;
1313
1228
  private updateThreadsCache;
1314
1229
  private updateInboxNotificationsCache;
1315
1230
  private setNotificationSettings;
1316
1231
  private setVersions;
1317
- private setQueryState;
1232
+ private setQuery1State;
1233
+ private setQuery2State;
1234
+ private setQuery3State;
1235
+ private setQuery4State;
1318
1236
  private updateOptimisticUpdatesCache;
1319
1237
  /**
1320
1238
  * Updates an existing inbox notification with a new value, replacing the
@@ -1377,7 +1295,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
1377
1295
  editComment(threadId: string, optimisticUpdateId: string, editedComment: CommentData): void;
1378
1296
  deleteComment(threadId: string, optimisticUpdateId: string, commentId: string, deletedAt: Date): void;
1379
1297
  updateThreadAndNotification(thread: ThreadData<M>, inboxNotification?: InboxNotificationData): void;
1380
- updateThreadsAndNotifications(threads: ThreadData<M>[], inboxNotifications: InboxNotificationData[], deletedThreads: ThreadDeleteInfo[], deletedInboxNotifications: InboxNotificationDeleteInfo[], queryKey?: string): void;
1298
+ updateThreadsAndNotifications(threads: ThreadData<M>[], inboxNotifications: InboxNotificationData[], deletedThreads: ThreadDeleteInfo[], deletedInboxNotifications: InboxNotificationDeleteInfo[]): void;
1381
1299
  /**
1382
1300
  * Updates existing notification setting for a room with a new value,
1383
1301
  * replacing the corresponding optimistic update.
@@ -1387,9 +1305,18 @@ declare class UmbrellaStore<M extends BaseMetadata> {
1387
1305
  updateRoomVersions(roomId: string, versions: HistoryVersion[], queryKey?: string): void;
1388
1306
  addOptimisticUpdate(optimisticUpdate: DistributiveOmit<OptimisticUpdate<M>, "id">): string;
1389
1307
  removeOptimisticUpdate(optimisticUpdateId: string): void;
1390
- setQueryLoading(queryKey: string): void;
1391
- private setQueryOK;
1392
- setQueryError(queryKey: string, error: Error): void;
1308
+ setQuery1Loading(): void;
1309
+ setQuery1OK(): void;
1310
+ setQuery1Error(error: Error): void;
1311
+ setQuery2Loading(queryKey: string): void;
1312
+ setQuery2OK(queryKey: string): void;
1313
+ setQuery2Error(queryKey: string, error: Error): void;
1314
+ setQuery3Loading(queryKey: string): void;
1315
+ private setQuery3OK;
1316
+ setQuery3Error(queryKey: string, error: Error): void;
1317
+ setQuery4Loading(queryKey: string): void;
1318
+ private setQuery4OK;
1319
+ setQuery4Error(queryKey: string, error: Error): void;
1393
1320
  }
1394
1321
 
1395
1322
  /**
@@ -1438,7 +1365,7 @@ declare function createLiveblocksContext<U extends BaseUserMeta = DU, M extends
1438
1365
  * @example
1439
1366
  * const { inboxNotifications, error, isLoading } = useInboxNotifications();
1440
1367
  */
1441
- declare function useInboxNotifications(): AsyncResultWithDataField<InboxNotificationData[], "inboxNotifications">;
1368
+ declare function useInboxNotifications(): AsyncResult<InboxNotificationData[], "inboxNotifications">;
1442
1369
  /**
1443
1370
  * Returns the inbox notifications for the current user.
1444
1371
  *
@@ -1488,7 +1415,7 @@ declare function useDeleteInboxNotification(): (inboxNotificationId: string) =>
1488
1415
  * @example
1489
1416
  * const { count, error, isLoading } = useUnreadInboxNotificationsCount();
1490
1417
  */
1491
- declare function useUnreadInboxNotificationsCount(): AsyncResultWithDataField<number, "count">;
1418
+ declare function useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountAsyncResult;
1492
1419
  /**
1493
1420
  * Returns the number of unread inbox notifications for the current user.
1494
1421
  *
@@ -1751,7 +1678,7 @@ declare function useThreadSubscription(threadId: string): ThreadSubscription;
1751
1678
  * const [{ settings }, updateSettings] = useRoomNotificationSettings();
1752
1679
  */
1753
1680
  declare function useRoomNotificationSettings(): [
1754
- RoomNotificationSettingsState,
1681
+ RoomNotificationSettingsAsyncResult,
1755
1682
  (settings: Partial<RoomNotificationSettings>) => void
1756
1683
  ];
1757
1684
  /**
@@ -1760,7 +1687,7 @@ declare function useRoomNotificationSettings(): [
1760
1687
  * @example
1761
1688
  * const {data} = useHistoryVersionData(versionId);
1762
1689
  */
1763
- declare function useHistoryVersionData(versionId: string): HistoryVersionDataState;
1690
+ declare function useHistoryVersionData(versionId: string): HistoryVersionDataAsyncResult;
1764
1691
  /**
1765
1692
  * Returns a function that updates the user's notification settings
1766
1693
  * for the current room.