@liveblocks/core 2.2.3-alpha1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -2058,25 +2058,27 @@ declare class CommentsApiError extends Error {
2058
2058
  constructor(message: string, status: number, details?: JsonObject | undefined);
2059
2059
  }
2060
2060
 
2061
- declare type BatchStoreStateLoading = {
2062
- isLoading: true;
2063
- data?: never;
2064
- error?: never;
2065
- };
2066
- declare type BatchStoreStateError = {
2067
- isLoading: false;
2068
- data?: never;
2069
- error: Error;
2070
- };
2071
- declare type BatchStoreStateSuccess<T> = {
2072
- isLoading: false;
2073
- data: T;
2074
- error?: never;
2061
+ declare type RenameDataField<T, TFieldName extends string> = T extends any ? {
2062
+ [K in keyof T as K extends "data" ? TFieldName : K]: T[K];
2063
+ } : never;
2064
+ declare type AsyncResult<T> = {
2065
+ readonly isLoading: true;
2066
+ readonly data?: never;
2067
+ readonly error?: never;
2068
+ } | {
2069
+ readonly isLoading: false;
2070
+ readonly data: T;
2071
+ readonly error?: never;
2072
+ } | {
2073
+ readonly isLoading: false;
2074
+ readonly data?: never;
2075
+ readonly error: Error;
2075
2076
  };
2076
- declare type BatchStoreState<T> = BatchStoreStateLoading | BatchStoreStateError | BatchStoreStateSuccess<T>;
2077
- declare type BatchStore<T, A extends unknown[]> = EventSource<BatchStoreState<T> | undefined> & {
2078
- get: (...args: A) => Promise<void>;
2079
- getState: (...args: A) => BatchStoreState<T> | undefined;
2077
+ declare type AsyncResultWithDataField<T, TDataField extends string> = RenameDataField<AsyncResult<T>, TDataField>;
2078
+
2079
+ declare type BatchStore<O, I> = Observable<void> & {
2080
+ get: (input: I) => Promise<void>;
2081
+ getState: (input: I) => AsyncResult<O> | undefined;
2080
2082
  };
2081
2083
 
2082
2084
  declare type Store<T> = {
@@ -2096,7 +2098,7 @@ declare type GetInboxNotificationsOptions = {
2096
2098
  since?: Date;
2097
2099
  };
2098
2100
 
2099
- declare type OptimisticUpdate<M extends BaseMetadata> = CreateThreadOptimisticUpdate<M> | DeleteThreadOptimisticUpdate | EditThreadMetadataOptimisticUpdate<M> | MarkThreadAsResolvedOptimisticUpdate | MarkThreadAsUnresolvedOptimisticUpdate | CreateCommentOptimisticUpdate | EditCommentOptimisticUpdate | DeleteCommentOptimisticUpdate | AddReactionOptimisticUpdate | RemoveReactionOptimisticUpdate | MarkInboxNotificationAsReadOptimisticUpdate | MarkAllInboxNotificationsAsReadOptimisticUpdate | UpdateNotificationSettingsOptimisticUpdate;
2101
+ declare type OptimisticUpdate<M extends BaseMetadata> = CreateThreadOptimisticUpdate<M> | DeleteThreadOptimisticUpdate | EditThreadMetadataOptimisticUpdate<M> | MarkThreadAsResolvedOptimisticUpdate | MarkThreadAsUnresolvedOptimisticUpdate | CreateCommentOptimisticUpdate | EditCommentOptimisticUpdate | DeleteCommentOptimisticUpdate | AddReactionOptimisticUpdate | RemoveReactionOptimisticUpdate | MarkInboxNotificationAsReadOptimisticUpdate | MarkAllInboxNotificationsAsReadOptimisticUpdate | DeleteInboxNotificationOptimisticUpdate | DeleteAllInboxNotificationsOptimisticUpdate | UpdateNotificationSettingsOptimisticUpdate;
2100
2102
  declare type CreateThreadOptimisticUpdate<M extends BaseMetadata> = {
2101
2103
  type: "create-thread";
2102
2104
  id: string;
@@ -2170,23 +2172,28 @@ declare type MarkInboxNotificationAsReadOptimisticUpdate = {
2170
2172
  readAt: Date;
2171
2173
  };
2172
2174
  declare type MarkAllInboxNotificationsAsReadOptimisticUpdate = {
2173
- type: "mark-inbox-notifications-as-read";
2175
+ type: "mark-all-inbox-notifications-as-read";
2174
2176
  id: string;
2175
2177
  readAt: Date;
2176
2178
  };
2179
+ declare type DeleteInboxNotificationOptimisticUpdate = {
2180
+ type: "delete-inbox-notification";
2181
+ id: string;
2182
+ inboxNotificationId: string;
2183
+ deletedAt: Date;
2184
+ };
2185
+ declare type DeleteAllInboxNotificationsOptimisticUpdate = {
2186
+ type: "delete-all-inbox-notifications";
2187
+ id: string;
2188
+ deletedAt: Date;
2189
+ };
2177
2190
  declare type UpdateNotificationSettingsOptimisticUpdate = {
2178
2191
  type: "update-notification-settings";
2179
2192
  id: string;
2180
2193
  roomId: string;
2181
2194
  settings: Partial<RoomNotificationSettings>;
2182
2195
  };
2183
- declare type QueryState = {
2184
- isLoading: true;
2185
- error?: never;
2186
- } | {
2187
- isLoading: false;
2188
- error?: Error;
2189
- };
2196
+ declare type QueryState = AsyncResult<undefined>;
2190
2197
  declare type CacheState<M extends BaseMetadata> = {
2191
2198
  /**
2192
2199
  * Threads by ID.
@@ -2291,8 +2298,8 @@ declare type PrivateClientApi<U extends BaseUserMeta, M extends BaseMetadata> =
2291
2298
  readonly currentUserIdStore: Store<string | null>;
2292
2299
  readonly resolveMentionSuggestions: ClientOptions<U>["resolveMentionSuggestions"];
2293
2300
  readonly cacheStore: CacheStore<BaseMetadata>;
2294
- readonly usersStore: BatchStore<U["info"] | undefined, [string]>;
2295
- readonly roomsInfoStore: BatchStore<DRI | undefined, [string]>;
2301
+ readonly usersStore: BatchStore<U["info"] | undefined, string>;
2302
+ readonly roomsInfoStore: BatchStore<DRI | undefined, string>;
2296
2303
  readonly getRoomIds: () => string[];
2297
2304
  };
2298
2305
  declare type NotificationsApi<M extends BaseMetadata> = {
@@ -2308,6 +2315,8 @@ declare type NotificationsApi<M extends BaseMetadata> = {
2308
2315
  getUnreadInboxNotificationsCount(): Promise<number>;
2309
2316
  markAllInboxNotificationsAsRead(): Promise<void>;
2310
2317
  markInboxNotificationAsRead(inboxNotificationId: string): Promise<void>;
2318
+ deleteAllInboxNotifications(): Promise<void>;
2319
+ deleteInboxNotification(inboxNotificationId: string): Promise<void>;
2311
2320
  };
2312
2321
  /**
2313
2322
  * @private Widest-possible Client type, matching _any_ Client instance. Note
@@ -2708,8 +2717,9 @@ declare function wait(millis: number): Promise<void>;
2708
2717
  declare function withTimeout<T>(promise: Promise<T>, millis: number, errmsg: string): Promise<T>;
2709
2718
  /**
2710
2719
  * Memoize a promise factory, so that each subsequent call will return the same
2711
- * pending or success promise, but if the promise rejects, the next call to the
2712
- * function will start a new promise.
2720
+ * pending or success promise. If the promise rejects, will retain that failed
2721
+ * promise for a small time period, after which the next attempt will reset the
2722
+ * memoized value.
2713
2723
  */
2714
2724
  declare function memoizeOnSuccess<T>(factoryFn: () => Promise<T>): () => Promise<T>;
2715
2725
 
@@ -2924,4 +2934,4 @@ declare type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (En
2924
2934
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
2925
2935
  };
2926
2936
 
2927
- export { type AckOp, type ActivityData, 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, deleteComment, deprecate, deprecateIf, detectDupes, errorIf, freeze, getMentionedIdsFromCommentBody, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, memoizeOnSuccess, nn, objectToQuery, patchLiveObjectKey, raise, removeReaction, shallow, stringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, upsertComment, wait, withTimeout };
2937
+ 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, deleteComment, deprecate, deprecateIf, detectDupes, errorIf, freeze, getMentionedIdsFromCommentBody, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, memoizeOnSuccess, nn, objectToQuery, patchLiveObjectKey, raise, removeReaction, shallow, stringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, upsertComment, wait, withTimeout };
package/dist/index.d.ts CHANGED
@@ -2058,25 +2058,27 @@ declare class CommentsApiError extends Error {
2058
2058
  constructor(message: string, status: number, details?: JsonObject | undefined);
2059
2059
  }
2060
2060
 
2061
- declare type BatchStoreStateLoading = {
2062
- isLoading: true;
2063
- data?: never;
2064
- error?: never;
2065
- };
2066
- declare type BatchStoreStateError = {
2067
- isLoading: false;
2068
- data?: never;
2069
- error: Error;
2070
- };
2071
- declare type BatchStoreStateSuccess<T> = {
2072
- isLoading: false;
2073
- data: T;
2074
- error?: never;
2061
+ declare type RenameDataField<T, TFieldName extends string> = T extends any ? {
2062
+ [K in keyof T as K extends "data" ? TFieldName : K]: T[K];
2063
+ } : never;
2064
+ declare type AsyncResult<T> = {
2065
+ readonly isLoading: true;
2066
+ readonly data?: never;
2067
+ readonly error?: never;
2068
+ } | {
2069
+ readonly isLoading: false;
2070
+ readonly data: T;
2071
+ readonly error?: never;
2072
+ } | {
2073
+ readonly isLoading: false;
2074
+ readonly data?: never;
2075
+ readonly error: Error;
2075
2076
  };
2076
- declare type BatchStoreState<T> = BatchStoreStateLoading | BatchStoreStateError | BatchStoreStateSuccess<T>;
2077
- declare type BatchStore<T, A extends unknown[]> = EventSource<BatchStoreState<T> | undefined> & {
2078
- get: (...args: A) => Promise<void>;
2079
- getState: (...args: A) => BatchStoreState<T> | undefined;
2077
+ declare type AsyncResultWithDataField<T, TDataField extends string> = RenameDataField<AsyncResult<T>, TDataField>;
2078
+
2079
+ declare type BatchStore<O, I> = Observable<void> & {
2080
+ get: (input: I) => Promise<void>;
2081
+ getState: (input: I) => AsyncResult<O> | undefined;
2080
2082
  };
2081
2083
 
2082
2084
  declare type Store<T> = {
@@ -2096,7 +2098,7 @@ declare type GetInboxNotificationsOptions = {
2096
2098
  since?: Date;
2097
2099
  };
2098
2100
 
2099
- declare type OptimisticUpdate<M extends BaseMetadata> = CreateThreadOptimisticUpdate<M> | DeleteThreadOptimisticUpdate | EditThreadMetadataOptimisticUpdate<M> | MarkThreadAsResolvedOptimisticUpdate | MarkThreadAsUnresolvedOptimisticUpdate | CreateCommentOptimisticUpdate | EditCommentOptimisticUpdate | DeleteCommentOptimisticUpdate | AddReactionOptimisticUpdate | RemoveReactionOptimisticUpdate | MarkInboxNotificationAsReadOptimisticUpdate | MarkAllInboxNotificationsAsReadOptimisticUpdate | UpdateNotificationSettingsOptimisticUpdate;
2101
+ declare type OptimisticUpdate<M extends BaseMetadata> = CreateThreadOptimisticUpdate<M> | DeleteThreadOptimisticUpdate | EditThreadMetadataOptimisticUpdate<M> | MarkThreadAsResolvedOptimisticUpdate | MarkThreadAsUnresolvedOptimisticUpdate | CreateCommentOptimisticUpdate | EditCommentOptimisticUpdate | DeleteCommentOptimisticUpdate | AddReactionOptimisticUpdate | RemoveReactionOptimisticUpdate | MarkInboxNotificationAsReadOptimisticUpdate | MarkAllInboxNotificationsAsReadOptimisticUpdate | DeleteInboxNotificationOptimisticUpdate | DeleteAllInboxNotificationsOptimisticUpdate | UpdateNotificationSettingsOptimisticUpdate;
2100
2102
  declare type CreateThreadOptimisticUpdate<M extends BaseMetadata> = {
2101
2103
  type: "create-thread";
2102
2104
  id: string;
@@ -2170,23 +2172,28 @@ declare type MarkInboxNotificationAsReadOptimisticUpdate = {
2170
2172
  readAt: Date;
2171
2173
  };
2172
2174
  declare type MarkAllInboxNotificationsAsReadOptimisticUpdate = {
2173
- type: "mark-inbox-notifications-as-read";
2175
+ type: "mark-all-inbox-notifications-as-read";
2174
2176
  id: string;
2175
2177
  readAt: Date;
2176
2178
  };
2179
+ declare type DeleteInboxNotificationOptimisticUpdate = {
2180
+ type: "delete-inbox-notification";
2181
+ id: string;
2182
+ inboxNotificationId: string;
2183
+ deletedAt: Date;
2184
+ };
2185
+ declare type DeleteAllInboxNotificationsOptimisticUpdate = {
2186
+ type: "delete-all-inbox-notifications";
2187
+ id: string;
2188
+ deletedAt: Date;
2189
+ };
2177
2190
  declare type UpdateNotificationSettingsOptimisticUpdate = {
2178
2191
  type: "update-notification-settings";
2179
2192
  id: string;
2180
2193
  roomId: string;
2181
2194
  settings: Partial<RoomNotificationSettings>;
2182
2195
  };
2183
- declare type QueryState = {
2184
- isLoading: true;
2185
- error?: never;
2186
- } | {
2187
- isLoading: false;
2188
- error?: Error;
2189
- };
2196
+ declare type QueryState = AsyncResult<undefined>;
2190
2197
  declare type CacheState<M extends BaseMetadata> = {
2191
2198
  /**
2192
2199
  * Threads by ID.
@@ -2291,8 +2298,8 @@ declare type PrivateClientApi<U extends BaseUserMeta, M extends BaseMetadata> =
2291
2298
  readonly currentUserIdStore: Store<string | null>;
2292
2299
  readonly resolveMentionSuggestions: ClientOptions<U>["resolveMentionSuggestions"];
2293
2300
  readonly cacheStore: CacheStore<BaseMetadata>;
2294
- readonly usersStore: BatchStore<U["info"] | undefined, [string]>;
2295
- readonly roomsInfoStore: BatchStore<DRI | undefined, [string]>;
2301
+ readonly usersStore: BatchStore<U["info"] | undefined, string>;
2302
+ readonly roomsInfoStore: BatchStore<DRI | undefined, string>;
2296
2303
  readonly getRoomIds: () => string[];
2297
2304
  };
2298
2305
  declare type NotificationsApi<M extends BaseMetadata> = {
@@ -2308,6 +2315,8 @@ declare type NotificationsApi<M extends BaseMetadata> = {
2308
2315
  getUnreadInboxNotificationsCount(): Promise<number>;
2309
2316
  markAllInboxNotificationsAsRead(): Promise<void>;
2310
2317
  markInboxNotificationAsRead(inboxNotificationId: string): Promise<void>;
2318
+ deleteAllInboxNotifications(): Promise<void>;
2319
+ deleteInboxNotification(inboxNotificationId: string): Promise<void>;
2311
2320
  };
2312
2321
  /**
2313
2322
  * @private Widest-possible Client type, matching _any_ Client instance. Note
@@ -2708,8 +2717,9 @@ declare function wait(millis: number): Promise<void>;
2708
2717
  declare function withTimeout<T>(promise: Promise<T>, millis: number, errmsg: string): Promise<T>;
2709
2718
  /**
2710
2719
  * Memoize a promise factory, so that each subsequent call will return the same
2711
- * pending or success promise, but if the promise rejects, the next call to the
2712
- * function will start a new promise.
2720
+ * pending or success promise. If the promise rejects, will retain that failed
2721
+ * promise for a small time period, after which the next attempt will reset the
2722
+ * memoized value.
2713
2723
  */
2714
2724
  declare function memoizeOnSuccess<T>(factoryFn: () => Promise<T>): () => Promise<T>;
2715
2725
 
@@ -2924,4 +2934,4 @@ declare type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (En
2924
2934
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
2925
2935
  };
2926
2936
 
2927
- export { type AckOp, type ActivityData, 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, deleteComment, deprecate, deprecateIf, detectDupes, errorIf, freeze, getMentionedIdsFromCommentBody, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, memoizeOnSuccess, nn, objectToQuery, patchLiveObjectKey, raise, removeReaction, shallow, stringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, upsertComment, wait, withTimeout };
2937
+ 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, deleteComment, deprecate, deprecateIf, detectDupes, errorIf, freeze, getMentionedIdsFromCommentBody, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, memoizeOnSuccess, nn, objectToQuery, patchLiveObjectKey, raise, removeReaction, shallow, stringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, upsertComment, wait, withTimeout };