@liveblocks/core 2.5.1 → 2.7.0-beta1
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 +269 -193
- package/dist/index.d.ts +269 -193
- package/dist/index.js +596 -443
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +582 -429
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -851,6 +851,52 @@ declare type CommentReaction = {
|
|
|
851
851
|
id: string;
|
|
852
852
|
}[];
|
|
853
853
|
};
|
|
854
|
+
declare type CommentAttachment = {
|
|
855
|
+
type: "attachment";
|
|
856
|
+
id: string;
|
|
857
|
+
name: string;
|
|
858
|
+
size: number;
|
|
859
|
+
mimeType: string;
|
|
860
|
+
};
|
|
861
|
+
declare type CommentLocalAttachmentIdle = {
|
|
862
|
+
type: "localAttachment";
|
|
863
|
+
status: "idle";
|
|
864
|
+
id: string;
|
|
865
|
+
name: string;
|
|
866
|
+
size: number;
|
|
867
|
+
mimeType: string;
|
|
868
|
+
file: File;
|
|
869
|
+
};
|
|
870
|
+
declare type CommentLocalAttachmentUploading = {
|
|
871
|
+
type: "localAttachment";
|
|
872
|
+
status: "uploading";
|
|
873
|
+
id: string;
|
|
874
|
+
name: string;
|
|
875
|
+
size: number;
|
|
876
|
+
mimeType: string;
|
|
877
|
+
file: File;
|
|
878
|
+
};
|
|
879
|
+
declare type CommentLocalAttachmentUploaded = {
|
|
880
|
+
type: "localAttachment";
|
|
881
|
+
status: "uploaded";
|
|
882
|
+
id: string;
|
|
883
|
+
name: string;
|
|
884
|
+
size: number;
|
|
885
|
+
mimeType: string;
|
|
886
|
+
file: File;
|
|
887
|
+
};
|
|
888
|
+
declare type CommentLocalAttachmentError = {
|
|
889
|
+
type: "localAttachment";
|
|
890
|
+
status: "error";
|
|
891
|
+
id: string;
|
|
892
|
+
name: string;
|
|
893
|
+
size: number;
|
|
894
|
+
mimeType: string;
|
|
895
|
+
file: File;
|
|
896
|
+
error: Error;
|
|
897
|
+
};
|
|
898
|
+
declare type CommentLocalAttachment = CommentLocalAttachmentIdle | CommentLocalAttachmentUploading | CommentLocalAttachmentUploaded | CommentLocalAttachmentError;
|
|
899
|
+
declare type CommentMixedAttachment = CommentAttachment | CommentLocalAttachment;
|
|
854
900
|
/**
|
|
855
901
|
* Represents a comment.
|
|
856
902
|
*/
|
|
@@ -863,6 +909,7 @@ declare type CommentData = {
|
|
|
863
909
|
createdAt: Date;
|
|
864
910
|
editedAt?: Date;
|
|
865
911
|
reactions: CommentReaction[];
|
|
912
|
+
attachments: CommentAttachment[];
|
|
866
913
|
} & ({
|
|
867
914
|
body: CommentBody;
|
|
868
915
|
deletedAt?: never;
|
|
@@ -995,6 +1042,29 @@ declare type KDAD = keyof DAD extends `$${string}` ? keyof DAD : "Custom notific
|
|
|
995
1042
|
*/
|
|
996
1043
|
declare const kInternal: unique symbol;
|
|
997
1044
|
|
|
1045
|
+
declare type RenameDataField<T, TFieldName extends string> = T extends any ? {
|
|
1046
|
+
[K in keyof T as K extends "data" ? TFieldName : K]: T[K];
|
|
1047
|
+
} : never;
|
|
1048
|
+
declare type AsyncResult<T> = {
|
|
1049
|
+
readonly isLoading: true;
|
|
1050
|
+
readonly data?: never;
|
|
1051
|
+
readonly error?: never;
|
|
1052
|
+
} | {
|
|
1053
|
+
readonly isLoading: false;
|
|
1054
|
+
readonly data: T;
|
|
1055
|
+
readonly error?: never;
|
|
1056
|
+
} | {
|
|
1057
|
+
readonly isLoading: false;
|
|
1058
|
+
readonly data?: never;
|
|
1059
|
+
readonly error: Error;
|
|
1060
|
+
};
|
|
1061
|
+
declare type AsyncResultWithDataField<T, TDataField extends string> = RenameDataField<AsyncResult<T>, TDataField>;
|
|
1062
|
+
|
|
1063
|
+
declare type BatchStore<O, I> = Observable<void> & {
|
|
1064
|
+
get: (input: I) => Promise<void>;
|
|
1065
|
+
getState: (input: I) => AsyncResult<O> | undefined;
|
|
1066
|
+
};
|
|
1067
|
+
|
|
998
1068
|
declare enum ClientMsgCode {
|
|
999
1069
|
UPDATE_PRESENCE = 100,
|
|
1000
1070
|
BROADCAST_EVENT = 103,
|
|
@@ -1723,174 +1793,8 @@ declare type GetThreadsOptions<M extends BaseMetadata> = {
|
|
|
1723
1793
|
metadata?: Partial<QueryMetadata<M>>;
|
|
1724
1794
|
};
|
|
1725
1795
|
};
|
|
1726
|
-
declare type
|
|
1727
|
-
|
|
1728
|
-
* Returns the threads within the current room and their associated inbox notifications.
|
|
1729
|
-
* It also returns the request date that can be used for subsequent polling.
|
|
1730
|
-
*
|
|
1731
|
-
* @example
|
|
1732
|
-
* const {
|
|
1733
|
-
* threads,
|
|
1734
|
-
* inboxNotifications,
|
|
1735
|
-
* requestedAt
|
|
1736
|
-
* } = await room.getThreads({ query: { resolved: false }});
|
|
1737
|
-
*/
|
|
1738
|
-
getThreads(options?: GetThreadsOptions<M>): Promise<{
|
|
1739
|
-
threads: ThreadData<M>[];
|
|
1740
|
-
inboxNotifications: InboxNotificationData[];
|
|
1741
|
-
requestedAt: Date;
|
|
1742
|
-
}>;
|
|
1743
|
-
/**
|
|
1744
|
-
* Returns the updated and deleted threads and their associated inbox notifications since the requested date.
|
|
1745
|
-
*
|
|
1746
|
-
* @example
|
|
1747
|
-
* const result = await room.getThreads();
|
|
1748
|
-
* // ... //
|
|
1749
|
-
* await room.getThreadsSince({ since: result.requestedAt });
|
|
1750
|
-
*/
|
|
1751
|
-
getThreadsSince(options: {
|
|
1752
|
-
since: Date;
|
|
1753
|
-
}): Promise<{
|
|
1754
|
-
threads: {
|
|
1755
|
-
updated: ThreadData<M>[];
|
|
1756
|
-
deleted: ThreadDeleteInfo[];
|
|
1757
|
-
};
|
|
1758
|
-
inboxNotifications: {
|
|
1759
|
-
updated: InboxNotificationData[];
|
|
1760
|
-
deleted: InboxNotificationDeleteInfo[];
|
|
1761
|
-
};
|
|
1762
|
-
requestedAt: Date;
|
|
1763
|
-
}>;
|
|
1764
|
-
/**
|
|
1765
|
-
* Returns a thread and the associated inbox notification if it exists.
|
|
1766
|
-
*
|
|
1767
|
-
* @example
|
|
1768
|
-
* const { thread, inboxNotification } = await room.getThread("th_xxx");
|
|
1769
|
-
*/
|
|
1770
|
-
getThread(threadId: string): Promise<{
|
|
1771
|
-
thread?: ThreadData<M>;
|
|
1772
|
-
inboxNotification?: InboxNotificationData;
|
|
1773
|
-
}>;
|
|
1774
|
-
/**
|
|
1775
|
-
* Creates a thread.
|
|
1776
|
-
*
|
|
1777
|
-
* @example
|
|
1778
|
-
* const thread = await room.createThread({
|
|
1779
|
-
* body: {
|
|
1780
|
-
* version: 1,
|
|
1781
|
-
* content: [{ type: "paragraph", children: [{ text: "Hello" }] }],
|
|
1782
|
-
* },
|
|
1783
|
-
* })
|
|
1784
|
-
*/
|
|
1785
|
-
createThread(options: {
|
|
1786
|
-
threadId?: string;
|
|
1787
|
-
commentId?: string;
|
|
1788
|
-
metadata: M | undefined;
|
|
1789
|
-
body: CommentBody;
|
|
1790
|
-
}): Promise<ThreadData<M>>;
|
|
1791
|
-
/**
|
|
1792
|
-
* Deletes a thread.
|
|
1793
|
-
*
|
|
1794
|
-
* @example
|
|
1795
|
-
* await room.deleteThread("th_xxx");
|
|
1796
|
-
*/
|
|
1797
|
-
deleteThread(threadId: string): Promise<void>;
|
|
1798
|
-
/**
|
|
1799
|
-
* Edits a thread's metadata.
|
|
1800
|
-
* To delete an existing metadata property, set its value to `null`.
|
|
1801
|
-
*
|
|
1802
|
-
* @example
|
|
1803
|
-
* await room.editThreadMetadata({ threadId: "th_xxx", metadata: { x: 100, y: 100 } })
|
|
1804
|
-
*/
|
|
1805
|
-
editThreadMetadata(options: {
|
|
1806
|
-
metadata: Patchable<M>;
|
|
1807
|
-
threadId: string;
|
|
1808
|
-
}): Promise<M>;
|
|
1809
|
-
/**
|
|
1810
|
-
* Marks a thread as resolved.
|
|
1811
|
-
*
|
|
1812
|
-
* @example
|
|
1813
|
-
* await room.markThreadAsResolved("th_xxx");
|
|
1814
|
-
*/
|
|
1815
|
-
markThreadAsResolved(threadId: string): Promise<void>;
|
|
1816
|
-
/**
|
|
1817
|
-
* Marks a thread as unresolved.
|
|
1818
|
-
*
|
|
1819
|
-
* @example
|
|
1820
|
-
* await room.markThreadAsUnresolved("th_xxx");
|
|
1821
|
-
*/
|
|
1822
|
-
markThreadAsUnresolved(threadId: string): Promise<void>;
|
|
1823
|
-
/**
|
|
1824
|
-
* Creates a comment.
|
|
1825
|
-
*
|
|
1826
|
-
* @example
|
|
1827
|
-
* await room.createComment({
|
|
1828
|
-
* threadId: "th_xxx",
|
|
1829
|
-
* body: {
|
|
1830
|
-
* version: 1,
|
|
1831
|
-
* content: [{ type: "paragraph", children: [{ text: "Hello" }] }],
|
|
1832
|
-
* },
|
|
1833
|
-
* });
|
|
1834
|
-
*/
|
|
1835
|
-
createComment(options: {
|
|
1836
|
-
threadId: string;
|
|
1837
|
-
commentId?: string;
|
|
1838
|
-
body: CommentBody;
|
|
1839
|
-
}): Promise<CommentData>;
|
|
1840
|
-
/**
|
|
1841
|
-
* Edits a comment.
|
|
1842
|
-
*
|
|
1843
|
-
* @example
|
|
1844
|
-
* await room.editComment({
|
|
1845
|
-
* threadId: "th_xxx",
|
|
1846
|
-
* commentId: "cm_xxx"
|
|
1847
|
-
* body: {
|
|
1848
|
-
* version: 1,
|
|
1849
|
-
* content: [{ type: "paragraph", children: [{ text: "Hello" }] }],
|
|
1850
|
-
* },
|
|
1851
|
-
* });
|
|
1852
|
-
*/
|
|
1853
|
-
editComment(options: {
|
|
1854
|
-
threadId: string;
|
|
1855
|
-
commentId: string;
|
|
1856
|
-
body: CommentBody;
|
|
1857
|
-
}): Promise<CommentData>;
|
|
1858
|
-
/**
|
|
1859
|
-
* Deletes a comment.
|
|
1860
|
-
* If it is the last non-deleted comment, the thread also gets deleted.
|
|
1861
|
-
*
|
|
1862
|
-
* @example
|
|
1863
|
-
* await room.deleteComment({
|
|
1864
|
-
* threadId: "th_xxx",
|
|
1865
|
-
* commentId: "cm_xxx"
|
|
1866
|
-
* });
|
|
1867
|
-
*/
|
|
1868
|
-
deleteComment(options: {
|
|
1869
|
-
threadId: string;
|
|
1870
|
-
commentId: string;
|
|
1871
|
-
}): Promise<void>;
|
|
1872
|
-
/**
|
|
1873
|
-
* Adds a reaction from a comment for the current user.
|
|
1874
|
-
*
|
|
1875
|
-
* @example
|
|
1876
|
-
* await room.addReaction({ threadId: "th_xxx", commentId: "cm_xxx", emoji: "👍" })
|
|
1877
|
-
*/
|
|
1878
|
-
addReaction(options: {
|
|
1879
|
-
threadId: string;
|
|
1880
|
-
commentId: string;
|
|
1881
|
-
emoji: string;
|
|
1882
|
-
}): Promise<CommentUserReaction>;
|
|
1883
|
-
/**
|
|
1884
|
-
* Removes a reaction from a comment.
|
|
1885
|
-
*
|
|
1886
|
-
* @example
|
|
1887
|
-
* await room.removeReaction({ threadId: "th_xxx", commentId: "cm_xxx", emoji: "👍" })
|
|
1888
|
-
*/
|
|
1889
|
-
removeReaction(options: {
|
|
1890
|
-
threadId: string;
|
|
1891
|
-
commentId: string;
|
|
1892
|
-
emoji: string;
|
|
1893
|
-
}): Promise<void>;
|
|
1796
|
+
declare type UploadAttachmentOptions = {
|
|
1797
|
+
signal?: AbortSignal;
|
|
1894
1798
|
};
|
|
1895
1799
|
/**
|
|
1896
1800
|
* @private Widest-possible Room type, matching _any_ Room instance. Note that
|
|
@@ -2100,6 +2004,198 @@ declare type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extend
|
|
|
2100
2004
|
* connection. If the room is not connected yet, initiate it.
|
|
2101
2005
|
*/
|
|
2102
2006
|
reconnect(): void;
|
|
2007
|
+
/**
|
|
2008
|
+
* Returns the threads within the current room and their associated inbox notifications.
|
|
2009
|
+
* It also returns the request date that can be used for subsequent polling.
|
|
2010
|
+
*
|
|
2011
|
+
* @example
|
|
2012
|
+
* const {
|
|
2013
|
+
* threads,
|
|
2014
|
+
* inboxNotifications,
|
|
2015
|
+
* requestedAt
|
|
2016
|
+
* } = await room.getThreads({ query: { resolved: false }});
|
|
2017
|
+
*/
|
|
2018
|
+
getThreads(options?: GetThreadsOptions<M>): Promise<{
|
|
2019
|
+
threads: ThreadData<M>[];
|
|
2020
|
+
inboxNotifications: InboxNotificationData[];
|
|
2021
|
+
requestedAt: Date;
|
|
2022
|
+
}>;
|
|
2023
|
+
/**
|
|
2024
|
+
* Returns the updated and deleted threads and their associated inbox notifications since the requested date.
|
|
2025
|
+
*
|
|
2026
|
+
* @example
|
|
2027
|
+
* const result = await room.getThreads();
|
|
2028
|
+
* // ... //
|
|
2029
|
+
* await room.getThreadsSince({ since: result.requestedAt });
|
|
2030
|
+
*/
|
|
2031
|
+
getThreadsSince(options: {
|
|
2032
|
+
since: Date;
|
|
2033
|
+
}): Promise<{
|
|
2034
|
+
threads: {
|
|
2035
|
+
updated: ThreadData<M>[];
|
|
2036
|
+
deleted: ThreadDeleteInfo[];
|
|
2037
|
+
};
|
|
2038
|
+
inboxNotifications: {
|
|
2039
|
+
updated: InboxNotificationData[];
|
|
2040
|
+
deleted: InboxNotificationDeleteInfo[];
|
|
2041
|
+
};
|
|
2042
|
+
requestedAt: Date;
|
|
2043
|
+
}>;
|
|
2044
|
+
/**
|
|
2045
|
+
* Returns a thread and the associated inbox notification if it exists.
|
|
2046
|
+
*
|
|
2047
|
+
* @example
|
|
2048
|
+
* const { thread, inboxNotification } = await room.getThread("th_xxx");
|
|
2049
|
+
*/
|
|
2050
|
+
getThread(threadId: string): Promise<{
|
|
2051
|
+
thread?: ThreadData<M>;
|
|
2052
|
+
inboxNotification?: InboxNotificationData;
|
|
2053
|
+
}>;
|
|
2054
|
+
/**
|
|
2055
|
+
* Creates a thread.
|
|
2056
|
+
*
|
|
2057
|
+
* @example
|
|
2058
|
+
* const thread = await room.createThread({
|
|
2059
|
+
* body: {
|
|
2060
|
+
* version: 1,
|
|
2061
|
+
* content: [{ type: "paragraph", children: [{ text: "Hello" }] }],
|
|
2062
|
+
* },
|
|
2063
|
+
* })
|
|
2064
|
+
*/
|
|
2065
|
+
createThread(options: {
|
|
2066
|
+
threadId?: string;
|
|
2067
|
+
commentId?: string;
|
|
2068
|
+
metadata: M | undefined;
|
|
2069
|
+
body: CommentBody;
|
|
2070
|
+
attachmentIds?: string[];
|
|
2071
|
+
}): Promise<ThreadData<M>>;
|
|
2072
|
+
/**
|
|
2073
|
+
* Deletes a thread.
|
|
2074
|
+
*
|
|
2075
|
+
* @example
|
|
2076
|
+
* await room.deleteThread("th_xxx");
|
|
2077
|
+
*/
|
|
2078
|
+
deleteThread(threadId: string): Promise<void>;
|
|
2079
|
+
/**
|
|
2080
|
+
* Edits a thread's metadata.
|
|
2081
|
+
* To delete an existing metadata property, set its value to `null`.
|
|
2082
|
+
*
|
|
2083
|
+
* @example
|
|
2084
|
+
* await room.editThreadMetadata({ threadId: "th_xxx", metadata: { x: 100, y: 100 } })
|
|
2085
|
+
*/
|
|
2086
|
+
editThreadMetadata(options: {
|
|
2087
|
+
metadata: Patchable<M>;
|
|
2088
|
+
threadId: string;
|
|
2089
|
+
}): Promise<M>;
|
|
2090
|
+
/**
|
|
2091
|
+
* Marks a thread as resolved.
|
|
2092
|
+
*
|
|
2093
|
+
* @example
|
|
2094
|
+
* await room.markThreadAsResolved("th_xxx");
|
|
2095
|
+
*/
|
|
2096
|
+
markThreadAsResolved(threadId: string): Promise<void>;
|
|
2097
|
+
/**
|
|
2098
|
+
* Marks a thread as unresolved.
|
|
2099
|
+
*
|
|
2100
|
+
* @example
|
|
2101
|
+
* await room.markThreadAsUnresolved("th_xxx");
|
|
2102
|
+
*/
|
|
2103
|
+
markThreadAsUnresolved(threadId: string): Promise<void>;
|
|
2104
|
+
/**
|
|
2105
|
+
* Creates a comment.
|
|
2106
|
+
*
|
|
2107
|
+
* @example
|
|
2108
|
+
* await room.createComment({
|
|
2109
|
+
* threadId: "th_xxx",
|
|
2110
|
+
* body: {
|
|
2111
|
+
* version: 1,
|
|
2112
|
+
* content: [{ type: "paragraph", children: [{ text: "Hello" }] }],
|
|
2113
|
+
* },
|
|
2114
|
+
* });
|
|
2115
|
+
*/
|
|
2116
|
+
createComment(options: {
|
|
2117
|
+
threadId: string;
|
|
2118
|
+
commentId?: string;
|
|
2119
|
+
body: CommentBody;
|
|
2120
|
+
attachmentIds?: string[];
|
|
2121
|
+
}): Promise<CommentData>;
|
|
2122
|
+
/**
|
|
2123
|
+
* Edits a comment.
|
|
2124
|
+
*
|
|
2125
|
+
* @example
|
|
2126
|
+
* await room.editComment({
|
|
2127
|
+
* threadId: "th_xxx",
|
|
2128
|
+
* commentId: "cm_xxx"
|
|
2129
|
+
* body: {
|
|
2130
|
+
* version: 1,
|
|
2131
|
+
* content: [{ type: "paragraph", children: [{ text: "Hello" }] }],
|
|
2132
|
+
* },
|
|
2133
|
+
* });
|
|
2134
|
+
*/
|
|
2135
|
+
editComment(options: {
|
|
2136
|
+
threadId: string;
|
|
2137
|
+
commentId: string;
|
|
2138
|
+
body: CommentBody;
|
|
2139
|
+
attachmentIds?: string[];
|
|
2140
|
+
}): Promise<CommentData>;
|
|
2141
|
+
/**
|
|
2142
|
+
* Deletes a comment.
|
|
2143
|
+
* If it is the last non-deleted comment, the thread also gets deleted.
|
|
2144
|
+
*
|
|
2145
|
+
* @example
|
|
2146
|
+
* await room.deleteComment({
|
|
2147
|
+
* threadId: "th_xxx",
|
|
2148
|
+
* commentId: "cm_xxx"
|
|
2149
|
+
* });
|
|
2150
|
+
*/
|
|
2151
|
+
deleteComment(options: {
|
|
2152
|
+
threadId: string;
|
|
2153
|
+
commentId: string;
|
|
2154
|
+
}): Promise<void>;
|
|
2155
|
+
/**
|
|
2156
|
+
* Adds a reaction from a comment for the current user.
|
|
2157
|
+
*
|
|
2158
|
+
* @example
|
|
2159
|
+
* await room.addReaction({ threadId: "th_xxx", commentId: "cm_xxx", emoji: "👍" })
|
|
2160
|
+
*/
|
|
2161
|
+
addReaction(options: {
|
|
2162
|
+
threadId: string;
|
|
2163
|
+
commentId: string;
|
|
2164
|
+
emoji: string;
|
|
2165
|
+
}): Promise<CommentUserReaction>;
|
|
2166
|
+
/**
|
|
2167
|
+
* Removes a reaction from a comment.
|
|
2168
|
+
*
|
|
2169
|
+
* @example
|
|
2170
|
+
* await room.removeReaction({ threadId: "th_xxx", commentId: "cm_xxx", emoji: "👍" })
|
|
2171
|
+
*/
|
|
2172
|
+
removeReaction(options: {
|
|
2173
|
+
threadId: string;
|
|
2174
|
+
commentId: string;
|
|
2175
|
+
emoji: string;
|
|
2176
|
+
}): Promise<void>;
|
|
2177
|
+
/**
|
|
2178
|
+
* Creates a local attachment from a file.
|
|
2179
|
+
*
|
|
2180
|
+
* @example
|
|
2181
|
+
* room.prepareAttachment(file);
|
|
2182
|
+
*/
|
|
2183
|
+
prepareAttachment(file: File): CommentLocalAttachment;
|
|
2184
|
+
/**
|
|
2185
|
+
* Uploads a local attachment.
|
|
2186
|
+
*
|
|
2187
|
+
* @example
|
|
2188
|
+
* const attachment = room.prepareAttachment(file);
|
|
2189
|
+
* await room.uploadAttachment(attachment);
|
|
2190
|
+
*/
|
|
2191
|
+
uploadAttachment(attachment: CommentLocalAttachment, options?: UploadAttachmentOptions): Promise<CommentAttachment>;
|
|
2192
|
+
/**
|
|
2193
|
+
* Returns a presigned URL for an attachment by its ID.
|
|
2194
|
+
*
|
|
2195
|
+
* @example
|
|
2196
|
+
* await room.getAttachmentUrl("at_xxx");
|
|
2197
|
+
*/
|
|
2198
|
+
getAttachmentUrl(attachmentId: string): Promise<string>;
|
|
2103
2199
|
/**
|
|
2104
2200
|
* Gets the user's notification settings for the current room.
|
|
2105
2201
|
*
|
|
@@ -2118,7 +2214,7 @@ declare type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extend
|
|
|
2118
2214
|
* Internal use only. Signature might change in the future.
|
|
2119
2215
|
*/
|
|
2120
2216
|
markInboxNotificationAsRead(notificationId: string): Promise<void>;
|
|
2121
|
-
}
|
|
2217
|
+
};
|
|
2122
2218
|
declare type Provider = {
|
|
2123
2219
|
synced: boolean;
|
|
2124
2220
|
getStatus: () => "loading" | "synchronizing" | "synchronized";
|
|
@@ -2149,6 +2245,7 @@ declare type PrivateRoomApi = {
|
|
|
2149
2245
|
explicitClose(event: IWebSocketCloseEvent): void;
|
|
2150
2246
|
rawSend(data: string): void;
|
|
2151
2247
|
};
|
|
2248
|
+
attachmentUrlsStore: BatchStore<string, string>;
|
|
2152
2249
|
};
|
|
2153
2250
|
declare type HistoryOp<P extends JsonObject> = Op | {
|
|
2154
2251
|
readonly type: "presence";
|
|
@@ -2188,29 +2285,6 @@ declare class CommentsApiError extends Error {
|
|
|
2188
2285
|
constructor(message: string, status: number, details?: JsonObject | undefined);
|
|
2189
2286
|
}
|
|
2190
2287
|
|
|
2191
|
-
declare type RenameDataField<T, TFieldName extends string> = T extends any ? {
|
|
2192
|
-
[K in keyof T as K extends "data" ? TFieldName : K]: T[K];
|
|
2193
|
-
} : never;
|
|
2194
|
-
declare type AsyncResult<T> = {
|
|
2195
|
-
readonly isLoading: true;
|
|
2196
|
-
readonly data?: never;
|
|
2197
|
-
readonly error?: never;
|
|
2198
|
-
} | {
|
|
2199
|
-
readonly isLoading: false;
|
|
2200
|
-
readonly data: T;
|
|
2201
|
-
readonly error?: never;
|
|
2202
|
-
} | {
|
|
2203
|
-
readonly isLoading: false;
|
|
2204
|
-
readonly data?: never;
|
|
2205
|
-
readonly error: Error;
|
|
2206
|
-
};
|
|
2207
|
-
declare type AsyncResultWithDataField<T, TDataField extends string> = RenameDataField<AsyncResult<T>, TDataField>;
|
|
2208
|
-
|
|
2209
|
-
declare type BatchStore<O, I> = Observable<void> & {
|
|
2210
|
-
get: (input: I) => Promise<void>;
|
|
2211
|
-
getState: (input: I) => AsyncResult<O> | undefined;
|
|
2212
|
-
};
|
|
2213
|
-
|
|
2214
2288
|
declare type Store<T> = {
|
|
2215
2289
|
get: () => T;
|
|
2216
2290
|
set: (callback: (currentState: T) => T) => void;
|
|
@@ -2798,6 +2872,8 @@ declare function assert(condition: boolean, errmsg: string): asserts condition;
|
|
|
2798
2872
|
*/
|
|
2799
2873
|
declare function nn<T>(value: T, errmsg?: string): NonNullable<T>;
|
|
2800
2874
|
|
|
2875
|
+
declare function chunk<T>(array: T[], size: number): T[][];
|
|
2876
|
+
|
|
2801
2877
|
declare function createThreadId(): string;
|
|
2802
2878
|
declare function createCommentId(): string;
|
|
2803
2879
|
declare function createInboxNotificationId(): string;
|
|
@@ -3140,4 +3216,4 @@ declare type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (En
|
|
|
3140
3216
|
[K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
|
|
3141
3217
|
};
|
|
3142
3218
|
|
|
3143
|
-
export { type AckOp, type ActivityData, type AsyncResult, type AsyncResultWithDataField, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type CacheState, type CacheStore, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, 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 CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LostConnectionEvent, type Lson, type LsonObject, type NoInfr, type NodeMap, NotificationsApiError, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalPromise, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialUnless, type Patchable, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type PrivateClientApi, type PrivateRoomApi, type QueryMetadata, type RejectedStorageOpServerMsg, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, type Status, type StorageStatus, type StorageUpdate, type Store, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type ThreadData, type ThreadDataPlain, type ThreadDeleteInfo, type ToImmutable, type ToJson, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type User, type UserJoinServerMsg, type UserLeftServerMsg, WebsocketCloseCodes, type YDocUpdateServerMsg, ackOp, addReaction, applyOptimisticUpdates, asPos, assert, assertNever, b64decode, cloneLson, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentId, createInboxNotificationId, createThreadId, deleteComment, deprecate, deprecateIf, detectDupes, errorIf, freeze, getMentionedIdsFromCommentBody, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, raise, removeReaction, shallow, stringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, upsertComment, wait, withTimeout };
|
|
3219
|
+
export { type AckOp, type ActivityData, type AsyncResult, type AsyncResultWithDataField, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type CacheState, type CacheStore, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LostConnectionEvent, type Lson, type LsonObject, type NoInfr, type NodeMap, NotificationsApiError, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalPromise, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialUnless, type Patchable, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type PrivateClientApi, type PrivateRoomApi, type QueryMetadata, type RejectedStorageOpServerMsg, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, type Status, type StorageStatus, type StorageUpdate, type Store, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type ThreadData, type ThreadDataPlain, type ThreadDeleteInfo, type ToImmutable, type ToJson, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, WebsocketCloseCodes, type YDocUpdateServerMsg, ackOp, addReaction, applyOptimisticUpdates, asPos, assert, assertNever, b64decode, chunk, cloneLson, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentId, createInboxNotificationId, createThreadId, deleteComment, deprecate, deprecateIf, detectDupes, errorIf, freeze, getMentionedIdsFromCommentBody, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, raise, removeReaction, shallow, stringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, upsertComment, wait, withTimeout };
|