@liveblocks/core 1.5.0-test1 → 1.5.0-test2

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
@@ -240,6 +240,7 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
240
240
  */
241
241
  update(patch: Partial<O>): void;
242
242
  toImmutable(): ToImmutable<O>;
243
+ clone(): LiveObject<O>;
243
244
  }
244
245
 
245
246
  /**
@@ -333,6 +334,7 @@ declare class LiveMap<TKey extends string, TValue extends Lson> extends Abstract
333
334
  */
334
335
  forEach(callback: (value: TValue, key: TKey, map: LiveMap<TKey, TValue>) => void): void;
335
336
  toImmutable(): ReadonlyMap<TKey, ToImmutable<TValue>>;
337
+ clone(): LiveMap<TKey, TValue>;
336
338
  }
337
339
 
338
340
  declare type StorageCallback = (updates: StorageUpdate[]) => void;
@@ -352,24 +354,29 @@ declare abstract class AbstractCrdt {
352
354
  * Return an immutable snapshot of this Live node and its children.
353
355
  */
354
356
  toImmutable(): Immutable;
357
+ /**
358
+ * Returns a deep clone of the current LiveStructure, suitable for insertion
359
+ * in the tree elsewhere.
360
+ */
361
+ abstract clone(): Lson;
355
362
  }
356
363
 
357
364
  declare type LiveListUpdateDelta = {
365
+ type: "insert";
358
366
  index: number;
359
367
  item: Lson;
360
- type: "insert";
361
368
  } | {
362
- index: number;
363
369
  type: "delete";
370
+ index: number;
364
371
  } | {
372
+ type: "move";
365
373
  index: number;
366
374
  previousIndex: number;
367
375
  item: Lson;
368
- type: "move";
369
376
  } | {
377
+ type: "set";
370
378
  index: number;
371
379
  item: Lson;
372
- type: "set";
373
380
  };
374
381
  /**
375
382
  * A LiveList notification that is sent in-client to any subscribers whenever
@@ -480,6 +487,7 @@ declare class LiveList<TItem extends Lson> extends AbstractCrdt {
480
487
  some(predicate: (value: TItem, index: number) => unknown): boolean;
481
488
  [Symbol.iterator](): IterableIterator<TItem>;
482
489
  toImmutable(): readonly ToImmutable<TItem>[];
490
+ clone(): LiveList<TItem>;
483
491
  }
484
492
 
485
493
  /**
@@ -488,6 +496,7 @@ declare class LiveList<TItem extends Lson> extends AbstractCrdt {
488
496
  declare class LiveRegister<TValue extends Json> extends AbstractCrdt {
489
497
  constructor(data: TValue);
490
498
  get data(): TValue;
499
+ clone(): TValue;
491
500
  }
492
501
 
493
502
  declare type LiveStructure = LiveObject<LsonObject> | LiveList<Lson> | LiveMap<string, Lson>;
@@ -723,7 +732,7 @@ declare type ThreadData<TThreadMetadata extends BaseMetadata = never> = {
723
732
  };
724
733
 
725
734
  declare type Options = {
726
- serverEndpoint: string;
735
+ baseUrl: string;
727
736
  };
728
737
  declare type PartialNullable<T> = {
729
738
  [P in keyof T]?: T[P] | null | undefined;
@@ -765,7 +774,7 @@ declare type CommentsApi<TThreadMetadata extends BaseMetadata> = {
765
774
  emoji: string;
766
775
  }): Promise<CommentData>;
767
776
  };
768
- declare function createCommentsApi<TThreadMetadata extends BaseMetadata>(roomId: string, getAuthValue: () => Promise<AuthValue>, { serverEndpoint }: Options): CommentsApi<TThreadMetadata>;
777
+ declare function createCommentsApi<TThreadMetadata extends BaseMetadata>(roomId: string, getAuthValue: () => Promise<AuthValue>, config: Options): CommentsApi<TThreadMetadata>;
769
778
 
770
779
  declare type Callback<T> = (event: T) => void;
771
780
  declare type UnsubscribeCallback = () => void;
@@ -944,6 +953,7 @@ declare type BaseAuthResult = NonNullable<Json>;
944
953
  declare type Delegates<T extends BaseAuthResult> = {
945
954
  authenticate: () => Promise<T>;
946
955
  createSocket: (authValue: T) => IWebSocketInstance;
956
+ canZombie: () => boolean;
947
957
  };
948
958
 
949
959
  declare enum ClientMsgCode {
@@ -1312,7 +1322,7 @@ declare type User<TPresence extends JsonObject, TUserMeta extends BaseUserMeta>
1312
1322
  * @deprecated Use `readonly User<TPresence, TUserMeta>[]` instead of `Others<TPresence, TUserMeta>`.
1313
1323
  */
