@liveblocks/core 3.19.5-rc1 → 3.20.0-exp2

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.cts CHANGED
@@ -427,6 +427,8 @@ declare const OpCode: Readonly<{
427
427
  DELETE_OBJECT_KEY: 6;
428
428
  CREATE_MAP: 7;
429
429
  CREATE_REGISTER: 8;
430
+ CREATE_TEXT: 9;
431
+ UPDATE_TEXT: 10;
430
432
  }>;
431
433
  declare namespace OpCode {
432
434
  type INIT = typeof OpCode.INIT;
@@ -438,13 +440,35 @@ declare namespace OpCode {
438
440
  type DELETE_OBJECT_KEY = typeof OpCode.DELETE_OBJECT_KEY;
439
441
  type CREATE_MAP = typeof OpCode.CREATE_MAP;
440
442
  type CREATE_REGISTER = typeof OpCode.CREATE_REGISTER;
443
+ type CREATE_TEXT = typeof OpCode.CREATE_TEXT;
444
+ type UPDATE_TEXT = typeof OpCode.UPDATE_TEXT;
441
445
  }
446
+ type TextAttributes = JsonObject;
447
+ type LiveTextDelta = {
448
+ text: string;
449
+ attributes?: TextAttributes;
450
+ }[];
451
+ type TextOperation = {
452
+ type: "insert";
453
+ index: number;
454
+ text: string;
455
+ attributes?: TextAttributes;
456
+ } | {
457
+ type: "delete";
458
+ index: number;
459
+ length: number;
460
+ } | {
461
+ type: "format";
462
+ index: number;
463
+ length: number;
464
+ attributes: JsonObject;
465
+ };
442
466
  /**
443
467
  * These operations are the payload for {@link UpdateStorageServerMsg} messages
444
468
  * only.
445
469
  */
446
- type Op = CreateOp | UpdateObjectOp | DeleteCrdtOp | SetParentKeyOp | DeleteObjectKeyOp;
447
- type CreateOp = CreateObjectOp | CreateRegisterOp | CreateMapOp | CreateListOp;
470
+ type Op = CreateOp | UpdateObjectOp | UpdateTextOp | DeleteCrdtOp | SetParentKeyOp | DeleteObjectKeyOp;
471
+ type CreateOp = CreateObjectOp | CreateRegisterOp | CreateMapOp | CreateListOp | CreateTextOp;
448
472
  type UpdateObjectOp = {
449
473
  readonly opId?: string;
450
474
  readonly id: string;
@@ -489,6 +513,26 @@ type CreateRegisterOp = {
489
513
  readonly intent?: "set" | "push";
490
514
  readonly deletedId?: string;
491
515
  };
516
+ type CreateTextOp = {
517
+ readonly opId?: string;
518
+ readonly id: string;
519
+ readonly intent?: "set";
520
+ readonly deletedId?: string;
521
+ readonly type: OpCode.CREATE_TEXT;
522
+ readonly parentId: string;
523
+ readonly parentKey: string;
524
+ readonly data: LiveTextDelta;
525
+ readonly version: number;
526
+ };
527
+ type UpdateTextOp = {
528
+ readonly opId?: string;
529
+ readonly id: string;
530
+ readonly type: OpCode.UPDATE_TEXT;
531
+ readonly baseVersion: number;
532
+ readonly version?: number;
533
+ readonly ops: TextOperation[];
534
+ readonly metadata?: JsonObject;
535
+ };
492
536
  type DeleteCrdtOp = {
493
537
  readonly opId?: string;
494
538
  readonly id: string;
@@ -617,15 +661,17 @@ declare const CrdtType: Readonly<{
617
661
  LIST: 1;
618
662
  MAP: 2;
619
663
  REGISTER: 3;
664
+ TEXT: 4;
620
665
  }>;
621
666
  declare namespace CrdtType {
622
667
  type OBJECT = typeof CrdtType.OBJECT;
623
668
  type LIST = typeof CrdtType.LIST;
624
669
  type MAP = typeof CrdtType.MAP;
625
670
  type REGISTER = typeof CrdtType.REGISTER;
671
+ type TEXT = typeof CrdtType.TEXT;
626
672
  }
627
673
  type SerializedCrdt = SerializedRootObject | SerializedChild;
628
- type SerializedChild = SerializedObject | SerializedList | SerializedMap | SerializedRegister;
674
+ type SerializedChild = SerializedObject | SerializedList | SerializedMap | SerializedRegister | SerializedText;
629
675
  type SerializedRootObject = {
630
676
  readonly type: CrdtType.OBJECT;
631
677
  readonly data: JsonObject;
@@ -654,13 +700,21 @@ type SerializedRegister = {
654
700
  readonly parentKey: string;
655
701
  readonly data: Json;
656
702
  };
703
+ type SerializedText = {
704
+ readonly type: CrdtType.TEXT;
705
+ readonly parentId: string;
706
+ readonly parentKey: string;
707
+ readonly data: LiveTextDelta;
708
+ readonly version: number;
709
+ };
657
710
  type StorageNode = RootStorageNode | ChildStorageNode;
658
- type ChildStorageNode = ObjectStorageNode | ListStorageNode | MapStorageNode | RegisterStorageNode;
711
+ type ChildStorageNode = ObjectStorageNode | ListStorageNode | MapStorageNode | RegisterStorageNode | TextStorageNode;
659
712
  type RootStorageNode = [id: "root", value: SerializedRootObject];
660
713
  type ObjectStorageNode = [id: string, value: SerializedObject];
661
714
  type ListStorageNode = [id: string, value: SerializedList];
662
715
  type MapStorageNode = [id: string, value: SerializedMap];
663
716
  type RegisterStorageNode = [id: string, value: SerializedRegister];
717
+ type TextStorageNode = [id: string, value: SerializedText];
664
718
  type NodeMap = Map<string, SerializedCrdt>;
665
719
  type NodeStream = Iterable<StorageNode>;
666
720
  declare function isRootStorageNode(node: StorageNode): node is RootStorageNode;
@@ -668,8 +722,9 @@ declare function isObjectStorageNode(node: StorageNode): node is RootStorageNode
668
722
  declare function isListStorageNode(node: StorageNode): node is ListStorageNode;
669
723
  declare function isMapStorageNode(node: StorageNode): node is MapStorageNode;
670
724
  declare function isRegisterStorageNode(node: StorageNode): node is RegisterStorageNode;
725
+ declare function isTextStorageNode(node: StorageNode): node is TextStorageNode;
671
726
  type CompactNode = CompactRootNode | CompactChildNode;
672
- type CompactChildNode = CompactObjectNode | CompactListNode | CompactMapNode | CompactRegisterNode;
727
+ type CompactChildNode = CompactObjectNode | CompactListNode | CompactMapNode | CompactRegisterNode | CompactTextNode;
673
728
  type CompactRootNode = readonly [id: "root", data: JsonObject];
674
729
  type CompactObjectNode = readonly [
675
730
  id: string,
@@ -697,6 +752,14 @@ type CompactRegisterNode = readonly [
697
752
  parentKey: string,
698
753
  data: Json
699
754
  ];
755
+ type CompactTextNode = readonly [
756
+ id: string,
757
+ type: CrdtType.TEXT,
758
+ parentId: string,
759
+ parentKey: string,
760
+ data: LiveTextDelta,
761
+ version: number
762
+ ];
700
763
  declare function compactNodesToNodeStream(compactNodes: CompactNode[]): NodeStream;
701
764
  declare function nodeStreamToCompactNodes(nodes: NodeStream): Iterable<CompactNode>;
702
765
 
@@ -854,16 +917,60 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
854
917
  clone(): LiveObject<O>;
855
918
  }
856
919
 
920
+ declare function applyLiveTextOperations(delta: LiveTextDelta, ops: readonly TextOperation[]): LiveTextDelta;
921
+
922
+ type LiveTextAttributes = TextAttributes;
923
+ type LiveTextAttributesPatch = JsonObject;
924
+
925
+ type LiveTextChange = {
926
+ readonly type: "insert";
927
+ readonly index: number;
928
+ readonly text: string;
929
+ readonly attributes?: TextAttributes;
930
+ } | {
931
+ readonly type: "delete";
932
+ readonly index: number;
933
+ readonly length: number;
934
+ readonly deletedText: string;
935
+ } | {
936
+ readonly type: "format";
937
+ readonly index: number;
938
+ readonly length: number;
939
+ readonly attributes: LiveTextAttributesPatch;
940
+ };
941
+ type LiveTextUpdates = {
942
+ type: "LiveText";
943
+ node: LiveText;
944
+ version: number;
945
+ updates: LiveTextChange[];
946
+ };
947
+
948
+ declare class LiveText extends AbstractCrdt {
949
+ #private;
950
+ constructor(textOrDelta?: string | LiveTextDelta, version?: number);
951
+ get version(): number;
952
+ get length(): number;
953
+ insert(index: number, text: string, attributes?: TextAttributes): void;
954
+ delete(index: number, length: number): void;
955
+ replace(index: number, length: number, text: string, attributes?: TextAttributes): void;
956
+ format(index: number, length: number, attributes: LiveTextAttributesPatch): void;
957
+ toString(): string;
958
+ toDelta(): LiveTextDelta;
959
+ toJSON(): LiveTextDelta;
960
+ clone(): LiveText;
961
+ }
962
+
857
963
  type StorageCallback = (updates: StorageUpdate[]) => void;
858
964
  type LiveMapUpdate = LiveMapUpdates<string, Lson>;
859
965
  type LiveObjectUpdate = LiveObjectUpdates<LsonObject>;
860
966
  type LiveListUpdate = LiveListUpdates<Lson>;
967
+ type LiveTextUpdate = LiveTextUpdates;
861
968
  /**
862
969
  * The payload of notifications sent (in-client) when LiveStructures change.
863
970
  * Messages of this kind are not originating from the network, but are 100%
864
971
  * in-client.
865
972
  */
866
- type StorageUpdate = LiveMapUpdate | LiveObjectUpdate | LiveListUpdate;
973
+ type StorageUpdate = LiveMapUpdate | LiveObjectUpdate | LiveListUpdate | LiveTextUpdate;
867
974
 
868
975
  /**
869
976
  * Read-only query surface over {@link UnacknowledgedOps}, handed to CRDTs so
@@ -1104,7 +1211,7 @@ declare class LiveRegister<TValue extends Json> extends AbstractCrdt {
1104
1211
  clone(): TValue;
1105
1212
  }
1106
1213
 
1107
- type LiveStructure = LiveObject<LsonObject> | LiveList<Lson> | LiveMap<string, Lson>;
1214
+ type LiveStructure = LiveObject<LsonObject> | LiveList<Lson> | LiveMap<string, Lson> | LiveText;
1108
1215
  /**
1109
1216
  * Think of Lson as a sibling of the Json data tree, except that the nested
1110
1217
  * data structure can contain a mix of Json values and LiveStructure instances.
@@ -1140,7 +1247,7 @@ type ToJson<L extends Lson | LsonObject> = L extends LiveList<infer I extends Ls
1140
1247
  readonly [K in keyof O]: ToJson<Exclude<O[K], undefined>> | (undefined extends O[K] ? undefined : never);
1141
1248
  } : L extends LiveMap<infer KS extends string, infer V extends Lson> ? Lson extends V ? ReadonlyJsonObject : {
1142
1249
  readonly [K in KS]: ToJson<V>;
1143
- } : L extends LsonObject ? string extends keyof L ? ReadonlyJsonObject : {
1250
+ } : L extends LiveText ? LiveTextDelta : L extends LsonObject ? string extends keyof L ? ReadonlyJsonObject : {
1144
1251
  readonly [K in keyof L]: ToJson<Exclude<L[K], undefined>> | (undefined extends L[K] ? undefined : never);
1145
1252
  } : L extends Json ? L : never;
1146
1253
 
@@ -4989,7 +5096,12 @@ type PlainLsonList = {
4989
5096
  liveblocksType: "LiveList";
4990
5097
  data: PlainLson[];
4991
5098
  };
4992
- type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | Json;
5099
+ type PlainLsonText = {
5100
+ liveblocksType: "LiveText";
5101
+ data: LiveTextDelta;
5102
+ version?: number;
5103
+ };
5104
+ type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | PlainLsonText | Json;
4993
5105
 
4994
5106
  /**
4995
5107
  * Returns PlainLson for a given Json or LiveStructure, suitable for calling the storage init api
@@ -5704,4 +5816,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
5704
5816
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
5705
5817
  };
5706
5818
 
5707
- export { type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeRetrievalPart, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiSourcesPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUrlSource, type AiUserMessage, type AiWebRetrievalPart, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type ChildStorageNode, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type ClientWireOp, 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, type CommentsEventServerMsg, type CompactChildNode, type CompactListNode, type CompactMapNode, type CompactNode, type CompactObjectNode, type CompactRegisterNode, type CompactRootNode, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DCM, type DE, type DFM, type DFMD, type DGI, type DP, type DRI, type DS, type DTM, 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 Feed, type FeedCreateMetadata, type FeedDeletedServerMsg, type FeedFetchMetadataFilter, type FeedMessage, type FeedMessagesAddedServerMsg, type FeedMessagesDeletedServerMsg, type FeedMessagesListServerMsg, type FeedMessagesUpdatedServerMsg, type FeedRequestError, FeedRequestErrorCode, type FeedRequestFailedServerMsg, type FeedUpdateMetadata, type FeedsAddedServerMsg, type FeedsEventServerMsg, type FeedsListServerMsg, type FeedsUpdatedServerMsg, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type HasOpId, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IgnoredOp, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LayerKey, type ListStorageNode, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MapStorageNode, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NodeStream, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type ObjectStorageNode, 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 ReadonlyJson, type ReadonlyJsonObject, type RegisterStorageNode, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type RootStorageNode, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type ServerWireOp, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageChunkServerMsg, type StorageNode, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncConfig, type SyncMode, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type UrlMetadata, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactNodesToNodeStream, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isListStorageNode, isLiveNode, isMapStorageNode, isNotificationChannelEnabled, isNumberOperator, isObjectStorageNode, isPlainObject, isRegisterStorageNode, isRootStorageNode, isStartsWithOperator, isUrl, kInternal, keys, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, nodeStreamToCompactNodes, objectToQuery, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
5819
+ export { type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeRetrievalPart, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiSourcesPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUrlSource, type AiUserMessage, type AiWebRetrievalPart, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type ChildStorageNode, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type ClientWireOp, 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, type CommentsEventServerMsg, type CompactChildNode, type CompactListNode, type CompactMapNode, type CompactNode, type CompactObjectNode, type CompactRegisterNode, type CompactRootNode, type CompactTextNode, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CreateTextOp, type Cursor, type CustomAuthenticationResult, type DAD, type DCM, type DE, type DFM, type DFMD, type DGI, type DP, type DRI, type DS, type DTM, 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 Feed, type FeedCreateMetadata, type FeedDeletedServerMsg, type FeedFetchMetadataFilter, type FeedMessage, type FeedMessagesAddedServerMsg, type FeedMessagesDeletedServerMsg, type FeedMessagesListServerMsg, type FeedMessagesUpdatedServerMsg, type FeedRequestError, FeedRequestErrorCode, type FeedRequestFailedServerMsg, type FeedUpdateMetadata, type FeedsAddedServerMsg, type FeedsEventServerMsg, type FeedsListServerMsg, type FeedsUpdatedServerMsg, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type HasOpId, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IgnoredOp, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LayerKey, type ListStorageNode, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveText, type LiveTextAttributes, type LiveTextAttributesPatch, type LiveTextChange, type LiveTextDelta, type TextOperation as LiveTextOperation, type LiveTextUpdate, type LiveTextUpdates, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MapStorageNode, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NodeStream, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type ObjectStorageNode, 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 PlainLsonText, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type ReadonlyJson, type ReadonlyJsonObject, type RegisterStorageNode, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type RootStorageNode, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type SerializedText, type ServerMsg, ServerMsgCode, type ServerWireOp, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageChunkServerMsg, type StorageNode, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncConfig, type SyncMode, type SyncSource, type SyncStatus, type TextAttributes, TextEditorType, type TextOperation, type TextStorageNode, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateTextOp, type UpdateYDocClientMsg, type UploadAttachmentOptions, type UrlMetadata, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, applyLiveTextOperations, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactNodesToNodeStream, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isListStorageNode, isLiveNode, isMapStorageNode, isNotificationChannelEnabled, isNumberOperator, isObjectStorageNode, isPlainObject, isRegisterStorageNode, isRootStorageNode, isStartsWithOperator, isTextStorageNode, isUrl, kInternal, keys, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, nodeStreamToCompactNodes, objectToQuery, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
package/dist/index.d.ts CHANGED
@@ -427,6 +427,8 @@ declare const OpCode: Readonly<{
427
427
  DELETE_OBJECT_KEY: 6;
428
428
  CREATE_MAP: 7;
429
429
  CREATE_REGISTER: 8;
430
+ CREATE_TEXT: 9;
431
+ UPDATE_TEXT: 10;
430
432
  }>;
431
433
  declare namespace OpCode {
432
434
  type INIT = typeof OpCode.INIT;
@@ -438,13 +440,35 @@ declare namespace OpCode {
438
440
  type DELETE_OBJECT_KEY = typeof OpCode.DELETE_OBJECT_KEY;
439
441
  type CREATE_MAP = typeof OpCode.CREATE_MAP;
440
442
  type CREATE_REGISTER = typeof OpCode.CREATE_REGISTER;
443
+ type CREATE_TEXT = typeof OpCode.CREATE_TEXT;
444
+ type UPDATE_TEXT = typeof OpCode.UPDATE_TEXT;
441
445
  }
446
+ type TextAttributes = JsonObject;
447
+ type LiveTextDelta = {
448
+ text: string;
449
+ attributes?: TextAttributes;
450
+ }[];
451
+ type TextOperation = {
452
+ type: "insert";
453
+ index: number;
454
+ text: string;
455
+ attributes?: TextAttributes;
456
+ } | {
457
+ type: "delete";
458
+ index: number;
459
+ length: number;
460
+ } | {
461
+ type: "format";
462
+ index: number;
463
+ length: number;
464
+ attributes: JsonObject;
465
+ };
442
466
  /**
443
467
  * These operations are the payload for {@link UpdateStorageServerMsg} messages
444
468
  * only.
445
469
  */
446
- type Op = CreateOp | UpdateObjectOp | DeleteCrdtOp | SetParentKeyOp | DeleteObjectKeyOp;
447
- type CreateOp = CreateObjectOp | CreateRegisterOp | CreateMapOp | CreateListOp;
470
+ type Op = CreateOp | UpdateObjectOp | UpdateTextOp | DeleteCrdtOp | SetParentKeyOp | DeleteObjectKeyOp;
471
+ type CreateOp = CreateObjectOp | CreateRegisterOp | CreateMapOp | CreateListOp | CreateTextOp;
448
472
  type UpdateObjectOp = {
449
473
  readonly opId?: string;
450
474
  readonly id: string;
@@ -489,6 +513,26 @@ type CreateRegisterOp = {
489
513
  readonly intent?: "set" | "push";
490
514
  readonly deletedId?: string;
491
515
  };
516
+ type CreateTextOp = {
517
+ readonly opId?: string;
518
+ readonly id: string;
519
+ readonly intent?: "set";
520
+ readonly deletedId?: string;
521
+ readonly type: OpCode.CREATE_TEXT;
522
+ readonly parentId: string;
523
+ readonly parentKey: string;
524
+ readonly data: LiveTextDelta;
525
+ readonly version: number;
526
+ };
527
+ type UpdateTextOp = {
528
+ readonly opId?: string;
529
+ readonly id: string;
530
+ readonly type: OpCode.UPDATE_TEXT;
531
+ readonly baseVersion: number;
532
+ readonly version?: number;
533
+ readonly ops: TextOperation[];
534
+ readonly metadata?: JsonObject;
535
+ };
492
536
  type DeleteCrdtOp = {
493
537
  readonly opId?: string;
494
538
  readonly id: string;
@@ -617,15 +661,17 @@ declare const CrdtType: Readonly<{
617
661
  LIST: 1;
618
662
  MAP: 2;
619
663
  REGISTER: 3;
664
+ TEXT: 4;
620
665
  }>;
621
666
  declare namespace CrdtType {
622
667
  type OBJECT = typeof CrdtType.OBJECT;
623
668
  type LIST = typeof CrdtType.LIST;
624
669
  type MAP = typeof CrdtType.MAP;
625
670
  type REGISTER = typeof CrdtType.REGISTER;
671
+ type TEXT = typeof CrdtType.TEXT;
626
672
  }
627
673
  type SerializedCrdt = SerializedRootObject | SerializedChild;
628
- type SerializedChild = SerializedObject | SerializedList | SerializedMap | SerializedRegister;
674
+ type SerializedChild = SerializedObject | SerializedList | SerializedMap | SerializedRegister | SerializedText;
629
675
  type SerializedRootObject = {
630
676
  readonly type: CrdtType.OBJECT;
631
677
  readonly data: JsonObject;
@@ -654,13 +700,21 @@ type SerializedRegister = {
654
700
  readonly parentKey: string;
655
701
  readonly data: Json;
656
702
  };
703
+ type SerializedText = {
704
+ readonly type: CrdtType.TEXT;
705
+ readonly parentId: string;
706
+ readonly parentKey: string;
707
+ readonly data: LiveTextDelta;
708
+ readonly version: number;
709
+ };
657
710
  type StorageNode = RootStorageNode | ChildStorageNode;
658
- type ChildStorageNode = ObjectStorageNode | ListStorageNode | MapStorageNode | RegisterStorageNode;
711
+ type ChildStorageNode = ObjectStorageNode | ListStorageNode | MapStorageNode | RegisterStorageNode | TextStorageNode;
659
712
  type RootStorageNode = [id: "root", value: SerializedRootObject];
660
713
  type ObjectStorageNode = [id: string, value: SerializedObject];
661
714
  type ListStorageNode = [id: string, value: SerializedList];
662
715
  type MapStorageNode = [id: string, value: SerializedMap];
663
716
  type RegisterStorageNode = [id: string, value: SerializedRegister];
717
+ type TextStorageNode = [id: string, value: SerializedText];
664
718
  type NodeMap = Map<string, SerializedCrdt>;
665
719
  type NodeStream = Iterable<StorageNode>;
666
720
  declare function isRootStorageNode(node: StorageNode): node is RootStorageNode;
@@ -668,8 +722,9 @@ declare function isObjectStorageNode(node: StorageNode): node is RootStorageNode
668
722
  declare function isListStorageNode(node: StorageNode): node is ListStorageNode;
669
723
  declare function isMapStorageNode(node: StorageNode): node is MapStorageNode;
670
724
  declare function isRegisterStorageNode(node: StorageNode): node is RegisterStorageNode;
725
+ declare function isTextStorageNode(node: StorageNode): node is TextStorageNode;
671
726
  type CompactNode = CompactRootNode | CompactChildNode;
672
- type CompactChildNode = CompactObjectNode | CompactListNode | CompactMapNode | CompactRegisterNode;
727
+ type CompactChildNode = CompactObjectNode | CompactListNode | CompactMapNode | CompactRegisterNode | CompactTextNode;
673
728
  type CompactRootNode = readonly [id: "root", data: JsonObject];
674
729
  type CompactObjectNode = readonly [
675
730
  id: string,
@@ -697,6 +752,14 @@ type CompactRegisterNode = readonly [
697
752
  parentKey: string,
698
753
  data: Json
699
754
  ];
755
+ type CompactTextNode = readonly [
756
+ id: string,
757
+ type: CrdtType.TEXT,
758
+ parentId: string,
759
+ parentKey: string,
760
+ data: LiveTextDelta,
761
+ version: number
762
+ ];
700
763
  declare function compactNodesToNodeStream(compactNodes: CompactNode[]): NodeStream;
701
764
  declare function nodeStreamToCompactNodes(nodes: NodeStream): Iterable<CompactNode>;
702
765
 
@@ -854,16 +917,60 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
854
917
  clone(): LiveObject<O>;
855
918
  }
856
919
 
920
+ declare function applyLiveTextOperations(delta: LiveTextDelta, ops: readonly TextOperation[]): LiveTextDelta;
921
+
922
+ type LiveTextAttributes = TextAttributes;
923
+ type LiveTextAttributesPatch = JsonObject;
924
+
925
+ type LiveTextChange = {
926
+ readonly type: "insert";
927
+ readonly index: number;
928
+ readonly text: string;
929
+ readonly attributes?: TextAttributes;
930
+ } | {
931
+ readonly type: "delete";
932
+ readonly index: number;
933
+ readonly length: number;
934
+ readonly deletedText: string;
935
+ } | {
936
+ readonly type: "format";
937
+ readonly index: number;
938
+ readonly length: number;
939
+ readonly attributes: LiveTextAttributesPatch;
940
+ };
941
+ type LiveTextUpdates = {
942
+ type: "LiveText";
943
+ node: LiveText;
944
+ version: number;
945
+ updates: LiveTextChange[];
946
+ };
947
+
948
+ declare class LiveText extends AbstractCrdt {
949
+ #private;
950
+ constructor(textOrDelta?: string | LiveTextDelta, version?: number);
951
+ get version(): number;
952
+ get length(): number;
953
+ insert(index: number, text: string, attributes?: TextAttributes): void;
954
+ delete(index: number, length: number): void;
955
+ replace(index: number, length: number, text: string, attributes?: TextAttributes): void;
956
+ format(index: number, length: number, attributes: LiveTextAttributesPatch): void;
957
+ toString(): string;
958
+ toDelta(): LiveTextDelta;
959
+ toJSON(): LiveTextDelta;
960
+ clone(): LiveText;
961
+ }
962
+
857
963
  type StorageCallback = (updates: StorageUpdate[]) => void;
858
964
  type LiveMapUpdate = LiveMapUpdates<string, Lson>;
859
965
  type LiveObjectUpdate = LiveObjectUpdates<LsonObject>;
860
966
  type LiveListUpdate = LiveListUpdates<Lson>;
967
+ type LiveTextUpdate = LiveTextUpdates;
861
968
  /**
862
969
  * The payload of notifications sent (in-client) when LiveStructures change.
863
970
  * Messages of this kind are not originating from the network, but are 100%
864
971
  * in-client.
865
972
  */
866
- type StorageUpdate = LiveMapUpdate | LiveObjectUpdate | LiveListUpdate;
973
+ type StorageUpdate = LiveMapUpdate | LiveObjectUpdate | LiveListUpdate | LiveTextUpdate;
867
974
 
868
975
  /**
869
976
  * Read-only query surface over {@link UnacknowledgedOps}, handed to CRDTs so
@@ -1104,7 +1211,7 @@ declare class LiveRegister<TValue extends Json> extends AbstractCrdt {
1104
1211
  clone(): TValue;
1105
1212
  }
1106
1213
 
1107
- type LiveStructure = LiveObject<LsonObject> | LiveList<Lson> | LiveMap<string, Lson>;
1214
+ type LiveStructure = LiveObject<LsonObject> | LiveList<Lson> | LiveMap<string, Lson> | LiveText;
1108
1215
  /**
1109
1216
  * Think of Lson as a sibling of the Json data tree, except that the nested
1110
1217
  * data structure can contain a mix of Json values and LiveStructure instances.
@@ -1140,7 +1247,7 @@ type ToJson<L extends Lson | LsonObject> = L extends LiveList<infer I extends Ls
1140
1247
  readonly [K in keyof O]: ToJson<Exclude<O[K], undefined>> | (undefined extends O[K] ? undefined : never);
1141
1248
  } : L extends LiveMap<infer KS extends string, infer V extends Lson> ? Lson extends V ? ReadonlyJsonObject : {
1142
1249
  readonly [K in KS]: ToJson<V>;
1143
- } : L extends LsonObject ? string extends keyof L ? ReadonlyJsonObject : {
1250
+ } : L extends LiveText ? LiveTextDelta : L extends LsonObject ? string extends keyof L ? ReadonlyJsonObject : {
1144
1251
  readonly [K in keyof L]: ToJson<Exclude<L[K], undefined>> | (undefined extends L[K] ? undefined : never);
1145
1252
  } : L extends Json ? L : never;
1146
1253
 
@@ -4989,7 +5096,12 @@ type PlainLsonList = {
4989
5096
  liveblocksType: "LiveList";
4990
5097
  data: PlainLson[];
4991
5098
  };
4992
- type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | Json;
5099
+ type PlainLsonText = {
5100
+ liveblocksType: "LiveText";
5101
+ data: LiveTextDelta;
5102
+ version?: number;
5103
+ };
5104
+ type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | PlainLsonText | Json;
4993
5105
 
4994
5106
  /**
4995
5107
  * Returns PlainLson for a given Json or LiveStructure, suitable for calling the storage init api
@@ -5704,4 +5816,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
5704
5816
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
5705
5817
  };
5706
5818
 
5707
- export { type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeRetrievalPart, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiSourcesPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUrlSource, type AiUserMessage, type AiWebRetrievalPart, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type ChildStorageNode, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type ClientWireOp, 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, type CommentsEventServerMsg, type CompactChildNode, type CompactListNode, type CompactMapNode, type CompactNode, type CompactObjectNode, type CompactRegisterNode, type CompactRootNode, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DCM, type DE, type DFM, type DFMD, type DGI, type DP, type DRI, type DS, type DTM, 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 Feed, type FeedCreateMetadata, type FeedDeletedServerMsg, type FeedFetchMetadataFilter, type FeedMessage, type FeedMessagesAddedServerMsg, type FeedMessagesDeletedServerMsg, type FeedMessagesListServerMsg, type FeedMessagesUpdatedServerMsg, type FeedRequestError, FeedRequestErrorCode, type FeedRequestFailedServerMsg, type FeedUpdateMetadata, type FeedsAddedServerMsg, type FeedsEventServerMsg, type FeedsListServerMsg, type FeedsUpdatedServerMsg, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type HasOpId, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IgnoredOp, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LayerKey, type ListStorageNode, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MapStorageNode, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NodeStream, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type ObjectStorageNode, 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 ReadonlyJson, type ReadonlyJsonObject, type RegisterStorageNode, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type RootStorageNode, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type ServerWireOp, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageChunkServerMsg, type StorageNode, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncConfig, type SyncMode, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type UrlMetadata, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactNodesToNodeStream, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isListStorageNode, isLiveNode, isMapStorageNode, isNotificationChannelEnabled, isNumberOperator, isObjectStorageNode, isPlainObject, isRegisterStorageNode, isRootStorageNode, isStartsWithOperator, isUrl, kInternal, keys, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, nodeStreamToCompactNodes, objectToQuery, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
5819
+ export { type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeRetrievalPart, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiSourcesPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUrlSource, type AiUserMessage, type AiWebRetrievalPart, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type ChildStorageNode, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type ClientWireOp, 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, type CommentsEventServerMsg, type CompactChildNode, type CompactListNode, type CompactMapNode, type CompactNode, type CompactObjectNode, type CompactRegisterNode, type CompactRootNode, type CompactTextNode, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CreateTextOp, type Cursor, type CustomAuthenticationResult, type DAD, type DCM, type DE, type DFM, type DFMD, type DGI, type DP, type DRI, type DS, type DTM, 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 Feed, type FeedCreateMetadata, type FeedDeletedServerMsg, type FeedFetchMetadataFilter, type FeedMessage, type FeedMessagesAddedServerMsg, type FeedMessagesDeletedServerMsg, type FeedMessagesListServerMsg, type FeedMessagesUpdatedServerMsg, type FeedRequestError, FeedRequestErrorCode, type FeedRequestFailedServerMsg, type FeedUpdateMetadata, type FeedsAddedServerMsg, type FeedsEventServerMsg, type FeedsListServerMsg, type FeedsUpdatedServerMsg, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type HasOpId, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IgnoredOp, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LayerKey, type ListStorageNode, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveText, type LiveTextAttributes, type LiveTextAttributesPatch, type LiveTextChange, type LiveTextDelta, type TextOperation as LiveTextOperation, type LiveTextUpdate, type LiveTextUpdates, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MapStorageNode, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NodeStream, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type ObjectStorageNode, 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 PlainLsonText, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type ReadonlyJson, type ReadonlyJsonObject, type RegisterStorageNode, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type RootStorageNode, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type SerializedText, type ServerMsg, ServerMsgCode, type ServerWireOp, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageChunkServerMsg, type StorageNode, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncConfig, type SyncMode, type SyncSource, type SyncStatus, type TextAttributes, TextEditorType, type TextOperation, type TextStorageNode, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateTextOp, type UpdateYDocClientMsg, type UploadAttachmentOptions, type UrlMetadata, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, applyLiveTextOperations, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactNodesToNodeStream, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isListStorageNode, isLiveNode, isMapStorageNode, isNotificationChannelEnabled, isNumberOperator, isObjectStorageNode, isPlainObject, isRegisterStorageNode, isRootStorageNode, isStartsWithOperator, isTextStorageNode, isUrl, kInternal, keys, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, nodeStreamToCompactNodes, objectToQuery, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };