@liveblocks/core 1.12.0 → 2.0.0-alpha1

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
@@ -216,10 +216,6 @@ declare enum WebsocketCloseCodes {
216
216
  CLOSE_WITHOUT_RETRY = 4999
217
217
  }
218
218
 
219
- /**
220
- * Old connection statuses, here for backward-compatibility reasons only.
221
- */
222
- declare type LegacyConnectionStatus = "closed" | "authenticating" | "connecting" | "open" | "unavailable" | "failed";
223
219
  /**
224
220
  * Returns a human-readable status indicating the current connection status of
225
221
  * a Room, as returned by `room.getStatus()`. Can be used to implement
@@ -778,6 +774,147 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
778
774
  clone(): LiveObject<O>;
779
775
  }
780
776
 
777
+ declare type BaseRoomInfo = {
778
+ [key: string]: Json | undefined;
779
+ /**
780
+ * The name of the room.
781
+ */
782
+ name?: string;
783
+ /**
784
+ * The URL of the room.
785
+ */
786
+ url?: string;
787
+ };
788
+
789
+ declare type DateToString<T> = {
790
+ [P in keyof T]: T[P] extends Date ? string : T[P] extends Date | null ? string | null : T[P] extends Date | undefined ? string | undefined : T[P];
791
+ };
792
+
793
+ declare type BaseMetadata = Record<string, string | boolean | number | undefined>;
794
+ declare type CommentReaction = {
795
+ emoji: string;
796
+ createdAt: Date;
797
+ users: {
798
+ id: string;
799
+ }[];
800
+ };
801
+ /**
802
+ * Represents a comment.
803
+ */
804
+ declare type CommentData = {
805
+ type: "comment";
806
+ id: string;
807
+ threadId: string;
808
+ roomId: string;
809
+ userId: string;
810
+ createdAt: Date;
811
+ editedAt?: Date;
812
+ reactions: CommentReaction[];
813
+ } & ({
814
+ body: CommentBody;
815
+ deletedAt?: never;
816
+ } | {
817
+ body?: never;
818
+ deletedAt: Date;
819
+ });
820
+ declare type CommentDataPlain = Omit<DateToString<CommentData>, "reactions" | "body"> & {
821
+ reactions: DateToString<CommentReaction>[];
822
+ } & ({
823
+ body: CommentBody;
824
+ deletedAt?: never;
825
+ } | {
826
+ body?: never;
827
+ deletedAt: string;
828
+ });
829
+ declare type CommentBodyBlockElement = CommentBodyParagraph;
830
+ declare type CommentBodyInlineElement = CommentBodyText | CommentBodyMention | CommentBodyLink;
831
+ declare type CommentBodyElement = CommentBodyBlockElement | CommentBodyInlineElement;
832
+ declare type CommentBodyParagraph = {
833
+ type: "paragraph";
834
+ children: CommentBodyInlineElement[];
835
+ };
836
+ declare type CommentBodyMention = {
837
+ type: "mention";
838
+ id: string;
839
+ };
840
+ declare type CommentBodyLink = {
841
+ type: "link";
842
+ url: string;
843
+ };
844
+ declare type CommentBodyText = {
845
+ bold?: boolean;
846
+ italic?: boolean;
847
+ strikethrough?: boolean;
848
+ code?: boolean;
849
+ text: string;
850
+ };
851
+ declare type CommentBody = {
852
+ version: 1;
853
+ content: CommentBodyBlockElement[];
854
+ };
855
+ declare type CommentUserReaction = {
856
+ emoji: string;
857
+ createdAt: Date;
858
+ userId: string;
859
+ };
860
+ declare type CommentUserReactionPlain = DateToString<CommentUserReaction>;
861
+ /**
862
+ * Represents a thread of comments.
863
+ */
864
+ declare type ThreadData<M extends BaseMetadata = DM> = {
865
+ type: "thread";
866
+ id: string;
867
+ roomId: string;
868
+ createdAt: Date;
869
+ updatedAt?: Date;
870
+ comments: CommentData[];
871
+ metadata: M;
872
+ };
873
+ interface ThreadDataWithDeleteInfo<M extends BaseMetadata = DM> extends ThreadData<M> {
874
+ deletedAt?: Date;
875
+ }
876
+ declare type ThreadDataPlain<M extends BaseMetadata> = Omit<DateToString<ThreadData<M>>, "comments" | "metadata"> & {
877
+ comments: CommentDataPlain[];
878
+ metadata: M;
879
+ };
880
+ declare type ThreadDeleteInfo = {
881
+ type: "deletedThread";
882
+ id: string;
883
+ roomId: string;
884
+ deletedAt: Date;
885
+ };
886
+ declare type QueryMetadataStringValue<T extends string> = T | {
887
+ startsWith: string;
888
+ };
889
+ /**
890
+ * This type can be used to build a metadata query string (compatible
891
+ * with `@liveblocks/query-parser`) through a type-safe API.
892
+ *
893
+ * In addition to exact values (`:` in query string), it adds:
894
+ * - to strings:
895
+ * - `startsWith` (`^` in query string)
896
+ */
897
+ declare type QueryMetadata<M extends BaseMetadata> = {
898
+ [K in keyof M]: M[K] extends string ? QueryMetadataStringValue<M[K]> : M[K];
899
+ };
900
+
901
+ declare global {
902
+ /**
903
+ * Namespace for user-defined Liveblocks types.
904
+ */
905
+ export interface Liveblocks {
906
+ [key: string]: unknown;
907
+ }
908
+ }
909
+ declare type ExtendableTypes = "Presence" | "Storage" | "UserMeta" | "RoomEvent" | "ThreadMetadata" | "RoomInfo";
910
+ declare type ExtendedType<K extends ExtendableTypes, B> = unknown extends Liveblocks[K] ? B : Liveblocks[K] extends B ? Liveblocks[K] : `The type you provided for '${K}' does not match its requirements. To learn how to fix this, see https://liveblocks.io/errors/${K}`;
911
+ declare type DP = ExtendedType<"Presence", JsonObject>;
912
+ declare type DS = ExtendedType<"Storage", LsonObject>;
913
+ declare type DU = ExtendedType<"UserMeta", BaseUserMeta>;
914
+ declare type DE = ExtendedType<"RoomEvent", Json>;
915
+ declare type DM = ExtendedType<"ThreadMetadata", BaseMetadata>;
916
+ declare type DRI = ExtendedType<"RoomInfo", BaseRoomInfo>;
917
+
781
918
  /**
782
919
  * Use this symbol to brand an object property as internal.
783
920
  *
@@ -834,12 +971,12 @@ declare enum ClientMsgCode {
834
971
  /**
835
972
  * Messages that can be sent from the client to the server.
836
973
  */