1314
1324
  declare type Others<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = readonly User<TPresence, TUserMeta>[];
1315
- declare type OthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = {
1325
+ declare type InternalOthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = {
1316
1326
  type: "leave";
1317
1327
  user: User<TPresence, TUserMeta>;
1318
1328
  } | {
@@ -1325,7 +1335,24 @@ declare type OthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUse
1325
1335
  } | {
1326
1336
  type: "reset";
1327
1337
  };
1338
+ declare type OthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = Resolve<InternalOthersEvent<TPresence, TUserMeta> & {
1339
+ others: readonly User<TPresence, TUserMeta>[];
1340
+ }>;
1328
1341
 
1342
+ declare type LegacyOthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = {
1343
+ type: "leave";
1344
+ user: User<TPresence, TUserMeta>;
1345
+ } | {
1346
+ type: "enter";
1347
+ user: User<TPresence, TUserMeta>;
1348
+ } | {
1349
+ type: "update";
1350
+ user: User<TPresence, TUserMeta>;
1351
+ updates: Partial<TPresence>;
1352
+ } | {
1353
+ type: "reset";
1354
+ };
1355
+ declare type LegacyOthersEventCallback<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = (others: readonly User<TPresence, TUserMeta>[], event: LegacyOthersEvent<TPresence, TUserMeta>) => void;
1329
1356
  declare type RoomEventMessage<TPresence extends JsonObject, TUserMeta extends BaseUserMeta, TRoomEvent extends Json> = {
1330
1357
  /**
1331
1358
  * The connection ID of the client that sent the event.
@@ -1458,7 +1485,7 @@ declare type SubscribeFn<TPresence extends JsonObject, _TStorage extends LsonObj
1458
1485
  * });
1459
1486
  *
1460
1487
  */
1461
- (type: "others", listener: (others: readonly User<TPresence, TUserMeta>[], event: OthersEvent<TPresence, TUserMeta>) => void): () => void;
1488
+ (type: "others", listener: LegacyOthersEventCallback<TPresence, TUserMeta>): () => void;
1462
1489
  /**
1463
1490
  * Subscribe to events broadcasted by {@link Room.broadcastEvent}
1464
1491
  *
@@ -1715,10 +1742,7 @@ declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUs
1715
1742
  readonly customEvent: Observable<RoomEventMessage<TPresence, TUserMeta, TRoomEvent>>;
1716
1743
  readonly self: Observable<User<TPresence, TUserMeta>>;
1717
1744
  readonly myPresence: Observable<TPresence>;
1718
- readonly others: Observable<{
1719
- others: readonly User<TPresence, TUserMeta>[];
1720
- event: OthersEvent<TPresence, TUserMeta>;
1721
- }>;
1745
+ readonly others: Observable<OthersEvent<TPresence, TUserMeta>>;
1722
1746
  readonly error: Observable<Error>;
1723
1747
  readonly storage: Observable<StorageUpdate[]>;
1724
1748
  readonly history: Observable<HistoryEvent>;
@@ -1855,6 +1879,13 @@ declare type Client = {
1855
1879
  * @param roomId The id of the room
1856
1880
  */
1857
1881
  leave(roomId: string): void;
1882
+ /**
1883
+ * Purges all cached auth tokens and reconnects all rooms that are still
1884
+ * connected, if any.
1885
+ *
1886
+ * Call this whenever you log out a user in your application.
1887
+ */
1888
+ logout(): void;
1858
1889
  };
1859
1890
  declare type AuthEndpoint = string | ((room: string) => Promise<CustomAuthenticationResult>);
1860
1891
  /**
@@ -1864,6 +1895,7 @@ declare type AuthEndpoint = string | ((room: string) => Promise<CustomAuthentica
1864
1895
  declare type ClientOptions = {
1865
1896
  throttle?: number;
1866
1897
  lostConnectionTimeout?: number;
1898
+ backgroundKeepAliveTimeout?: number;
1867
1899
  polyfills?: Polyfills;
1868
1900
  unstable_fallbackToHTTP?: boolean;
1869
1901
  /**
@@ -1923,6 +1955,7 @@ declare type ParentToChildNodeMap = Map<string, // Parent's node ID
1923
1955
  IdTuple<SerializedChild>[]>;
1924
1956
 
1925
1957
  declare function isLiveNode(value: unknown): value is LiveNode;
1958
+ declare function cloneLson<L extends Lson | undefined>(value: L): L;
1926
1959
 
1927
1960
  declare function lsonToJson(value: Lson): Json;
1928
1961
  declare function patchLiveObjectKey<O extends LsonObject, K extends keyof O, V extends Json>(liveObject: LiveObject<O>, key: K, prev?: V, next?: V): void;
@@ -2407,4 +2440,4 @@ declare type EnsureJson<T> = [
2407
2440
  [K in keyof T]: EnsureJson<T[K]>;
2408
2441
  };
2409
2442
 
2410
- export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CreateRootObjectOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, EnterOptions, EventSource, FetchStorageClientMsg, FetchYDocClientMsg, History, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomEventMessage, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ThreadData, ToImmutable, ToJson, UnsubscribeCallback, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, YDocUpdateServerMsg, asPos, assert, assertNever, b64decode, fancyConsole as console, createAsyncCache, createClient, createCommentsApi, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, patchLiveObjectKey, shallow, stringify, throwUsageError, toPlainLson, tryParseJson, withTimeout };
2443
+ export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CreateRootObjectOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, EnterOptions, EventSource, FetchStorageClientMsg, FetchYDocClientMsg, History, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, OthersEvent, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomEventMessage, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ThreadData, ToImmutable, ToJson, UnsubscribeCallback, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, YDocUpdateServerMsg, asPos, assert, assertNever, b64decode, cloneLson, fancyConsole as console, createAsyncCache, createClient, createCommentsApi, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, patchLiveObjectKey, shallow, stringify, throwUsageError, toPlainLson, tryParseJson, withTimeout };
package/dist/index.d.ts CHANGED
@@ -240,6 +240,7 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
240
240
  */
241
241
  update(patch: Partial<O>): void;
242
242
  toImmutable(): ToImmutable<O>;
243
+ clone(): LiveObject<O>;
243
244
  }
