@liveblocks/react 1.10.0-beta2 → 1.10.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
@@ -2,7 +2,7 @@ import { ReactElement, ReactNode, PropsWithChildren } from 'react';
2
2
  import { JsonObject, LsonObject, BaseUserMeta, LiveObject, User, Json, RoomNotificationSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1, Client } from '@liveblocks/client';
3
3
  export { Json, JsonObject, shallow } from '@liveblocks/client';
4
4
  import * as _liveblocks_core from '@liveblocks/core';
5
- import { BaseMetadata, GetThreadsOptions, Resolve, ToImmutable, kInternal, ThreadData, InboxNotificationData, RoomEventMessage, CommentData, RoomInfo, CommentBody, PartialNullable, RoomInitializers, ResolveUsersArgs, OptionalPromise, ResolveMentionSuggestionsArgs, BaseUserMeta as BaseUserMeta$1 } from '@liveblocks/core';
5
+ import { BaseMetadata, Resolve, ToImmutable, kInternal, ThreadData, InboxNotificationData, LiveblocksError, RoomEventMessage, CommentData, RoomInfo, CommentBody, PartialNullable, RoomInitializers, ResolveUsersArgs, OptionalPromise, ResolveMentionSuggestionsArgs, BaseUserMeta as BaseUserMeta$1 } from '@liveblocks/core';
6
6
 
