@liveblocks/core 3.20.0-exp5 → 3.20.0-perm1
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 +645 -1348
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +88 -191
- package/dist/index.d.ts +88 -191
- package/dist/index.js +550 -1253
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -64,6 +64,76 @@ type DistributiveRelax<T, Ks extends string | number | symbol> = T extends any ?
|
|
|
64
64
|
[K in Exclude<Ks, keyof T>]?: never;
|
|
65
65
|
}> : never;
|
|
66
66
|
|
|
67
|
+
declare const Permission: {
|
|
68
|
+
/**
|
|
69
|
+
* Default permission for a room
|
|
70
|
+
*/
|
|
71
|
+
readonly RoomWrite: "room:write";
|
|
72
|
+
readonly RoomRead: "room:read";
|
|
73
|
+
/**
|
|
74
|
+
* Presence (LiveRoom Websocket access)
|
|
75
|
+
*/
|
|
76
|
+
readonly RoomPresenceRead: "room:presence:read";
|
|
77
|
+
readonly RoomPresenceNone: "room:presence:none";
|
|
78
|
+
/**
|
|
79
|
+
* Storage
|
|
80
|
+
*/
|
|
81
|
+
readonly RoomStorageRead: "room:storage:read";
|
|
82
|
+
readonly RoomStorageWrite: "room:storage:write";
|
|
83
|
+
readonly RoomStorageNone: "room:storage:none";
|
|
84
|
+
/**
|
|
85
|
+
* Comments
|
|
86
|
+
*/
|
|
87
|
+
readonly RoomCommentsWrite: "room:comments:write";
|
|
88
|
+
readonly RoomCommentsRead: "room:comments:read";
|
|
89
|
+
readonly RoomCommentsNone: "room:comments:none";
|
|
90
|
+
/**
|
|
91
|
+
* Feeds
|
|
92
|
+
*/
|
|
93
|
+
readonly RoomFeedsRead: "room:feeds:read";
|
|
94
|
+
readonly RoomFeedsWrite: "room:feeds:write";
|
|
95
|
+
readonly RoomFeedsNone: "room:feeds:none";
|
|
96
|
+
/**
|
|
97
|
+
* Legacy
|
|
98
|
+
*/
|
|
99
|
+
readonly LegacyRoomPresenceWrite: "room:presence:write";
|
|
100
|
+
readonly LegacyCommentsWrite: "comments:write";
|
|
101
|
+
readonly LegacyCommentsRead: "comments:read";
|
|
102
|
+
readonly LegacyFeedsWrite: "feeds:write";
|
|
103
|
+
};
|
|
104
|
+
type Permission = (typeof Permission)[keyof typeof Permission];
|
|
105
|
+
type AccessLevel = "write" | "read" | "none";
|
|
106
|
+
type RequiredAccessLevel = "read" | "write";
|
|
107
|
+
type PermissionCapabilities = {
|
|
108
|
+
creation: AccessLevel;
|
|
109
|
+
presence: AccessLevel;
|
|
110
|
+
storage: AccessLevel;
|
|
111
|
+
comments: AccessLevel;
|
|
112
|
+
feeds: AccessLevel;
|
|
113
|
+
personal: "write";
|
|
114
|
+
};
|
|
115
|
+
type PermissionResources = keyof PermissionCapabilities;
|
|
116
|
+
declare function permissionCapabilitiesFromScopes(scopes: readonly string[]): PermissionCapabilities;
|
|
117
|
+
declare function hasPermissionCapability(scopes: readonly string[], resource: PermissionResources, requiredAccess: RequiredAccessLevel): boolean;
|
|
118
|
+
declare function hasPermissionCapabilityAccess(capabilities: Partial<PermissionCapabilities>, resource: PermissionResources, requiredAccess: RequiredAccessLevel): boolean;
|
|
119
|
+
|
|
120
|
+
type RoomPermission = Permission[];
|
|
121
|
+
type RoomPermissionObject = {
|
|
122
|
+
default?: "read" | "write";
|
|
123
|
+
presence?: "read" | "none";
|
|
124
|
+
storage?: "read" | "write" | "none";
|
|
125
|
+
comments?: "read" | "write" | "none";
|
|
126
|
+
feeds?: "read" | "write" | "none";
|
|
127
|
+
};
|
|
128
|
+
type RoomPermissionInput = readonly Permission[] | RoomPermissionObject;
|
|
129
|
+
type RoomAccesses = Record<string, RoomPermission>;
|
|
130
|
+
type RoomAccessesInput = Record<string, RoomPermissionInput>;
|
|
131
|
+
type RoomAccessesUpdateInput = Record<string, RoomPermissionInput | null>;
|
|
132
|
+
declare function normalizeRoomPermissionInput(input: RoomPermissionInput): RoomPermission;
|
|
133
|
+
declare function normalizeRoomAccessesInput(input: RoomAccessesInput | undefined): RoomAccesses | undefined;
|
|
134
|
+
declare function normalizeRoomAccessesUpdateInput(input: RoomAccessesUpdateInput | undefined): Record<string, RoomPermission | null> | undefined;
|
|
135
|
+
declare function getRoomPermissionConflicts(permission: Permission): readonly Permission[];
|
|
136
|
+
|
|
67
137
|
type CustomAuthenticationResult = Relax<{
|
|
68
138
|
token: string;
|
|
69
139
|
} | {
|
|
@@ -132,15 +202,6 @@ type BaseUserMeta = {
|
|
|
132
202
|
info?: IUserInfo;
|
|
133
203
|
};
|
|
134
204
|
|
|
135
|
-
declare enum Permission {
|
|
136
|
-
Read = "room:read",
|
|
137
|
-
Write = "room:write",
|
|
138
|
-
PresenceWrite = "room:presence:write",
|
|
139
|
-
CommentsWrite = "comments:write",
|
|
140
|
-
CommentsRead = "comments:read",
|
|
141
|
-
FeedsWrite = "feeds:write"
|
|
142
|
-
}
|
|
143
|
-
|
|
144
205
|
type RenameDataField<T, TFieldName extends string> = T extends any ? {
|
|
145
206
|
[K in keyof T as K extends "data" ? TFieldName : K]: T[K];
|
|
146
207
|
} : never;
|
|
@@ -427,8 +488,6 @@ declare const OpCode: Readonly<{
|
|
|
427
488
|
DELETE_OBJECT_KEY: 6;
|
|
428
489
|
CREATE_MAP: 7;
|
|
429
490
|
CREATE_REGISTER: 8;
|
|
430
|
-
CREATE_TEXT: 9;
|
|
431
|
-
UPDATE_TEXT: 10;
|
|
432
491
|
}>;
|
|
433
492
|
declare namespace OpCode {
|
|
434
493
|
type INIT = typeof OpCode.INIT;
|
|
@@ -440,33 +499,13 @@ declare namespace OpCode {
|
|
|
440
499
|
type DELETE_OBJECT_KEY = typeof OpCode.DELETE_OBJECT_KEY;
|
|
441
500
|
type CREATE_MAP = typeof OpCode.CREATE_MAP;
|
|
442
501
|
type CREATE_REGISTER = typeof OpCode.CREATE_REGISTER;
|
|
443
|
-
type CREATE_TEXT = typeof OpCode.CREATE_TEXT;
|
|
444
|
-
type UPDATE_TEXT = typeof OpCode.UPDATE_TEXT;
|
|
445
502
|
}
|
|
446
|
-
type TextAttributes = JsonObject;
|
|
447
|
-
type LiveTextSegment = [text: string] | [text: string, attributes: TextAttributes];
|
|
448
|
-
type LiveTextData = LiveTextSegment[];
|
|
449
|
-
type TextOperation = {
|
|
450
|
-
type: "insert";
|
|
451
|
-
index: number;
|
|
452
|
-
text: string;
|
|
453
|
-
attributes?: TextAttributes;
|
|
454
|
-
} | {
|
|
455
|
-
type: "delete";
|
|
456
|
-
index: number;
|
|
457
|
-
length: number;
|
|
458
|
-
} | {
|
|
459
|
-
type: "format";
|
|
460
|
-
index: number;
|
|
461
|
-
length: number;
|
|
462
|
-
attributes: JsonObject;
|
|
463
|
-
};
|
|
464
503
|
/**
|
|
465
504
|
* These operations are the payload for {@link UpdateStorageServerMsg} messages
|
|
466
505
|
* only.
|
|
467
506
|
*/
|
|
468
|
-
type Op = CreateOp | UpdateObjectOp |
|
|
469
|
-
type CreateOp = CreateObjectOp | CreateRegisterOp | CreateMapOp | CreateListOp
|
|
507
|
+
type Op = CreateOp | UpdateObjectOp | DeleteCrdtOp | SetParentKeyOp | DeleteObjectKeyOp;
|
|
508
|
+
type CreateOp = CreateObjectOp | CreateRegisterOp | CreateMapOp | CreateListOp;
|
|
470
509
|
type UpdateObjectOp = {
|
|
471
510
|
readonly opId?: string;
|
|
472
511
|
readonly id: string;
|
|
@@ -476,60 +515,40 @@ type UpdateObjectOp = {
|
|
|
476
515
|
type CreateObjectOp = {
|
|
477
516
|
readonly opId?: string;
|
|
478
517
|
readonly id: string;
|
|
518
|
+
readonly intent?: "set";
|
|
519
|
+
readonly deletedId?: string;
|
|
479
520
|
readonly type: OpCode.CREATE_OBJECT;
|
|
480
521
|
readonly parentId: string;
|
|
481
522
|
readonly parentKey: string;
|
|
482
523
|
readonly data: JsonObject;
|
|
483
|
-
readonly intent?: "set" | "push";
|
|
484
|
-
readonly deletedId?: string;
|
|
485
524
|
};
|
|
486
525
|
type CreateListOp = {
|
|
487
526
|
readonly opId?: string;
|
|
488
527
|
readonly id: string;
|
|
528
|
+
readonly intent?: "set";
|
|
529
|
+
readonly deletedId?: string;
|
|
489
530
|
readonly type: OpCode.CREATE_LIST;
|
|
490
531
|
readonly parentId: string;
|
|
491
532
|
readonly parentKey: string;
|
|
492
|
-
readonly intent?: "set" | "push";
|
|
493
|
-
readonly deletedId?: string;
|
|
494
533
|
};
|
|
495
534
|
type CreateMapOp = {
|
|
496
535
|
readonly opId?: string;
|
|
497
536
|
readonly id: string;
|
|
537
|
+
readonly intent?: "set";
|
|
538
|
+
readonly deletedId?: string;
|
|
498
539
|
readonly type: OpCode.CREATE_MAP;
|
|
499
540
|
readonly parentId: string;
|
|
500
541
|
readonly parentKey: string;
|
|
501
|
-
readonly intent?: "set" | "push";
|
|
502
|
-
readonly deletedId?: string;
|
|
503
542
|
};
|
|
504
543
|
type CreateRegisterOp = {
|
|
505
544
|
readonly opId?: string;
|
|
506
545
|
readonly id: string;
|
|
546
|
+
readonly intent?: "set";
|
|
547
|
+
readonly deletedId?: string;
|
|
507
548
|
readonly type: OpCode.CREATE_REGISTER;
|
|
508
549
|
readonly parentId: string;
|
|
509
550
|
readonly parentKey: string;
|
|
510
551
|
readonly data: Json;
|
|
511
|
-
readonly intent?: "set" | "push";
|
|
512
|
-
readonly deletedId?: string;
|
|
513
|
-
};
|
|
514
|
-
type CreateTextOp = {
|
|
515
|
-
readonly opId?: string;
|
|
516
|
-
readonly id: string;
|
|
517
|
-
readonly type: OpCode.CREATE_TEXT;
|
|
518
|
-
readonly parentId: string;
|
|
519
|
-
readonly parentKey: string;
|
|
520
|
-
readonly data: LiveTextData;
|
|
521
|
-
readonly version: number;
|
|
522
|
-
readonly intent?: "set" | "push";
|
|
523
|
-
readonly deletedId?: string;
|
|
524
|
-
};
|
|
525
|
-
type UpdateTextOp = {
|
|
526
|
-
readonly opId?: string;
|
|
527
|
-
readonly id: string;
|
|
528
|
-
readonly type: OpCode.UPDATE_TEXT;
|
|
529
|
-
readonly baseVersion: number;
|
|
530
|
-
readonly version?: number;
|
|
531
|
-
readonly ops: TextOperation[];
|
|
532
|
-
readonly metadata?: JsonObject;
|
|
533
552
|
};
|
|
534
553
|
type DeleteCrdtOp = {
|
|
535
554
|
readonly opId?: string;
|
|
@@ -561,7 +580,6 @@ type HasOpId = {
|
|
|
561
580
|
* acknowledge the receipt.
|
|
562
581
|
*/
|
|
563
582
|
type ClientWireOp = Op & HasOpId;
|
|
564
|
-
type ClientWireCreateOp = CreateOp & HasOpId;
|
|
565
583
|
/**
|
|
566
584
|
* ServerWireOp: Ops sent from server → client. Three variants:
|
|
567
585
|
* 1. ClientWireOp — Full echo back of our own op, confirming it was applied
|
|
@@ -659,17 +677,15 @@ declare const CrdtType: Readonly<{
|
|
|
659
677
|
LIST: 1;
|
|
660
678
|
MAP: 2;
|
|
661
679
|
REGISTER: 3;
|
|
662
|
-
TEXT: 4;
|
|
663
680
|
}>;
|
|
664
681
|
declare namespace CrdtType {
|
|
665
682
|
type OBJECT = typeof CrdtType.OBJECT;
|
|
666
683
|
type LIST = typeof CrdtType.LIST;
|
|
667
684
|
type MAP = typeof CrdtType.MAP;
|
|
668
685
|
type REGISTER = typeof CrdtType.REGISTER;
|
|
669
|
-
type TEXT = typeof CrdtType.TEXT;
|
|
670
686
|
}
|
|
671
687
|
type SerializedCrdt = SerializedRootObject | SerializedChild;
|
|
672
|
-
type SerializedChild = SerializedObject | SerializedList | SerializedMap | SerializedRegister
|
|
688
|
+
type SerializedChild = SerializedObject | SerializedList | SerializedMap | SerializedRegister;
|
|
673
689
|
type SerializedRootObject = {
|
|
674
690
|
readonly type: CrdtType.OBJECT;
|
|
675
691
|
readonly data: JsonObject;
|
|
@@ -698,21 +714,13 @@ type SerializedRegister = {
|
|
|
698
714
|
readonly parentKey: string;
|
|
699
715
|
readonly data: Json;
|
|
700
716
|
};
|
|
701
|
-
type SerializedText = {
|
|
702
|
-
readonly type: CrdtType.TEXT;
|
|
703
|
-
readonly parentId: string;
|
|
704
|
-
readonly parentKey: string;
|
|
705
|
-
readonly data: LiveTextData;
|
|
706
|
-
readonly version: number;
|
|
707
|
-
};
|
|
708
717
|
type StorageNode = RootStorageNode | ChildStorageNode;
|
|
709
|
-
type ChildStorageNode = ObjectStorageNode | ListStorageNode | MapStorageNode | RegisterStorageNode
|
|
718
|
+
type ChildStorageNode = ObjectStorageNode | ListStorageNode | MapStorageNode | RegisterStorageNode;
|
|
710
719
|
type RootStorageNode = [id: "root", value: SerializedRootObject];
|
|
711
720
|
type ObjectStorageNode = [id: string, value: SerializedObject];
|
|
712
721
|
type ListStorageNode = [id: string, value: SerializedList];
|
|
713
722
|
type MapStorageNode = [id: string, value: SerializedMap];
|
|
714
723
|
type RegisterStorageNode = [id: string, value: SerializedRegister];
|
|
715
|
-
type TextStorageNode = [id: string, value: SerializedText];
|
|
716
724
|
type NodeMap = Map<string, SerializedCrdt>;
|
|
717
725
|
type NodeStream = Iterable<StorageNode>;
|
|
718
726
|
declare function isRootStorageNode(node: StorageNode): node is RootStorageNode;
|
|
@@ -720,9 +728,8 @@ declare function isObjectStorageNode(node: StorageNode): node is RootStorageNode
|
|
|
720
728
|
declare function isListStorageNode(node: StorageNode): node is ListStorageNode;
|
|
721
729
|
declare function isMapStorageNode(node: StorageNode): node is MapStorageNode;
|
|
722
730
|
declare function isRegisterStorageNode(node: StorageNode): node is RegisterStorageNode;
|
|
723
|
-
declare function isTextStorageNode(node: StorageNode): node is TextStorageNode;
|
|
724
731
|
type CompactNode = CompactRootNode | CompactChildNode;
|
|
725
|
-
type CompactChildNode = CompactObjectNode | CompactListNode | CompactMapNode | CompactRegisterNode
|
|
732
|
+
type CompactChildNode = CompactObjectNode | CompactListNode | CompactMapNode | CompactRegisterNode;
|
|
726
733
|
type CompactRootNode = readonly [id: "root", data: JsonObject];
|
|
727
734
|
type CompactObjectNode = readonly [
|
|
728
735
|
id: string,
|
|
@@ -750,14 +757,6 @@ type CompactRegisterNode = readonly [
|
|
|
750
757
|
parentKey: string,
|
|
751
758
|
data: Json
|
|
752
759
|
];
|
|
753
|
-
type CompactTextNode = readonly [
|
|
754
|
-
id: string,
|
|
755
|
-
type: CrdtType.TEXT,
|
|
756
|
-
parentId: string,
|
|
757
|
-
parentKey: string,
|
|
758
|
-
data: LiveTextData,
|
|
759
|
-
version: number
|
|
760
|
-
];
|
|
761
760
|
declare function compactNodesToNodeStream(compactNodes: CompactNode[]): NodeStream;
|
|
762
761
|
declare function nodeStreamToCompactNodes(nodes: NodeStream): Iterable<CompactNode>;
|
|
763
762
|
|
|
@@ -806,14 +805,6 @@ type SyncMode = boolean | "atomic" | SyncConfig;
|
|
|
806
805
|
type SyncConfig = {
|
|
807
806
|
[key: string]: SyncMode | undefined;
|
|
808
807
|
};
|
|
809
|
-
/**
|
|
810
|
-
* Deeply converts all nested lists to LiveLists, and all nested objects to
|
|
811
|
-
* LiveObjects.
|
|
812
|
-
*
|
|
813
|
-
* As such, the returned result will not contain any Json arrays or Json
|
|
814
|
-
* objects anymore.
|
|
815
|
-
*/
|
|
816
|
-
declare function deepLiveify(value: Json, config?: SyncMode): Lson;
|
|
817
808
|
|
|
818
809
|
/**
|
|
819
810
|
* Optional keys of O whose non-undefined type is plain Json (not a
|
|
@@ -923,74 +914,16 @@ declare class LiveObject<O extends LsonObject> extends AbstractCrdt {
|
|
|
923
914
|
clone(): LiveObject<O>;
|
|
924
915
|
}
|
|
925
916
|
|
|
926
|
-
declare function applyLiveTextOperations(data: LiveTextData, ops: readonly TextOperation[]): LiveTextData;
|
|
927
|
-
|
|
928
|
-
type LiveTextAttributes = TextAttributes;
|
|
929
|
-
type LiveTextAttributesPatch = JsonObject;
|
|
930
|
-
|
|
931
|
-
type LiveTextChange = {
|
|
932
|
-
readonly type: "insert";
|
|
933
|
-
readonly index: number;
|
|
934
|
-
readonly text: string;
|
|
935
|
-
readonly attributes?: TextAttributes;
|
|
936
|
-
} | {
|
|
937
|
-
readonly type: "delete";
|
|
938
|
-
readonly index: number;
|
|
939
|
-
readonly length: number;
|
|
940
|
-
readonly deletedText: string;
|
|
941
|
-
} | {
|
|
942
|
-
readonly type: "format";
|
|
943
|
-
readonly index: number;
|
|
944
|
-
readonly length: number;
|
|
945
|
-
readonly attributes: LiveTextAttributesPatch;
|
|
946
|
-
};
|
|
947
|
-
type LiveTextUpdates = {
|
|
948
|
-
type: "LiveText";
|
|
949
|
-
node: LiveText;
|
|
950
|
-
version: number;
|
|
951
|
-
updates: LiveTextChange[];
|
|
952
|
-
};
|
|
953
|
-
|
|
954
|
-
declare class LiveText extends AbstractCrdt {
|
|
955
|
-
#private;
|
|
956
|
-
constructor(textOrData?: string | LiveTextData, version?: number);
|
|
957
|
-
get version(): number;
|
|
958
|
-
get length(): number;
|
|
959
|
-
insert(index: number, text: string, attributes?: TextAttributes): void;
|
|
960
|
-
delete(index: number, length: number): void;
|
|
961
|
-
replace(index: number, length: number, text: string, attributes?: TextAttributes): void;
|
|
962
|
-
format(index: number, length: number, attributes: LiveTextAttributesPatch): void;
|
|
963
|
-
toString(): string;
|
|
964
|
-
toJSON(): LiveTextData;
|
|
965
|
-
clone(): LiveText;
|
|
966
|
-
}
|
|
967
|
-
|
|
968
917
|
type StorageCallback = (updates: StorageUpdate[]) => void;
|
|
969
918
|
type LiveMapUpdate = LiveMapUpdates<string, Lson>;
|
|
970
919
|
type LiveObjectUpdate = LiveObjectUpdates<LsonObject>;
|
|
971
920
|
type LiveListUpdate = LiveListUpdates<Lson>;
|
|
972
|
-
type LiveTextUpdate = LiveTextUpdates;
|
|
973
921
|
/**
|
|
974
922
|
* The payload of notifications sent (in-client) when LiveStructures change.
|
|
975
923
|
* Messages of this kind are not originating from the network, but are 100%
|
|
976
924
|
* in-client.
|
|
977
925
|
*/
|
|
978
|
-
type StorageUpdate = LiveMapUpdate | LiveObjectUpdate | LiveListUpdate
|
|
979
|
-
|
|
980
|
-
/**
|
|
981
|
-
* Read-only query surface over {@link UnacknowledgedOps}, handed to CRDTs so
|
|
982
|
-
* they can look up their own still-pending Create ops without being able to
|
|
983
|
-
* mutate the set (only the room adds/acks).
|
|
984
|
-
*/
|
|
985
|
-
interface ReadonlyUnacknowledgedOps {
|
|
986
|
-
/** Still-unacknowledged Create ops whose `parentId` is the given one. */
|
|
987
|
-
getByParentId(parentId: string): Iterable<ClientWireCreateOp>;
|
|
988
|
-
/**
|
|
989
|
-
* Still-unacknowledged Create ops whose `parentId` and `parentKey` are both
|
|
990
|
-
* the given ones (i.e. targeting one exact position).
|
|
991
|
-
*/
|
|
992
|
-
getByParentIdAndKey(parentId: string, parentKey: string): Iterable<ClientWireCreateOp>;
|
|
993
|
-
}
|
|
926
|
+
type StorageUpdate = LiveMapUpdate | LiveObjectUpdate | LiveListUpdate;
|
|
994
927
|
|
|
995
928
|
/**
|
|
996
929
|
* The managed pool is a namespace registry (i.e. a context) that "owns" all
|
|
@@ -1020,11 +953,6 @@ interface ManagedPool {
|
|
|
1020
953
|
* @returns {void}
|
|
1021
954
|
*/
|
|
1022
955
|
assertStorageIsWritable: () => void;
|
|
1023
|
-
/**
|
|
1024
|
-
* Read-only view of the client's still-unacknowledged ops (sent or
|
|
1025
|
-
* pending-send, not yet confirmed by the server).
|
|
1026
|
-
*/
|
|
1027
|
-
readonly unacknowledgedOps: ReadonlyUnacknowledgedOps;
|
|
1028
956
|
}
|
|
1029
957
|
type CreateManagedPoolOptions = {
|
|
1030
958
|
/**
|
|
@@ -1044,13 +972,6 @@ type CreateManagedPoolOptions = {
|
|
|
1044
972
|
* have an effect upstream.
|
|
1045
973
|
*/
|
|
1046
974
|
isStorageWritable?: () => boolean;
|
|
1047
|
-
/**
|
|
1048
|
-
* Read-only view of the client's still-unacknowledged ops. Used by CRDTs
|
|
1049
|
-
* (e.g. LiveList) to know which of their optimistic mutations the server
|
|
1050
|
-
* hasn't confirmed yet. Defaults to an empty view (e.g. server-side pools
|
|
1051
|
-
* that dispatch-and-flush have no optimistic state to track).
|
|
1052
|
-
*/
|
|
1053
|
-
unacknowledgedOps?: ReadonlyUnacknowledgedOps;
|
|
1054
975
|
};
|
|
1055
976
|
/**
|
|
1056
977
|
* @private Private API, never use this API directly.
|
|
@@ -1216,7 +1137,7 @@ declare class LiveRegister<TValue extends Json> extends AbstractCrdt {
|
|
|
1216
1137
|
clone(): TValue;
|
|
1217
1138
|
}
|
|
1218
1139
|
|
|
1219
|
-
type LiveStructure = LiveObject<LsonObject> | LiveList<Lson> | LiveMap<string, Lson
|
|
1140
|
+
type LiveStructure = LiveObject<LsonObject> | LiveList<Lson> | LiveMap<string, Lson>;
|
|
1220
1141
|
/**
|
|
1221
1142
|
* Think of Lson as a sibling of the Json data tree, except that the nested
|
|
1222
1143
|
* data structure can contain a mix of Json values and LiveStructure instances.
|
|
@@ -1252,7 +1173,7 @@ type ToJson<L extends Lson | LsonObject> = L extends LiveList<infer I extends Ls
|
|
|
1252
1173
|
readonly [K in keyof O]: ToJson<Exclude<O[K], undefined>> | (undefined extends O[K] ? undefined : never);
|
|
1253
1174
|
} : L extends LiveMap<infer KS extends string, infer V extends Lson> ? Lson extends V ? ReadonlyJsonObject : {
|
|
1254
1175
|
readonly [K in KS]: ToJson<V>;
|
|
1255
|
-
} : L extends
|
|
1176
|
+
} : L extends LsonObject ? string extends keyof L ? ReadonlyJsonObject : {
|
|
1256
1177
|
readonly [K in keyof L]: ToJson<Exclude<L[K], undefined>> | (undefined extends L[K] ? undefined : never);
|
|
1257
1178
|
} : L extends Json ? L : never;
|
|
1258
1179
|
|
|
@@ -1928,18 +1849,6 @@ interface RoomHttpApi<TM extends BaseMetadata, CM extends BaseMetadata> {
|
|
|
1928
1849
|
signal?: AbortSignal;
|
|
1929
1850
|
}): Promise<CommentAttachment>;
|
|
1930
1851
|
getOrCreateAttachmentUrlsStore(roomId: string): BatchStore<string, string>;
|
|
1931
|
-
uploadChatAttachment({ chatId, attachment, signal, }: {
|
|
1932
|
-
chatId: string;
|
|
1933
|
-
attachment: {
|
|
1934
|
-
id: string;
|
|
1935
|
-
file: File;
|
|
1936
|
-
};
|
|
1937
|
-
signal?: AbortSignal;
|
|
1938
|
-
}): Promise<void>;
|
|
1939
|
-
getOrCreateChatAttachmentUrlsStore(chatId: string): BatchStore<string, string>;
|
|
1940
|
-
getChatAttachmentUrl(options: {
|
|
1941
|
-
attachmentId: string;
|
|
1942
|
-
}): Promise<string>;
|
|
1943
1852
|
createTextMention({ roomId, mentionId, mention, }: {
|
|
1944
1853
|
roomId: string;
|
|
1945
1854
|
mentionId: string;
|
|
@@ -5101,12 +5010,7 @@ type PlainLsonList = {
|
|
|
5101
5010
|
liveblocksType: "LiveList";
|
|
5102
5011
|
data: PlainLson[];
|
|
5103
5012
|
};
|
|
5104
|
-
type
|
|
5105
|
-
liveblocksType: "LiveText";
|
|
5106
|
-
data: LiveTextData;
|
|
5107
|
-
version?: number;
|
|
5108
|
-
};
|
|
5109
|
-
type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | PlainLsonText | Json;
|
|
5013
|
+
type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | Json;
|
|
5110
5014
|
|
|
5111
5015
|
/**
|
|
5112
5016
|
* Returns PlainLson for a given Json or LiveStructure, suitable for calling the storage init api
|
|
@@ -5602,13 +5506,6 @@ declare class SortedList<T> {
|
|
|
5602
5506
|
reposition(value: T): number;
|
|
5603
5507
|
at(index: number): T | undefined;
|
|
5604
5508
|
get length(): number;
|
|
5605
|
-
/**
|
|
5606
|
-
* Whether the given value is present, by identity. O(log n) plus the length
|
|
5607
|
-
* of any run of items that share its sort key (normally 1). Bisects on the
|
|
5608
|
-
* value's own key, so it only finds values sitting at their sorted position,
|
|
5609
|
-
* which is true for any item currently in the list.
|
|
5610
|
-
*/
|
|
5611
|
-
includes(value: T): boolean;
|
|
5612
5509
|
filter(predicate: (value: T) => boolean): IterableIterator<T>;
|
|
5613
5510
|
findAllRight(predicate: (value: T, index: number) => unknown): IterableIterator<T>;
|
|
5614
5511
|
[Symbol.iterator](): IterableIterator<T>;
|
|
@@ -5821,4 +5718,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
|
|
|
5821
5718
|
[K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
|
|
5822
5719
|
};
|
|
5823
5720
|
|
|
5824
|
-
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
|
|
5721
|
+
export { type AccessLevel, 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 PermissionCapabilities, type PermissionResources, 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 RequiredAccessLevel, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomAccesses, type RoomAccessesInput, type RoomAccessesUpdateInput, type RoomEventMessage, type RoomPermission, type RoomPermissionInput, type RoomPermissionObject, 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, getRoomPermissionConflicts, getSubscriptionKey, hasPermissionCapability, hasPermissionCapabilityAccess, 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, normalizeRoomAccessesInput, normalizeRoomAccessesUpdateInput, normalizeRoomPermissionInput, objectToQuery, patchNotificationSettings, permissionCapabilitiesFromScopes, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
|