@liveblocks/react 3.13.0-vincent2 → 3.13.0
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/_private.cjs +7 -7
- package/dist/_private.d.cts +2 -2
- package/dist/_private.d.ts +2 -2
- package/dist/_private.js +1 -1
- package/dist/{chunk-F3MGJA3E.cjs → chunk-C7F5PZXE.cjs} +2 -2
- package/dist/chunk-C7F5PZXE.cjs.map +1 -0
- package/dist/{chunk-CCOIV25T.js → chunk-ERRJHA6O.js} +171 -16
- package/dist/chunk-ERRJHA6O.js.map +1 -0
- package/dist/{chunk-5I7TKGJB.cjs → chunk-QFAOGFJK.cjs} +170 -15
- package/dist/chunk-QFAOGFJK.cjs.map +1 -0
- package/dist/{chunk-YJFPVEXB.js → chunk-RTM66YNN.js} +2 -2
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/{room-BadENFHi.d.cts → room-CEMGQ1Mj.d.cts} +145 -108
- package/dist/{room-BadENFHi.d.ts → room-CEMGQ1Mj.d.ts} +145 -108
- package/dist/suspense.cjs +6 -4
- package/dist/suspense.cjs.map +1 -1
- package/dist/suspense.d.cts +1 -1
- package/dist/suspense.d.ts +1 -1
- package/dist/suspense.js +8 -6
- package/dist/suspense.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-5I7TKGJB.cjs.map +0 -1
- package/dist/chunk-CCOIV25T.js.map +0 -1
- package/dist/chunk-F3MGJA3E.cjs.map +0 -1
- /package/dist/{chunk-YJFPVEXB.js.map → chunk-RTM66YNN.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ComponentType, Context, PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
import { BaseUserMeta, Client, JsonObject, LsonObject, LiveObject, User, Json, RoomSubscriptionSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1, ClientOptions, ThreadData as ThreadData$1, CommentData as CommentData$1 } from '@liveblocks/client';
|
|
4
4
|
import * as _liveblocks_core from '@liveblocks/core';
|
|
5
|
-
import { OpaqueClient, OpaqueRoom, AiKnowledgeSource, AiOpaqueToolDefinition, Relax, AiAssistantContentPart, BaseMetadata, QueryMetadata, AsyncResult, DRI, AsyncSuccess, DGI, GroupData, Resolve, CommentBody, CommentAttachment, PartialUnless, Patchable, InboxNotificationData, NotificationSettings, ToImmutable, MessageId, PartialNotificationSettings, AiChatsQuery, AsyncLoading, AsyncError, ThreadData, SearchCommentsResult, HistoryVersion, AiChat, UrlMetadata, Client as Client$1, LiveblocksError, SyncStatus, RoomEventMessage, CommentData, AiUserMessage, WithRequired, AiChatMessage, WithNavigation, MutableSignal, ThreadDataWithDeleteInfo, ThreadDeleteInfo, SubscriptionKey, SubscriptionData, DerivedSignal, DefaultMap, CommentUserReaction, InboxNotificationDeleteInfo, SubscriptionDeleteInfo, RoomSubscriptionSettings as RoomSubscriptionSettings$1, ISignal, Permission, BaseUserMeta as BaseUserMeta$1, DistributiveOmit, DU,
|
|
5
|
+
import { OpaqueClient, OpaqueRoom, AiKnowledgeSource, AiOpaqueToolDefinition, Relax, AiAssistantContentPart, BaseMetadata, QueryMetadata, AsyncResult, DRI, AsyncSuccess, DGI, GroupData, Resolve, CommentBody, CommentAttachment, PartialUnless, Patchable, InboxNotificationData, NotificationSettings, ToImmutable, MessageId, PartialNotificationSettings, AiChatsQuery, AsyncLoading, AsyncError, ThreadData, SearchCommentsResult, HistoryVersion, AiChat, UrlMetadata, Client as Client$1, LiveblocksError, SyncStatus, RoomEventMessage, CommentData, AiUserMessage, WithRequired, AiChatMessage, WithNavigation, MutableSignal, ThreadDataWithDeleteInfo, ThreadDeleteInfo, SubscriptionKey, SubscriptionData, DerivedSignal, DefaultMap, CommentUserReaction, InboxNotificationDeleteInfo, SubscriptionDeleteInfo, RoomSubscriptionSettings as RoomSubscriptionSettings$1, ISignal, Permission, BaseUserMeta as BaseUserMeta$1, DistributiveOmit, DU, DTM, DCM, TextEditorType, IYjsProvider, MentionData, DP, DS, DE } from '@liveblocks/core';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -125,7 +125,7 @@ type UseAiChatsOptions = {
|
|
|
125
125
|
*/
|
|
126
126
|
query?: AiChatsQuery;
|
|
127
127
|
};
|
|
128
|
-
type ThreadsQuery<
|
|
128
|
+
type ThreadsQuery<TM extends BaseMetadata> = {
|
|
129
129
|
/**
|
|
130
130
|
* Whether to only return threads marked as resolved or unresolved. If not provided,
|
|
131
131
|
* all threads will be returned.
|
|
@@ -140,21 +140,21 @@ type ThreadsQuery<M extends BaseMetadata> = {
|
|
|
140
140
|
* The metadata to filter the threads by. If provided, only threads with metadata that matches
|
|
141
141
|
* the provided metadata will be returned. If not provided, all threads will be returned.
|
|
142
142
|
*/
|
|
143
|
-
metadata?: Partial<QueryMetadata<
|
|
143
|
+
metadata?: Partial<QueryMetadata<TM>>;
|
|
144
144
|
};
|
|
145
|
-
type UseUserThreadsOptions<
|
|
145
|
+
type UseUserThreadsOptions<TM extends BaseMetadata> = {
|
|
146
146
|
/**
|
|
147
147
|
* The query (including metadata) to filter the threads by. If provided, only threads
|
|
148
148
|
* that match the query will be returned. If not provided, all threads will be returned.
|
|
149
149
|
*/
|
|
150
|
-
query?: ThreadsQuery<
|
|
150
|
+
query?: ThreadsQuery<TM>;
|
|
151
151
|
};
|
|
152
|
-
type UseThreadsOptions<
|
|
152
|
+
type UseThreadsOptions<TM extends BaseMetadata> = {
|
|
153
153
|
/**
|
|
154
154
|
* The query (including metadata) to filter the threads by. If provided, only threads
|
|
155
155
|
* that match the query will be returned. If not provided, all threads will be returned.
|
|
156
156
|
*/
|
|
157
|
-
query?: ThreadsQuery<
|
|
157
|
+
query?: ThreadsQuery<TM>;
|
|
158
158
|
/**
|
|
159
159
|
* Whether to scroll to a comment on load based on the URL hash. Defaults to `true`.
|
|
160
160
|
*
|
|
@@ -164,11 +164,11 @@ type UseThreadsOptions<M extends BaseMetadata> = {
|
|
|
164
164
|
*/
|
|
165
165
|
scrollOnLoad?: boolean;
|
|
166
166
|
};
|
|
167
|
-
type SearchCommentsQuery<
|
|
167
|
+
type SearchCommentsQuery<TM extends BaseMetadata> = {
|
|
168
168
|
/**
|
|
169
169
|
* (Optional) Metadata to filter the threads by.
|
|
170
170
|
*/
|
|
171
|
-
threadMetadata?: Partial<QueryMetadata<
|
|
171
|
+
threadMetadata?: Partial<QueryMetadata<TM>>;
|
|
172
172
|
/**
|
|
173
173
|
* (Optional) Whether to only return comments from threads marked as resolved or unresolved.
|
|
174
174
|
*/
|
|
@@ -186,8 +186,8 @@ type SearchCommentsQuery<M extends BaseMetadata> = {
|
|
|
186
186
|
*/
|
|
187
187
|
text: string;
|
|
188
188
|
};
|
|
189
|
-
type UseSearchCommentsOptions<
|
|
190
|
-
query: SearchCommentsQuery<
|
|
189
|
+
type UseSearchCommentsOptions<TM extends BaseMetadata> = {
|
|
190
|
+
query: SearchCommentsQuery<TM>;
|
|
191
191
|
};
|
|
192
192
|
type InboxNotificationsQuery = {
|
|
193
193
|
/**
|
|
@@ -215,26 +215,36 @@ type GroupInfoAsyncSuccess = AsyncSuccess<DGI, "info">;
|
|
|
215
215
|
type AttachmentUrlAsyncResult = AsyncResult<string, "url">;
|
|
216
216
|
type AttachmentUrlAsyncSuccess = AsyncSuccess<string, "url">;
|
|
217
217
|
type GroupAsyncResult = AsyncResult<GroupData | undefined, "group">;
|
|
218
|
-
type CreateThreadOptions<
|
|
218
|
+
type CreateThreadOptions<TM extends BaseMetadata, CM extends BaseMetadata> = Resolve<{
|
|
219
219
|
body: CommentBody;
|
|
220
220
|
attachments?: CommentAttachment[];
|
|
221
|
-
} & PartialUnless<
|
|
222
|
-
metadata:
|
|
221
|
+
} & PartialUnless<TM, {
|
|
222
|
+
metadata: TM;
|
|
223
|
+
}> & PartialUnless<CM, {
|
|
224
|
+
commentMetadata: CM;
|
|
223
225
|
}>>;
|
|
224
|
-
type EditThreadMetadataOptions<
|
|
226
|
+
type EditThreadMetadataOptions<TM extends BaseMetadata> = {
|
|
225
227
|
threadId: string;
|
|
226
|
-
metadata: Patchable<
|
|
228
|
+
metadata: Patchable<TM>;
|
|
227
229
|
};
|
|
228
|
-
type CreateCommentOptions = {
|
|
230
|
+
type CreateCommentOptions<CM extends BaseMetadata> = {
|
|
229
231
|
threadId: string;
|
|
230
232
|
body: CommentBody;
|
|
231
233
|
attachments?: CommentAttachment[];
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
+
} & PartialUnless<CM, {
|
|
235
|
+
metadata: CM;
|
|
236
|
+
}>;
|
|
237
|
+
type EditCommentOptions<CM extends BaseMetadata> = {
|
|
234
238
|
threadId: string;
|
|
235
239
|
commentId: string;
|
|
236
240
|
body: CommentBody;
|
|
237
241
|
attachments?: CommentAttachment[];
|
|
242
|
+
metadata?: Patchable<CM>;
|
|
243
|
+
};
|
|
244
|
+
type EditCommentMetadataOptions<CM extends BaseMetadata> = {
|
|
245
|
+
threadId: string;
|
|
246
|
+
commentId: string;
|
|
247
|
+
metadata: Patchable<CM>;
|
|
238
248
|
};
|
|
239
249
|
type DeleteCommentOptions = {
|
|
240
250
|
threadId: string;
|
|
@@ -253,8 +263,8 @@ type PaginationFields = {
|
|
|
253
263
|
};
|
|
254
264
|
type PagedAsyncSuccess<T, F extends string> = Resolve<AsyncSuccess<T, F> & PaginationFields>;
|
|
255
265
|
type PagedAsyncResult<T, F extends string> = Relax<AsyncLoading<F> | AsyncError<F> | PagedAsyncSuccess<T, F>>;
|
|
256
|
-
type ThreadsAsyncSuccess<
|
|
257
|
-
type ThreadsAsyncResult<
|
|
266
|
+
type ThreadsAsyncSuccess<TM extends BaseMetadata, CM extends BaseMetadata> = PagedAsyncSuccess<ThreadData<TM, CM>[], "threads">;
|
|
267
|
+
type ThreadsAsyncResult<TM extends BaseMetadata, CM extends BaseMetadata> = PagedAsyncResult<ThreadData<TM, CM>[], "threads">;
|
|
258
268
|
type SearchCommentsAsyncResult = AsyncResult<Array<SearchCommentsResult>, "results">;
|
|
259
269
|
type InboxNotificationsAsyncSuccess = PagedAsyncSuccess<InboxNotificationData[], "inboxNotifications">;
|
|
260
270
|
type InboxNotificationsAsyncResult = PagedAsyncResult<InboxNotificationData[], "inboxNotifications">;
|
|
@@ -493,13 +503,13 @@ type SharedContextBundle<U extends BaseUserMeta> = {
|
|
|
493
503
|
/**
|
|
494
504
|
* Properties that are the same in RoomContext and RoomContext["suspense"].
|
|
495
505
|
*/
|
|
496
|
-
type RoomContextBundleCommon<P extends JsonObject, S extends LsonObject, U extends BaseUserMeta, E extends Json,
|
|
506
|
+
type RoomContextBundleCommon<P extends JsonObject, S extends LsonObject, U extends BaseUserMeta, E extends Json, TM extends BaseMetadata, CM extends BaseMetadata> = {
|
|
497
507
|
/**
|
|
498
508
|
* You normally don't need to directly interact with the RoomContext, but
|
|
499
509
|
* it can be necessary if you're building an advanced app where you need to
|
|
500
510
|
* set up a context bridge between two React renderers.
|
|
501
511
|
*/
|
|
502
|
-
RoomContext: Context<Room<P, S, U, E,
|
|
512
|
+
RoomContext: Context<Room<P, S, U, E, TM, CM> | null>;
|
|
503
513
|
/**
|
|
504
514
|
* Makes a Room available in the component hierarchy below.
|
|
505
515
|
* Joins the room when the component is mounted, and automatically leaves
|
|
@@ -512,10 +522,10 @@ type RoomContextBundleCommon<P extends JsonObject, S extends LsonObject, U exten
|
|
|
512
522
|
*/
|
|
513
523
|
useRoom(options?: {
|
|
514
524
|
allowOutsideRoom: false;
|
|
515
|
-
}): Room<P, S, U, E,
|
|
525
|
+
}): Room<P, S, U, E, TM, CM>;
|
|
516
526
|
useRoom(options: {
|
|
517
527
|
allowOutsideRoom: boolean;
|
|
518
|
-
}): Room<P, S, U, E,
|
|
528
|
+
}): Room<P, S, U, E, TM, CM> | null;
|
|
519
529
|
/**
|
|
520
530
|
* Returns the current connection status for the Room, and triggers
|
|
521
531
|
* a re-render whenever it changes. Can be used to render a status badge.
|
|
@@ -786,7 +796,7 @@ type RoomContextBundleCommon<P extends JsonObject, S extends LsonObject, U exten
|
|
|
786
796
|
* const createThread = useCreateThread();
|
|
787
797
|
* createThread({ body: {}, metadata: {} });
|
|
788
798
|
*/
|
|
789
|
-
useCreateThread(): (options: CreateThreadOptions<
|
|
799
|
+
useCreateThread(): (options: CreateThreadOptions<TM, CM>) => ThreadData<TM, CM>;
|
|
790
800
|
/**
|
|
791
801
|
* Returns a function that deletes a thread and its associated comments.
|
|
792
802
|
* Only the thread creator can delete a thread, it will throw otherwise.
|
|
@@ -804,7 +814,7 @@ type RoomContextBundleCommon<P extends JsonObject, S extends LsonObject, U exten
|
|
|
804
814
|
* const editThreadMetadata = useEditThreadMetadata();
|
|
805
815
|
* editThreadMetadata({ threadId: "th_xxx", metadata: {} })
|
|
806
816
|
*/
|
|
807
|
-
useEditThreadMetadata(): (options: EditThreadMetadataOptions<
|
|
817
|
+
useEditThreadMetadata(): (options: EditThreadMetadataOptions<TM>) => void;
|
|
808
818
|
/**
|
|
809
819
|
* Returns a function that marks a thread as resolved.
|
|
810
820
|
*
|
|
@@ -844,15 +854,24 @@ type RoomContextBundleCommon<P extends JsonObject, S extends LsonObject, U exten
|
|
|
844
854
|
* const createComment = useCreateComment();
|
|
845
855
|
* createComment({ threadId: "th_xxx", body: {} });
|
|
846
856
|
*/
|
|
847
|
-
useCreateComment(): (options: CreateCommentOptions) => CommentData
|
|
857
|
+
useCreateComment(): (options: CreateCommentOptions<CM>) => CommentData<CM>;
|
|
848
858
|
/**
|
|
849
|
-
* Returns a function that edits a comment
|
|
859
|
+
* Returns a function that edits a comment.
|
|
850
860
|
*
|
|
851
861
|
* @example
|
|
852
862
|
* const editComment = useEditComment()
|
|
853
863
|
* editComment({ threadId: "th_xxx", commentId: "cm_xxx", body: {} })
|
|
854
864
|
*/
|
|
855
|
-
useEditComment(): (options: EditCommentOptions) => void;
|
|
865
|
+
useEditComment(): (options: EditCommentOptions<CM>) => void;
|
|
866
|
+
/**
|
|
867
|
+
* Returns a function that edits a comment's metadata.
|
|
868
|
+
* To delete an existing metadata property, set its value to `null`.
|
|
869
|
+
*
|
|
870
|
+
* @example
|
|
871
|
+
* const editCommentMetadata = useEditCommentMetadata();
|
|
872
|
+
* editCommentMetadata({ threadId: "th_xxx", commentId: "cm_xxx", metadata: { tag: "important", externalId: 1234 } })
|
|
873
|
+
*/
|
|
874
|
+
useEditCommentMetadata(): (options: EditCommentMetadataOptions<CM>) => void;
|
|
856
875
|
/**
|
|
857
876
|
* Returns a function that deletes a comment.
|
|
858
877
|
* If it is the last non-deleted comment, the thread also gets deleted.
|
|
@@ -904,7 +923,7 @@ type RoomContextBundleCommon<P extends JsonObject, S extends LsonObject, U exten
|
|
|
904
923
|
*/
|
|
905
924
|
useThreadSubscription(threadId: string): ThreadSubscription;
|
|
906
925
|
};
|
|
907
|
-
type RoomContextBundle<P extends JsonObject, S extends LsonObject, U extends BaseUserMeta, E extends Json,
|
|
926
|
+
type RoomContextBundle<P extends JsonObject, S extends LsonObject, U extends BaseUserMeta, E extends Json, TM extends BaseMetadata, CM extends BaseMetadata> = Resolve<RoomContextBundleCommon<P, S, U, E, TM, CM> & SharedContextBundle<U>["classic"] & {
|
|
908
927
|
/**
|
|
909
928
|
* Extract arbitrary data from the Liveblocks Storage state, using an
|
|
910
929
|
* arbitrary selector function.
|
|
@@ -965,14 +984,14 @@ type RoomContextBundle<P extends JsonObject, S extends LsonObject, U extends Bas
|
|
|
965
984
|
* @example
|
|
966
985
|
* const { threads, error, isLoading } = useThreads();
|
|
967
986
|
*/
|
|
968
|
-
useThreads(options?: UseThreadsOptions<
|
|
987
|
+
useThreads(options?: UseThreadsOptions<TM>): ThreadsAsyncResult<TM, CM>;
|
|
969
988
|
/**
|
|
970
989
|
* Returns the result of searching comments by text in the current room. The result includes the id and the plain text content of the matched comments along with the parent thread id of the comment.
|
|
971
990
|
*
|
|
972
991
|
* @example
|
|
973
992
|
* const { results, error, isLoading } = useSearchComments({ query: { text: "hello"} });
|
|
974
993
|
*/
|
|
975
|
-
useSearchComments(options: UseSearchCommentsOptions<
|
|
994
|
+
useSearchComments(options: UseSearchCommentsOptions<TM>): SearchCommentsAsyncResult;
|
|
976
995
|
/**
|
|
977
996
|
* Returns the user's subscription settings for the current room
|
|
978
997
|
* and a function to update them.
|
|
@@ -1005,7 +1024,7 @@ type RoomContextBundle<P extends JsonObject, S extends LsonObject, U extends Bas
|
|
|
1005
1024
|
* const { data, error, isLoading } = useHistoryVersionData(version.id);
|
|
1006
1025
|
*/
|
|
1007
1026
|
useHistoryVersionData(id: string): HistoryVersionDataAsyncResult;
|
|
1008
|
-
suspense: Resolve<RoomContextBundleCommon<P, S, U, E,
|
|
1027
|
+
suspense: Resolve<RoomContextBundleCommon<P, S, U, E, TM, CM> & SharedContextBundle<U>["suspense"] & {
|
|
1009
1028
|
/**
|
|
1010
1029
|
* Extract arbitrary data from the Liveblocks Storage state, using an
|
|
1011
1030
|
* arbitrary selector function.
|
|
@@ -1060,7 +1079,7 @@ type RoomContextBundle<P extends JsonObject, S extends LsonObject, U extends Bas
|
|
|
1060
1079
|
* @example
|
|
1061
1080
|
* const { threads } = useThreads();
|
|
1062
1081
|
*/
|
|
1063
|
-
useThreads(options?: UseThreadsOptions<
|
|
1082
|
+
useThreads(options?: UseThreadsOptions<TM>): ThreadsAsyncSuccess<TM, CM>;
|
|
1064
1083
|
/**
|
|
1065
1084
|
* (Private beta) Returns a history of versions of the current room.
|
|
1066
1085
|
*
|
|
@@ -1091,7 +1110,7 @@ type RoomContextBundle<P extends JsonObject, S extends LsonObject, U extends Bas
|
|
|
1091
1110
|
/**
|
|
1092
1111
|
* Properties that are the same in LiveblocksContext and LiveblocksContext["suspense"].
|
|
1093
1112
|
*/
|
|
1094
|
-
type LiveblocksContextBundleCommon<
|
|
1113
|
+
type LiveblocksContextBundleCommon<TM extends BaseMetadata, CM extends BaseMetadata> = {
|
|
1095
1114
|
/**
|
|
1096
1115
|
* Makes Liveblocks features outside of rooms (e.g. Notifications) available
|
|
1097
1116
|
* in the component hierarchy below.
|
|
@@ -1144,7 +1163,7 @@ type LiveblocksContextBundleCommon<M extends BaseMetadata> = {
|
|
|
1144
1163
|
* @example
|
|
1145
1164
|
* const thread = useInboxNotificationThread("in_xxx");
|
|
1146
1165
|
*/
|
|
1147
|
-
useInboxNotificationThread(inboxNotificationId: string): ThreadData<
|
|
1166
|
+
useInboxNotificationThread(inboxNotificationId: string): ThreadData<TM, CM>;
|
|
1148
1167
|
/**
|
|
1149
1168
|
* Returns notification settings for the current user.
|
|
1150
1169
|
*
|
|
@@ -1265,7 +1284,7 @@ type LiveblocksContextBundleCommon<M extends BaseMetadata> = {
|
|
|
1265
1284
|
(options: WithRequired<SendAiMessageOptions, "chatId">): AiUserMessage;
|
|
1266
1285
|
};
|
|
1267
1286
|
};
|
|
1268
|
-
type LiveblocksContextBundle<U extends BaseUserMeta,
|
|
1287
|
+
type LiveblocksContextBundle<U extends BaseUserMeta, TM extends BaseMetadata, CM extends BaseMetadata> = Resolve<LiveblocksContextBundleCommon<TM, CM> & SharedContextBundle<U>["classic"] & {
|
|
1269
1288
|
/**
|
|
1270
1289
|
* Returns the inbox notifications for the current user.
|
|
1271
1290
|
*
|
|
@@ -1286,7 +1305,7 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
|
|
|
1286
1305
|
* This hook is experimental and could be removed or changed at any time!
|
|
1287
1306
|
* Do not use unless explicitly recommended by the Liveblocks team.
|
|
1288
1307
|
*/
|
|
1289
|
-
useUserThreads_experimental(options?: UseUserThreadsOptions<
|
|
1308
|
+
useUserThreads_experimental(options?: UseUserThreadsOptions<TM>): ThreadsAsyncResult<TM, CM>;
|
|
1290
1309
|
/**
|
|
1291
1310
|
* (Private beta) Returns the chats for the current user.
|
|
1292
1311
|
*
|
|
@@ -1338,7 +1357,7 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
|
|
|
1338
1357
|
* const { metadata, error, isLoading } = useUrlMetadata("https://liveblocks.io");
|
|
1339
1358
|
*/
|
|
1340
1359
|
useUrlMetadata(url: string): UrlMetadataAsyncResult;
|
|
1341
|
-
suspense: Resolve<LiveblocksContextBundleCommon<
|
|
1360
|
+
suspense: Resolve<LiveblocksContextBundleCommon<TM, CM> & SharedContextBundle<U>["suspense"] & {
|
|
1342
1361
|
/**
|
|
1343
1362
|
* Returns the inbox notifications for the current user.
|
|
1344
1363
|
*
|
|
@@ -1369,7 +1388,7 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
|
|
|
1369
1388
|
* This hook is experimental and could be removed or changed at any time!
|
|
1370
1389
|
* Do not use unless explicitly recommended by the Liveblocks team.
|
|
1371
1390
|
*/
|
|
1372
|
-
useUserThreads_experimental(options?: UseUserThreadsOptions<
|
|
1391
|
+
useUserThreads_experimental(options?: UseUserThreadsOptions<TM>): ThreadsAsyncSuccess<TM, CM>;
|
|
1373
1392
|
/**
|
|
1374
1393
|
* (Private beta) Returns the chats for the current user.
|
|
1375
1394
|
*
|
|
@@ -1424,7 +1443,7 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
|
|
|
1424
1443
|
}>;
|
|
1425
1444
|
}>;
|
|
1426
1445
|
|
|
1427
|
-
type ReadonlyThreadDB<
|
|
1446
|
+
type ReadonlyThreadDB<TM extends BaseMetadata, CM extends BaseMetadata> = Omit<ThreadDB<TM, CM>, "upsert" | "delete" | "signal">;
|
|
1428
1447
|
/**
|
|
1429
1448
|
* This class implements a lightweight, in-memory, "database" for all Thread
|
|
1430
1449
|
* instances.
|
|
@@ -1442,20 +1461,20 @@ type ReadonlyThreadDB<M extends BaseMetadata> = Omit<ThreadDB<M>, "upsert" | "de
|
|
|
1442
1461
|
* optimistic updates without losing the original thread contents.
|
|
1443
1462
|
*
|
|
1444
1463
|
*/
|
|
1445
|
-
declare class ThreadDB<
|
|
1464
|
+
declare class ThreadDB<TM extends BaseMetadata, CM extends BaseMetadata> {
|
|
1446
1465
|
#private;
|
|
1447
1466
|
readonly signal: MutableSignal<this>;
|
|
1448
1467
|
constructor();
|
|
1449
|
-
clone(): ThreadDB<
|
|
1468
|
+
clone(): ThreadDB<TM, CM>;
|
|
1450
1469
|
/** Returns an existing thread by ID. Will never return a deleted thread. */
|
|
1451
|
-
get(threadId: string): ThreadData<
|
|
1470
|
+
get(threadId: string): ThreadData<TM, CM> | undefined;
|
|
1452
1471
|
/** Returns the (possibly deleted) thread by ID. */
|
|
1453
|
-
getEvenIfDeleted(threadId: string): ThreadDataWithDeleteInfo<
|
|
1472
|
+
getEvenIfDeleted(threadId: string): ThreadDataWithDeleteInfo<TM, CM> | undefined;
|
|
1454
1473
|
/** Adds or updates a thread in the DB. If the newly given thread is a deleted one, it will get deleted. */
|
|
1455
|
-
upsert(thread: ThreadDataWithDeleteInfo<
|
|
1474
|
+
upsert(thread: ThreadDataWithDeleteInfo<TM, CM>): void;
|
|
1456
1475
|
/** Like .upsert(), except it won't update if a thread by this ID already exists. */
|
|
1457
|
-
upsertIfNewer(thread: ThreadDataWithDeleteInfo<
|
|
1458
|
-
applyDelta(newThreads: ThreadData<
|
|
1476
|
+
upsertIfNewer(thread: ThreadDataWithDeleteInfo<TM, CM>): void;
|
|
1477
|
+
applyDelta(newThreads: ThreadData<TM, CM>[], deletedThreads: ThreadDeleteInfo[]): void;
|
|
1459
1478
|
/**
|
|
1460
1479
|
* Marks a thread as deleted. It will no longer pop up in .findMany()
|
|
1461
1480
|
* queries, but it can still be accessed via `.getEvenIfDeleted()`.
|
|
@@ -1474,15 +1493,15 @@ declare class ThreadDB<M extends BaseMetadata> {
|
|
|
1474
1493
|
*
|
|
1475
1494
|
* Subscriptions are needed to filter threads based on the user's subscriptions.
|
|
1476
1495
|
*/
|
|
1477
|
-
findMany(roomId: string | undefined, query: ThreadsQuery<
|
|
1496
|
+
findMany(roomId: string | undefined, query: ThreadsQuery<TM> | undefined, direction: "asc" | "desc", subscriptions?: Record<SubscriptionKey, SubscriptionData>): ThreadData<TM, CM>[];
|
|
1478
1497
|
}
|
|
1479
1498
|
|
|
1480
|
-
type OptimisticUpdate<
|
|
1481
|
-
type CreateThreadOptimisticUpdate<
|
|
1499
|
+
type OptimisticUpdate<TM extends BaseMetadata, CM extends BaseMetadata> = CreateThreadOptimisticUpdate<TM, CM> | DeleteThreadOptimisticUpdate | EditThreadMetadataOptimisticUpdate<TM> | MarkThreadAsResolvedOptimisticUpdate | MarkThreadAsUnresolvedOptimisticUpdate | SubscribeToThreadOptimisticUpdate | UnsubscribeFromThreadOptimisticUpdate | CreateCommentOptimisticUpdate<CM> | EditCommentOptimisticUpdate<CM> | EditCommentMetadataOptimisticUpdate<CM> | DeleteCommentOptimisticUpdate | AddReactionOptimisticUpdate | RemoveReactionOptimisticUpdate | MarkInboxNotificationAsReadOptimisticUpdate | MarkAllInboxNotificationsAsReadOptimisticUpdate | DeleteInboxNotificationOptimisticUpdate | DeleteAllInboxNotificationsOptimisticUpdate | UpdateRoomSubscriptionSettingsOptimisticUpdate | UpdateNotificationSettingsOptimisticUpdate;
|
|
1500
|
+
type CreateThreadOptimisticUpdate<TM extends BaseMetadata, CM extends BaseMetadata> = {
|
|
1482
1501
|
type: "create-thread";
|
|
1483
1502
|
id: string;
|
|
1484
1503
|
roomId: string;
|
|
1485
|
-
thread: ThreadData<
|
|
1504
|
+
thread: ThreadData<TM, CM>;
|
|
1486
1505
|
};
|
|
1487
1506
|
type DeleteThreadOptimisticUpdate = {
|
|
1488
1507
|
type: "delete-thread";
|
|
@@ -1491,11 +1510,11 @@ type DeleteThreadOptimisticUpdate = {
|
|
|
1491
1510
|
threadId: string;
|
|
1492
1511
|
deletedAt: Date;
|
|
1493
1512
|
};
|
|
1494
|
-
type EditThreadMetadataOptimisticUpdate<
|
|
1513
|
+
type EditThreadMetadataOptimisticUpdate<TM extends BaseMetadata> = {
|
|
1495
1514
|
type: "edit-thread-metadata";
|
|
1496
1515
|
id: string;
|
|
1497
1516
|
threadId: string;
|
|
1498
|
-
metadata: Resolve<Patchable<
|
|
1517
|
+
metadata: Resolve<Patchable<TM>>;
|
|
1499
1518
|
updatedAt: Date;
|
|
1500
1519
|
};
|
|
1501
1520
|
type MarkThreadAsResolvedOptimisticUpdate = {
|
|
@@ -1522,15 +1541,23 @@ type UnsubscribeFromThreadOptimisticUpdate = {
|
|
|
1522
1541
|
threadId: string;
|
|
1523
1542
|
unsubscribedAt: Date;
|
|
1524
1543
|
};
|
|
1525
|
-
type CreateCommentOptimisticUpdate = {
|
|
1544
|
+
type CreateCommentOptimisticUpdate<CM extends BaseMetadata> = {
|
|
1526
1545
|
type: "create-comment";
|
|
1527
1546
|
id: string;
|
|
1528
|
-
comment: CommentData
|
|
1547
|
+
comment: CommentData<CM>;
|
|
1529
1548
|
};
|
|
1530
|
-
type EditCommentOptimisticUpdate = {
|
|
1549
|
+
type EditCommentOptimisticUpdate<CM extends BaseMetadata> = {
|
|
1531
1550
|
type: "edit-comment";
|
|
1532
1551
|
id: string;
|
|
1533
|
-
comment: CommentData
|
|
1552
|
+
comment: CommentData<CM>;
|
|
1553
|
+
};
|
|
1554
|
+
type EditCommentMetadataOptimisticUpdate<CM extends BaseMetadata> = {
|
|
1555
|
+
type: "edit-comment-metadata";
|
|
1556
|
+
id: string;
|
|
1557
|
+
threadId: string;
|
|
1558
|
+
commentId: string;
|
|
1559
|
+
metadata: Resolve<Patchable<CM>>;
|
|
1560
|
+
updatedAt: Date;
|
|
1534
1561
|
};
|
|
1535
1562
|
type DeleteCommentOptimisticUpdate = {
|
|
1536
1563
|
type: "delete-comment";
|
|
@@ -1626,14 +1653,14 @@ type NotificationsLUT = Map<string, InboxNotificationData>;
|
|
|
1626
1653
|
*/
|
|
1627
1654
|
type RoomSubscriptionSettingsByRoomId = Record<RoomId, RoomSubscriptionSettings$1>;
|
|
1628
1655
|
type SubscriptionsByKey = Record<SubscriptionKey, SubscriptionData>;
|
|
1629
|
-
type CleanThreadifications<
|
|
1630
|
-
type CleanThreads<
|
|
1656
|
+
type CleanThreadifications<TM extends BaseMetadata, CM extends BaseMetadata> = CleanThreads<TM, CM> & CleanNotifications;
|
|
1657
|
+
type CleanThreads<TM extends BaseMetadata, CM extends BaseMetadata> = {
|
|
1631
1658
|
/**
|
|
1632
1659
|
* Keep track of loading and error status of all the queries made by the client.
|
|
1633
1660
|
* e.g. 'room-abc-{"color":"red"}' - ok
|
|
1634
1661
|
* e.g. 'room-abc-{}' - loading
|
|
1635
1662
|
*/
|
|
1636
|
-
threadsDB: ReadonlyThreadDB<
|
|
1663
|
+
threadsDB: ReadonlyThreadDB<TM, CM>;
|
|
1637
1664
|
};
|
|
1638
1665
|
type CleanNotifications = {
|
|
1639
1666
|
/**
|
|
@@ -1668,7 +1695,7 @@ declare function createStore_forNotifications(): {
|
|
|
1668
1695
|
delete: (inboxNotificationId: string) => void;
|
|
1669
1696
|
applyDelta: (newNotifications: InboxNotificationData[], deletedNotifications: InboxNotificationDeleteInfo[]) => void;
|
|
1670
1697
|
clear: () => void;
|
|
1671
|
-
updateAssociatedNotification: (newComment: CommentData) => void;
|
|
1698
|
+
updateAssociatedNotification: <CM extends BaseMetadata>(newComment: CommentData<CM>) => void;
|
|
1672
1699
|
upsert: (notification: InboxNotificationData) => void;
|
|
1673
1700
|
};
|
|
1674
1701
|
declare function createStore_forUnreadNotificationsCount(): {
|
|
@@ -1677,13 +1704,13 @@ declare function createStore_forUnreadNotificationsCount(): {
|
|
|
1677
1704
|
}>;
|
|
1678
1705
|
update: (queryKey: InboxNotificationsQueryKey, count: number) => void;
|
|
1679
1706
|
};
|
|
1680
|
-
declare function createStore_forSubscriptions(updates: ISignal<readonly OptimisticUpdate<BaseMetadata>[]>, threads: ReadonlyThreadDB<BaseMetadata>): {
|
|
1707
|
+
declare function createStore_forSubscriptions(updates: ISignal<readonly OptimisticUpdate<BaseMetadata, BaseMetadata>[]>, threads: ReadonlyThreadDB<BaseMetadata, BaseMetadata>): {
|
|
1681
1708
|
signal: DerivedSignal<SubscriptionsByKey>;
|
|
1682
1709
|
applyDelta: (newSubscriptions: SubscriptionData[], deletedSubscriptions: SubscriptionDeleteInfo[]) => void;
|
|
1683
1710
|
create: (subscription: SubscriptionData) => void;
|
|
1684
1711
|
delete: (subscriptionKey: SubscriptionKey) => void;
|
|
1685
1712
|
};
|
|
1686
|
-
declare function createStore_forRoomSubscriptionSettings(updates: ISignal<readonly OptimisticUpdate<BaseMetadata>[]>): {
|
|
1713
|
+
declare function createStore_forRoomSubscriptionSettings(updates: ISignal<readonly OptimisticUpdate<BaseMetadata, BaseMetadata>[]>): {
|
|
1687
1714
|
signal: DerivedSignal<RoomSubscriptionSettingsByRoomId>;
|
|
1688
1715
|
update: (roomId: string, settings: RoomSubscriptionSettings$1) => void;
|
|
1689
1716
|
};
|
|
@@ -1723,18 +1750,18 @@ declare function createStore_forPermissionHints(): {
|
|
|
1723
1750
|
* }
|
|
1724
1751
|
* e.g. {} when before the first successful fetch.
|
|
1725
1752
|
*/
|
|
1726
|
-
declare function createStore_forNotificationSettings(updates: ISignal<readonly OptimisticUpdate<BaseMetadata>[]>): {
|
|
1753
|
+
declare function createStore_forNotificationSettings(updates: ISignal<readonly OptimisticUpdate<BaseMetadata, BaseMetadata>[]>): {
|
|
1727
1754
|
signal: DerivedSignal<NotificationSettings>;
|
|
1728
1755
|
update: (settings: NotificationSettings) => void;
|
|
1729
1756
|
};
|
|
1730
|
-
declare function createStore_forOptimistic<
|
|
1731
|
-
signal: ISignal<readonly OptimisticUpdate<
|
|
1732
|
-
add: (optimisticUpdate: DistributiveOmit<OptimisticUpdate<
|
|
1757
|
+
declare function createStore_forOptimistic<TM extends BaseMetadata, CM extends BaseMetadata>(client: Client$1<BaseUserMeta$1, TM, CM>): {
|
|
1758
|
+
signal: ISignal<readonly OptimisticUpdate<TM, CM>[]>;
|
|
1759
|
+
add: (optimisticUpdate: DistributiveOmit<OptimisticUpdate<TM, CM>, "id">) => string;
|
|
1733
1760
|
remove: (optimisticId: string) => void;
|
|
1734
1761
|
};
|
|
1735
|
-
declare class UmbrellaStore<
|
|
1762
|
+
declare class UmbrellaStore<TM extends BaseMetadata, CM extends BaseMetadata> {
|
|
1736
1763
|
#private;
|
|
1737
|
-
readonly threads: ThreadDB<
|
|
1764
|
+
readonly threads: ThreadDB<TM, CM>;
|
|
1738
1765
|
readonly notifications: ReturnType<typeof createStore_forNotifications>;
|
|
1739
1766
|
readonly subscriptions: ReturnType<typeof createStore_forSubscriptions>;
|
|
1740
1767
|
readonly roomSubscriptionSettings: ReturnType<typeof createStore_forRoomSubscriptionSettings>;
|
|
@@ -1743,12 +1770,12 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1743
1770
|
readonly urlsMetadata: ReturnType<typeof createStore_forUrlsMetadata>;
|
|
1744
1771
|
readonly permissionHints: ReturnType<typeof createStore_forPermissionHints>;
|
|
1745
1772
|
readonly notificationSettings: ReturnType<typeof createStore_forNotificationSettings>;
|
|
1746
|
-
readonly optimisticUpdates: ReturnType<typeof createStore_forOptimistic<
|
|
1773
|
+
readonly optimisticUpdates: ReturnType<typeof createStore_forOptimistic<TM, CM>>;
|
|
1747
1774
|
readonly outputs: {
|
|
1748
|
-
readonly threadifications: DerivedSignal<CleanThreadifications<
|
|
1749
|
-
readonly threads: DerivedSignal<ReadonlyThreadDB<
|
|
1750
|
-
readonly loadingRoomThreads: DefaultMap<RoomQueryKey, LoadableResource<ThreadsAsyncResult<
|
|
1751
|
-
readonly loadingUserThreads: DefaultMap<UserQueryKey, LoadableResource<ThreadsAsyncResult<
|
|
1775
|
+
readonly threadifications: DerivedSignal<CleanThreadifications<TM, CM>>;
|
|
1776
|
+
readonly threads: DerivedSignal<ReadonlyThreadDB<TM, CM>>;
|
|
1777
|
+
readonly loadingRoomThreads: DefaultMap<RoomQueryKey, LoadableResource<ThreadsAsyncResult<TM, CM>>>;
|
|
1778
|
+
readonly loadingUserThreads: DefaultMap<UserQueryKey, LoadableResource<ThreadsAsyncResult<TM, CM>>>;
|
|
1752
1779
|
readonly notifications: DerivedSignal<CleanNotifications>;
|
|
1753
1780
|
readonly threadSubscriptions: DerivedSignal<CleanThreadSubscriptions>;
|
|
1754
1781
|
readonly loadingNotifications: DefaultMap<InboxNotificationsQueryKey, LoadableResource<InboxNotificationsAsyncResult>>;
|
|
@@ -1793,9 +1820,9 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1793
1820
|
/**
|
|
1794
1821
|
* Creates an new thread, replacing the corresponding optimistic update.
|
|
1795
1822
|
*/
|
|
1796
|
-
createThread(optimisticId: string, thread: Readonly<ThreadDataWithDeleteInfo<
|
|
1823
|
+
createThread(optimisticId: string, thread: Readonly<ThreadDataWithDeleteInfo<TM, CM>>): void;
|
|
1797
1824
|
patchThread(threadId: string, optimisticId: string | null, patch: {
|
|
1798
|
-
metadata?:
|
|
1825
|
+
metadata?: TM;
|
|
1799
1826
|
resolved?: boolean;
|
|
1800
1827
|
}, updatedAt: Date): void;
|
|
1801
1828
|
addReaction(threadId: string, optimisticId: string | null, commentId: string, reaction: CommentUserReaction, createdAt: Date): void;
|
|
@@ -1813,10 +1840,11 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1813
1840
|
* Creates an existing comment and ensures the associated notification is
|
|
1814
1841
|
* updated correctly, replacing the corresponding optimistic update.
|
|
1815
1842
|
*/
|
|
1816
|
-
createComment(newComment: CommentData
|
|
1817
|
-
editComment(threadId: string, optimisticId: string, editedComment: CommentData): void;
|
|
1843
|
+
createComment(newComment: CommentData<CM>, optimisticId: string): void;
|
|
1844
|
+
editComment(threadId: string, optimisticId: string, editedComment: CommentData<CM>): void;
|
|
1845
|
+
editCommentMetadata(threadId: string, commentId: string, optimisticId: string, updatedMetadata: CM, updatedAt: Date): void;
|
|
1818
1846
|
deleteComment(threadId: string, optimisticId: string, commentId: string, deletedAt: Date): void;
|
|
1819
|
-
updateThreadifications(threads: ThreadData<
|
|
1847
|
+
updateThreadifications(threads: ThreadData<TM, CM>[], notifications: InboxNotificationData[], subscriptions: SubscriptionData[], deletedThreads?: ThreadDeleteInfo[], deletedNotifications?: InboxNotificationDeleteInfo[], deletedSubscriptions?: SubscriptionDeleteInfo[]): void;
|
|
1820
1848
|
/**
|
|
1821
1849
|
* Updates existing subscription settings for a room with a new value,
|
|
1822
1850
|
* replacing the corresponding optimistic update.
|
|
@@ -1844,7 +1872,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
|
|
|
1844
1872
|
*
|
|
1845
1873
|
* @private
|
|
1846
1874
|
*/
|
|
1847
|
-
declare function getUmbrellaStoreForClient<
|
|
1875
|
+
declare function getUmbrellaStoreForClient<TM extends BaseMetadata$1, CM extends BaseMetadata$1>(client: OpaqueClient): UmbrellaStore<TM, CM>;
|
|
1848
1876
|
/**
|
|
1849
1877
|
* Returns a function that creates an AI chat.
|
|
1850
1878
|
*
|
|
@@ -1946,7 +1974,7 @@ declare function LiveblocksProvider<U extends BaseUserMeta = DU>(props: PropsWit
|
|
|
1946
1974
|
* LiveblocksProvider created in this way takes no props, because it uses
|
|
1947
1975
|
* settings from the given client instead.
|
|
1948
1976
|
*/
|
|
1949
|
-
declare function createLiveblocksContext<U extends BaseUserMeta = DU,
|
|
1977
|
+
declare function createLiveblocksContext<U extends BaseUserMeta = DU, TM extends BaseMetadata$1 = DTM, CM extends BaseMetadata$1 = DCM>(client: OpaqueClient): LiveblocksContextBundle<U, TM, CM>;
|
|
1950
1978
|
/**
|
|
1951
1979
|
* Returns the inbox notifications for the current user.
|
|
1952
1980
|
*
|
|
@@ -2073,7 +2101,7 @@ declare function useGroupInfo(groupId: string): GroupInfoAsyncResult;
|
|
|
2073
2101
|
* const { info } = useGroupInfo("group-id");
|
|
2074
2102
|
*/
|
|
2075
2103
|
declare function useGroupInfoSuspense(groupId: string): GroupInfoAsyncSuccess;
|
|
2076
|
-
type TypedBundle$1 = LiveblocksContextBundle<DU,
|
|
2104
|
+
type TypedBundle$1 = LiveblocksContextBundle<DU, DTM, DCM>;
|
|
2077
2105
|
/**
|
|
2078
2106
|
* Returns the thread associated with a `"thread"` inbox notification.
|
|
2079
2107
|
*
|
|
@@ -2293,33 +2321,17 @@ declare function useOthersConnectionIds(): readonly number[];
|
|
|
2293
2321
|
/**
|
|
2294
2322
|
* @private
|
|
2295
2323
|
*/
|
|
2296
|
-
declare function useCreateRoomThread<
|
|
2324
|
+
declare function useCreateRoomThread<TM extends BaseMetadata$1, CM extends BaseMetadata$1>(roomId: string): (options: CreateThreadOptions<TM, CM>) => ThreadData$1<TM, CM>;
|
|
2297
2325
|
declare function useDeleteRoomThread(roomId: string): (threadId: string) => void;
|
|
2298
|
-
declare function useEditRoomThreadMetadata<
|
|
2299
|
-
/**
|
|
2300
|
-
* Returns a function that adds a comment to a thread.
|
|
2301
|
-
*
|
|
2302
|
-
* @example
|
|
2303
|
-
* const createComment = useCreateComment();
|
|
2304
|
-
* createComment({ threadId: "th_xxx", body: {} });
|
|
2305
|
-
*/
|
|
2306
|
-
declare function useCreateComment(): (options: CreateCommentOptions) => CommentData$1;
|
|
2326
|
+
declare function useEditRoomThreadMetadata<TM extends BaseMetadata$1>(roomId: string): (options: EditThreadMetadataOptions<TM>) => void;
|
|
2307
2327
|
/**
|
|
2308
2328
|
* @private
|
|
2309
2329
|
*/
|
|
2310
|
-
declare function useCreateRoomComment(roomId: string): (options: CreateCommentOptions) => CommentData$1
|
|
2311
|
-
/**
|
|
2312
|
-
* Returns a function that edits a comment's body.
|
|
2313
|
-
*
|
|
2314
|
-
* @example
|
|
2315
|
-
* const editComment = useEditComment()
|
|
2316
|
-
* editComment({ threadId: "th_xxx", commentId: "cm_xxx", body: {} })
|
|
2317
|
-
*/
|
|
2318
|
-
declare function useEditComment(): (options: EditCommentOptions) => void;
|
|
2330
|
+
declare function useCreateRoomComment<CM extends BaseMetadata$1>(roomId: string): (options: CreateCommentOptions<CM>) => CommentData$1<CM>;
|
|
2319
2331
|
/**
|
|
2320
2332
|
* @private
|
|
2321
2333
|
*/
|
|
2322
|
-
declare function useEditRoomComment(roomId: string): (options: EditCommentOptions) => void;
|
|
2334
|
+
declare function useEditRoomComment<CM extends BaseMetadata$1>(roomId: string): (options: EditCommentOptions<CM>) => void;
|
|
2323
2335
|
/**
|
|
2324
2336
|
* Returns a function that deletes a comment.
|
|
2325
2337
|
* If it is the last non-deleted comment, the thread also gets deleted.
|
|
@@ -2336,7 +2348,7 @@ declare function useDeleteRoomComment(roomId: string): ({ threadId, commentId }:
|
|
|
2336
2348
|
/**
|
|
2337
2349
|
* @private
|
|
2338
2350
|
*/
|
|
2339
|
-
declare function useAddRoomCommentReaction
|
|
2351
|
+
declare function useAddRoomCommentReaction(roomId: string): ({ threadId, commentId, emoji }: CommentReactionOptions) => void;
|
|
2340
2352
|
/**
|
|
2341
2353
|
* Returns a function that removes a reaction on a comment.
|
|
2342
2354
|
*
|
|
@@ -2475,8 +2487,8 @@ declare function useRoomPermissions(roomId: string): Set<_liveblocks_core.Permis
|
|
|
2475
2487
|
* that any RoomProvider created in this way does not need to be nested in
|
|
2476
2488
|
* LiveblocksProvider, as it already has access to the client.
|
|
2477
2489
|
*/
|
|
2478
|
-
declare function createRoomContext<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUserMeta = DU, E extends Json = DE,
|
|
2479
|
-
type TypedBundle = RoomContextBundle<DP, DS, DU, DE,
|
|
2490
|
+
declare function createRoomContext<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUserMeta = DU, E extends Json = DE, TM extends BaseMetadata$1 = DTM, CM extends BaseMetadata$1 = DCM>(client: OpaqueClient): RoomContextBundle<P, S, U, E, TM, CM>;
|
|
2491
|
+
type TypedBundle = RoomContextBundle<DP, DS, DU, DE, DTM, DCM>;
|
|
2480
2492
|
/**
|
|
2481
2493
|
* Makes a Room available in the component hierarchy below.
|
|
2482
2494
|
* Joins the room when the component is mounted, and automatically leaves
|
|
@@ -2595,6 +2607,31 @@ declare const _useDeleteThread: TypedBundle["useDeleteThread"];
|
|
|
2595
2607
|
* editThreadMetadata({ threadId: "th_xxx", metadata: {} })
|
|
2596
2608
|
*/
|
|
2597
2609
|
declare const _useEditThreadMetadata: TypedBundle["useEditThreadMetadata"];
|
|
2610
|
+
/**
|
|
2611
|
+
* Returns a function that adds a comment to a thread.
|
|
2612
|
+
*
|
|
2613
|
+
* @example
|
|
2614
|
+
* const createComment = useCreateComment();
|
|
2615
|
+
* createComment({ threadId: "th_xxx", body: {} });
|
|
2616
|
+
*/
|
|
2617
|
+
declare const _useCreateComment: TypedBundle["useCreateComment"];
|
|
2618
|
+
/**
|
|
2619
|
+
* Returns a function that edits a comment.
|
|
2620
|
+
*
|
|
2621
|
+
* @example
|
|
2622
|
+
* const editComment = useEditComment()
|
|
2623
|
+
* editComment({ threadId: "th_xxx", commentId: "cm_xxx", body: {} })
|
|
2624
|
+
*/
|
|
2625
|
+
declare const _useEditComment: TypedBundle["useEditComment"];
|
|
2626
|
+
/**
|
|
2627
|
+
* Returns a function that edits a comment's metadata.
|
|
2628
|
+
* To delete an existing metadata property, set its value to `null`.
|
|
2629
|
+
*
|
|
2630
|
+
* @example
|
|
2631
|
+
* const editCommentMetadata = useEditCommentMetadata();
|
|
2632
|
+
* editCommentMetadata({ threadId: "th_xxx", commentId: "cm_xxx", metadata: { tag: "important", externalId: 1234 } })
|
|
2633
|
+
*/
|
|
2634
|
+
declare const _useEditCommentMetadata: TypedBundle["useEditCommentMetadata"];
|
|
2598
2635
|
/**
|
|
2599
2636
|
* useEventListener is a React hook that allows you to respond to events broadcast
|
|
2600
2637
|
* by other users in the room.
|
|
@@ -2953,4 +2990,4 @@ declare const _useStorageRoot: TypedBundle["useStorageRoot"];
|
|
|
2953
2990
|
*/
|
|
2954
2991
|
declare const _useUpdateMyPresence: TypedBundle["useUpdateMyPresence"];
|
|
2955
2992
|
|
|
2956
|
-
export { _useEditThreadMetadata as $, type AiChatStatus as A, createLiveblocksContext as B, ClientContext as C, useDeleteAllInboxNotifications as D, useDeleteInboxNotification as E, useErrorListener as F, type GroupAsyncResult as G, useMarkAllInboxNotificationsAsRead as H, useMarkInboxNotificationAsRead as I, useSyncStatus as J, createRoomContext as K, LiveblocksProvider as L, type MutationContext as M, _RoomProvider as N, _useAddReaction as O, _useBroadcastEvent as P, useCanRedo as Q, type RegisterAiKnowledgeProps as R, type SendAiMessageOptions as S, useCanUndo as T, type UseSendAiMessageOptions as U,
|
|
2993
|
+
export { _useEditThreadMetadata as $, type AiChatStatus as A, createLiveblocksContext as B, ClientContext as C, useDeleteAllInboxNotifications as D, useDeleteInboxNotification as E, useErrorListener as F, type GroupAsyncResult as G, useMarkAllInboxNotificationsAsRead as H, useMarkInboxNotificationAsRead as I, useSyncStatus as J, createRoomContext as K, LiveblocksProvider as L, type MutationContext as M, _RoomProvider as N, _useAddReaction as O, _useBroadcastEvent as P, useCanRedo as Q, type RegisterAiKnowledgeProps as R, type SendAiMessageOptions as S, useCanUndo as T, type UseSendAiMessageOptions as U, _useCreateComment as V, _useCreateThread as W, useDeleteComment as X, _useDeleteThread as Y, _useEditComment as Z, _useInboxNotificationThread as _, useAddRoomCommentReaction as a, useGroupInfoSuspense as a$, _useEditCommentMetadata as a0, useMarkThreadAsResolved as a1, useMarkThreadAsUnresolved as a2, useSubscribeToThread as a3, useUnsubscribeFromThread as a4, _useEventListener as a5, useHistory as a6, _useIsInsideRoom as a7, useLostConnectionListener as a8, useMarkThreadAsRead as a9, useUpdateNotificationSettings as aA, useCreateAiChat as aB, useDeleteAiChat as aC, useSendAiMessage as aD, _useUserThreads_experimental as aE, useRoomInfo as aF, useGroupInfo as aG, useUnreadInboxNotificationsCount as aH, _useUser as aI, _useAiChat as aJ, _useAiChats as aK, _useAiChatMessages as aL, useAiChatStatus as aM, _useUrlMetadata as aN, _useOtherSuspense as aO, _useOthersSuspense as aP, useOthersConnectionIdsSuspense as aQ, _useOthersMappedSuspense as aR, _useSelfSuspense as aS, _useStorageSuspense as aT, _useThreadsSuspense as aU, useAttachmentUrlSuspense as aV, _useHistoryVersionsSuspense as aW, _useRoomSubscriptionSettingsSuspense as aX, useInboxNotificationsSuspense as aY, useNotificationSettingsSuspense as aZ, useRoomInfoSuspense as a_, _useMutation as aa, _useMyPresence as ab, _useOthersListener as ac, useRedo as ad, useRemoveReaction as ae, _useRoom as af, useStatus as ag, _useStorageRoot as ah, useThreadSubscription as ai, useUndo as aj, _useUpdateMyPresence as ak, useUpdateRoomSubscriptionSettings as al, useHistoryVersionData as am, _useOther as an, _useOthers as ao, useOthersConnectionIds as ap, _useOthersMapped as aq, _useSelf as ar, _useStorage as as, _useThreads as at, _useSearchComments as au, useAttachmentUrl as av, _useHistoryVersions as aw, _useRoomSubscriptionSettings as ax, useInboxNotifications as ay, useNotificationSettings as az, useCreateRoomComment as b, useUnreadInboxNotificationsCountSuspense as b0, _useUserSuspense as b1, _useUserThreadsSuspense_experimental as b2, _useAiChatsSuspense as b3, _useAiChatMessagesSuspense as b4, _useAiChatSuspense as b5, _useUrlMetadataSuspense as b6, useCreateRoomThread as c, useCreateTextMention as d, useDeleteRoomComment as e, useDeleteRoomThread as f, getUmbrellaStoreForClient as g, useDeleteTextMention as h, useEditRoomComment as i, useEditRoomThreadMetadata as j, useMarkRoomThreadAsRead as k, useMarkRoomThreadAsResolved as l, useMarkRoomThreadAsUnresolved as m, useMentionSuggestionsCache as n, useRemoveRoomCommentReaction as o, useReportTextEditor as p, useResolveMentionSuggestions as q, useRoomAttachmentUrl as r, useRoomPermissions as s, useRoomThreadSubscription as t, useClientOrNull as u, useYjsProvider as v, type RegisterAiToolProps as w, type UseThreadsOptions as x, RoomContext as y, useClient as z };
|