7
7
  declare type Props = {
8
8
  fallback: NonNullable<ReactNode> | null;
@@ -27,7 +27,11 @@ declare type Props = {
27
27
  */
28
28
  declare function ClientSideSuspense(props: Props): ReactElement;
29
29
 
30
- declare type UseThreadsOptions<TThreadMetadata extends BaseMetadata> = GetThreadsOptions<TThreadMetadata>;
30
+ declare type UseThreadsOptions<TThreadMetadata extends BaseMetadata> = {
31
+ query?: {
32
+ metadata?: Partial<TThreadMetadata>;
33
+ };
34
+ };
31
35
 
32
36
  declare type UserStateLoading = {
33
37
  isLoading: true;
@@ -345,7 +349,7 @@ declare type RoomContextBundleCommon<TPresence extends JsonObject, TStorage exte
345
349
  * console.error(er);
346
350
  * })
347
351
  */
348
- useErrorListener(callback: (err: Error) => void): void;
352
+ useErrorListener(callback: (err: LiveblocksError) => void): void;
349
353
  /**
350
354
  * useEventListener is a React hook that allows you to respond to events broadcast
351
355
  * by other users in the room.
@@ -936,7 +940,7 @@ declare type LiveblocksContextBundleCommon = {
936
940
  /**
937
941
  * @beta
938
942
  *
939
- * Makes Liveblocks non-Room features (e.g. Notifications) available
943
+ * Makes Liveblocks features outside of rooms (e.g. Notifications) available
940
944
  * in the component hierarchy below.
941
945
  */
942
946
  LiveblocksProvider(props: PropsWithChildren): JSX.Element;
@@ -1001,7 +1005,7 @@ declare type LiveblocksContextBundle<TUserMeta extends BaseUserMeta> = Resolve<L
1001
1005
  * Returns the number of unread inbox notifications for the current user.
1002
1006
  *
1003
1007
  * @example
1004
- * const unreadCount = useUnreadInboxNotificationsCount();
1008
+ * const { count, error, isLoading } = useUnreadInboxNotificationsCount();
1005
1009
  */
1006
1010
  useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountState;
1007
1011
  suspense: Resolve<LiveblocksContextBundleCommon & SharedContextBundle<TUserMeta>["suspense"] & {
@@ -1011,7 +1015,7 @@ declare type LiveblocksContextBundle<TUserMeta extends BaseUserMeta> = Resolve<L
1011
1015
  * Returns the inbox notifications for the current user.
1012
1016
  *
1013
1017
  * @example
1014
- * const { inboxNotifications, error, isLoading } = useInboxNotifications();
1018
+ * const { inboxNotifications } = useInboxNotifications();
1015
1019
  */
1016
1020
  useInboxNotifications(): InboxNotificationsStateSuccess;
1017
1021
  /**
@@ -1020,7 +1024,7 @@ declare type LiveblocksContextBundle<TUserMeta extends BaseUserMeta> = Resolve<L
1020
1024
  * Returns the number of unread inbox notifications for the current user.
1021
1025
  *
1022
1026
  * @example
1023
- * const unreadCount = useUnreadInboxNotificationsCount();
1027
+ * const { count } = useUnreadInboxNotificationsCount();
1024
1028
  */
1025
1029
  useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountStateSuccess;
1026
1030
  }>;
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { ReactElement, ReactNode, PropsWithChildren } from 'react';
2
2
  import { JsonObject, LsonObject, BaseUserMeta, LiveObject, User, Json, RoomNotificationSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1, Client } from '@liveblocks/client';
3
3
  export { Json, JsonObject, shallow } from '@liveblocks/client';
4
4
  import * as _liveblocks_core from '@liveblocks/core';
5
- import { BaseMetadata, GetThreadsOptions, Resolve, ToImmutable, kInternal, ThreadData, InboxNotificationData, RoomEventMessage, CommentData, RoomInfo, CommentBody, PartialNullable, RoomInitializers, ResolveUsersArgs, OptionalPromise, ResolveMentionSuggestionsArgs, BaseUserMeta as BaseUserMeta$1 } from '@liveblocks/core';
5
+ import { BaseMetadata, Resolve, ToImmutable, kInternal, ThreadData, InboxNotificationData, LiveblocksError, RoomEventMessage, CommentData, RoomInfo, CommentBody, PartialNullable, RoomInitializers, ResolveUsersArgs, OptionalPromise, ResolveMentionSuggestionsArgs, BaseUserMeta as BaseUserMeta$1 } from '@liveblocks/core';
6
6
 
7
7
  declare type Props = {
8
8
  fallback: NonNullable<ReactNode> | null;
@@ -27,7 +27,11 @@ declare type Props = {
27
27
  */
28
28
  declare function ClientSideSuspense(props: Props): ReactElement;
29
29
 
30
- declare type UseThreadsOptions<TThreadMetadata extends BaseMetadata> = GetThreadsOptions<TThreadMetadata>;
30
+ declare type UseThreadsOptions<TThreadMetadata extends BaseMetadata> = {
31
+ query?: {
32
+ metadata?: Partial<TThreadMetadata>;
33
+ };
34
+ };
31
35
 
32
36
  declare type UserStateLoading = {
33
37
  isLoading: true;
@@ -345,7 +349,7 @@ declare type RoomContextBundleCommon<TPresence extends JsonObject, TStorage exte
345
349
  * console.error(er);
346
350
  * })
347
351
  */
348
- useErrorListener(callback: (err: Error) => void): void;
352
+ useErrorListener(callback: (err: LiveblocksError) => void): void;
349
353
  /**
350
354
  * useEventListener is a React hook that allows you to respond to events broadcast
351
355
  * by other users in the room.
@@ -936,7 +940,7 @@ declare type LiveblocksContextBundleCommon = {
936
940
  /**
937
941
  * @beta
938
942
  *
939
- * Makes Liveblocks non-Room features (e.g. Notifications) available
943
+ * Makes Liveblocks features outside of rooms (e.g. Notifications) available
940
944
  * in the component hierarchy below.
941
945
  */
942
946
  LiveblocksProvider(props: PropsWithChildren): JSX.Element;
@@ -1001,7 +1005,7 @@ declare type LiveblocksContextBundle<TUserMeta extends BaseUserMeta> = Resolve<L
1001
1005
  * Returns the number of unread inbox notifications for the current user.
1002
1006
  *
1003
1007
  * @example
1004
- * const unreadCount = useUnreadInboxNotificationsCount();
1008
+ * const { count, error, isLoading } = useUnreadInboxNotificationsCount();
1005
1009
  */
1006
1010
  useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountState;
1007
1011
  suspense: Resolve<LiveblocksContextBundleCommon & SharedContextBundle<TUserMeta>["suspense"] & {
@@ -1011,7 +1015,7 @@ declare type LiveblocksContextBundle<TUserMeta extends BaseUserMeta> = Resolve<L
1011
1015
  * Returns the inbox notifications for the current user.
1012
1016
  *
1013
1017
  * @example
1014
- * const { inboxNotifications, error, isLoading } = useInboxNotifications();
1018
+ * const { inboxNotifications } = useInboxNotifications();
1015
1019
  */
1016
1020
  useInboxNotifications(): InboxNotificationsStateSuccess;
1017
1021
  /**
@@ -1020,7 +1024,7 @@ declare type LiveblocksContextBundle<TUserMeta extends BaseUserMeta> = Resolve<L
1020
1024
  * Returns the number of unread inbox notifications for the current user.
1021
1025
  *
1022
1026
  * @example
1023
- * const unreadCount = useUnreadInboxNotificationsCount();
1027
+ * const { count } = useUnreadInboxNotificationsCount();
1024
1028
  */
1025
1029
  useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountStateSuccess;
1026
1030
  }>;