@liveblocks/core 1.2.1 → 1.2.2-comments1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +371 -11
- package/dist/index.d.ts +371 -11
- package/dist/index.js +457 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +415 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -570,6 +570,11 @@ declare type CustomAuthenticationResult = {
|
|
|
570
570
|
reason: string;
|
|
571
571
|
};
|
|
572
572
|
|
|
573
|
+
declare type BaseUserInfo = {
|
|
574
|
+
[key: string]: Json | undefined;
|
|
575
|
+
name?: string;
|
|
576
|
+
avatar?: string;
|
|
577
|
+
};
|
|
573
578
|
/**
|
|
574
579
|
* This type is used by clients to define the metadata for a user.
|
|
575
580
|
*/
|
|
@@ -582,9 +587,162 @@ declare type BaseUserMeta = {
|
|
|
582
587
|
/**
|
|
583
588
|
* Additional user information that has been set in the authentication endpoint.
|
|
584
589
|
*/
|
|
585
|
-
info?:
|
|
590
|
+
info?: BaseUserInfo;
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
declare enum Permission {
|
|
594
|
+
Read = "room:read",
|
|
595
|
+
Write = "room:write",
|
|
596
|
+
PresenceWrite = "room:presence:write",
|
|
597
|
+
CommentsWrite = "comments:write",
|
|
598
|
+
CommentsRead = "comments:read"
|
|
599
|
+
}
|
|
600
|
+
declare type LiveblocksPermissions = Record<string, Permission[]>;
|
|
601
|
+
declare enum TokenKind {
|
|
602
|
+
SECRET_LEGACY = "sec-legacy",
|
|
603
|
+
ACCESS_TOKEN = "acc",
|
|
604
|
+
ID_TOKEN = "id"
|
|
605
|
+
}
|
|
606
|
+
declare type JwtMeta = {
|
|
607
|
+
iat: number;
|
|
608
|
+
exp: number;
|
|
609
|
+
};
|
|
610
|
+
/**
|
|
611
|
+
* Legacy Secret Token.
|
|
612
|
+
*/
|
|
613
|
+
declare type LegacySecretToken = {
|
|
614
|
+
k: TokenKind.SECRET_LEGACY;
|
|
615
|
+
roomId: string;
|
|
616
|
+
scopes: string[];
|
|
617
|
+
id?: string;
|
|
618
|
+
info?: BaseUserInfo;
|
|
619
|
+
[other: string]: Json | undefined;
|
|
620
|
+
} & JwtMeta;
|
|
621
|
+
/**
|
|
622
|
+
* New authorization Access Token.
|
|
623
|
+
*/
|
|
624
|
+
declare type AccessToken = {
|
|
625
|
+
k: TokenKind.ACCESS_TOKEN;
|
|
626
|
+
pid: string;
|
|
627
|
+
uid: string;
|
|
628
|
+
perms: LiveblocksPermissions;
|
|
629
|
+
ui?: BaseUserInfo;
|
|
630
|
+
} & JwtMeta;
|
|
631
|
+
/**
|
|
632
|
+
* New authorization ID Token.
|
|
633
|
+
*/
|
|
634
|
+
declare type IDToken = {
|
|
635
|
+
k: TokenKind.ID_TOKEN;
|
|
636
|
+
pid: string;
|
|
637
|
+
uid: string;
|
|
638
|
+
gids?: string[];
|
|
639
|
+
ui?: BaseUserInfo;
|
|
640
|
+
} & JwtMeta;
|
|
641
|
+
declare type AuthToken = AccessToken | IDToken | LegacySecretToken;
|
|
642
|
+
declare type ParsedAuthToken = {
|
|
643
|
+
readonly raw: string;
|
|
644
|
+
readonly parsed: AuthToken;
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
declare type AuthValue = {
|
|
648
|
+
type: "secret";
|
|
649
|
+
token: ParsedAuthToken;
|
|
650
|
+
} | {
|
|
651
|
+
type: "public";
|
|
652
|
+
publicApiKey: string;
|
|
653
|
+
};
|
|
654
|
+
|
|
655
|
+
declare type BaseMetadata = Record<string, string | boolean | number>;
|
|
656
|
+
|
|
657
|
+
declare type CommentBodyBlockElement = CommentBodyParagraph;
|
|
658
|
+
declare type CommentBodyInlineElement = CommentBodyText | CommentBodyMention;
|
|
659
|
+
declare type CommentBodyElement = CommentBodyBlockElement | CommentBodyInlineElement;
|
|
660
|
+
declare type CommentBodyParagraph = {
|
|
661
|
+
type: "paragraph";
|
|
662
|
+
children: CommentBodyInlineElement[];
|
|
663
|
+
};
|
|
664
|
+
declare type CommentBodyMention = {
|
|
665
|
+
type: "mention";
|
|
666
|
+
id: string;
|
|
667
|
+
};
|
|
668
|
+
declare type CommentBodyText = {
|
|
669
|
+
bold?: boolean;
|
|
670
|
+
italic?: boolean;
|
|
671
|
+
strikethrough?: boolean;
|
|
672
|
+
code?: boolean;
|
|
673
|
+
text: string;
|
|
674
|
+
};
|
|
675
|
+
declare type CommentBody = {
|
|
676
|
+
version: 1;
|
|
677
|
+
content: CommentBodyBlockElement[];
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* Represents a comment.
|
|
682
|
+
*/
|
|
683
|
+
declare type CommentData = {
|
|
684
|
+
type: "comment";
|
|
685
|
+
id: string;
|
|
686
|
+
threadId: string;
|
|
687
|
+
roomId: string;
|
|
688
|
+
userId: string;
|
|
689
|
+
createdAt: string;
|
|
690
|
+
editedAt?: string;
|
|
691
|
+
} & ({
|
|
692
|
+
body: CommentBody;
|
|
693
|
+
mentionedIds: string[];
|
|
694
|
+
deletedAt?: never;
|
|
695
|
+
} | {
|
|
696
|
+
body?: never;
|
|
697
|
+
mentionedIds: [];
|
|
698
|
+
deletedAt: string;
|
|
699
|
+
});
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Represents a thread of comments.
|
|
703
|
+
*/
|
|
704
|
+
declare type ThreadData<ThreadMetadata extends BaseMetadata = never> = {
|
|
705
|
+
type: "thread";
|
|
706
|
+
id: string;
|
|
707
|
+
roomId: string;
|
|
708
|
+
createdAt: string;
|
|
709
|
+
updatedAt?: string;
|
|
710
|
+
comments: CommentData[];
|
|
711
|
+
metadata: [ThreadMetadata] extends [never] ? Record<string, never> : ThreadMetadata;
|
|
586
712
|
};
|
|
587
713
|
|
|
714
|
+
declare type Options = {
|
|
715
|
+
serverEndpoint: string;
|
|
716
|
+
};
|
|
717
|
+
declare type CommentsApi<ThreadMetadata extends BaseMetadata> = {
|
|
718
|
+
getThreads(): Promise<ThreadData<ThreadMetadata>[]>;
|
|
719
|
+
createThread(options: {
|
|
720
|
+
threadId: string;
|
|
721
|
+
commentId: string;
|
|
722
|
+
metadata: ThreadMetadata | undefined;
|
|
723
|
+
body: CommentBody;
|
|
724
|
+
}): Promise<ThreadData<ThreadMetadata>>;
|
|
725
|
+
editThreadMetadata(options: {
|
|
726
|
+
metadata: Partial<ThreadMetadata>;
|
|
727
|
+
threadId: string;
|
|
728
|
+
}): Promise<ThreadData<ThreadMetadata>>;
|
|
729
|
+
createComment(options: {
|
|
730
|
+
threadId: string;
|
|
731
|
+
commentId: string;
|
|
732
|
+
body: CommentBody;
|
|
733
|
+
}): Promise<CommentData>;
|
|
734
|
+
editComment(options: {
|
|
735
|
+
threadId: string;
|
|
736
|
+
commentId: string;
|
|
737
|
+
body: CommentBody;
|
|
738
|
+
}): Promise<CommentData>;
|
|
739
|
+
deleteComment(options: {
|
|
740
|
+
threadId: string;
|
|
741
|
+
commentId: string;
|
|
742
|
+
}): Promise<void>;
|
|
743
|
+
};
|
|
744
|
+
declare function createCommentsApi<ThreadMetadata extends BaseMetadata>(roomId: string, getAuthValue: () => Promise<AuthValue>, { serverEndpoint }: Options): CommentsApi<ThreadMetadata>;
|
|
745
|
+
|
|
588
746
|
declare type Callback<T> = (event: T) => void;
|
|
589
747
|
declare type UnsubscribeCallback = () => void;
|
|
590
748
|
declare type Observable<T> = {
|
|
@@ -606,6 +764,59 @@ declare type Observable<T> = {
|
|
|
606
764
|
*/
|
|
607
765
|
waitUntil(predicate?: (event: T) => boolean): Promise<T>;
|
|
608
766
|
};
|
|
767
|
+
declare type EventSource<T> = Observable<T> & {
|
|
768
|
+
/**
|
|
769
|
+
* Notify all subscribers about the event.
|
|
770
|
+
*/
|
|
771
|
+
notify(event: T): void;
|
|
772
|
+
/**
|
|
773
|
+
* Clear all registered event listeners. None of the registered functions
|
|
774
|
+
* will ever get called again. Be careful when using this API, because the
|
|
775
|
+
* subscribers may not have any idea they won't be notified anymore.
|
|
776
|
+
*/
|
|
777
|
+
clear(): void;
|
|
778
|
+
/**
|
|
779
|
+
* Returns the number of active subscribers.
|
|
780
|
+
*/
|
|
781
|
+
count(): number;
|
|
782
|
+
/**
|
|
783
|
+
* Pauses event delivery until unpaused. Any .notify() calls made while
|
|
784
|
+
* paused will get buffered into memory and emitted later.
|
|
785
|
+
*/
|
|
786
|
+
pause(): void;
|
|
787
|
+
/**
|
|
788
|
+
* Emits all in-memory buffered events, and unpauses. Any .notify() calls
|
|
789
|
+
* made after this will be synchronously delivered again.
|
|
790
|
+
*/
|
|
791
|
+
unpause(): void;
|
|
792
|
+
/**
|
|
793
|
+
* Observable instance, which can be used to subscribe to this event source
|
|
794
|
+
* in a readonly fashion. Safe to publicly expose.
|
|
795
|
+
*/
|
|
796
|
+
observable: Observable<T>;
|
|
797
|
+
};
|
|
798
|
+
/**
|
|
799
|
+
* makeEventSource allows you to generate a subscribe/notify pair of functions
|
|
800
|
+
* to make subscribing easy and to get notified about events.
|
|
801
|
+
*
|
|
802
|
+
* The events are anonymous, so you can use it to define events, like so:
|
|
803
|
+
*
|
|
804
|
+
* const event1 = makeEventSource();
|
|
805
|
+
* const event2 = makeEventSource();
|
|
806
|
+
*
|
|
807
|
+
* event1.subscribe(foo);
|
|
808
|
+
* event1.subscribe(bar);
|
|
809
|
+
* event2.subscribe(qux);
|
|
810
|
+
*
|
|
811
|
+
* // Unsubscription is pretty standard
|
|
812
|
+
* const unsub = event2.subscribe(foo);
|
|
813
|
+
* unsub();
|
|
814
|
+
*
|
|
815
|
+
* event1.notify(); // Now foo and bar will get called
|
|
816
|
+
* event2.notify(); // Now qux will get called (but foo will not, since it's unsubscribed)
|
|
817
|
+
*
|
|
818
|
+
*/
|
|
819
|
+
declare function makeEventSource<T>(): EventSource<T>;
|
|
609
820
|
|
|
610
821
|
interface IWebSocketEvent {
|
|
611
822
|
type: string;
|
|
@@ -760,12 +971,41 @@ declare enum ServerMsgCode {
|
|
|
760
971
|
INITIAL_STORAGE_STATE = 200,
|
|
761
972
|
UPDATE_STORAGE = 201,
|
|
762
973
|
REJECT_STORAGE_OP = 299,
|
|
763
|
-
UPDATE_YDOC = 300
|
|
974
|
+
UPDATE_YDOC = 300,
|
|
975
|
+
THREAD_CREATED = 400,
|
|
976
|
+
THREAD_METADATA_UPDATED = 401,
|
|
977
|
+
COMMENT_CREATED = 402,
|
|
978
|
+
COMMENT_EDITED = 403,
|
|
979
|
+
COMMENT_DELETED = 404
|
|
764
980
|
}
|
|
765
981
|
/**
|
|
766
982
|
* Messages that can be sent from the server to the client.
|
|
767
983
|
*/
|
|
768
|
-
declare type ServerMsg<TPresence extends JsonObject, TUserMeta extends BaseUserMeta, TRoomEvent extends Json> = UpdatePresenceServerMsg<TPresence> | UserJoinServerMsg<TUserMeta> | UserLeftServerMsg | BroadcastedEventServerMsg<TRoomEvent> | RoomStateServerMsg<TUserMeta> | InitialDocumentStateServerMsg | UpdateStorageServerMsg | RejectedStorageOpServerMsg | YDocUpdate;
|
|
984
|
+
declare type ServerMsg<TPresence extends JsonObject, TUserMeta extends BaseUserMeta, TRoomEvent extends Json> = UpdatePresenceServerMsg<TPresence> | UserJoinServerMsg<TUserMeta> | UserLeftServerMsg | BroadcastedEventServerMsg<TRoomEvent> | RoomStateServerMsg<TUserMeta> | InitialDocumentStateServerMsg | UpdateStorageServerMsg | RejectedStorageOpServerMsg | YDocUpdate | CommentsEventServerMsg;
|
|
985
|
+
declare type CommentsEventServerMsg = ThreadCreatedEvent | ThreadMetadataUpdatedEvent | CommentCreatedEvent | CommentEditedEvent | CommentDeletedEvent;
|
|
986
|
+
declare type ThreadCreatedEvent = {
|
|
987
|
+
type: ServerMsgCode.THREAD_CREATED;
|
|
988
|
+
threadId: string;
|
|
989
|
+
};
|
|
990
|
+
declare type ThreadMetadataUpdatedEvent = {
|
|
991
|
+
type: ServerMsgCode.THREAD_METADATA_UPDATED;
|
|
992
|
+
threadId: string;
|
|
993
|
+
};
|
|
994
|
+
declare type CommentCreatedEvent = {
|
|
995
|
+
type: ServerMsgCode.COMMENT_CREATED;
|
|
996
|
+
threadId: string;
|
|
997
|
+
commentId: string;
|
|
998
|
+
};
|
|
999
|
+
declare type CommentEditedEvent = {
|
|
1000
|
+
type: ServerMsgCode.COMMENT_EDITED;
|
|
1001
|
+
threadId: string;
|
|
1002
|
+
commentId: string;
|
|
1003
|
+
};
|
|
1004
|
+
declare type CommentDeletedEvent = {
|
|
1005
|
+
type: ServerMsgCode.COMMENT_DELETED;
|
|
1006
|
+
threadId: string;
|
|
1007
|
+
commentId: string;
|
|
1008
|
+
};
|
|
769
1009
|
/**
|
|
770
1010
|
* Sent by the WebSocket server and broadcasted to all clients to announce that
|
|
771
1011
|
* a User updated their presence. For example, when a user moves their cursor.
|
|
@@ -856,6 +1096,7 @@ declare type YDocUpdate = {
|
|
|
856
1096
|
readonly type: ServerMsgCode.UPDATE_YDOC;
|
|
857
1097
|
readonly update: string;
|
|
858
1098
|
readonly isSync: boolean;
|
|
1099
|
+
readonly stateVector: string | null;
|
|
859
1100
|
};
|
|
860
1101
|
/**
|
|
861
1102
|
* Sent by the WebSocket server and broadcasted to all clients to announce that
|
|
@@ -971,6 +1212,10 @@ declare type User<TPresence extends JsonObject, TUserMeta extends BaseUserMeta>
|
|
|
971
1212
|
* can only read but not mutate it.
|
|
972
1213
|
*/
|
|
973
1214
|
readonly canWrite: boolean;
|
|
1215
|
+
/**
|
|
1216
|
+
* True if the user can comment on a thread
|
|
1217
|
+
*/
|
|
1218
|
+
readonly canComment: boolean;
|
|
974
1219
|
};
|
|
975
1220
|
|
|
976
1221
|
/**
|
|
@@ -1238,7 +1483,7 @@ declare type SubscribeFn<TPresence extends JsonObject, _TStorage extends LsonObj
|
|
|
1238
1483
|
*/
|
|
1239
1484
|
(type: "storage-status", listener: Callback<StorageStatus>): () => void;
|
|
1240
1485
|
};
|
|
1241
|
-
declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUserMeta extends BaseUserMeta, TRoomEvent extends Json> = {
|
|
1486
|
+
declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUserMeta extends BaseUserMeta, TRoomEvent extends Json> = CommentsApi<any> & {
|
|
1242
1487
|
/**
|
|
1243
1488
|
* The id of the room.
|
|
1244
1489
|
*/
|
|
@@ -1383,6 +1628,7 @@ declare type Room<TPresence extends JsonObject, TStorage extends LsonObject, TUs
|
|
|
1383
1628
|
readonly storageDidLoad: Observable<void>;
|
|
1384
1629
|
readonly storageStatus: Observable<StorageStatus>;
|
|
1385
1630
|
readonly ydoc: Observable<YDocUpdate>;
|
|
1631
|
+
readonly comments: Observable<CommentsEventServerMsg>;
|
|
1386
1632
|
};
|
|
1387
1633
|
/**
|
|
1388
1634
|
* Batches modifications made during the given function.
|
|
@@ -1568,6 +1814,93 @@ declare function assert(condition: boolean, errmsg: string): asserts condition;
|
|
|
1568
1814
|
*/
|
|
1569
1815
|
declare function nn<T>(value: T, errmsg?: string): NonNullable<T>;
|
|
1570
1816
|
|
|
1817
|
+
declare type AsyncFunction<T, A extends any[] = any[]> = (...args: A) => Promise<T>;
|
|
1818
|
+
declare type AsyncCacheOptions<T, E> = {
|
|
1819
|
+
isStateEqual?: (a: AsyncState<T, E>, b: AsyncState<T, E>) => boolean;
|
|
1820
|
+
};
|
|
1821
|
+
declare type AsyncStateInitial = {
|
|
1822
|
+
readonly isLoading: false;
|
|
1823
|
+
readonly data?: never;
|
|
1824
|
+
readonly error?: never;
|
|
1825
|
+
};
|
|
1826
|
+
declare type AsyncStateLoading<T> = {
|
|
1827
|
+
readonly isLoading: true;
|
|
1828
|
+
readonly data?: T;
|
|
1829
|
+
readonly error?: never;
|
|
1830
|
+
};
|
|
1831
|
+
declare type AsyncStateSuccess<T> = {
|
|
1832
|
+
readonly isLoading: false;
|
|
1833
|
+
readonly data: T;
|
|
1834
|
+
readonly error?: never;
|
|
1835
|
+
};
|
|
1836
|
+
declare type AsyncStateError<T, E> = {
|
|
1837
|
+
readonly isLoading: false;
|
|
1838
|
+
readonly data?: T;
|
|
1839
|
+
readonly error: E;
|
|
1840
|
+
};
|
|
1841
|
+
declare type AsyncState<T, E> = AsyncStateInitial | AsyncStateLoading<T> | AsyncStateSuccess<T> | AsyncStateError<T, E>;
|
|
1842
|
+
declare type AsyncStateResolved<T, E> = AsyncStateSuccess<T> | AsyncStateError<T, E>;
|
|
1843
|
+
declare type AsyncCacheItem<T, E> = Observable<AsyncState<T, E>> & {
|
|
1844
|
+
setAsyncFunction(asyncFunction: AsyncFunction<T, [string]>): void;
|
|
1845
|
+
get(): Promise<AsyncStateResolved<T, E>>;
|
|
1846
|
+
getState(): AsyncState<T, E>;
|
|
1847
|
+
revalidate(): Promise<AsyncStateResolved<T, E>>;
|
|
1848
|
+
};
|
|
1849
|
+
declare type AsyncCache<T, E> = {
|
|
1850
|
+
/**
|
|
1851
|
+
* @private
|
|
1852
|
+
*
|
|
1853
|
+
* Creates a key in the cache.
|
|
1854
|
+
*
|
|
1855
|
+
* @param key The key to create.
|
|
1856
|
+
* @param asyncFunction Override the cache's function for this key.
|
|
1857
|
+
*/
|
|
1858
|
+
create(key: string, asyncFunction?: AsyncFunction<T, [string]>): AsyncCacheItem<T, E>;
|
|
1859
|
+
/**
|
|
1860
|
+
* Returns a promise which resolves with the state of the key.
|
|
1861
|
+
*
|
|
1862
|
+
* @param key The key to get.
|
|
1863
|
+
*/
|
|
1864
|
+
get(key: string): Promise<AsyncStateResolved<T, E>>;
|
|
1865
|
+
/**
|
|
1866
|
+
* Returns the current state of the key synchronously.
|
|
1867
|
+
*
|
|
1868
|
+
* @param key The key to get the state of.
|
|
1869
|
+
*/
|
|
1870
|
+
getState(key: string): AsyncState<T, E> | undefined;
|
|
1871
|
+
/**
|
|
1872
|
+
* Revalidates the key.
|
|
1873
|
+
*
|
|
1874
|
+
* @param key The key to revalidate.
|
|
1875
|
+
*/
|
|
1876
|
+
revalidate(key: string): Promise<AsyncStateResolved<T, E>>;
|
|
1877
|
+
/**
|
|
1878
|
+
* Subscribes to the key's changes.
|
|
1879
|
+
*
|
|
1880
|
+
* @param key The key to subscribe to.
|
|
1881
|
+
* @param callback The function invoked on every change.
|
|
1882
|
+
*/
|
|
1883
|
+
subscribe(key: string, callback: Callback<AsyncState<T, E>>): UnsubscribeCallback;
|
|
1884
|
+
/**
|
|
1885
|
+
* Subscribes to the key's changes once.
|
|
1886
|
+
*
|
|
1887
|
+
* @param key The key to subscribe to.
|
|
1888
|
+
* @param callback The function invoked on every change.
|
|
1889
|
+
*/
|
|
1890
|
+
subscribeOnce(key: string, callback: Callback<AsyncState<T, E>>): UnsubscribeCallback;
|
|
1891
|
+
/**
|
|
1892
|
+
* Returns whether a key already exists in the cache.
|
|
1893
|
+
*
|
|
1894
|
+
* @param key The key to look for.
|
|
1895
|
+
*/
|
|
1896
|
+
has(key: string): boolean;
|
|
1897
|
+
/**
|
|
1898
|
+
* Clears all keys.
|
|
1899
|
+
*/
|
|
1900
|
+
clear(): void;
|
|
1901
|
+
};
|
|
1902
|
+
declare function createAsyncCache<T, E>(asyncFunction: AsyncFunction<T, [string]>, options?: AsyncCacheOptions<T, E>): AsyncCache<T, E>;
|
|
1903
|
+
|
|
1571
1904
|
/**
|
|
1572
1905
|
* Displays a deprecation warning in the dev console. Only in dev mode, and
|
|
1573
1906
|
* only once per message/key. In production, this is a no-op.
|
|
@@ -1594,12 +1927,39 @@ declare function throwUsageError(message: string): void;
|
|
|
1594
1927
|
*/
|
|
1595
1928
|
declare function errorIf(condition: unknown, message: string): void;
|
|
1596
1929
|
|
|
1930
|
+
declare const warn: (message: string, ...args: readonly unknown[]) => void;
|
|
1931
|
+
declare const error: (message: string, ...args: readonly unknown[]) => void;
|
|
1932
|
+
declare const warnWithTitle: (title: string, message: string, ...args: readonly unknown[]) => void;
|
|
1933
|
+
declare const errorWithTitle: (title: string, message: string, ...args: readonly unknown[]) => void;
|
|
1934
|
+
|
|
1935
|
+
declare const fancyConsole_error: typeof error;
|
|
1936
|
+
declare const fancyConsole_errorWithTitle: typeof errorWithTitle;
|
|
1937
|
+
declare const fancyConsole_warn: typeof warn;
|
|
1938
|
+
declare const fancyConsole_warnWithTitle: typeof warnWithTitle;
|
|
1939
|
+
declare namespace fancyConsole {
|
|
1940
|
+
export {
|
|
1941
|
+
fancyConsole_error as error,
|
|
1942
|
+
fancyConsole_errorWithTitle as errorWithTitle,
|
|
1943
|
+
fancyConsole_warn as warn,
|
|
1944
|
+
fancyConsole_warnWithTitle as warnWithTitle,
|
|
1945
|
+
};
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1597
1948
|
/**
|
|
1598
1949
|
* Freezes the given argument, but only in development builds. In production
|
|
1599
1950
|
* builds, this is a no-op for performance reasons.
|
|
1600
1951
|
*/
|
|
1601
1952
|
declare const freeze: typeof Object.freeze;
|
|
1602
1953
|
|
|
1954
|
+
declare type Poller = {
|
|
1955
|
+
start(interval: number): void;
|
|
1956
|
+
restart(interval: number): void;
|
|
1957
|
+
pause(): void;
|
|
1958
|
+
resume(): void;
|
|
1959
|
+
stop(): void;
|
|
1960
|
+
};
|
|
1961
|
+
declare function makePoller(callback: () => void): Poller;
|
|
1962
|
+
|
|
1603
1963
|
declare const brand: unique symbol;
|
|
1604
1964
|
declare type Brand<T, TBrand extends string> = T & {
|
|
1605
1965
|
[brand]: TBrand;
|
|
@@ -1799,15 +2159,15 @@ declare type TreeNode = LsonTreeNode | UserTreeNode;
|
|
|
1799
2159
|
type DevToolsTreeNode_JsonTreeNode = JsonTreeNode;
|
|
1800
2160
|
type DevToolsTreeNode_LiveTreeNode<TName extends `Live${string}` = `Live${string}`> = LiveTreeNode<TName>;
|
|
1801
2161
|
type DevToolsTreeNode_LsonTreeNode = LsonTreeNode;
|
|
1802
|
-
type DevToolsTreeNode_UserTreeNode = UserTreeNode;
|
|
1803
2162
|
type DevToolsTreeNode_TreeNode = TreeNode;
|
|
2163
|
+
type DevToolsTreeNode_UserTreeNode = UserTreeNode;
|
|
1804
2164
|
declare namespace DevToolsTreeNode {
|
|
1805
2165
|
export {
|
|
1806
2166
|
DevToolsTreeNode_JsonTreeNode as JsonTreeNode,
|
|
1807
2167
|
DevToolsTreeNode_LiveTreeNode as LiveTreeNode,
|
|
1808
2168
|
DevToolsTreeNode_LsonTreeNode as LsonTreeNode,
|
|
1809
|
-
DevToolsTreeNode_UserTreeNode as UserTreeNode,
|
|
1810
2169
|
DevToolsTreeNode_TreeNode as TreeNode,
|
|
2170
|
+
DevToolsTreeNode_UserTreeNode as UserTreeNode,
|
|
1811
2171
|
};
|
|
1812
2172
|
}
|
|
1813
2173
|
|
|
@@ -1907,16 +2267,16 @@ declare type FullClientToPanelMessage = ClientToPanelMessage & {
|
|
|
1907
2267
|
source: "liveblocks-devtools-client";
|
|
1908
2268
|
};
|
|
1909
2269
|
|
|
1910
|
-
type protocol_PanelToClientMessage = PanelToClientMessage;
|
|
1911
2270
|
type protocol_ClientToPanelMessage = ClientToPanelMessage;
|
|
1912
|
-
type protocol_FullPanelToClientMessage = FullPanelToClientMessage;
|
|
1913
2271
|
type protocol_FullClientToPanelMessage = FullClientToPanelMessage;
|
|
2272
|
+
type protocol_FullPanelToClientMessage = FullPanelToClientMessage;
|
|
2273
|
+
type protocol_PanelToClientMessage = PanelToClientMessage;
|
|
1914
2274
|
declare namespace protocol {
|
|
1915
2275
|
export {
|
|
1916
|
-
protocol_PanelToClientMessage as PanelToClientMessage,
|
|
1917
2276
|
protocol_ClientToPanelMessage as ClientToPanelMessage,
|
|
1918
|
-
protocol_FullPanelToClientMessage as FullPanelToClientMessage,
|
|
1919
2277
|
protocol_FullClientToPanelMessage as FullClientToPanelMessage,
|
|
2278
|
+
protocol_FullPanelToClientMessage as FullPanelToClientMessage,
|
|
2279
|
+
protocol_PanelToClientMessage as PanelToClientMessage,
|
|
1920
2280
|
};
|
|
1921
2281
|
}
|
|
1922
2282
|
|
|
@@ -1932,4 +2292,4 @@ declare type EnsureJson<T> = [
|
|
|
1932
2292
|
[K in keyof T]: EnsureJson<T[K]>;
|
|
1933
2293
|
};
|
|
1934
2294
|
|
|
1935
|
-
export { AckOp, BaseAuthResult, BaseUserMeta, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CreateRootObjectOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, FetchStorageClientMsg, FetchYDocClientMsg, History, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ToImmutable, ToJson, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, asArrayWithLegacyMethods, asPos, assert, assertNever, b64decode, createClient, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makePosition, nn, patchLiveObjectKey, shallow, throwUsageError, toPlainLson, tryParseJson, withTimeout };
|
|
2295
|
+
export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyElement, CommentBodyMention, CommentBodyParagraph, CommentData, CommentsApi, CrdtType, CreateChildOp, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CreateRootObjectOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, EventSource, FetchStorageClientMsg, FetchYDocClientMsg, History, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ThreadData, ToImmutable, ToJson, UnsubscribeCallback, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, asArrayWithLegacyMethods, asPos, assert, assertNever, b64decode, fancyConsole as console, createAsyncCache, createClient, createCommentsApi, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, patchLiveObjectKey, shallow, throwUsageError, toPlainLson, tryParseJson, withTimeout };
|