@liveblocks/core 2.24.0-sub1 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +25 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -1
- package/dist/index.d.ts +60 -1
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1305,6 +1305,9 @@ type RoomSubscriptionSettings = {
|
|
|
1305
1305
|
threads: RoomThreadsSubscriptionSettings;
|
|
1306
1306
|
textMentions: RoomTextMentionsSubscriptionSettings;
|
|
1307
1307
|
};
|
|
1308
|
+
type UserRoomSubscriptionSettings = {
|
|
1309
|
+
roomId: string;
|
|
1310
|
+
} & RoomSubscriptionSettings;
|
|
1308
1311
|
/**
|
|
1309
1312
|
* @deprecated Renamed to `RoomSubscriptionSettings`
|
|
1310
1313
|
*/
|
|
@@ -1649,6 +1652,10 @@ type SubscriptionData<K extends keyof DAD = keyof DAD> = {
|
|
|
1649
1652
|
createdAt: Date;
|
|
1650
1653
|
};
|
|
1651
1654
|
type SubscriptionDataPlain = DateToString<SubscriptionData>;
|
|
1655
|
+
type UserSubscriptionData<K extends keyof DAD = keyof DAD> = SubscriptionData<K> & {
|
|
1656
|
+
userId: string;
|
|
1657
|
+
};
|
|
1658
|
+
type UserSubscriptionDataPlain = DateToString<UserSubscriptionData>;
|
|
1652
1659
|
type SubscriptionDeleteInfo = {
|
|
1653
1660
|
type: "deletedSubscription";
|
|
1654
1661
|
kind: NotificationKind;
|
|
@@ -3562,6 +3569,20 @@ declare function convertToCommentUserReaction(data: CommentUserReactionPlain): C
|
|
|
3562
3569
|
* @returns The rich inbox notification data object that can be used by the client.
|
|
3563
3570
|
*/
|
|
3564
3571
|
declare function convertToInboxNotificationData(data: InboxNotificationDataPlain): InboxNotificationData;
|
|
3572
|
+
/**
|
|
3573
|
+
* Converts a plain subscription data object (usually returned by the API) to a subscription data object that can be used by the client.
|
|
3574
|
+
* This is necessary because the plain data object stores dates as ISO strings, but the client expects them as Date objects.
|
|
3575
|
+
* @param data The plain subscription data object (usually returned by the API)
|
|
3576
|
+
* @returns The rich subscription data object that can be used by the client.
|
|
3577
|
+
*/
|
|
3578
|
+
declare function convertToSubscriptionData(data: SubscriptionDataPlain): SubscriptionData;
|
|
3579
|
+
/**
|
|
3580
|
+
* Converts a plain user subscription data object (usually returned by the API) to a user subscription data object that can be used by the client.
|
|
3581
|
+
* This is necessary because the plain data object stores dates as ISO strings, but the client expects them as Date objects.
|
|
3582
|
+
* @param data The plain user subscription data object (usually returned by the API)
|
|
3583
|
+
* @returns The rich user subscription data object that can be used by the client.
|
|
3584
|
+
*/
|
|
3585
|
+
declare function convertToUserSubscriptionData(data: UserSubscriptionDataPlain): UserSubscriptionData;
|
|
3565
3586
|
|
|
3566
3587
|
/**
|
|
3567
3588
|
* Lookup table for nodes (= SerializedCrdt values) by their IDs.
|
|
@@ -3740,6 +3761,35 @@ declare function throwUsageError(message: string): void;
|
|
|
3740
3761
|
*/
|
|
3741
3762
|
declare function errorIf(condition: unknown, message: string): void;
|
|
3742
3763
|
|
|
3764
|
+
/**
|
|
3765
|
+
* A Deque (= Double Ended Queue) is like a stack, but where elements can be
|
|
3766
|
+
* efficiently pushed or popped from either side.
|
|
3767
|
+
*
|
|
3768
|
+
* The following calls are equivalent with arrays (but insertions are O(n)
|
|
3769
|
+
* instead of O(n^2)):
|
|
3770
|
+
*
|
|
3771
|
+
* - deque.push(1) ⇔ array.push(1)
|
|
3772
|
+
* - deque.push([1, 2, 3]) ⇔ array.push(1, 2, 3)
|
|
3773
|
+
* - deque.push(many) ⇔ array.push(...many)
|
|
3774
|
+
* - deque.pop() ⇔ array.pop()
|
|
3775
|
+
*
|
|
3776
|
+
* - deque.pushLeft(1) ⇔ array.unshift(1)
|
|
3777
|
+
* - deque.pushLeft([1, 2, 3]) ⇔ array.unshift(1, 2, 3)
|
|
3778
|
+
* - deque.pushLeft(many) ⇔ array.unshift(...many)
|
|
3779
|
+
* - deque.popLeft() ⇔ array.shift()
|
|
3780
|
+
*
|
|
3781
|
+
*/
|
|
3782
|
+
declare class Deque<T> {
|
|
3783
|
+
#private;
|
|
3784
|
+
constructor();
|
|
3785
|
+
get length(): number;
|
|
3786
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
3787
|
+
push(value: T | readonly T[]): void;
|
|
3788
|
+
pop(): T | undefined;
|
|
3789
|
+
pushLeft(value: T | readonly T[]): void;
|
|
3790
|
+
popLeft(): T | undefined;
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3743
3793
|
declare const warn: (message: string, ...args: readonly unknown[]) => void;
|
|
3744
3794
|
declare const error: (message: string, ...args: readonly unknown[]) => void;
|
|
3745
3795
|
declare const warnWithTitle: (title: string, message: string, ...args: readonly unknown[]) => void;
|
|
@@ -3996,6 +4046,15 @@ declare function asPos(str: string): Pos;
|
|
|
3996
4046
|
* Testing goes one level deep.
|
|
3997
4047
|
*/
|
|
3998
4048
|
declare function shallow(a: unknown, b: unknown): boolean;
|
|
4049
|
+
/**
|
|
4050
|
+
* Two-level deep shallow check.
|
|
4051
|
+
* Useful for checking equality of { isLoading: false, myData: [ ... ] } like
|
|
4052
|
+
* data structures, where you want to do a shallow comparison on the "data"
|
|
4053
|
+
* key.
|
|
4054
|
+
*
|
|
4055
|
+
* NOTE: Works on objects only, not on arrays!
|
|
4056
|
+
*/
|
|
4057
|
+
declare function shallow2(a: unknown, b: unknown): boolean;
|
|
3999
4058
|
|
|
4000
4059
|
/**
|
|
4001
4060
|
* A datastructure to keep elements in ascending order, as defined by the "less
|
|
@@ -4196,4 +4255,4 @@ declare const CommentsApiError: typeof HttpError;
|
|
|
4196
4255
|
/** @deprecated Use HttpError instead. */
|
|
4197
4256
|
declare const NotificationsApiError: typeof HttpError;
|
|
4198
4257
|
|
|
4199
|
-
export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, 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 CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, HttpError, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserNotificationSettings, WebsocketCloseCodes, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveUsersInCommentBody, shallow, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
|
|
4258
|
+
export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, 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 CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, HttpError, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserNotificationSettings, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveUsersInCommentBody, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
|
package/dist/index.d.ts
CHANGED
|
@@ -1305,6 +1305,9 @@ type RoomSubscriptionSettings = {
|
|
|
1305
1305
|
threads: RoomThreadsSubscriptionSettings;
|
|
1306
1306
|
textMentions: RoomTextMentionsSubscriptionSettings;
|
|
1307
1307
|
};
|
|
1308
|
+
type UserRoomSubscriptionSettings = {
|
|
1309
|
+
roomId: string;
|
|
1310
|
+
} & RoomSubscriptionSettings;
|
|
1308
1311
|
/**
|
|
1309
1312
|
* @deprecated Renamed to `RoomSubscriptionSettings`
|
|
1310
1313
|
*/
|
|
@@ -1649,6 +1652,10 @@ type SubscriptionData<K extends keyof DAD = keyof DAD> = {
|
|
|
1649
1652
|
createdAt: Date;
|
|
1650
1653
|
};
|
|
1651
1654
|
type SubscriptionDataPlain = DateToString<SubscriptionData>;
|
|
1655
|
+
type UserSubscriptionData<K extends keyof DAD = keyof DAD> = SubscriptionData<K> & {
|
|
1656
|
+
userId: string;
|
|
1657
|
+
};
|
|
1658
|
+
type UserSubscriptionDataPlain = DateToString<UserSubscriptionData>;
|
|
1652
1659
|
type SubscriptionDeleteInfo = {
|
|
1653
1660
|
type: "deletedSubscription";
|
|
1654
1661
|
kind: NotificationKind;
|
|
@@ -3562,6 +3569,20 @@ declare function convertToCommentUserReaction(data: CommentUserReactionPlain): C
|
|
|
3562
3569
|
* @returns The rich inbox notification data object that can be used by the client.
|
|
3563
3570
|
*/
|
|
3564
3571
|
declare function convertToInboxNotificationData(data: InboxNotificationDataPlain): InboxNotificationData;
|
|
3572
|
+
/**
|
|
3573
|
+
* Converts a plain subscription data object (usually returned by the API) to a subscription data object that can be used by the client.
|
|
3574
|
+
* This is necessary because the plain data object stores dates as ISO strings, but the client expects them as Date objects.
|
|
3575
|
+
* @param data The plain subscription data object (usually returned by the API)
|
|
3576
|
+
* @returns The rich subscription data object that can be used by the client.
|
|
3577
|
+
*/
|
|
3578
|
+
declare function convertToSubscriptionData(data: SubscriptionDataPlain): SubscriptionData;
|
|
3579
|
+
/**
|
|
3580
|
+
* Converts a plain user subscription data object (usually returned by the API) to a user subscription data object that can be used by the client.
|
|
3581
|
+
* This is necessary because the plain data object stores dates as ISO strings, but the client expects them as Date objects.
|
|
3582
|
+
* @param data The plain user subscription data object (usually returned by the API)
|
|
3583
|
+
* @returns The rich user subscription data object that can be used by the client.
|
|
3584
|
+
*/
|
|
3585
|
+
declare function convertToUserSubscriptionData(data: UserSubscriptionDataPlain): UserSubscriptionData;
|
|
3565
3586
|
|
|
3566
3587
|
/**
|
|
3567
3588
|
* Lookup table for nodes (= SerializedCrdt values) by their IDs.
|
|
@@ -3740,6 +3761,35 @@ declare function throwUsageError(message: string): void;
|
|
|
3740
3761
|
*/
|
|
3741
3762
|
declare function errorIf(condition: unknown, message: string): void;
|
|
3742
3763
|
|
|
3764
|
+
/**
|
|
3765
|
+
* A Deque (= Double Ended Queue) is like a stack, but where elements can be
|
|
3766
|
+
* efficiently pushed or popped from either side.
|
|
3767
|
+
*
|
|
3768
|
+
* The following calls are equivalent with arrays (but insertions are O(n)
|
|
3769
|
+
* instead of O(n^2)):
|
|
3770
|
+
*
|
|
3771
|
+
* - deque.push(1) ⇔ array.push(1)
|
|
3772
|
+
* - deque.push([1, 2, 3]) ⇔ array.push(1, 2, 3)
|
|
3773
|
+
* - deque.push(many) ⇔ array.push(...many)
|
|
3774
|
+
* - deque.pop() ⇔ array.pop()
|
|
3775
|
+
*
|
|
3776
|
+
* - deque.pushLeft(1) ⇔ array.unshift(1)
|
|
3777
|
+
* - deque.pushLeft([1, 2, 3]) ⇔ array.unshift(1, 2, 3)
|
|
3778
|
+
* - deque.pushLeft(many) ⇔ array.unshift(...many)
|
|
3779
|
+
* - deque.popLeft() ⇔ array.shift()
|
|
3780
|
+
*
|
|
3781
|
+
*/
|
|
3782
|
+
declare class Deque<T> {
|
|
3783
|
+
#private;
|
|
3784
|
+
constructor();
|
|
3785
|
+
get length(): number;
|
|
3786
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
3787
|
+
push(value: T | readonly T[]): void;
|
|
3788
|
+
pop(): T | undefined;
|
|
3789
|
+
pushLeft(value: T | readonly T[]): void;
|
|
3790
|
+
popLeft(): T | undefined;
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3743
3793
|
declare const warn: (message: string, ...args: readonly unknown[]) => void;
|
|
3744
3794
|
declare const error: (message: string, ...args: readonly unknown[]) => void;
|
|
3745
3795
|
declare const warnWithTitle: (title: string, message: string, ...args: readonly unknown[]) => void;
|
|
@@ -3996,6 +4046,15 @@ declare function asPos(str: string): Pos;
|
|
|
3996
4046
|
* Testing goes one level deep.
|
|
3997
4047
|
*/
|
|
3998
4048
|
declare function shallow(a: unknown, b: unknown): boolean;
|
|
4049
|
+
/**
|
|
4050
|
+
* Two-level deep shallow check.
|
|
4051
|
+
* Useful for checking equality of { isLoading: false, myData: [ ... ] } like
|
|
4052
|
+
* data structures, where you want to do a shallow comparison on the "data"
|
|
4053
|
+
* key.
|
|
4054
|
+
*
|
|
4055
|
+
* NOTE: Works on objects only, not on arrays!
|
|
4056
|
+
*/
|
|
4057
|
+
declare function shallow2(a: unknown, b: unknown): boolean;
|
|
3999
4058
|
|
|
4000
4059
|
/**
|
|
4001
4060
|
* A datastructure to keep elements in ascending order, as defined by the "less
|
|
@@ -4196,4 +4255,4 @@ declare const CommentsApiError: typeof HttpError;
|
|
|
4196
4255
|
/** @deprecated Use HttpError instead. */
|
|
4197
4256
|
declare const NotificationsApiError: typeof HttpError;
|
|
4198
4257
|
|
|
4199
|
-
export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, 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 CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, HttpError, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserNotificationSettings, WebsocketCloseCodes, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveUsersInCommentBody, shallow, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
|
|
4258
|
+
export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, 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 CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, HttpError, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserNotificationSettings, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveUsersInCommentBody, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/version.ts
|
|
8
8
|
var PKG_NAME = "@liveblocks/core";
|
|
9
|
-
var PKG_VERSION = "2.24.0
|
|
9
|
+
var PKG_VERSION = "2.24.0";
|
|
10
10
|
var PKG_FORMAT = "esm";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -125,6 +125,13 @@ function convertToSubscriptionData(data) {
|
|
|
125
125
|
createdAt
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
+
function convertToUserSubscriptionData(data) {
|
|
129
|
+
const createdAt = new Date(data.createdAt);
|
|
130
|
+
return {
|
|
131
|
+
...data,
|
|
132
|
+
createdAt
|
|
133
|
+
};
|
|
134
|
+
}
|
|
128
135
|
function convertToThreadDeleteInfo(data) {
|
|
129
136
|
const deletedAt = new Date(data.deletedAt);
|
|
130
137
|
return {
|
|
@@ -9300,6 +9307,18 @@ function shallow(a, b) {
|
|
|
9300
9307
|
}
|
|
9301
9308
|
return shallowObj(a, b);
|
|
9302
9309
|
}
|
|
9310
|
+
function shallow2(a, b) {
|
|
9311
|
+
if (!isPlainObject(a) || !isPlainObject(b)) {
|
|
9312
|
+
return shallow(a, b);
|
|
9313
|
+
}
|
|
9314
|
+
const keysA = Object.keys(a);
|
|
9315
|
+
if (keysA.length !== Object.keys(b).length) {
|
|
9316
|
+
return false;
|
|
9317
|
+
}
|
|
9318
|
+
return keysA.every(
|
|
9319
|
+
(key) => Object.prototype.hasOwnProperty.call(b, key) && shallow(a[key], b[key])
|
|
9320
|
+
);
|
|
9321
|
+
}
|
|
9303
9322
|
|
|
9304
9323
|
// src/lib/SortedList.ts
|
|
9305
9324
|
function bisectRight(arr, x, lt) {
|
|
@@ -9398,6 +9417,7 @@ export {
|
|
|
9398
9417
|
CommentsApiError,
|
|
9399
9418
|
CrdtType,
|
|
9400
9419
|
DefaultMap,
|
|
9420
|
+
Deque,
|
|
9401
9421
|
DerivedSignal,
|
|
9402
9422
|
HttpError,
|
|
9403
9423
|
LiveList,
|
|
@@ -9429,7 +9449,9 @@ export {
|
|
|
9429
9449
|
convertToCommentData,
|
|
9430
9450
|
convertToCommentUserReaction,
|
|
9431
9451
|
convertToInboxNotificationData,
|
|
9452
|
+
convertToSubscriptionData,
|
|
9432
9453
|
convertToThreadData,
|
|
9454
|
+
convertToUserSubscriptionData,
|
|
9433
9455
|
createClient,
|
|
9434
9456
|
createCommentAttachmentId,
|
|
9435
9457
|
createCommentId,
|
|
@@ -9478,6 +9500,7 @@ export {
|
|
|
9478
9500
|
raise,
|
|
9479
9501
|
resolveUsersInCommentBody,
|
|
9480
9502
|
shallow,
|
|
9503
|
+
shallow2,
|
|
9481
9504
|
stableStringify,
|
|
9482
9505
|
stringifyCommentBody,
|
|
9483
9506
|
throwUsageError,
|