837
- declare type ClientMsg<TPresence extends JsonObject, TRoomEvent extends Json> = BroadcastEventClientMsg<TRoomEvent> | UpdatePresenceClientMsg<TPresence> | UpdateStorageClientMsg | FetchStorageClientMsg | FetchYDocClientMsg | UpdateYDocClientMsg;
838
- declare type BroadcastEventClientMsg<TRoomEvent extends Json> = {
974
+ declare type ClientMsg<P extends JsonObject, E extends Json> = BroadcastEventClientMsg<E> | UpdatePresenceClientMsg<P> | UpdateStorageClientMsg | FetchStorageClientMsg | FetchYDocClientMsg | UpdateYDocClientMsg;
975
+ declare type BroadcastEventClientMsg<E extends Json> = {
839
976
  type: ClientMsgCode.BROADCAST_EVENT;
840
- event: TRoomEvent;
977
+ event: E;
841
978
  };
842
- declare type UpdatePresenceClientMsg<TPresence extends JsonObject> = {
979
+ declare type UpdatePresenceClientMsg<P extends JsonObject> = {
843
980
  readonly type: ClientMsgCode.UPDATE_PRESENCE;
844
981
  /**
845
982
  * Set this to any number to signify that this is a Full Presence™
@@ -855,7 +992,7 @@ declare type UpdatePresenceClientMsg<TPresence extends JsonObject> = {
855
992
  * all presence fields, and isn't a partial "patch".
856
993
  */
857
994
  readonly targetActor: number;
858
- readonly data: TPresence;
995
+ readonly data: P;
859
996
  } | {
860
997
  readonly type: ClientMsgCode.UPDATE_PRESENCE;
861
998
  /**
@@ -863,7 +1000,7 @@ declare type UpdatePresenceClientMsg<TPresence extends JsonObject> = {
863
1000
  * Presence™ "patch".
864
1001
  */
865
1002
  readonly targetActor?: undefined;
866
- readonly data: Partial<TPresence>;
1003
+ readonly data: Partial<P>;
867
1004
  };
868
1005
  declare type UpdateStorageClientMsg = {
869
1006
  readonly type: ClientMsgCode.UPDATE_STORAGE;
@@ -883,6 +1020,42 @@ declare type UpdateYDocClientMsg = {
883
1020
  readonly guid?: string;
884
1021
  };
885
1022
 
1023
+ declare type InboxNotificationThreadData = {
1024
+ kind: "thread";
1025
+ id: string;
1026
+ roomId: string;
1027
+ threadId: string;
1028
+ notifiedAt: Date;
1029
+ readAt: Date | null;
1030
+ };
1031
+ declare type ActivityData = Record<string, string | boolean | number | undefined>;
1032
+ declare type InboxNotificationActivity = {
1033
+ id: string;
1034
+ createdAt: Date;
1035
+ data: ActivityData;
1036
+ };
1037
+ declare type InboxNotificationCustomData = {
1038
+ kind: `$${string}`;
1039
+ id: string;
1040
+ roomId?: string;
1041
+ subjectId: string;
1042
+ notifiedAt: Date;
1043
+ readAt: Date | null;
1044
+ activities: InboxNotificationActivity[];
1045
+ };
1046
+ declare type InboxNotificationData = InboxNotificationThreadData | InboxNotificationCustomData;
1047
+ declare type InboxNotificationThreadDataPlain = DateToString<InboxNotificationThreadData>;
1048
+ declare type InboxNotificationCustomDataPlain = Omit<DateToString<InboxNotificationCustomData>, "activities"> & {
1049
+ activities: DateToString<InboxNotificationActivity>[];
1050
+ };
1051
+ declare type InboxNotificationDataPlain = InboxNotificationThreadDataPlain | InboxNotificationCustomDataPlain;
1052
+ declare type InboxNotificationDeleteInfo = {
1053
+ type: "deletedInboxNotification";
1054
+ id: string;
1055
+ roomId: string;
1056
+ deletedAt: Date;
1057
+ };
1058
+
886
1059
  declare type IdTuple<T> = [id: string, value: T];
887
1060
  declare enum CrdtType {
888
1061
  OBJECT = 0,
@@ -944,7 +1117,7 @@ declare enum ServerMsgCode {
944
1117
  /**
945
1118
  * Messages that can be sent from the server to the client.
946
1119
  */
947
- declare type ServerMsg<TPresence extends JsonObject, TUserMeta extends BaseUserMeta, TRoomEvent extends Json> = UpdatePresenceServerMsg<TPresence> | UserJoinServerMsg<TUserMeta> | UserLeftServerMsg | BroadcastedEventServerMsg<TRoomEvent> | RoomStateServerMsg<TUserMeta> | InitialDocumentStateServerMsg | UpdateStorageServerMsg | RejectedStorageOpServerMsg | YDocUpdateServerMsg | CommentsEventServerMsg;
1120
+ declare type ServerMsg<P extends JsonObject, U extends BaseUserMeta, E extends Json> = UpdatePresenceServerMsg<P> | UserJoinServerMsg<U> | UserLeftServerMsg | BroadcastedEventServerMsg<E> | RoomStateServerMsg<U> | InitialDocumentStateServerMsg | UpdateStorageServerMsg | RejectedStorageOpServerMsg | YDocUpdateServerMsg | CommentsEventServerMsg;
948
1121
  declare type CommentsEventServerMsg = ThreadCreatedEvent | ThreadMetadataUpdatedEvent | CommentCreatedEvent | CommentEditedEvent | CommentDeletedEvent | CommentReactionAdded | CommentReactionRemoved;
949
1122
  declare type ThreadCreatedEvent = {
950
1123
  type: ServerMsgCode.THREAD_CREATED;
@@ -992,7 +1165,7 @@ declare type CommentReactionRemoved = {
992
1165
  * those cases, the `targetActor` field indicates the newly connected client,
993
1166
  * so all other existing clients can ignore this broadcasted message.
994
1167
  */
995
- declare type UpdatePresenceServerMsg<TPresence extends JsonObject> = {
1168
+ declare type UpdatePresenceServerMsg<P extends JsonObject> = {
996
1169
  readonly type: ServerMsgCode.UPDATE_PRESENCE;
997
1170
  /**
998
1171
  * The User whose Presence has changed.
@@ -1016,7 +1189,7 @@ declare type UpdatePresenceServerMsg<TPresence extends JsonObject> = {
1016
1189
  * this will be the full Presence, otherwise it only contain the fields that
1017
1190
  * have changed since the last broadcast.
1018
1191
  */
1019
- readonly data: TPresence;
1192
+ readonly data: P;
1020
1193
  } | {
1021
1194
  readonly type: ServerMsgCode.UPDATE_PRESENCE;
1022
1195
  /**
@@ -1031,25 +1204,25 @@ declare type UpdatePresenceServerMsg<TPresence extends JsonObject> = {
1031
1204
  * A partial Presence patch to apply to the User. It will only contain the
1032
1205
  * fields that have changed since the last broadcast.
1033
1206
  */
1034
- readonly data: Partial<TPresence>;
1207
+ readonly data: Partial<P>;
1035
1208
  };
1036
1209
  /**
1037
1210
  * Sent by the WebSocket server and broadcasted to all clients to announce that
1038
1211
  * a new User has joined the Room.
1039
1212
  */
1040
- declare type UserJoinServerMsg<TUserMeta extends BaseUserMeta> = {
1213
+ declare type UserJoinServerMsg<U extends BaseUserMeta> = {
1041
1214
  readonly type: ServerMsgCode.USER_JOINED;
1042
1215
  readonly actor: number;
1043
1216
  /**
1044
1217
  * The id of the User that has been set in the authentication endpoint.
1045
1218
  * Useful to get additional information about the connected user.
1046
1219
  */
1047
- readonly id: TUserMeta["id"];
1220
+ readonly id: U["id"];
1048
1221
  /**
1049
1222
  * Additional user information that has been set in the authentication
1050
1223
  * endpoint.
1051
1224
  */
1052
- readonly info: TUserMeta["info"];
1225
+ readonly info: U["info"];
1053
1226
  /**
1054
1227
  * Informs the client what (public) permissions this (other) User has.
1055
1228
  */
@@ -1078,7 +1251,7 @@ declare type YDocUpdateServerMsg = {
1078
1251
  * Sent by the WebSocket server and broadcasted to all clients to announce that
1079
1252
  * a User broadcasted an Event to everyone in the Room.
1080
1253
  */
1081
- declare type BroadcastedEventServerMsg<TRoomEvent extends Json> = {
1254
+ declare type BroadcastedEventServerMsg<E extends Json> = {
1082
1255
  readonly type: ServerMsgCode.BROADCASTED_EVENT;
1083
1256
  /**
1084
1257
  * The User who broadcast the Event. Absent when this event is broadcast from
@@ -1089,14 +1262,14 @@ declare type BroadcastedEventServerMsg<TRoomEvent extends Json> = {
1089
1262
  * The arbitrary payload of the Event. This can be any JSON value. Clients
1090
1263
  * will have to manually verify/decode this event.
1091
1264
  */
1092
- readonly event: TRoomEvent;
1265
+ readonly event: E;
1093
1266
  };
1094
1267
  /**
1095
1268
  * Sent by the WebSocket server to a single client in response to the client
1096
1269
  * joining the Room, to provide the initial state of the Room. The payload
1097
1270
  * includes a list of all other Users that already are in the Room.
1098
1271
  */
1099
- declare type RoomStateServerMsg<TUserMeta extends BaseUserMeta> = {
1272
+ declare type RoomStateServerMsg<U extends BaseUserMeta> = {
1100
1273
  readonly type: ServerMsgCode.ROOM_STATE;
1101
1274
  /**
1102
1275
  * Informs the client what their actor ID is going to be.
@@ -1114,7 +1287,7 @@ declare type RoomStateServerMsg<TUserMeta extends BaseUserMeta> = {
1114
1287
  */
1115
1288
  readonly scopes: string[];
1116
1289
  readonly users: {
1117
- readonly [otherActor: number]: TUserMeta & {
1290
+ readonly [otherActor: number]: U & {
1118
1291
  scopes: string[];
1119
1292
  };
1120
1293
  };
@@ -1150,82 +1323,6 @@ declare type RejectedStorageOpServerMsg = {
1150
1323
  readonly reason: string;
1151
1324
  };
1152
1325
 
1153
- declare type BaseMetadata = Record<string, string | boolean | number>;
1154
-
1155
- declare type CommentBodyBlockElement = CommentBodyParagraph;
1156
- declare type CommentBodyInlineElement = CommentBodyText | CommentBodyMention | CommentBodyLink;
1157
- declare type CommentBodyElement = CommentBodyBlockElement | CommentBodyInlineElement;
1158
- declare type CommentBodyParagraph = {
1159
- type: "paragraph";
1160
- children: CommentBodyInlineElement[];
1161
- };
1162
- declare type CommentBodyMention = {
1163
- type: "mention";
1164
- id: string;
1165
- };
1166
- declare type CommentBodyLink = {
1167
- type: "link";
1168
- url: string;
1169
- };
1170
- declare type CommentBodyText = {
1171
- bold?: boolean;
1172
- italic?: boolean;
1173
- strikethrough?: boolean;
1174
- code?: boolean;
1175
- text: string;
1176
- };
1177
- declare type CommentBody = {
1178
- version: 1;
1179
- content: CommentBodyBlockElement[];
1180
- };
1181
-
1182
- declare type DateToString<T> = {
1183
- [P in keyof T]: T[P] extends Date ? string : T[P] extends Date | null ? string | null : T[P] extends Date | undefined ? string | undefined : T[P];
1184
- };
1185
-
1186
- declare type CommentReaction = {
1187
- emoji: string;
1188
- createdAt: Date;
1189
- users: {
1190
- id: string;
1191
- }[];
1192
- };
1193
- /**
1194
- * Represents a comment.
1195
- */
1196
- declare type CommentData = {
1197
- type: "comment";
1198
- id: string;
1199
- threadId: string;
1200
- roomId: string;
1201
- userId: string;
1202
- createdAt: Date;
1203
- editedAt?: Date;
1204
- reactions: CommentReaction[];
1205
- } & ({
1206
- body: CommentBody;
1207
- deletedAt?: never;
1208
- } | {
1209
- body?: never;
1210
- deletedAt: Date;
1211
- });
1212
- declare type CommentDataPlain = Omit<DateToString<CommentData>, "reactions" | "body"> & {
1213
- reactions: DateToString<CommentReaction>[];
1214
- } & ({
1215
- body: CommentBody;
1216
- deletedAt?: never;
1217
- } | {
1218
- body?: never;
1219
- deletedAt: string;
1220
- });
1221
-
1222
- declare type CommentUserReaction = {
1223
- emoji: string;
1224
- createdAt: Date;
1225
- userId: string;
1226
- };
1227
- declare type CommentUserReactionPlain = DateToString<CommentUserReaction>;
1228
-
1229
1326
  declare type JsonTreeNode = {
1230
1327
  readonly type: "Json";
1231
1328
  readonly id: string;
@@ -1270,47 +1367,10 @@ declare namespace DevToolsTreeNode {
1270
1367
  export type { DevToolsTreeNode_CustomEventTreeNode as CustomEventTreeNode, DevToolsTreeNode_JsonTreeNode as JsonTreeNode, DevToolsTreeNode_LiveTreeNode as LiveTreeNode, DevToolsTreeNode_LsonTreeNode as LsonTreeNode, DevToolsTreeNode_TreeNode as TreeNode, DevToolsTreeNode_UserTreeNode as UserTreeNode };
1271
1368
  }
1272
1369
 
1273
- declare type InboxNotificationThreadData = {
1274
- kind: "thread";
1275
- id: string;
1276
- roomId: string;
1277
- threadId: string;
1278
- notifiedAt: Date;
1279
- readAt: Date | null;
1280
- };
1281
- declare type ActivityData = Record<string, string | boolean | number>;
1282
- declare type InboxNotificationActivity = {
1283
- id: string;
1284
- createdAt: Date;
1285
- data: ActivityData;
1286
- };
1287
- declare type InboxNotificationCustomData = {
1288
- kind: `$${string}`;
1289
- id: string;
1290
- roomId?: string;
1291
- subjectId: string;
1292
- notifiedAt: Date;
1293
- readAt: Date | null;
1294
- activities: InboxNotificationActivity[];
1295
- };
1296
- declare type InboxNotificationData = InboxNotificationThreadData | InboxNotificationCustomData;
1297
- declare type InboxNotificationThreadDataPlain = DateToString<InboxNotificationThreadData>;
1298
- declare type InboxNotificationCustomDataPlain = Omit<DateToString<InboxNotificationCustomData>, "activities"> & {
1299
- activities: DateToString<InboxNotificationActivity>[];
1300
- };
1301
- declare type InboxNotificationDataPlain = InboxNotificationThreadDataPlain | InboxNotificationCustomDataPlain;
1302
-
1303
- declare type InboxNotificationDeleteInfo = {
1304
- type: "deletedInboxNotification";
1305
- id: string;
1306
- roomId: string;
1307
- deletedAt: Date;
1308
- };
1309
-
1310
1370
  /**
1311
1371
  * Represents a user connected in a room. Treated as immutable.
1312
1372
  */
1313
- declare type User<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = {
1373
+ declare type User<P extends JsonObject = DP, U extends BaseUserMeta = DU> = {
1314
1374
  /**
1315
1375
  * The connection ID of the User. It is unique and increment at every new connection.
1316
1376
  */
@@ -1319,21 +1379,15 @@ declare type User<TPresence extends JsonObject, TUserMeta extends BaseUserMeta>
1319
1379
  * The ID of the User that has been set in the authentication endpoint.
1320
1380
  * Useful to get additional information about the connected user.
1321
1381
  */
1322
- readonly id: TUserMeta["id"];
1382
+ readonly id: U["id"];
1323
1383
  /**
1324
1384
  * Additional user information that has been set in the authentication endpoint.
1325
1385
  */
1326
- readonly info: TUserMeta["info"];
1386
+ readonly info: U["info"];
1327
1387
  /**
1328
1388
  * The user’s presence data.
1329
1389
  */
1330
- readonly presence: TPresence;
1331
- /**
1332
- * @deprecated Use `!user.canWrite` instead.
1333
- * False if the user can mutate the Room’s Storage and/or YDoc, true if they
1334
- * can only read but not mutate it.
1335
- */
1336
- readonly isReadOnly: boolean;
1390
+ readonly presence: P;
1337
1391
  /**
1338
1392
  * True if the user can mutate the Room’s Storage and/or YDoc, false if they
1339
1393
  * can only read but not mutate it.
@@ -1345,94 +1399,48 @@ declare type User<TPresence extends JsonObject, TUserMeta extends BaseUserMeta>
1345
1399
  readonly canComment: boolean;
1346
1400
  };
1347
1401
 
1348
- /**
1349
- * @deprecated Use `readonly User<TPresence, TUserMeta>[]` instead of `Others<TPresence, TUserMeta>`.
1350
- */
1351
- declare type Others<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = readonly User<TPresence, TUserMeta>[];
1352
- declare type InternalOthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = {
1402
+ declare type InternalOthersEvent<P extends JsonObject, U extends BaseUserMeta> = {
1353
1403
  type: "leave";
1354
- user: User<TPresence, TUserMeta>;
1404
+ user: User<P, U>;
1355
1405
  } | {
1356
1406
  type: "enter";
1357
- user: User<TPresence, TUserMeta>;
1407
+ user: User<P, U>;
1358
1408
  } | {
1359
1409
  type: "update";
1360
- user: User<TPresence, TUserMeta>;
1361
- updates: Partial<TPresence>;
1410
+ user: User<P, U>;
1411
+ updates: Partial<P>;
1362
1412
  } | {
1363
1413
  type: "reset";
1364
1414
  user?: never;
1365
1415
  };
1366
- declare type OthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = Resolve<InternalOthersEvent<TPresence, TUserMeta> & {
1367
- others: readonly User<TPresence, TUserMeta>[];
1416
+ declare type OthersEvent<P extends JsonObject = DP, U extends BaseUserMeta = DU> = Resolve<InternalOthersEvent<P, U> & {
1417
+ others: readonly User<P, U>[];
1368
1418
  }>;
1369
1419
 
1370
1420
  declare type PartialNullable<T> = {
1371
1421
  [P in keyof T]?: T[P] | null;
1372
1422
  };
1373
1423
 
1374
- declare type QueryMetadataStringValue<T extends string> = T | {
1375
- startsWith: string;
1376
- };
1377
- /**
1378
- * This type can be used to build a metadata query string (compatible
1379
- * with `@liveblocks/query-parser`) through a type-safe API.
1380
- *
1381
- * In addition to exact values (`:` in query string), it adds:
1382
- * - to strings:
1383
- * - `startsWith` (`^` in query string)
1384
- */
1385
- declare type QueryMetadata<T extends BaseMetadata> = {
1386
- [K in keyof T]: T[K] extends string ? QueryMetadataStringValue<T[K]> : T[K];
1387
- };
1388
-
1389
1424
  declare type RoomThreadsNotificationSettings = "all" | "replies_and_mentions" | "none";
1390
1425
  declare type RoomNotificationSettings = {
1391
1426
  threads: RoomThreadsNotificationSettings;
1392
1427
  };
1393
1428
 
1394
- /**
1395
- * Represents a thread of comments.
1396
- */
1397
- declare type ThreadData<TThreadMetadata extends BaseMetadata = never> = {
1398
- type: "thread";
1399
- id: string;
1400
- roomId: string;
1401
- createdAt: Date;
1402
- updatedAt?: Date;
1403
- comments: CommentData[];
1404
- metadata: [TThreadMetadata] extends [never] ? Record<string, never> : TThreadMetadata;
1405
- };
1406
- interface ThreadDataWithDeleteInfo<TThreadMetadata extends BaseMetadata = never> extends ThreadData<TThreadMetadata> {
1407
- deletedAt?: Date;
1408
- }
1409
- declare type ThreadDataPlain<TThreadMetadata extends BaseMetadata = never> = Omit<DateToString<ThreadData<TThreadMetadata>>, "comments" | "metadata"> & {
1410
- comments: CommentDataPlain[];
1411
- metadata: [TThreadMetadata] extends [never] ? Record<string, never> : TThreadMetadata;
1412
- };
1413
-
1414
- declare type ThreadDeleteInfo = {
1415
- type: "deletedThread";
1416
- id: string;
1417
- roomId: string;
1418
- deletedAt: Date;
1419
- };
1420
-
1421
- declare type LegacyOthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = {
1429
+ declare type LegacyOthersEvent<P extends JsonObject, U extends BaseUserMeta> = {
1422
1430
  type: "leave";
1423
- user: User<TPresence, TUserMeta>;
1431
+ user: User<P, U>;
1424
1432
  } | {
1425
1433
  type: "enter";
1426
- user: User<TPresence, TUserMeta>;
1434
+ user: User<P, U>;
1427
1435
  } | {
1428
1436
  type: "update";
1429
- user: User<TPresence, TUserMeta>;
1430
- updates: Partial<TPresence>;
1437
+ user: User<P, U>;
1438
+ updates: Partial<P>;
1431
1439
  } | {
1432
1440
  type: "reset";
1433
1441
  };
1434
- declare type LegacyOthersEventCallback<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = (others: readonly User<TPresence, TUserMeta>[], event: LegacyOthersEvent<TPresence, TUserMeta>) => void;
1435
- declare type RoomEventMessage<TPresence extends JsonObject, TUserMeta extends BaseUserMeta, TRoomEvent extends Json> = {
1442
+ declare type LegacyOthersEventCallback<P extends JsonObject, U extends BaseUserMeta> = (others: readonly User<P, U>[], event: LegacyOthersEvent<P, U>) => void;
1443
+ declare type RoomEventMessage<P extends JsonObject, U extends BaseUserMeta, E extends Json> = {
1436
1444
  /**
1437
1445
  * The connection ID of the client that sent the event.
1438
1446
  * If this message was broadcast from the server (via the REST API), then
@@ -1444,8 +1452,8 @@ declare type RoomEventMessage<TPresence extends JsonObject, TUserMeta extends Ba
1444
1452
  * If this message was broadcast from the server (via the REST API), then
1445
1453
  * this value will be null.
1446
1454
  */
1447
- user: User<TPresence, TUserMeta> | null;
1448
- event: TRoomEvent;
1455
+ user: User<P, U> | null;
1456
+ event: E;
1449
1457
  };
1450
1458
  declare type StorageStatus = "not-loaded" | "loading" | "synchronizing" | "synchronized";
1451
1459
  interface History {
@@ -1537,7 +1545,7 @@ declare type BroadcastOptions = {
1537
1545
  */
1538
1546
  shouldQueueEventIfNotReady: boolean;
1539
1547
  };
1540
- declare type SubscribeFn<TPresence extends JsonObject, _TStorage extends LsonObject, TUserMeta extends BaseUserMeta, TRoomEvent extends Json> = {
1548
+ declare type SubscribeFn<P extends JsonObject, _TStorage extends LsonObject, U extends BaseUserMeta, E extends Json> = {
1541
1549
  /**
1542
1550
  * Subscribe to the current user presence updates.
1543
1551
  *
@@ -1550,7 +1558,7 @@ declare type SubscribeFn<TPresence extends JsonObject, _TStorage extends LsonObj
1550
1558
  * // Do something
1551
1559
  * });
1552
1560
  */
1553
- (type: "my-presence", listener: Callback<TPresence>): () => void;
1561
+ (type: "my-presence", listener: Callback<P>): () => void;
1554
1562
  /**
1555
1563
  * Subscribe to the other users updates.
1556
1564
  *
@@ -1564,7 +1572,7 @@ declare type SubscribeFn<TPresence extends JsonObject, _TStorage extends LsonObj
1564
1572
  * });
1565
1573
  *
1566
1574
  */
1567
- (type: "others", listener: LegacyOthersEventCallback<TPresence, TUserMeta>): () => void;
1575
+ (type: "others", listener: LegacyOthersEventCallback<P, U>): () => void;
1568
1576
  /**
1569
1577
  * Subscribe to events broadcasted by {@link Room.broadcastEvent}
1570
1578
  *
@@ -1578,7 +1586,7 @@ declare type SubscribeFn<TPresence extends JsonObject, _TStorage extends LsonObj
1578
1586
  * });
1579
1587
  *
1580
1588
  */
1581
- (type: "event", listener: Callback<RoomEventMessage<TPresence, TUserMeta, TRoomEvent>>): () => void;
1589
+ (type: "event", listener: Callback<RoomEventMessage<P, U, E>>): () => void;
1582
1590
  /**
1583
1591
  * Subscribe to errors thrown in the room.
1584
1592
  *
@@ -1586,30 +1594,6 @@ declare type SubscribeFn<TPresence extends JsonObject, _TStorage extends LsonObj
1586
1594
  *
1587
1595
  */
1588
1596
  (type: "error", listener: Callback<LiveblocksError>): () => void;
1589
- /**
1590
- * @deprecated This API will be removed in a future version of Liveblocks.
1591
- * Prefer using the newer `.subscribe('status')` API.
1592
- *
1593
- * We recommend making the following changes if you use these APIs:
1594
- *
1595
- * OLD APIs NEW APIs
1596
- * .getConnectionState() --> .getStatus()
1597
- * .subscribe('connection') --> .subscribe('status')
1598
- *
1599
- * OLD STATUSES NEW STATUSES
1600
- * closed --> initial
1601
- * authenticating --> connecting
1602
- * connecting --> connecting
1603
- * open --> connected
1604
- * unavailable --> reconnecting
1605
- * failed --> disconnected
1606
- *
1607
- * Subscribe to legacy connection status updates.
1608
- *
1609
- * @returns Unsubscribe function.
1610
- *
1611
- */
1612
- (type: "connection", listener: Callback<LegacyConnectionStatus>): () => void;
1613
1597
  /**
1614
1598
  * Subscribe to connection status updates. The callback will be called any
1615
1599
  * time the status changes.
@@ -1694,15 +1678,15 @@ declare type SubscribeFn<TPresence extends JsonObject, _TStorage extends LsonObj
1694
1678
  */
1695
1679
  (type: "storage-status", listener: Callback<StorageStatus>): () => void;
1696
1680
  };
1697
- declare type GetThreadsOptions<TThreadMetadata extends BaseMetadata> = {
1681
+ declare type GetThreadsOptions<M extends BaseMetadata> = {
1698
1682
  query?: {
1699
- metadata?: Partial<QueryMetadata<TThreadMetadata>>;
1683
+ metadata?: Partial<QueryMetadata<M>>;
1700
1684
  };
1701
1685
  since?: Date;
1702
1686
  };
1703
- declare type CommentsApi = {
1704
- getThreads<TThreadMetadata extends BaseMetadata = never>(options?: GetThreadsOptions<TThreadMetadata>): Promise<{
1705
- threads: ThreadData<TThreadMetadata>[];
1687
+ declare type CommentsApi<M extends BaseMetadata> = {
1688
+ getThreads(options?: GetThreadsOptions<M>): Promise<{
1689
+ threads: ThreadData<M>[];
1706
1690
  inboxNotifications: InboxNotificationData[];
1707
1691
  deletedThreads: ThreadDeleteInfo[];
1708
1692
  deletedInboxNotifications: InboxNotificationDeleteInfo[];
@@ -1710,22 +1694,22 @@ declare type CommentsApi = {
1710
1694
  requestedAt: Date;
1711
1695
  };
1712
1696
  }>;
1713
- getThread<TThreadMetadata extends BaseMetadata = never>(options: {
1697
+ getThread(options: {
1714
1698
  threadId: string;
1715
1699
  }): Promise<{
1716
- thread: ThreadData<TThreadMetadata>;
1700
+ thread: ThreadData<M>;
1717
1701
  inboxNotification?: InboxNotificationData;
1718
1702
  } | undefined>;
1719
- createThread<TThreadMetadata extends BaseMetadata = never>(options: {
1703
+ createThread(options: {
1720
1704
  threadId: string;
1721
1705
  commentId: string;
1722
- metadata: TThreadMetadata | undefined;
1706
+ metadata: M | undefined;
1723
1707
  body: CommentBody;
1724
- }): Promise<ThreadData<TThreadMetadata>>;
1725
- editThreadMetadata<TThreadMetadata extends BaseMetadata = never>(options: {
1726
- metadata: PartialNullable<TThreadMetadata>;
1708
+ }): Promise<ThreadData<M>>;
1709
+ editThreadMetadata(options: {
1710
+ metadata: PartialNullable<M>;
1727
1711
  threadId: string;
1728
- }): Promise<TThreadMetadata>;
1712
+ }): Promise<M>;
1729
1713
  createComment(options: {
1730
1714
  threadId: string;
1731
1715
  commentId: string;
@@ -1751,7 +1735,13 @@ declare type CommentsApi = {
1751
1735
  emoji: string;
1752
1736
  }): Promise<void>;
1753
1737
  };
1754
- declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUserMeta extends BaseUserMeta, TRoomEvent extends Json> = {
1738
+ /**
1739
+ * @private Widest-possible Room type, matching _any_ Room instance. Note that
1740
+ * this type is different from `Room`-without-type-arguments. That represents
1741
+ * a Room instance using globally augmented types only, which is narrower.
1742
+ */
1743
+ declare type OpaqueRoom = Room<JsonObject, LsonObject, BaseUserMeta, Json, BaseMetadata>;
1744
+ declare type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUserMeta = DU, E extends Json = DE, M extends BaseMetadata = DM> = {
1755
1745
  /**
1756
1746
  * @private
1757
1747
  *
@@ -1759,36 +1749,17 @@ declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUs
1759
1749
  * of Liveblocks, NEVER USE ANY OF THESE DIRECTLY, because bad things
1760
1750
  * will probably happen if you do.
1761
1751
  */
1762
- readonly [kInternal]: PrivateRoomApi;
1752
+ readonly [kInternal]: PrivateRoomApi<M>;
1763
1753
  /**
1764
1754
  * The id of the room.
1765
1755
  */
1766
1756
  readonly id: string;
1767
- /**
1768
- * @deprecated This API will be removed in a future version of Liveblocks.
1769
- * Prefer using `.getStatus()` instead.
1770
- *
1771
- * We recommend making the following changes if you use these APIs:
1772
- *
1773
- * OLD APIs NEW APIs
1774
- * .getConnectionState() --> .getStatus()
1775
- * .subscribe('connection') --> .subscribe('status')
1776
- *
1777
- * OLD STATUSES NEW STATUSES
1778
- * closed --> initial
1779
- * authenticating --> connecting
1780
- * connecting --> connecting
1781
- * open --> connected
1782
- * unavailable --> reconnecting
1783
- * failed --> disconnected
1784
- */
1785
- getConnectionState(): LegacyConnectionStatus;
1786
1757
  /**
1787
1758
  * Return the current connection status for this room. Can be used to display
1788
1759
  * a status badge for your Liveblocks connection.
1789
1760
  */
1790
1761
  getStatus(): Status;
1791
- readonly subscribe: SubscribeFn<TPresence, TStorage, TUserMeta, TRoomEvent>;
1762
+ readonly subscribe: SubscribeFn<P, S, U, E>;
1792
1763
  /**
1793
1764
  * Room's history contains functions that let you undo and redo operation made on by the current client on the presence and storage.
1794
1765
  */
@@ -1800,21 +1771,21 @@ declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUs
1800
1771
  * @example
1801
1772
  * const user = room.getSelf();
1802
1773
  */
1803
- getSelf(): User<TPresence, TUserMeta> | null;
1774
+ getSelf(): User<P, U> | null;
1804
1775
  /**
1805
1776
  * Gets the presence of the current user.
1806
1777
  *
1807
1778
  * @example
1808
1779
  * const presence = room.getPresence();
1809
1780
  */
1810
- getPresence(): TPresence;
1781
+ getPresence(): P;
1811
1782
  /**
1812
1783
  * Gets all the other users in the room.
1813
1784
  *
1814
1785
  * @example
1815
1786
  * const others = room.getOthers();
1816
1787
  */
1817
- getOthers(): readonly User<TPresence, TUserMeta>[];
1788
+ getOthers(): readonly User<P, U>[];
1818
1789
  /**
1819
1790
  * Updates the presence of the current user. Only pass the properties you want to update. No need to send the full presence.
1820
1791
  * @param patch A partial object that contains the properties you want to update.
@@ -1827,7 +1798,7 @@ declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUs
1827
1798
  * const presence = room.getPresence();
1828
1799
  * // presence is equivalent to { x: 0, y: 0 }
1829
1800
  */
1830
- updatePresence(patch: Partial<TPresence>, options?: {
1801
+ updatePresence(patch: Partial<P>, options?: {
1831
1802
  /**
1832
1803
  * Whether or not the presence should have an impact on the undo/redo history.
1833
1804
  */
@@ -1858,7 +1829,7 @@ declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUs
1858
1829
  * }
1859
1830
  * });
1860
1831
  */
1861
- broadcastEvent(event: TRoomEvent, options?: BroadcastOptions): void;
1832
+ broadcastEvent(event: E, options?: BroadcastOptions): void;
1862
1833
  /**
1863
1834
  * Get the room's storage asynchronously.
1864
1835
  * The storage's root is a {@link LiveObject}.
@@ -1867,7 +1838,7 @@ declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUs
1867
1838
  * const { root } = await room.getStorage();
1868
1839
  */
1869
1840
  getStorage(): Promise<{
1870
- root: LiveObject<TStorage>;
1841
+ root: LiveObject<S>;
1871
1842
  }>;
1872
1843
  /**
1873
1844
  * Get the room's storage synchronously.
@@ -1876,14 +1847,14 @@ declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUs
1876
1847
  * @example
1877
1848
  * const root = room.getStorageSnapshot();
1878
1849
  */
1879
- getStorageSnapshot(): LiveObject<TStorage> | null;
1850
+ getStorageSnapshot(): LiveObject<S> | null;
1880
1851
  readonly events: {
1881
1852
  readonly status: Observable<Status>;
1882
1853
  readonly lostConnection: Observable<LostConnectionEvent>;
1883
- readonly customEvent: Observable<RoomEventMessage<TPresence, TUserMeta, TRoomEvent>>;
1884
- readonly self: Observable<User<TPresence, TUserMeta>>;
1885
- readonly myPresence: Observable<TPresence>;
1886
- readonly others: Observable<OthersEvent<TPresence, TUserMeta>>;
1854
+ readonly customEvent: Observable<RoomEventMessage<P, U, E>>;
1855
+ readonly self: Observable<User<P, U>>;
1856
+ readonly myPresence: Observable<P>;
1857
+ readonly others: Observable<OthersEvent<P, U>>;
1887
1858
  readonly error: Observable<LiveblocksError>;
1888
1859
  readonly storage: Observable<StorageUpdate[]>;
1889
1860
  readonly history: Observable<HistoryEvent>;
@@ -1952,7 +1923,7 @@ declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUs
1952
1923
  * Liveblocks, NEVER USE ANY OF THESE METHODS DIRECTLY, because bad things
1953
1924
  * will probably happen if you do.
1954
1925
  */
1955
- declare type PrivateRoomApi = {
1926
+ declare type PrivateRoomApi<M extends BaseMetadata> = {
1956
1927
  presenceBuffer: Json | undefined;
1957
1928
  undoStack: readonly (readonly Readonly<HistoryOp<JsonObject>>[])[];
1958
1929
  nodeCount: number;
@@ -1962,32 +1933,32 @@ declare type PrivateRoomApi = {
1962
1933
  explicitClose(event: IWebSocketCloseEvent): void;
1963
1934
  rawSend(data: string): void;
1964
1935
  };
1965
- comments: CommentsApi;
1936
+ comments: CommentsApi<M>;
1966
1937
  notifications: {
1967
1938
  getRoomNotificationSettings(): Promise<RoomNotificationSettings>;
1968
1939
  updateRoomNotificationSettings(settings: Partial<RoomNotificationSettings>): Promise<RoomNotificationSettings>;
1969
1940
  markInboxNotificationAsRead(notificationId: string): Promise<void>;
1970
1941
  };
1971
1942
  };
1972
- declare type HistoryOp<TPresence extends JsonObject> = Op | {
1943
+ declare type HistoryOp<P extends JsonObject> = Op | {
1973
1944
  readonly type: "presence";
1974
- readonly data: TPresence;
1945
+ readonly data: P;
1975
1946
  };
1976
1947
  declare type Polyfills = {
1977
1948
  atob?: (data: string) => string;
1978
1949
  fetch?: typeof fetch;
1979
1950
  WebSocket?: IWebSocket;
1980
1951
  };
1981
- declare type RoomInitializers<TPresence extends JsonObject, TStorage extends LsonObject> = Resolve<{
1952
+ declare type RoomInitializers<P extends JsonObject, S extends LsonObject> = Resolve<{
1982
1953
  /**
1983
1954
  * The initial Presence to use and announce when you enter the Room. The
1984
1955
  * Presence is available on all users in the Room (me & others).
1985
1956
  */
1986
- initialPresence: TPresence | ((roomId: string) => TPresence);
1957
+ initialPresence: P | ((roomId: string) => P);
1987
1958
  /**
1988
1959
  * The initial Storage to use when entering a new Room.
1989
1960
  */
1990
- initialStorage?: TStorage | ((roomId: string) => TStorage);
1961
+ initialStorage?: S | ((roomId: string) => S);
1991
1962
  /**
1992
1963
  * Whether or not the room automatically connects to Liveblock servers.
1993
1964
  * Default is true.
@@ -1996,8 +1967,6 @@ declare type RoomInitializers<TPresence extends JsonObject, TStorage extends Lso
1996
1967
  * the authentication endpoint or connect via WebSocket.
1997
1968
  */
1998
1969
  autoConnect?: boolean;
1999
- /** @deprecated Renamed to `autoConnect` */
2000
- shouldInitiallyConnect?: boolean;
2001
1970
  }>;
2002
1971
  declare class CommentsApiError extends Error {
2003
1972
  message: string;
@@ -2038,17 +2007,17 @@ declare type GetInboxNotificationsOptions = {
2038
2007
  since?: Date;
2039
2008
  };
2040
2009
 
2041
- declare type OptimisticUpdate<TThreadMetadata extends BaseMetadata> = CreateThreadOptimisticUpdate<TThreadMetadata> | EditThreadMetadataOptimisticUpdate<TThreadMetadata> | CreateCommentOptimisticUpdate | EditCommentOptimisticUpdate | DeleteCommentOptimisticUpdate | AddReactionOptimisticUpdate | RemoveReactionOptimisticUpdate | MarkInboxNotificationAsReadOptimisticUpdate | MarkAllInboxNotificationsAsReadOptimisticUpdate | UpdateNotificationSettingsOptimisticUpdate;
2042
- declare type CreateThreadOptimisticUpdate<TThreadMetadata extends BaseMetadata> = {
2010
+ declare type OptimisticUpdate<M extends BaseMetadata> = CreateThreadOptimisticUpdate<M> | EditThreadMetadataOptimisticUpdate<M> | CreateCommentOptimisticUpdate | EditCommentOptimisticUpdate | DeleteCommentOptimisticUpdate | AddReactionOptimisticUpdate | RemoveReactionOptimisticUpdate | MarkInboxNotificationAsReadOptimisticUpdate | MarkAllInboxNotificationsAsReadOptimisticUpdate | UpdateNotificationSettingsOptimisticUpdate;
2011
+ declare type CreateThreadOptimisticUpdate<M extends BaseMetadata> = {
2043
2012
  type: "create-thread";
2044
2013
  id: string;
2045
- thread: ThreadData<TThreadMetadata>;
2014
+ thread: ThreadData<M>;
2046
2015
  };
2047
- declare type EditThreadMetadataOptimisticUpdate<TThreadMetadata extends BaseMetadata> = {
2016
+ declare type EditThreadMetadataOptimisticUpdate<M extends BaseMetadata> = {
2048
2017
  type: "edit-thread-metadata";
2049
2018
  id: string;
2050
2019
  threadId: string;
2051
- metadata: Resolve<PartialNullable<TThreadMetadata>>;
2020
+ metadata: Resolve<PartialNullable<M>>;
2052
2021
  updatedAt: Date;
2053
2022
  };
2054
2023
  declare type CreateCommentOptimisticUpdate = {
@@ -2108,11 +2077,11 @@ declare type QueryState = {
2108
2077
  isLoading: false;
2109
2078
  error?: Error;
2110
2079
  };
2111
- declare type CacheState<TThreadMetadata extends BaseMetadata> = {
2080
+ declare type CacheState<M extends BaseMetadata> = {
2112
2081
  /**
2113
2082
  * Threads by ID.
2114
2083
  */
2115
- threads: Record<string, ThreadDataWithDeleteInfo<TThreadMetadata>>;
2084
+ threads: Record<string, ThreadDataWithDeleteInfo<M>>;
2116
2085
  /**
2117
2086
  * Keep track of loading and error status of all the queries made by the client.
2118
2087
  */
@@ -2121,7 +2090,7 @@ declare type CacheState<TThreadMetadata extends BaseMetadata> = {
2121
2090
  * Optimistic updates that have not been acknowledged by the server yet.
2122
2091
  * They are applied on top of the threads in selectors.
2123
2092
  */
2124
- optimisticUpdates: OptimisticUpdate<TThreadMetadata>[];
2093
+ optimisticUpdates: OptimisticUpdate<M>[];
2125
2094
  /**
2126
2095
  * Inbox notifications by ID.
2127
2096
  */
@@ -2131,33 +2100,22 @@ declare type CacheState<TThreadMetadata extends BaseMetadata> = {
2131
2100
  */
2132
2101
  notificationSettings: Record<string, RoomNotificationSettings>;
2133
2102
  };
2134
- interface CacheStore<TThreadMetadata extends BaseMetadata> extends Store<CacheState<TThreadMetadata>> {
2103
+ interface CacheStore<M extends BaseMetadata> extends Store<CacheState<M>> {
2135
2104
  deleteThread(threadId: string): void;
2136
- updateThreadAndNotification(thread: ThreadData<TThreadMetadata>, inboxNotification?: InboxNotificationData): void;
2137
- updateThreadsAndNotifications(threads: ThreadData<TThreadMetadata>[], inboxNotifications: InboxNotificationData[], deletedThreads: ThreadDeleteInfo[], deletedInboxNotifications: InboxNotificationDeleteInfo[], queryKey?: string): void;
2105
+ updateThreadAndNotification(thread: ThreadData<M>, inboxNotification?: InboxNotificationData): void;
2106
+ updateThreadsAndNotifications(threads: ThreadData<M>[], inboxNotifications: InboxNotificationData[], deletedThreads: ThreadDeleteInfo[], deletedInboxNotifications: InboxNotificationDeleteInfo[], queryKey?: string): void;
2138
2107
  updateRoomInboxNotificationSettings(roomId: string, settings: RoomNotificationSettings, queryKey: string): void;
2139
- pushOptimisticUpdate(optimisticUpdate: OptimisticUpdate<TThreadMetadata>): void;
2108
+ pushOptimisticUpdate(optimisticUpdate: OptimisticUpdate<M>): void;
2140
2109
  setQueryState(queryKey: string, queryState: QueryState): void;
2141
2110
  }
2142
- declare function applyOptimisticUpdates<TThreadMetadata extends BaseMetadata>(state: CacheState<TThreadMetadata>): Pick<CacheState<TThreadMetadata>, "threads" | "inboxNotifications" | "notificationSettings">;
2143
- declare function upsertComment<TThreadMetadata extends BaseMetadata>(thread: ThreadDataWithDeleteInfo<TThreadMetadata>, comment: CommentData): ThreadDataWithDeleteInfo<TThreadMetadata>;
2144
- declare function deleteComment<TThreadMetadata extends BaseMetadata>(thread: ThreadDataWithDeleteInfo<TThreadMetadata>, commentId: string, deletedAt: Date): ThreadDataWithDeleteInfo<TThreadMetadata>;
2145
- declare function addReaction<TThreadMetadata extends BaseMetadata>(thread: ThreadDataWithDeleteInfo<TThreadMetadata>, commentId: string, reaction: CommentUserReaction): ThreadDataWithDeleteInfo<TThreadMetadata>;
2146
- declare function removeReaction<TThreadMetadata extends BaseMetadata>(thread: ThreadDataWithDeleteInfo<TThreadMetadata>, commentId: string, emoji: string, userId: string, removedAt: Date): ThreadDataWithDeleteInfo<TThreadMetadata>;
2111
+ declare function applyOptimisticUpdates<M extends BaseMetadata>(state: CacheState<M>): Pick<CacheState<M>, "threads" | "inboxNotifications" | "notificationSettings">;
2112
+ declare function upsertComment<M extends BaseMetadata>(thread: ThreadDataWithDeleteInfo<M>, comment: CommentData): ThreadDataWithDeleteInfo<M>;
2113
+ declare function deleteComment<M extends BaseMetadata>(thread: ThreadDataWithDeleteInfo<M>, commentId: string, deletedAt: Date): ThreadDataWithDeleteInfo<M>;
2114
+ declare function addReaction<M extends BaseMetadata>(thread: ThreadDataWithDeleteInfo<M>, commentId: string, reaction: CommentUserReaction): ThreadDataWithDeleteInfo<M>;
2115
+ declare function removeReaction<M extends BaseMetadata>(thread: ThreadDataWithDeleteInfo<M>, commentId: string, emoji: string, userId: string, removedAt: Date): ThreadDataWithDeleteInfo<M>;
2147
2116
 
2148
2117
  declare type OptionalPromise<T> = T | Promise<T>;
2149
2118
 
2150
- declare type RoomInfo = {
2151
- /**
2152
- * The name of the room.
2153
- */
2154
- name?: string;
2155
- /**
2156
- * The URL of the room.
2157
- */
2158
- url?: string;
2159
- };
2160
-
2161
2119
  declare type ResolveMentionSuggestionsArgs = {
2162
2120
  /**
2163
2121
  * The ID of the current room.
@@ -2180,7 +2138,7 @@ declare type ResolveRoomsInfoArgs = {
2180
2138
  */
2181
2139
  roomIds: string[];
2182
2140
  };
2183
- declare type EnterOptions<TPresence extends JsonObject, TStorage extends LsonObject> = Resolve<RoomInitializers<TPresence, TStorage> & {
2141
+ declare type EnterOptions<P extends JsonObject = DP, S extends LsonObject = DS> = Resolve<RoomInitializers<P, S> & {
2184
2142
  /**
2185
2143
  * Only necessary when you’re using Liveblocks with React v17 or lower.
2186
2144
  *
@@ -2198,19 +2156,19 @@ declare type EnterOptions<TPresence extends JsonObject, TStorage extends LsonObj
2198
2156
  * of Liveblocks, NEVER USE ANY OF THESE DIRECTLY, because bad things
2199
2157
  * will probably happen if you do.
2200
2158
  */
2201
- declare type PrivateClientApi<TUserMeta extends BaseUserMeta> = {
2202
- notifications: NotificationsApi;
2203
- currentUserIdStore: Store<string | null>;
2204
- resolveMentionSuggestions: ClientOptions["resolveMentionSuggestions"];
2205
- cacheStore: CacheStore<BaseMetadata>;
2206
- usersStore: BatchStore<TUserMeta["info"] | undefined, [string]>;
2207
- roomsInfoStore: BatchStore<RoomInfo | undefined, [string]>;
2208
- getRoomIds: () => string[];
2159
+ declare type PrivateClientApi<U extends BaseUserMeta, M extends BaseMetadata> = {
2160
+ readonly notifications: NotificationsApi<M>;
2161
+ readonly currentUserIdStore: Store<string | null>;
2162
+ readonly resolveMentionSuggestions: ClientOptions<U>["resolveMentionSuggestions"];
2163
+ readonly cacheStore: CacheStore<BaseMetadata>;
2164
+ readonly usersStore: BatchStore<U["info"] | undefined, [string]>;
2165
+ readonly roomsInfoStore: BatchStore<DRI | undefined, [string]>;
2166
+ readonly getRoomIds: () => string[];
2209
2167
  };
2210
- declare type NotificationsApi<TThreadMetadata extends BaseMetadata = never> = {
2168
+ declare type NotificationsApi<M extends BaseMetadata> = {
2211
2169
  getInboxNotifications(options?: GetInboxNotificationsOptions): Promise<{
2212
2170
  inboxNotifications: InboxNotificationData[];
2213
- threads: ThreadData<TThreadMetadata>[];
2171
+ threads: ThreadData<M>[];
2214
2172
  deletedThreads: ThreadDeleteInfo[];
2215
2173
  deletedInboxNotifications: InboxNotificationDeleteInfo[];
2216
2174
  meta: {
@@ -2221,44 +2179,30 @@ declare type NotificationsApi<TThreadMetadata extends BaseMetadata = never> = {
2221
2179
  markAllInboxNotificationsAsRead(): Promise<void>;
2222
2180
  markInboxNotificationAsRead(inboxNotificationId: string): Promise<void>;
2223
2181
  };
2224
- declare type Client<TUserMeta extends BaseUserMeta = BaseUserMeta> = {
2182
+ /**
2183
+ * @private Widest-possible Client type, matching _any_ Client instance. Note
2184
+ * that this type is different from `Client`-without-type-arguments. That
2185
+ * represents a Client instance using globally augmented types only, which is
2186
+ * narrower.
2187
+ */
2188
+ declare type OpaqueClient = Client<BaseUserMeta>;
2189
+ declare type Client<U extends BaseUserMeta = DU> = {
2225
2190
  /**
2226
2191
  * Gets a room. Returns null if {@link Client.enter} has not been called previously.
2227
2192
  *
2228
2193
  * @param roomId The id of the room
2229
2194
  */
2230
- getRoom<TPresence extends JsonObject, TStorage extends LsonObject = LsonObject, TUserMeta extends BaseUserMeta = BaseUserMeta, TRoomEvent extends Json = never>(roomId: string): Room<TPresence, TStorage, TUserMeta, TRoomEvent> | null;
2195
+ getRoom<P extends JsonObject = DP, S extends LsonObject = DS, E extends Json = DE, M extends BaseMetadata = DM>(roomId: string): Room<P, S, U, E, M> | null;
2231
2196
  /**
2232
2197
  * Enter a room.
2233
2198
  * @param roomId The id of the room
2234
2199
  * @param options Optional. You can provide initializers for the Presence or Storage when entering the Room.
2235
2200
  * @returns The room and a leave function. Call the returned leave() function when you no longer need the room.
2236
2201
  */
2237
- enterRoom<TPresence extends JsonObject, TStorage extends LsonObject = LsonObject, TUserMeta extends BaseUserMeta = BaseUserMeta, TRoomEvent extends Json = never>(roomId: string, options: EnterOptions<TPresence, TStorage>): {
2238
- room: Room<TPresence, TStorage, TUserMeta, TRoomEvent>;
2202
+ enterRoom<P extends JsonObject = DP, S extends LsonObject = DS, E extends Json = DE, M extends BaseMetadata = DM>(roomId: string, options: EnterOptions<P, S>): {
2203
+ room: Room<P, S, U, E, M>;
2239
2204
  leave: () => void;
2240
2205
  };
2241
- /**
2242
- * @deprecated - Prefer using {@link Client.enterRoom} instead.
2243
- *
2244
- * Enters a room and returns it.
2245
- * @param roomId The id of the room
2246
- * @param options Optional. You can provide initializers for the Presence or Storage when entering the Room.
2247
- */
2248
- enter<TPresence extends JsonObject, TStorage extends LsonObject = LsonObject, TUserMeta extends BaseUserMeta = BaseUserMeta, TRoomEvent extends Json = never>(roomId: string, options: EnterOptions<TPresence, TStorage>): Room<TPresence, TStorage, TUserMeta, TRoomEvent>;
2249
- /**
2250
- * @deprecated - Prefer using {@link Client.enterRoom} and calling the returned leave function instead, which is safer.
2251
- *
2252
- * Forcefully leaves a room.
2253
- *
2254
- * Only call this if you know for sure there are no other "instances" of this
2255
- * room used elsewhere in your application. Force-leaving can trigger
2256
- * unexpected conditions in other parts of your application that may not
2257
- * expect this.
2258
- *
2259
- * @param roomId The id of the room
2260
- */
2261
- leave(roomId: string): void;
2262
2206
  /**
2263
2207
  * Purges all cached auth tokens and reconnects all rooms that are still
2264
2208
  * connected, if any.
@@ -2273,14 +2217,14 @@ declare type Client<TUserMeta extends BaseUserMeta = BaseUserMeta> = {
2273
2217
  * of Liveblocks, NEVER USE ANY OF THESE DIRECTLY, because bad things
2274
2218
  * will probably happen if you do.
2275
2219
  */
2276
- readonly [kInternal]: PrivateClientApi<TUserMeta>;
2220
+ readonly [kInternal]: PrivateClientApi<U, BaseMetadata>;
2277
2221
  };
2278
2222
  declare type AuthEndpoint = string | ((room?: string) => Promise<CustomAuthenticationResult>);
2279
2223
  /**
2280
2224
  * The authentication endpoint that is called to ensure that the current user has access to a room.
2281
2225
  * Can be an url or a callback if you need to add additional headers.
2282
2226
  */
2283
- declare type ClientOptions<TUserMeta extends BaseUserMeta = BaseUserMeta> = {
2227
+ declare type ClientOptions<U extends BaseUserMeta = DU> = {
2284
2228
  throttle?: number;
2285
2229
  lostConnectionTimeout?: number;
2286
2230
  backgroundKeepAliveTimeout?: number;
@@ -2288,33 +2232,17 @@ declare type ClientOptions<TUserMeta extends BaseUserMeta = BaseUserMeta> = {
2288
2232
  unstable_fallbackToHTTP?: boolean;
2289
2233
  unstable_streamData?: boolean;
2290
2234
  /**
2291
- * @deprecated Use `polyfills: { fetch: ... }` instead.
2292
- * This option will be removed in a future release.
2293
- */
2294
- fetchPolyfill?: Polyfills["fetch"];
2295
- /**
2296
- * @deprecated Use `polyfills: { WebSocket: ... }` instead.
2297
- * This option will be removed in a future release.
2298
- */
2299
- WebSocketPolyfill?: Polyfills["WebSocket"];
2300
- /**
2301
- * @beta
2302
- *
2303
2235
  * A function that returns a list of user IDs matching a string.
2304
2236
  */
2305
2237
  resolveMentionSuggestions?: (args: ResolveMentionSuggestionsArgs) => OptionalPromise<string[]>;
2306
2238
  /**
2307
- * @beta
2308
- *
2309
2239
  * A function that returns user info from user IDs.
2310
2240
  */
2311
- resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(TUserMeta["info"] | undefined)[] | undefined>;
2241
+ resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(U["info"] | undefined)[] | undefined>;
2312
2242
  /**
2313
- * @beta
2314
- *
2315
2243
  * A function that returns room info from room IDs.
2316
2244
  */
2317
- resolveRoomsInfo?: (args: ResolveRoomsInfoArgs) => OptionalPromise<(RoomInfo | undefined)[] | undefined>;
2245
+ resolveRoomsInfo?: (args: ResolveRoomsInfoArgs) => OptionalPromise<(DRI | undefined)[] | undefined>;
2318
2246
  } & ({
2319
2247
  publicApiKey: string;
2320
2248
  authEndpoint?: never;
@@ -2347,7 +2275,7 @@ declare type ClientOptions<TUserMeta extends BaseUserMeta = BaseUserMeta> = {
2347
2275
  * }
2348
2276
  * });
2349
2277
  */
2350
- declare function createClient<TUserMeta extends BaseUserMeta = BaseUserMeta>(options: ClientOptions<TUserMeta>): Client<TUserMeta>;
2278
+ declare function createClient<U extends BaseUserMeta = DU>(options: ClientOptions<U>): Client<U>;
2351
2279
  declare class NotificationsApiError extends Error {
2352
2280
  message: string;
2353
2281
  status: number;
@@ -2381,7 +2309,7 @@ declare type CommentBodyLinkElementArgs = {
2381
2309
  */
2382
2310
  href: string;
2383
2311
  };
2384
- declare type CommentBodyMentionElementArgs<TUserMeta extends BaseUserMeta = BaseUserMeta> = {
2312
+ declare type CommentBodyMentionElementArgs<U extends BaseUserMeta = DU> = {
2385
2313
  /**
2386
2314
  * The mention element.
2387
2315
  */
@@ -2389,9 +2317,9 @@ declare type CommentBodyMentionElementArgs<TUserMeta extends BaseUserMeta = Base
2389
2317
  /**
2390
2318
  * The mention's user info, if the `resolvedUsers` option was provided.
2391
2319
  */
2392
- user?: TUserMeta["info"];
2320
+ user?: U["info"];
2393
2321
  };
2394
- declare type StringifyCommentBodyElements<TUserMeta extends BaseUserMeta = BaseUserMeta> = {
2322
+ declare type StringifyCommentBodyElements<U extends BaseUserMeta = DU> = {
2395
2323
  /**
2396
2324
  * The element used to display paragraphs.
2397
2325
  */
@@ -2407,9 +2335,9 @@ declare type StringifyCommentBodyElements<TUserMeta extends BaseUserMeta = BaseU
2407
2335
  /**
2408
2336
  * The element used to display mentions.
2409
2337
  */
2410
- mention: (args: CommentBodyMentionElementArgs<TUserMeta>, index: number) => string;
2338
+ mention: (args: CommentBodyMentionElementArgs<U>, index: number) => string;
2411
2339
  };
2412
- declare type StringifyCommentBodyOptions<TUserMeta extends BaseUserMeta = BaseUserMeta> = {
2340
+ declare type StringifyCommentBodyOptions<U extends BaseUserMeta = DU> = {
2413
2341
  /**
2414
2342
  * Which format to convert the comment to.
2415
2343
  */
@@ -2418,7 +2346,7 @@ declare type StringifyCommentBodyOptions<TUserMeta extends BaseUserMeta = BaseUs
2418
2346
  * The elements used to customize the resulting string. Each element has
2419
2347
  * priority over the defaults inherited from the `format` option.
2420
2348
  */
2421
- elements?: Partial<StringifyCommentBodyElements<TUserMeta>>;
2349
+ elements?: Partial<StringifyCommentBodyElements<U>>;
2422
2350
  /**
2423
2351
  * The separator used between paragraphs.
2424
2352
  */
@@ -2426,7 +2354,7 @@ declare type StringifyCommentBodyOptions<TUserMeta extends BaseUserMeta = BaseUs
2426
2354
  /**
2427
2355
  * A function that returns user info from user IDs.
2428
2356
  */
2429
- resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(TUserMeta["info"] | undefined)[] | undefined>;
2357
+ resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(U["info"] | undefined)[] | undefined>;
2430
2358
  };
2431
2359
  /**
2432
2360
  * Get an array of each user's ID that has been mentioned in a `CommentBody`.
@@ -2436,7 +2364,7 @@ declare function getMentionedIdsFromCommentBody(body: CommentBody): string[];
2436
2364
  * Convert a `CommentBody` into either a plain string,
2437
2365
  * Markdown, HTML, or a custom format.
2438
2366
  */
2439
- declare function stringifyCommentBody<TUserMeta extends BaseUserMeta = BaseUserMeta>(body: CommentBody, options?: StringifyCommentBodyOptions<TUserMeta>): Promise<string>;
2367
+ declare function stringifyCommentBody(body: CommentBody, options?: StringifyCommentBodyOptions<BaseUserMeta>): Promise<string>;
2440
2368
 
2441
2369
  /**
2442
2370
  * Converts a plain comment data object (usually returned by the API) to a comment data object that can be used by the client.
@@ -2451,7 +2379,7 @@ declare function convertToCommentData(data: CommentDataPlain): CommentData;
2451
2379
  * @param data The plain thread data object (usually returned by the API)
2452
2380
  * @returns The rich thread data object that can be used by the client.
2453
2381
  */
2454
- declare function convertToThreadData<TThreadMetadata extends BaseMetadata = never>(data: ThreadDataPlain<TThreadMetadata>): ThreadData<TThreadMetadata>;
2382
+ declare function convertToThreadData<M extends BaseMetadata>(data: ThreadDataPlain<M>): ThreadData<M>;
2455
2383
  /**
2456
2384
  * Converts a plain comment reaction object (usually returned by the API) to a comment reaction object that can be used by the client.
2457
2385
  * This is necessary because the plain data object stores dates as ISO strings, but the client expects them as Date objects.
@@ -2484,7 +2412,7 @@ declare function cloneLson<L extends Lson | undefined>(value: L): L;
2484
2412
 
2485
2413
  declare function lsonToJson(value: Lson): Json;
2486
2414
  declare function patchLiveObjectKey<O extends LsonObject, K extends keyof O, V extends Json>(liveObject: LiveObject<O>, key: K, prev?: V, next?: V): void;
2487
- declare function legacy_patchImmutableObject<S extends JsonObject>(state: S, updates: StorageUpdate[]): S;
2415
+ declare function legacy_patchImmutableObject<TState extends JsonObject>(state: TState, updates: StorageUpdate[]): TState;
2488
2416
 
2489
2417
  /**
2490
2418
  * Helper function that can be used to implement exhaustive switch statements
@@ -2854,4 +2782,4 @@ declare type EnsureJson<T> = [
2854
2782
  [K in keyof T]: EnsureJson<T[K]>;
2855
2783
  };
2856
2784
 
2857
- export { type AckOp, type ActivityData, type BaseAuthResult, type BaseMetadata, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type CacheState, type CacheStore, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type LegacyConnectionStatus, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LostConnectionEvent, type Lson, type LsonObject, type NodeMap, NotificationsApiError, type Op, OpCode, type OptionalPromise, type Others, type OthersEvent, type ParentToChildNodeMap, type PartialNullable, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type QueryMetadata, type RejectedStorageOpServerMsg, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomInfo, type RoomInitializers, type RoomNotificationSettings, type RoomStateServerMsg, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, type Status, type StorageStatus, type StorageUpdate, type Store, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type ThreadData, type ThreadDataPlain, type ThreadDeleteInfo, type ToImmutable, type ToJson, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type User, type UserJoinServerMsg, type UserLeftServerMsg, WebsocketCloseCodes, type YDocUpdateServerMsg, ackOp, addReaction, applyOptimisticUpdates, asPos, assert, assertNever, b64decode, cloneLson, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, deleteComment, deprecate, deprecateIf, detectDupes, errorIf, freeze, getMentionedIdsFromCommentBody, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, objectToQuery, patchLiveObjectKey, raise, removeReaction, shallow, stringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, upsertComment, withTimeout };
2785
+ export { type AckOp, type ActivityData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type CacheState, type CacheStore, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DE, type DM, type DP, type DRI, type DS, type DU, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LostConnectionEvent, type Lson, type LsonObject, type NodeMap, NotificationsApiError, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalPromise, type OthersEvent, type ParentToChildNodeMap, type PartialNullable, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type PrivateClientApi, type PrivateRoomApi, type QueryMetadata, type RejectedStorageOpServerMsg, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomInitializers, type RoomNotificationSettings, type RoomStateServerMsg, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, type Status, type StorageStatus, type StorageUpdate, type Store, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type ThreadData, type ThreadDataPlain, type ThreadDeleteInfo, type ToImmutable, type ToJson, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type User, type UserJoinServerMsg, type UserLeftServerMsg, WebsocketCloseCodes, type YDocUpdateServerMsg, ackOp, addReaction, applyOptimisticUpdates, asPos, assert, assertNever, b64decode, cloneLson, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, deleteComment, deprecate, deprecateIf, detectDupes, errorIf, freeze, getMentionedIdsFromCommentBody, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, objectToQuery, patchLiveObjectKey, raise, removeReaction, shallow, stringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, upsertComment, withTimeout };