244
245
 
245
246
  /**
@@ -333,6 +334,7 @@ declare class LiveMap<TKey extends string, TValue extends Lson> extends Abstract
333
334
  */
334
335
  forEach(callback: (value: TValue, key: TKey, map: LiveMap<TKey, TValue>) => void): void;
335
336
  toImmutable(): ReadonlyMap<TKey, ToImmutable<TValue>>;
337
+ clone(): LiveMap<TKey, TValue>;
336
338
  }
337
339
 
338
340
  declare type StorageCallback = (updates: StorageUpdate[]) => void;
@@ -352,24 +354,29 @@ declare abstract class AbstractCrdt {
352
354
  * Return an immutable snapshot of this Live node and its children.
353
355
  */
354
356
  toImmutable(): Immutable;
357
+ /**
358
+ * Returns a deep clone of the current LiveStructure, suitable for insertion
359
+ * in the tree elsewhere.
360
+ */
361
+ abstract clone(): Lson;
355
362
  }
356
363
 
357
364
  declare type LiveListUpdateDelta = {
365
+ type: "insert";
358
366
  index: number;
359
367
  item: Lson;
360
- type: "insert";
361
368
  } | {
362
- index: number;
363
369
  type: "delete";
370
+ index: number;
364
371
  } | {
372
+ type: "move";
365
373
  index: number;
366
374
  previousIndex: number;
367
375
  item: Lson;
368
- type: "move";
369
376
  } | {
377
+ type: "set";
370
378
  index: number;
371
379
  item: Lson;
372
- type: "set";
373
380
  };
