@liveblocks/react 1.10.0-beta1 → 1.10.0-beta3
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 +26 -6
- package/dist/index.d.ts +26 -6
- package/dist/index.js +474 -344
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +468 -338
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
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,
|
|
5
|
+
import { BaseMetadata, Resolve, ToImmutable, kInternal, ThreadData, InboxNotificationData, 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> =
|
|
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;
|
|
@@ -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
|
|
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
|
|
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
|
|
1027
|
+
* const { count } = useUnreadInboxNotificationsCount();
|
|
1024
1028
|
*/
|
|
1025
1029
|
useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountStateSuccess;
|
|
1026
1030
|
}>;
|
|
@@ -1049,7 +1053,23 @@ declare function createLiveblocksContext<TUserMeta extends BaseUserMeta = BaseUs
|
|
|
1049
1053
|
* This is an internal API, use `createRoomContext` instead.
|
|
1050
1054
|
*/
|
|
1051
1055
|
declare function useRoomContextBundle(): RoomContextBundle<JsonObject, LsonObject, BaseUserMeta, never, BaseMetadata>;
|
|
1052
|
-
declare
|
|
1056
|
+
declare type Options<TUserMeta extends BaseUserMeta> = {
|
|
1057
|
+
/**
|
|
1058
|
+
* @deprecated Define 'resolveUsers' in 'createClient' from '@liveblocks/client' instead.
|
|
1059
|
+
* Please refer to our Upgrade Guide to learn more, see https://liveblocks.io/docs/platform/upgrading/1.10.
|
|
1060
|
+
*
|
|
1061
|
+
* A function that returns user info from user IDs.
|
|
1062
|
+
*/
|
|
1063
|
+
resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(TUserMeta["info"] | undefined)[] | undefined>;
|
|
1064
|
+
/**
|
|
1065
|
+
* @deprecated Define 'resolveMentionSuggestions' in 'createClient' from '@liveblocks/client' instead.
|
|
1066
|
+
* Please refer to our Upgrade Guide to learn more, see https://liveblocks.io/docs/platform/upgrading/1.10.
|
|
1067
|
+
*
|
|
1068
|
+
* A function that returns a list of user IDs matching a string.
|
|
1069
|
+
*/
|
|
1070
|
+
resolveMentionSuggestions?: (args: ResolveMentionSuggestionsArgs) => OptionalPromise<string[]>;
|
|
1071
|
+
};
|
|
1072
|
+
declare function createRoomContext<TPresence extends JsonObject, TStorage extends LsonObject = LsonObject, TUserMeta extends BaseUserMeta = BaseUserMeta, TRoomEvent extends Json = never, TThreadMetadata extends BaseMetadata = never>(client: Client, options?: Options<TUserMeta>): RoomContextBundle<TPresence, TStorage, TUserMeta, TRoomEvent, TThreadMetadata>;
|
|
1053
1073
|
|
|
1054
1074
|
/**
|
|
1055
1075
|
* @private
|
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,
|
|
5
|
+
import { BaseMetadata, Resolve, ToImmutable, kInternal, ThreadData, InboxNotificationData, 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> =
|
|
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;
|
|
@@ -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
|
|
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
|
|
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
|
|
1027
|
+
* const { count } = useUnreadInboxNotificationsCount();
|
|
1024
1028
|
*/
|
|
1025
1029
|
useUnreadInboxNotificationsCount(): UnreadInboxNotificationsCountStateSuccess;
|
|
1026
1030
|
}>;
|
|
@@ -1049,7 +1053,23 @@ declare function createLiveblocksContext<TUserMeta extends BaseUserMeta = BaseUs
|
|
|
1049
1053
|
* This is an internal API, use `createRoomContext` instead.
|
|
1050
1054
|
*/
|
|
1051
1055
|
declare function useRoomContextBundle(): RoomContextBundle<JsonObject, LsonObject, BaseUserMeta, never, BaseMetadata>;
|
|
1052
|
-
declare
|
|
1056
|
+
declare type Options<TUserMeta extends BaseUserMeta> = {
|
|
1057
|
+
/**
|
|
1058
|
+
* @deprecated Define 'resolveUsers' in 'createClient' from '@liveblocks/client' instead.
|
|
1059
|
+
* Please refer to our Upgrade Guide to learn more, see https://liveblocks.io/docs/platform/upgrading/1.10.
|
|
1060
|
+
*
|
|
1061
|
+
* A function that returns user info from user IDs.
|
|
1062
|
+
*/
|
|
1063
|
+
resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(TUserMeta["info"] | undefined)[] | undefined>;
|
|
1064
|
+
/**
|
|
1065
|
+
* @deprecated Define 'resolveMentionSuggestions' in 'createClient' from '@liveblocks/client' instead.
|
|
1066
|
+
* Please refer to our Upgrade Guide to learn more, see https://liveblocks.io/docs/platform/upgrading/1.10.
|
|
1067
|
+
*
|
|
1068
|
+
* A function that returns a list of user IDs matching a string.
|
|
1069
|
+
*/
|
|
1070
|
+
resolveMentionSuggestions?: (args: ResolveMentionSuggestionsArgs) => OptionalPromise<string[]>;
|
|
1071
|
+
};
|
|
1072
|
+
declare function createRoomContext<TPresence extends JsonObject, TStorage extends LsonObject = LsonObject, TUserMeta extends BaseUserMeta = BaseUserMeta, TRoomEvent extends Json = never, TThreadMetadata extends BaseMetadata = never>(client: Client, options?: Options<TUserMeta>): RoomContextBundle<TPresence, TStorage, TUserMeta, TRoomEvent, TThreadMetadata>;
|
|
1053
1073
|
|
|
1054
1074
|
/**
|
|
1055
1075
|
* @private
|