@liveblocks/core 2.13.3-emails2 → 2.14.0-v2encoding

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
@@ -104,21 +104,22 @@ declare type EventSource<T> = Observable<T> & {
104
104
  * Returns the number of active subscribers.
105
105
  */
106
106
  count(): number;
107
- /**
108
- * Pauses event delivery until unpaused. Any .notify() calls made while
109
- * paused will get buffered into memory and emitted later.
110
- */
111
- pause(): void;
112
- /**
113
- * Emits all in-memory buffered events, and unpauses. Any .notify() calls
114
- * made after this will be synchronously delivered again.
115
- */
116
- unpause(): void;
117
107
  /**
118
108
  * Observable instance, which can be used to subscribe to this event source
119
109
  * in a readonly fashion. Safe to publicly expose.
120
110
  */
121
111
  observable: Observable<T>;
112
+ /**
113
+ * Disposes of this event source.
114
+ *
115
+ * Will clears all registered event listeners. None of the registered
116
+ * functions will ever get called again.
117
+ *
118
+ * WARNING!
119
+ * Be careful when using this API, because the subscribers may not have any
120
+ * idea they won't be notified anymore.
121
+ */
122
+ [Symbol.dispose](): void;
122
123
  };
123
124
  /**
124
125
  * makeEventSource allows you to generate a subscribe/notify pair of functions
@@ -473,6 +474,7 @@ declare type LiveMapUpdates<TKey extends string, TValue extends Lson> = {
473
474
  * If multiple clients update the same property simultaneously, the last modification received by the Liveblocks servers is the winner.
474
475
  */