374
381
  /**
375
382
  * A LiveList notification that is sent in-client to any subscribers whenever
@@ -480,6 +487,7 @@ declare class LiveList<TItem extends Lson> extends AbstractCrdt {
480
487
  some(predicate: (value: TItem, index: number) => unknown): boolean;
481
488
  [Symbol.iterator](): IterableIterator<TItem>;
482
489
  toImmutable(): readonly ToImmutable<TItem>[];
490
+ clone(): LiveList<TItem>;
483
491
  }
484
492
 
485
493
  /**
@@ -488,6 +496,7 @@ declare class LiveList<TItem extends Lson> extends AbstractCrdt {
488
496
  declare class LiveRegister<TValue extends Json> extends AbstractCrdt {
489
497
  constructor(data: TValue);
490
498
  get data(): TValue;
499
+ clone(): TValue;
491
500
  }
492
501
 
493
502
  declare type LiveStructure = LiveObject<LsonObject> | LiveList<Lson> | LiveMap<string, Lson>;
@@ -723,7 +732,7 @@ declare type ThreadData<TThreadMetadata extends BaseMetadata = never> = {
723
732
  };
724
733
 
725
734
  declare type Options = {
726
- serverEndpoint: string;
735
+ baseUrl: string;
727
736
  };
728
737
  declare type PartialNullable<T> = {
729
738
  [P in keyof T]?: T[P] | null | undefined;
@@ -765,7 +774,7 @@ declare type CommentsApi<TThreadMetadata extends BaseMetadata> = {
765
774
  emoji: string;
766
775
  }): Promise<CommentData>;
767
776
  };
768
- declare function createCommentsApi<TThreadMetadata extends BaseMetadata>(roomId: string, getAuthValue: () => Promise<AuthValue>, { serverEndpoint }: Options): CommentsApi<TThreadMetadata>;
777
+ declare function createCommentsApi<TThreadMetadata extends BaseMetadata>(roomId: string, getAuthValue: () => Promise<AuthValue>, config: Options): CommentsApi<TThreadMetadata>;
769
778
 
770
779
  declare type Callback<T> = (event: T) => void;
771
780
  declare type UnsubscribeCallback = () => void;
@@ -944,6 +953,7 @@ declare type BaseAuthResult = NonNullable<Json>;
944
953
  declare type Delegates<T extends BaseAuthResult> = {
945
954
  authenticate: () => Promise<T>;
946
955
  createSocket: (authValue: T) => IWebSocketInstance;
956
+ canZombie: () => boolean;
947
957
  };
948
958
 
949
959
  declare enum ClientMsgCode {
@@ -1312,7 +1322,7 @@ declare type User<TPresence extends JsonObject, TUserMeta extends BaseUserMeta>
1312
1322
  * @deprecated Use `readonly User<TPresence, TUserMeta>[]` instead of `Others<TPresence, TUserMeta>`.
1313
1323
  */
1314
1324
  declare type Others<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = readonly User<TPresence, TUserMeta>[];
1315
- declare type OthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = {
1325
+ declare type InternalOthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = {
1316
1326
  type: "leave";
1317
1327
  user: User<TPresence, TUserMeta>;
1318
1328
  } | {
@@ -1325,7 +1335,24 @@ declare type OthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUse
1325
1335
  } | {
1326
1336
  type: "reset";
1327
1337
  };
1338
+ declare type OthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = Resolve<InternalOthersEvent<TPresence, TUserMeta> & {
1339
+ others: readonly User<TPresence, TUserMeta>[];
1340
+ }>;
1328
1341
 
1342
+ declare type LegacyOthersEvent<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = {
1343
+ type: "leave";
1344
+ user: User<TPresence, TUserMeta>;
1345
+ } | {
1346
+ type: "enter";
1347
+ user: User<TPresence, TUserMeta>;
1348
+ } | {
1349
+ type: "update";
1350
+ user: User<TPresence, TUserMeta>;
1351
+ updates: Partial<TPresence>;
1352
+ } | {
1353
+ type: "reset";
1354
+ };
1355
+ declare type LegacyOthersEventCallback<TPresence extends JsonObject, TUserMeta extends BaseUserMeta> = (others: readonly User<TPresence, TUserMeta>[], event: LegacyOthersEvent<TPresence, TUserMeta>) => void;
1329
1356
  declare type RoomEventMessage<TPresence extends JsonObject, TUserMeta extends BaseUserMeta, TRoomEvent extends Json> = {
1330
1357
  /**
1331
1358
  * The connection ID of the client that sent the event.
@@ -1458,7 +1485,7 @@ declare type SubscribeFn<TPresence extends JsonObject, _TStorage extends LsonObj
1458
1485
  * });
1459
1486
  *
1460
1487
  */
1461
- (type: "others", listener: (others: readonly User<TPresence, TUserMeta>[], event: OthersEvent<TPresence, TUserMeta>) => void): () => void;
1488
+ (type: "others", listener: LegacyOthersEventCallback<TPresence, TUserMeta>): () => void;
1462
1489
  /**
1463
1490
  * Subscribe to events broadcasted by {@link Room.broadcastEvent}
1464
1491
  *
@@ -1715,10 +1742,7 @@ declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUs
1715
1742
  readonly customEvent: Observable<RoomEventMessage<TPresence, TUserMeta, TRoomEvent>>;
1716
1743
  readonly self: Observable<User<TPresence, TUserMeta>>;
1717
1744
  readonly myPresence: Observable<TPresence>;
1718
- readonly others: Observable<{
1719
- others: readonly User<TPresence, TUserMeta>[];
1720
- event: OthersEvent<TPresence, TUserMeta>;
1721
- }>;
1745
+ readonly others: Observable<OthersEvent<TPresence, TUserMeta>>;
1722
1746
  readonly error: Observable<Error>;
1723
1747
  readonly storage: Observable<StorageUpdate[]>;
1724
1748
  readonly history: Observable<HistoryEvent>;
@@ -1855,6 +1879,13 @@ declare type Client = {
1855
1879
  * @param roomId The id of the room
1856
1880
  */
1857
1881
  leave(roomId: string): void;
1882
+ /**
1883
+ * Purges all cached auth tokens and reconnects all rooms that are still
1884
+ * connected, if any.
1885
+ *
1886
+ * Call this whenever you log out a user in your application.
1887
+ */
1888
+ logout(): void;
1858
1889
  };
1859
1890
  declare type AuthEndpoint = string | ((room: string) => Promise<CustomAuthenticationResult>);
1860
1891
  /**
@@ -1864,6 +1895,7 @@ declare type AuthEndpoint = string | ((room: string) => Promise<CustomAuthentica
1864
1895
  declare type ClientOptions = {
1865
1896
  throttle?: number;
1866
1897
  lostConnectionTimeout?: number;
1898
+ backgroundKeepAliveTimeout?: number;
1867
1899
  polyfills?: Polyfills;
1868
1900
  unstable_fallbackToHTTP?: boolean;
1869
1901
  /**
@@ -1923,6 +1955,7 @@ declare type ParentToChildNodeMap = Map<string, // Parent's node ID
1923
1955
  IdTuple<SerializedChild>[]>;
1924
1956
 
1925
1957
  declare function isLiveNode(value: unknown): value is LiveNode;
1958
+ declare function cloneLson<L extends Lson | undefined>(value: L): L;
1926
1959
 
1927
1960
  declare function lsonToJson(value: Lson): Json;
1928
1961
  declare function patchLiveObjectKey<O extends LsonObject, K extends keyof O, V extends Json>(liveObject: LiveObject<O>, key: K, prev?: V, next?: V): void;
@@ -2407,4 +2440,4 @@ declare type EnsureJson<T> = [
2407
2440
  [K in keyof T]: EnsureJson<T[K]>;
2408
2441
  };
2409
2442
 
2410
- export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CreateRootObjectOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, EnterOptions, EventSource, FetchStorageClientMsg, FetchYDocClientMsg, History, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomEventMessage, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ThreadData, ToImmutable, ToJson, UnsubscribeCallback, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, YDocUpdateServerMsg, asPos, assert, assertNever, b64decode, fancyConsole as console, createAsyncCache, createClient, createCommentsApi, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, patchLiveObjectKey, shallow, stringify, throwUsageError, toPlainLson, tryParseJson, withTimeout };
2443
+ export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CreateRootObjectOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, EnterOptions, EventSource, FetchStorageClientMsg, FetchYDocClientMsg, History, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, OthersEvent, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomEventMessage, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ThreadData, ToImmutable, ToJson, UnsubscribeCallback, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, YDocUpdateServerMsg, asPos, assert, assertNever, b64decode, cloneLson, fancyConsole as console, createAsyncCache, createClient, createCommentsApi, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, patchLiveObjectKey, shallow, stringify, throwUsageError, toPlainLson, tryParseJson, withTimeout };