475
476
  declare class LiveMap<TKey extends string, TValue extends Lson> extends AbstractCrdt {
477
+ #private;
476
478
  constructor(entries?: readonly (readonly [TKey, TValue])[] | undefined);
477
479
  /**
478
480
  * Returns a specified element from the LiveMap.
@@ -538,6 +540,7 @@ declare type LiveListUpdate = LiveListUpdates<Lson>;
538
540
  declare type StorageUpdate = LiveMapUpdate | LiveObjectUpdate | LiveListUpdate;
539
541
 
540
542
  declare abstract class AbstractCrdt {
543
+ #private;
541
544
  get roomId(): string | null;
542
545
  /**
543
546
  * Return an immutable snapshot of this Live node and its children.
@@ -581,6 +584,7 @@ declare type LiveListUpdates<TItem extends Lson> = {
581
584
  * The LiveList class represents an ordered collection of items that is synchronized across clients.
582
585
  */
583
586
  declare class LiveList<TItem extends Lson> extends AbstractCrdt {
587
+ #private;
584
588
  constructor(items: TItem[]);
585
589
  /**
586
590
  * Returns the number of elements.
@@ -684,6 +688,7 @@ declare class LiveList<TItem extends Lson> extends AbstractCrdt {
684
688
  * INTERNAL
685
689
  */
686
690
  declare class LiveRegister<TValue extends Json> extends AbstractCrdt {
691
+ #private;
687
692
  constructor(data: TValue);
688
693
  get data(): TValue;
689
694
  clone(): TValue;
@@ -750,6 +755,7 @@ declare type LiveObjectUpdates<TData extends LsonObject> = {
750
755
  * If multiple clients update the same property simultaneously, the last modification received by the Liveblocks servers is the winner.
751
756
  */
752
757
  declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
758
+ #private;
753
759
  constructor(obj?: O);
754
760
  /**
755
761
  * Transform the LiveObject into a javascript object
@@ -1124,11 +1130,13 @@ declare type FetchYDocClientMsg = {
1124
1130
  readonly type: ClientMsgCode.FETCH_YDOC;
1125
1131
  readonly vector: string;
1126
1132
  readonly guid?: string;
1133
+ readonly v2?: boolean;
1127
1134
  };
1128
1135
  declare type UpdateYDocClientMsg = {
1129
1136
  readonly type: ClientMsgCode.UPDATE_YDOC;
1130
1137
  readonly update: string;
1131
1138
  readonly guid?: string;
1139
+ readonly v2?: boolean;
1132
1140
  };
1133
1141
 
1134
1142
  declare type IdTuple<T> = [id: string, value: T];
@@ -1331,6 +1339,7 @@ declare type YDocUpdateServerMsg = {
1331
1339
  readonly isSync: boolean;
1332
1340
  readonly stateVector: string | null;
1333
1341
  readonly guid?: string;
1342
+ readonly v2?: boolean;
1334
1343
  };
1335
1344
  /**
1336
1345
  * Sent by the WebSocket server and broadcasted to all clients to announce that
@@ -1902,11 +1911,11 @@ declare type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extend
1902
1911
  *
1903
1912
  * @param {string} data the doc update to send to the server, base64 encoded uint8array
1904
1913
  */
1905
- updateYDoc(data: string, guid?: string): void;
1914
+ updateYDoc(data: string, guid?: string, isV2?: boolean): void;
1906
1915
  /**
1907
1916
  * Sends a request for the current document from liveblocks server
1908
1917
  */
1909
- fetchYDoc(stateVector: string, guid?: string): void;
1918
+ fetchYDoc(stateVector: string, guid?: string, isV2?: boolean): void;
1910
1919
  /**
1911
1920
  * Broadcasts an event to other users in the room. Event broadcasted to the room can be listened with {@link Room.subscribe}("event").
1912
1921
  * @param {any} event the event to broadcast. Should be serializable to JSON
@@ -3027,8 +3036,7 @@ declare function getMentionedIdsFromCommentBody(body: CommentBody): string[];
3027
3036
  declare function resolveUsersInCommentBody<U extends BaseUserMeta>(body: CommentBody, resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(U["info"] | undefined)[] | undefined>): Promise<Map<string, U["info"]>>;
3028
3037
  declare function htmlSafe(value: string): HtmlSafeString;
3029
3038
  declare class HtmlSafeString {
3030
- private _strings;
3031
- private _values;
3039
+ #private;
3032
3040
  constructor(strings: readonly string[], values: readonly (string | string[] | HtmlSafeString | HtmlSafeString[])[]);
3033
3041
  toString(): string;
3034
3042
  }
@@ -3463,8 +3471,7 @@ declare function shallow(a: unknown, b: unknown): boolean;
3463
3471
  * [{ id: 1 }, { id: 4 }, { id: 5 }, { id: 9 }])
3464
3472
  */
3465
3473
  declare class SortedList<T> {
3466
- private _data;
3467
- private _lt;
3474
+ #private;
3468
3475
  private constructor();
3469
3476
  static from<T>(arr: T[], lt: (a: T, b: T) => boolean): SortedList<T>;
3470
3477
  static fromAlreadySorted<T>(alreadySorted: T[], lt: (a: T, b: T) => boolean): SortedList<T>;
package/dist/index.d.ts CHANGED
@@ -104,21 +104,22 @@ declare type EventSource<T> = Observable<T> & {
104
104
  * Returns the number of active subscribers.
105
105
  */
106
106
  count(): number;
107
- /**
108
- * Pauses event delivery until unpaused. Any .notify() calls made while
109
- * paused will get buffered into memory and emitted later.
110
- */
111
- pause(): void;
112
- /**
113
- * Emits all in-memory buffered events, and unpauses. Any .notify() calls
114
- * made after this will be synchronously delivered again.
115
- */
116
- unpause(): void;
117
107
  /**
118
108
  * Observable instance, which can be used to subscribe to this event source
119
109
  * in a readonly fashion. Safe to publicly expose.
120
110
  */
121
111
  observable: Observable<T>;
112
+ /**
113
+ * Disposes of this event source.
114
+ *
115
+ * Will clears all registered event listeners. None of the registered
116
+ * functions will ever get called again.
117
+ *
118
+ * WARNING!
119
+ * Be careful when using this API, because the subscribers may not have any
120
+ * idea they won't be notified anymore.
121
+ */
122
+ [Symbol.dispose](): void;
122
123
  };
123
124
  /**
124
125
  * makeEventSource allows you to generate a subscribe/notify pair of functions
@@ -473,6 +474,7 @@ declare type LiveMapUpdates<TKey extends string, TValue extends Lson> = {
473
474
  * If multiple clients update the same property simultaneously, the last modification received by the Liveblocks servers is the winner.
474
475
  */
475
476
  declare class LiveMap<TKey extends string, TValue extends Lson> extends AbstractCrdt {
477
+ #private;
476
478
  constructor(entries?: readonly (readonly [TKey, TValue])[] | undefined);
477
479
  /**
478
480
  * Returns a specified element from the LiveMap.
@@ -538,6 +540,7 @@ declare type LiveListUpdate = LiveListUpdates<Lson>;
538
540
  declare type StorageUpdate = LiveMapUpdate | LiveObjectUpdate | LiveListUpdate;
539
541
 
540
542
  declare abstract class AbstractCrdt {
543
+ #private;
541
544
  get roomId(): string | null;
542
545
  /**
543
546
  * Return an immutable snapshot of this Live node and its children.
@@ -581,6 +584,7 @@ declare type LiveListUpdates<TItem extends Lson> = {
581
584
  * The LiveList class represents an ordered collection of items that is synchronized across clients.
582
585
  */
583
586
  declare class LiveList<TItem extends Lson> extends AbstractCrdt {
587
+ #private;
584
588
  constructor(items: TItem[]);
585
589
  /**
586
590
  * Returns the number of elements.
@@ -684,6 +688,7 @@ declare class LiveList<TItem extends Lson> extends AbstractCrdt {
684
688
  * INTERNAL
685
689
  */
686
690
  declare class LiveRegister<TValue extends Json> extends AbstractCrdt {
691
+ #private;
687
692
  constructor(data: TValue);
688
693
  get data(): TValue;
689
694
  clone(): TValue;
@@ -750,6 +755,7 @@ declare type LiveObjectUpdates<TData extends LsonObject> = {
750
755
  * If multiple clients update the same property simultaneously, the last modification received by the Liveblocks servers is the winner.
751
756
  */
752
757
  declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
758
+ #private;
753
759
  constructor(obj?: O);
754
760
  /**
755
761
  * Transform the LiveObject into a javascript object
@@ -1124,11 +1130,13 @@ declare type FetchYDocClientMsg = {
1124
1130
  readonly type: ClientMsgCode.FETCH_YDOC;
1125
1131
  readonly vector: string;
1126
1132
  readonly guid?: string;
1133
+ readonly v2?: boolean;
1127
1134
  };
1128
1135
  declare type UpdateYDocClientMsg = {
1129
1136
  readonly type: ClientMsgCode.UPDATE_YDOC;
1130
1137
  readonly update: string;
1131
1138
  readonly guid?: string;
1139
+ readonly v2?: boolean;
1132
1140
  };
1133
1141
 
1134
1142
  declare type IdTuple<T> = [id: string, value: T];
@@ -1331,6 +1339,7 @@ declare type YDocUpdateServerMsg = {
1331
1339
  readonly isSync: boolean;
1332
1340
  readonly stateVector: string | null;
1333
1341
  readonly guid?: string;
1342
+ readonly v2?: boolean;
1334
1343
  };
1335
1344
  /**
1336
1345
  * Sent by the WebSocket server and broadcasted to all clients to announce that
@@ -1902,11 +1911,11 @@ declare type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extend
1902
1911
  *
1903
1912
  * @param {string} data the doc update to send to the server, base64 encoded uint8array
1904
1913
  */
1905
- updateYDoc(data: string, guid?: string): void;
1914
+ updateYDoc(data: string, guid?: string, isV2?: boolean): void;
1906
1915
  /**
1907
1916
  * Sends a request for the current document from liveblocks server
1908
1917
  */
1909
- fetchYDoc(stateVector: string, guid?: string): void;
1918
+ fetchYDoc(stateVector: string, guid?: string, isV2?: boolean): void;
1910
1919
  /**
1911
1920
  * Broadcasts an event to other users in the room. Event broadcasted to the room can be listened with {@link Room.subscribe}("event").
1912
1921
  * @param {any} event the event to broadcast. Should be serializable to JSON
@@ -3027,8 +3036,7 @@ declare function getMentionedIdsFromCommentBody(body: CommentBody): string[];
3027
3036
  declare function resolveUsersInCommentBody<U extends BaseUserMeta>(body: CommentBody, resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(U["info"] | undefined)[] | undefined>): Promise<Map<string, U["info"]>>;
3028
3037
  declare function htmlSafe(value: string): HtmlSafeString;
3029
3038
  declare class HtmlSafeString {
3030
- private _strings;
3031
- private _values;
3039
+ #private;
3032
3040
  constructor(strings: readonly string[], values: readonly (string | string[] | HtmlSafeString | HtmlSafeString[])[]);
3033
3041
  toString(): string;
3034
3042
  }
@@ -3463,8 +3471,7 @@ declare function shallow(a: unknown, b: unknown): boolean;
3463
3471
  * [{ id: 1 }, { id: 4 }, { id: 5 }, { id: 9 }])
3464
3472
  */
3465
3473
  declare class SortedList<T> {
3466
- private _data;
3467
- private _lt;
3474
+ #private;
3468
3475
  private constructor();
3469
3476
  static from<T>(arr: T[], lt: (a: T, b: T) => boolean): SortedList<T>;
3470
3477
  static fromAlreadySorted<T>(alreadySorted: T[], lt: (a: T, b: T) => boolean): SortedList<T>;