stream-chat 10.0.0-rc.2 → 10.0.0-rc.21

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.
Files changed (298) hide show
  1. package/README.md +11 -8
  2. package/dist/cjs/index.browser.js +15397 -12090
  3. package/dist/cjs/index.browser.js.map +4 -4
  4. package/dist/cjs/index.node.js +15349 -11991
  5. package/dist/cjs/index.node.js.map +4 -4
  6. package/dist/esm/index.mjs +15164 -11880
  7. package/dist/esm/index.mjs.map +4 -4
  8. package/dist/types/ChannelManager.d.ts +246 -6
  9. package/dist/types/CooldownTimer.d.ts +22 -8
  10. package/dist/types/EventHandlerPipeline.d.ts +12 -16
  11. package/dist/types/LiveLocationManager.d.ts +69 -6
  12. package/dist/types/api-client.d.ts +22 -9
  13. package/dist/types/channel.d.ts +550 -300
  14. package/dist/types/channel_state.d.ts +167 -22
  15. package/dist/types/client.d.ts +325 -305
  16. package/dist/types/configuration/ConfigController.d.ts +172 -0
  17. package/dist/types/configuration/InstanceConfigurationRegistry.d.ts +192 -0
  18. package/dist/types/configuration/index.d.ts +3 -0
  19. package/dist/types/configuration/keys.d.ts +31 -0
  20. package/dist/types/configuration/shape.d.ts +58 -0
  21. package/dist/types/configuration/types.d.ts +206 -50
  22. package/dist/types/configuration/utils/applyInstanceConfiguration.d.ts +59 -0
  23. package/dist/types/configuration/utils/copyConfigPatch.d.ts +1 -0
  24. package/dist/types/configuration/utils/declarativeSlices.d.ts +24 -0
  25. package/dist/types/configuration/utils/deepFreezeConfig.d.ts +22 -0
  26. package/dist/types/configuration/utils/index.d.ts +1 -0
  27. package/dist/types/configuration/utils/serverAuthority.d.ts +49 -0
  28. package/dist/types/connection/ConnectionIdManager.d.ts +67 -0
  29. package/dist/types/connection/ConnectionRecoveryManager.d.ts +164 -0
  30. package/dist/types/connection/index.d.ts +4 -0
  31. package/dist/types/connection/networkConnection/NetworkConnectionObserver.d.ts +153 -0
  32. package/dist/types/connection/networkConnection/index.d.ts +3 -0
  33. package/dist/types/connection/networkConnection/reporters.d.ts +43 -0
  34. package/dist/types/connection/networkConnection/types.d.ts +55 -0
  35. package/dist/types/connection/wsConnection/StableWSConnection.d.ts +204 -0
  36. package/dist/types/connection/wsConnection/WSConnection.d.ts +168 -0
  37. package/dist/types/connection/wsConnection/WSConnectionFallback.d.ts +55 -0
  38. package/dist/types/connection/wsConnection/config.d.ts +51 -0
  39. package/dist/types/connection/wsConnection/index.d.ts +4 -0
  40. package/dist/types/connection/wsConnection/types.d.ts +99 -0
  41. package/dist/types/constants.d.ts +3 -1
  42. package/dist/types/entityStore/EntityStore.d.ts +160 -40
  43. package/dist/types/entityStore/StoreBackedItemIndex.d.ts +48 -29
  44. package/dist/types/entityStore/index.d.ts +0 -1
  45. package/dist/types/errors.d.ts +24 -4
  46. package/dist/types/formatMessageMemo.d.ts +5 -0
  47. package/dist/types/gen/chat/ChannelApi.d.ts +51 -23
  48. package/dist/types/gen/chat/ChatApi.d.ts +215 -168
  49. package/dist/types/gen/models/index.d.ts +2164 -557
  50. package/dist/types/gen/models/timestamp-guard.d.ts +22 -0
  51. package/dist/types/gen/moderation/ModerationApi.d.ts +39 -32
  52. package/dist/types/gen-imports.d.ts +1 -0
  53. package/dist/types/index.d.ts +20 -7
  54. package/dist/types/languageNames.d.ts +97 -0
  55. package/dist/types/logger.d.ts +1 -1
  56. package/dist/types/messageComposer/CustomDataManager.d.ts +7 -1
  57. package/dist/types/messageComposer/LocationComposer.d.ts +10 -4
  58. package/dist/types/messageComposer/attachmentIdentity.d.ts +11 -0
  59. package/dist/types/messageComposer/attachmentManager.d.ts +48 -10
  60. package/dist/types/messageComposer/attachmentUtils.d.ts +34 -0
  61. package/dist/types/messageComposer/configuration/commands.configuration.d.ts +1 -3
  62. package/dist/types/messageComposer/configuration/configuration.d.ts +9 -1
  63. package/dist/types/messageComposer/configuration/index.d.ts +0 -1
  64. package/dist/types/messageComposer/configuration/types.d.ts +57 -1
  65. package/dist/types/messageComposer/index.d.ts +1 -0
  66. package/dist/types/messageComposer/linkPreviewsManager.d.ts +10 -4
  67. package/dist/types/messageComposer/messageComposer.d.ts +210 -14
  68. package/dist/types/messageComposer/middleware/attachmentManager/postUpload/attachmentEnrichment.d.ts +20 -1
  69. package/dist/types/messageComposer/middleware/messageComposer/attachments.d.ts +11 -0
  70. package/dist/types/messageComposer/middleware/messageComposer/types.d.ts +2 -2
  71. package/dist/types/messageComposer/middleware/pollComposer/index.d.ts +1 -0
  72. package/dist/types/messageComposer/middleware/pollComposer/state.d.ts +3 -2
  73. package/dist/types/messageComposer/middleware/pollComposer/types.d.ts +9 -2
  74. package/dist/types/messageComposer/middleware/pollComposer/validation.d.ts +44 -0
  75. package/dist/types/messageComposer/middleware/textComposer/commands.d.ts +2 -2
  76. package/dist/types/messageComposer/middleware/textComposer/mentions.d.ts +94 -229
  77. package/dist/types/messageComposer/pollComposer.d.ts +8 -3
  78. package/dist/types/messageComposer/textComposer.d.ts +9 -1
  79. package/dist/types/messageComposer/types.d.ts +7 -3
  80. package/dist/types/messageDelivery/MessageDeliveryReporter.d.ts +64 -8
  81. package/dist/types/messageDelivery/MessageReceiptsTracker.d.ts +48 -11
  82. package/dist/types/messageOperations/FailedSendCache.d.ts +34 -0
  83. package/dist/types/messageOperations/MessageOperationStatePolicy.d.ts +52 -6
  84. package/dist/types/messageOperations/MessageOperations.d.ts +94 -11
  85. package/dist/types/{entityStore → messageOperations}/applyReactionLocally.d.ts +8 -2
  86. package/dist/types/messageOperations/createMessageOperations.d.ts +11 -0
  87. package/dist/types/messageOperations/index.d.ts +7 -1
  88. package/dist/types/messageOperations/reflectReactionEvent.d.ts +24 -0
  89. package/dist/types/messageOperations/sendOrdering.d.ts +17 -0
  90. package/dist/types/messageOperations/settlePendingAttachmentUploads.d.ts +28 -0
  91. package/dist/types/messageOperations/types.d.ts +66 -1
  92. package/dist/types/middleware.d.ts +8 -0
  93. package/dist/types/moderation.d.ts +18 -4
  94. package/dist/types/notifications/NotificationManager.d.ts +43 -2
  95. package/dist/types/notifications/types.d.ts +55 -42
  96. package/dist/types/offline-support/offline_support_api.d.ts +128 -12
  97. package/dist/types/offline-support/offline_sync_manager.d.ts +26 -5
  98. package/dist/types/offline-support/queueableOperations.d.ts +106 -0
  99. package/dist/types/offline-support/types.d.ts +77 -28
  100. package/dist/types/pagination/FilterBuilder.d.ts +1 -18
  101. package/dist/types/pagination/cursorDerivation/createdAtAroundPaginationFlags.d.ts +2 -1
  102. package/dist/types/pagination/cursorDerivation/linearPaginationFlags.d.ts +21 -3
  103. package/dist/types/pagination/filterCompiler.d.ts +5 -0
  104. package/dist/types/pagination/paginators/BasePaginator.d.ts +331 -7
  105. package/dist/types/pagination/paginators/ChannelPaginator.d.ts +54 -11
  106. package/dist/types/pagination/paginators/MessageIntervalPaginator.d.ts +283 -66
  107. package/dist/types/pagination/paginators/MessagePaginator.d.ts +10 -9
  108. package/dist/types/pagination/paginators/PinnedMessagePaginator.d.ts +17 -1
  109. package/dist/types/pagination/paginators/ReminderPaginator.d.ts +8 -8
  110. package/dist/types/pagination/paginators/ThreadPaginator.d.ts +57 -0
  111. package/dist/types/pagination/paginators/index.d.ts +1 -0
  112. package/dist/types/pagination/utility.normalization.d.ts +29 -2
  113. package/dist/types/poll.d.ts +41 -14
  114. package/dist/types/poll_manager.d.ts +3 -2
  115. package/dist/types/poll_optimistic_votes.d.ts +61 -0
  116. package/dist/types/reminders/Reminder.d.ts +17 -7
  117. package/dist/types/reminders/ReminderManager.d.ts +34 -6
  118. package/dist/types/search/BaseSearchSource.d.ts +50 -25
  119. package/dist/types/search/ChannelMemberSearchSource.d.ts +11 -6
  120. package/dist/types/search/ChannelSearchSource.d.ts +27 -5
  121. package/dist/types/search/MessageSearchSource.d.ts +36 -6
  122. package/dist/types/search/SearchController.d.ts +44 -11
  123. package/dist/types/search/UserSearchSource.d.ts +11 -5
  124. package/dist/types/search/types.d.ts +14 -1
  125. package/dist/types/signing.d.ts +0 -157
  126. package/dist/types/thread.d.ts +118 -62
  127. package/dist/types/thread_manager.d.ts +124 -35
  128. package/dist/types/token_manager.d.ts +5 -8
  129. package/dist/types/types.d.ts +138 -562
  130. package/dist/types/types.utility.d.ts +8 -0
  131. package/dist/types/upload-utils.d.ts +20 -0
  132. package/dist/types/uploadManager.d.ts +50 -2
  133. package/dist/types/utils/FixedSizeQueueCache.d.ts +2 -0
  134. package/dist/types/utils/WithSubscriptions.d.ts +1 -1
  135. package/dist/types/utils/objectPath.d.ts +49 -0
  136. package/dist/types/utils/time.d.ts +85 -0
  137. package/dist/types/utils.d.ts +63 -40
  138. package/package.json +22 -33
  139. package/src/ChannelManager.ts +561 -109
  140. package/src/CooldownTimer.ts +55 -45
  141. package/src/EventHandlerPipeline.ts +13 -23
  142. package/src/LiveLocationManager.ts +191 -37
  143. package/src/api-client.ts +144 -53
  144. package/src/channel.ts +1573 -1050
  145. package/src/channel_state.ts +239 -129
  146. package/src/client.ts +843 -892
  147. package/src/client_state.ts +2 -2
  148. package/src/configuration/ConfigController.ts +298 -0
  149. package/src/configuration/InstanceConfigurationRegistry.ts +430 -0
  150. package/src/configuration/index.ts +7 -0
  151. package/src/configuration/keys.ts +86 -0
  152. package/src/configuration/shape.ts +776 -0
  153. package/src/configuration/types.ts +218 -60
  154. package/src/configuration/utils/applyInstanceConfiguration.ts +184 -0
  155. package/src/configuration/utils/copyConfigPatch.ts +61 -0
  156. package/src/configuration/utils/declarativeSlices.ts +81 -0
  157. package/src/configuration/utils/deepFreezeConfig.ts +33 -0
  158. package/src/configuration/utils/index.ts +5 -0
  159. package/src/configuration/utils/serverAuthority.ts +146 -0
  160. package/src/connection/ConnectionIdManager.ts +153 -0
  161. package/src/connection/ConnectionRecoveryManager.ts +371 -0
  162. package/src/connection/index.ts +4 -0
  163. package/src/connection/networkConnection/NetworkConnectionObserver.ts +281 -0
  164. package/src/connection/networkConnection/index.ts +3 -0
  165. package/src/connection/networkConnection/reporters.ts +85 -0
  166. package/src/connection/networkConnection/types.ts +60 -0
  167. package/src/{connection.ts → connection/wsConnection/StableWSConnection.ts} +242 -151
  168. package/src/connection/wsConnection/WSConnection.ts +345 -0
  169. package/src/connection/wsConnection/WSConnectionFallback.ts +259 -0
  170. package/src/connection/wsConnection/config.ts +108 -0
  171. package/src/connection/wsConnection/index.ts +4 -0
  172. package/src/connection/wsConnection/types.ts +101 -0
  173. package/src/constants.ts +5 -3
  174. package/src/entityStore/EntityStore.ts +350 -10
  175. package/src/entityStore/StoreBackedItemIndex.ts +66 -37
  176. package/src/entityStore/index.ts +0 -1
  177. package/src/errors.ts +40 -7
  178. package/src/formatMessageMemo.ts +23 -0
  179. package/src/gen/chat/ChannelApi.ts +230 -44
  180. package/src/gen/chat/ChatApi.ts +1047 -1745
  181. package/src/gen/models/index.ts +2378 -3721
  182. package/src/gen/models/timestamp-guard.ts +27 -0
  183. package/src/gen/moderation/ModerationApi.ts +218 -388
  184. package/src/gen-imports.ts +1 -0
  185. package/src/index.ts +82 -6
  186. package/src/languageNames.ts +103 -0
  187. package/src/logger.ts +1 -1
  188. package/src/messageComposer/CustomDataManager.ts +10 -1
  189. package/src/messageComposer/LocationComposer.ts +68 -20
  190. package/src/messageComposer/attachmentIdentity.ts +39 -0
  191. package/src/messageComposer/attachmentManager.ts +191 -68
  192. package/src/messageComposer/attachmentUtils.ts +58 -0
  193. package/src/messageComposer/configuration/commands.configuration.ts +1 -26
  194. package/src/messageComposer/configuration/configuration.ts +22 -3
  195. package/src/messageComposer/configuration/index.ts +0 -1
  196. package/src/messageComposer/configuration/types.ts +58 -1
  197. package/src/messageComposer/index.ts +1 -0
  198. package/src/messageComposer/linkPreviewsManager.ts +16 -10
  199. package/src/messageComposer/messageComposer.ts +487 -98
  200. package/src/messageComposer/middleware/attachmentManager/postUpload/AttachmentPostUploadMiddlewareExecutor.ts +1 -1
  201. package/src/messageComposer/middleware/attachmentManager/postUpload/attachmentEnrichment.ts +58 -33
  202. package/src/messageComposer/middleware/attachmentManager/postUpload/uploadErrorHandler.ts +7 -2
  203. package/src/messageComposer/middleware/attachmentManager/preUpload/blockedUploadNotification.ts +3 -2
  204. package/src/messageComposer/middleware/messageComposer/attachments.ts +98 -1
  205. package/src/messageComposer/middleware/messageComposer/linkPreviews.ts +20 -10
  206. package/src/messageComposer/middleware/messageComposer/sharedLocation.ts +7 -2
  207. package/src/messageComposer/middleware/messageComposer/types.ts +2 -7
  208. package/src/messageComposer/middleware/messageComposer/userDataInjection.ts +11 -6
  209. package/src/messageComposer/middleware/pollComposer/index.ts +1 -0
  210. package/src/messageComposer/middleware/pollComposer/state.ts +43 -11
  211. package/src/messageComposer/middleware/pollComposer/types.ts +9 -2
  212. package/src/messageComposer/middleware/pollComposer/validation.ts +76 -0
  213. package/src/messageComposer/middleware/textComposer/commandUtils.ts +3 -2
  214. package/src/messageComposer/middleware/textComposer/commands.ts +1 -2
  215. package/src/messageComposer/middleware/textComposer/mentions.ts +91 -39
  216. package/src/messageComposer/pollComposer.ts +11 -3
  217. package/src/messageComposer/textComposer.ts +36 -4
  218. package/src/messageComposer/types.ts +19 -14
  219. package/src/messageDelivery/MessageDeliveryReporter.ts +154 -53
  220. package/src/messageDelivery/MessageReceiptsTracker.ts +136 -64
  221. package/src/messageOperations/FailedSendCache.ts +90 -0
  222. package/src/messageOperations/MessageOperationStatePolicy.ts +269 -27
  223. package/src/messageOperations/MessageOperations.ts +340 -136
  224. package/src/{entityStore → messageOperations}/applyReactionLocally.ts +10 -3
  225. package/src/messageOperations/createMessageOperations.ts +192 -0
  226. package/src/messageOperations/index.ts +7 -0
  227. package/src/messageOperations/reflectReactionEvent.ts +51 -0
  228. package/src/messageOperations/sendOrdering.ts +28 -0
  229. package/src/messageOperations/settlePendingAttachmentUploads.ts +110 -0
  230. package/src/messageOperations/types.ts +74 -0
  231. package/src/middleware.ts +11 -0
  232. package/src/moderation.ts +47 -24
  233. package/src/notifications/NotificationManager.ts +73 -3
  234. package/src/notifications/configuration.ts +10 -8
  235. package/src/notifications/types.ts +58 -42
  236. package/src/offline-support/offline_support_api.ts +380 -197
  237. package/src/offline-support/offline_sync_manager.ts +105 -32
  238. package/src/offline-support/queueableOperations.ts +270 -0
  239. package/src/offline-support/types.ts +85 -39
  240. package/src/pagination/FilterBuilder.ts +1 -22
  241. package/src/pagination/cursorDerivation/createdAtAroundPaginationFlags.ts +11 -7
  242. package/src/pagination/cursorDerivation/linearPaginationFlags.ts +25 -7
  243. package/src/pagination/filterCompiler.ts +17 -0
  244. package/src/pagination/paginators/BasePaginator.ts +731 -81
  245. package/src/pagination/paginators/ChannelPaginator.ts +210 -102
  246. package/src/pagination/paginators/MessageIntervalPaginator.ts +703 -193
  247. package/src/pagination/paginators/MessagePaginator.ts +45 -36
  248. package/src/pagination/paginators/PinnedMessagePaginator.ts +74 -28
  249. package/src/pagination/paginators/ReminderPaginator.ts +15 -13
  250. package/src/pagination/paginators/ThreadPaginator.ts +181 -0
  251. package/src/pagination/paginators/UserGroupPaginator.ts +8 -1
  252. package/src/pagination/paginators/index.ts +1 -0
  253. package/src/pagination/utility.normalization.ts +37 -9
  254. package/src/poll.ts +189 -112
  255. package/src/poll_manager.ts +14 -8
  256. package/src/poll_optimistic_votes.ts +335 -0
  257. package/src/reminders/Reminder.ts +34 -16
  258. package/src/reminders/ReminderManager.ts +68 -41
  259. package/src/reminders/ReminderTimer.ts +7 -6
  260. package/src/search/BaseSearchSource.ts +133 -40
  261. package/src/search/ChannelMemberSearchSource.ts +27 -18
  262. package/src/search/ChannelSearchSource.ts +61 -7
  263. package/src/search/MessageSearchSource.ts +133 -28
  264. package/src/search/SearchController.ts +93 -16
  265. package/src/search/UserSearchSource.ts +27 -13
  266. package/src/search/types.ts +14 -1
  267. package/src/signing.ts +1 -315
  268. package/src/thread.ts +503 -511
  269. package/src/thread_manager.ts +339 -204
  270. package/src/token_manager.ts +12 -32
  271. package/src/types.ts +159 -780
  272. package/src/types.utility.ts +14 -0
  273. package/src/upload-utils.ts +53 -0
  274. package/src/uploadManager.ts +85 -7
  275. package/src/utils/FixedSizeQueueCache.ts +5 -0
  276. package/src/utils/WithSubscriptions.ts +1 -1
  277. package/src/utils/objectPath.ts +67 -0
  278. package/src/utils/time.ts +104 -0
  279. package/src/utils.ts +209 -157
  280. package/dist/types/base64.d.ts +0 -2
  281. package/dist/types/configuration/InstanceConfigurationService.d.ts +0 -26
  282. package/dist/types/connection.d.ts +0 -146
  283. package/dist/types/connection_fallback.d.ts +0 -42
  284. package/dist/types/gen/model-decoders/decoders.d.ts +0 -3
  285. package/dist/types/gen/model-decoders/event-decoder-mapping.d.ts +0 -6
  286. package/dist/types/insights.d.ts +0 -58
  287. package/dist/types/pagination/utility.queryChannel.d.ts +0 -26
  288. package/dist/types/permissions.d.ts +0 -55
  289. package/dist/types/store.d.ts +0 -125
  290. package/src/base64.ts +0 -78
  291. package/src/configuration/InstanceConfigurationService.ts +0 -73
  292. package/src/connection_fallback.ts +0 -215
  293. package/src/gen/model-decoders/decoders.ts +0 -2680
  294. package/src/gen/model-decoders/event-decoder-mapping.ts +0 -198
  295. package/src/insights.ts +0 -83
  296. package/src/pagination/utility.queryChannel.ts +0 -84
  297. package/src/permissions.ts +0 -102
  298. package/src/store.ts +0 -304
@@ -1,30 +1,63 @@
1
- import { StateStore } from '../store';
2
- import type { MessageResponse } from '../types';
1
+ import { StateStore } from '@stream-io/state-store';
2
+ import type { StreamChat } from '../client';
3
3
  import type { SearchSource } from './BaseSearchSource';
4
4
  export type SearchControllerState = {
5
5
  isActive: boolean;
6
6
  searchQuery: string;
7
7
  sources: SearchSource[];
8
8
  };
9
- export type InternalSearchControllerState = {
10
- focusedMessage?: MessageResponse;
11
- };
12
9
  export type SearchControllerConfig = {
13
10
  keepSingleActiveSource: boolean;
14
11
  };
15
12
  export type SearchControllerOptions = {
13
+ /**
14
+ * Required for this controller to take part in `client.config`.
15
+ *
16
+ * It is the one configurable class this package never constructs — an app or a downstream SDK does
17
+ * (`<Chat>` in `stream-chat-react`) — so there is no other route by which it could find the
18
+ * configuration registry. Left out, the controller still works and `updateConfig` still applies;
19
+ * only the declarative key and its setup function go unheard.
20
+ */
21
+ client?: StreamChat;
16
22
  config?: Partial<SearchControllerConfig>;
17
23
  sources?: SearchSource[];
18
24
  };
25
+ export declare const DEFAULT_SEARCH_CONTROLLER_CONFIG: SearchControllerConfig;
19
26
  export declare class SearchController {
27
+ state: StateStore<SearchControllerState>;
28
+ /** The shared configuration machinery — see {@link ConfigController}. */
29
+ private readonly configController;
30
+ private readonly client?;
31
+ /** Teardown for the configuration subscription, when this controller was given a client. */
32
+ private unsubscribeConfiguration?;
20
33
  /**
21
- * Not intended for direct use by integrators, might be removed without notice resulting in
22
- * broken integrations.
34
+ * Resolved configuration, as a store so consumers can react to it — the same shape every configurable
35
+ * class exposes (`configState` for the store, {@link config} for the current value).
23
36
  */
24
- _internalState: StateStore<InternalSearchControllerState>;
25
- state: StateStore<SearchControllerState>;
26
- config: SearchControllerConfig;
27
- constructor({ config, sources }?: SearchControllerOptions);
37
+ get configState(): StateStore<SearchControllerConfig>;
38
+ constructor({ client, config, sources }?: SearchControllerOptions);
39
+ private subscribeConfiguration;
40
+ /**
41
+ * Takes again what {@link SearchController.dispose} released: the configuration subscription and
42
+ * whatever each source holds outside itself. A no-op for what is already held, so a UI can call it
43
+ * on every mount, including a remount of the same instance after its cleanup disposed it.
44
+ */
45
+ registerSubscriptions(): void;
46
+ /**
47
+ * Releases the configuration subscription, running the setup function's teardown, and what each
48
+ * source holds outside itself, such as a channel search's hold on its results in the channel
49
+ * store. {@link SearchController.registerSubscriptions} takes them again.
50
+ */
51
+ dispose(): void;
52
+ /**
53
+ * The current resolved configuration. `Readonly` because the value is the store's live object —
54
+ * assigning to a field of it would change state without notifying anyone. Use {@link updateConfig}.
55
+ */
56
+ get config(): Readonly<SearchControllerConfig>;
57
+ /** Merges a partial configuration into the resolved config and notifies subscribers. */
58
+ updateConfig(config: Partial<SearchControllerConfig>): void;
59
+ /** Rebuilds the resolved configuration from package defaults plus the declarative slice. */
60
+ initializeConfig(config?: Partial<SearchControllerConfig>): void;
28
61
  get hasNext(): boolean;
29
62
  get sources(): SearchSource<any>[];
30
63
  get activeSources(): SearchSource<any>[];
@@ -1,21 +1,27 @@
1
- import { BaseSearchSource } from './BaseSearchSource';
1
+ import { BaseSearchSource, type SearchQueryOptions } from './BaseSearchSource';
2
2
  import { FilterBuilder, type FilterBuilderOptions } from '../pagination';
3
3
  import type { StreamChat } from '../client';
4
- import type { UserFilters, UserOptions, UserResponse, UserSort } from '../types';
4
+ import type { SortParamRequest, UserFilters, UserOptions, UserResponse } from '../types';
5
5
  import type { SearchSourceOptions } from './types';
6
6
  type CustomContext = Record<string, unknown>;
7
7
  export type UserSearchSourceFilterBuilderContext<C extends CustomContext = CustomContext> = {
8
8
  searchQuery?: string;
9
9
  } & C;
10
+ export type UserSearchSourceOptions = SearchSourceOptions & {
11
+ /** Static base filters merged under the dynamically generated ones. */
12
+ filters?: UserFilters;
13
+ sort?: SortParamRequest[];
14
+ searchOptions?: Omit<UserOptions, 'limit' | 'offset'>;
15
+ };
10
16
  export declare class UserSearchSource<TFilterContext extends CustomContext = CustomContext> extends BaseSearchSource<UserResponse> {
11
17
  readonly type = "users";
12
18
  client: StreamChat;
13
19
  filters: UserFilters | undefined;
14
- sort: UserSort | undefined;
20
+ sort: SortParamRequest[] | undefined;
15
21
  searchOptions: Omit<UserOptions, 'limit' | 'offset'> | undefined;
16
22
  filterBuilder: FilterBuilder<UserFilters, UserSearchSourceFilterBuilderContext<TFilterContext>>;
17
- constructor(client: StreamChat, options?: SearchSourceOptions, filterBuilderOptions?: FilterBuilderOptions<UserFilters, UserSearchSourceFilterBuilderContext<TFilterContext>>);
18
- protected query(searchQuery: string): Promise<{
23
+ constructor(client: StreamChat, options?: UserSearchSourceOptions, filterBuilderOptions?: FilterBuilderOptions<UserFilters, UserSearchSourceFilterBuilderContext<TFilterContext>>);
24
+ protected query(searchQuery: string, queryOptions?: SearchQueryOptions): Promise<{
19
25
  items: import("..").FullUserResponse[];
20
26
  }>;
21
27
  protected filterQueryResults(items: UserResponse[]): UserResponse[];
@@ -9,8 +9,21 @@ export type SearchSourceState<T = any> = {
9
9
  offset?: number;
10
10
  };
11
11
  export type SearchSourceOptions = {
12
- /** The number of milliseconds to debounce the search query (defaults to `300`). */
12
+ /**
13
+ * Legacy single debounce interval. When set, it applies to both short and long queries,
14
+ * unless overridden by `shortQueryDebounceMs` / `longQueryDebounceMs`.
15
+ */
13
16
  debounceMs?: number;
17
+ /**
18
+ * Debounce interval for queries no longer than `shortQueryMaxLength`. Such queries have
19
+ * low selectivity and are expensive server-side, so they are debounced harder.
20
+ * Defaults to 500ms.
21
+ */
22
+ shortQueryDebounceMs?: number;
23
+ /** Debounce interval for queries longer than `shortQueryMaxLength`. Defaults to 300ms. */
24
+ longQueryDebounceMs?: number;
25
+ /** Query length (inclusive) that still counts as short. Defaults to 2. */
26
+ shortQueryMaxLength?: number;
14
27
  pageSize?: number;
15
28
  /** When `true`, the source can execute queries with an empty search string (defaults to `false`). */
16
29
  allowEmptySearchString?: boolean;
@@ -1,24 +1,3 @@
1
- import jwt from 'jsonwebtoken';
2
- import type { UR } from './types';
3
- import type { WSEvent } from './gen/models';
4
- /**
5
- * Creates the JWT token that can be used for a user session.
6
- *
7
- * @param apiSecret - API secret key.
8
- * @param userId - The `user_id` key in the JWT payload.
9
- * @param extraData - Extra data that should be part of the JWT token (optional, defaults to `{}`).
10
- * @param jwtOptions - Options that can be passed to `jwt.sign` (optional, defaults to `{}`).
11
- * @returns The signed JWT token.
12
- */
13
- export declare function JWTUserToken(apiSecret: jwt.Secret, userId: string, extraData?: UR, jwtOptions?: jwt.SignOptions): string;
14
- /**
15
- * Creates the JWT token that can be used for a server-side session.
16
- *
17
- * @param apiSecret - API secret key.
18
- * @param jwtOptions - Options that can be passed to `jwt.sign` (optional, defaults to `{}`).
19
- * @returns The signed JWT token.
20
- */
21
- export declare function JWTServerToken(apiSecret: jwt.Secret, jwtOptions?: jwt.SignOptions): string;
22
1
  /**
23
2
  * Decodes a JWT token and returns the embedded `user_id`.
24
3
  *
@@ -26,139 +5,3 @@ export declare function JWTServerToken(apiSecret: jwt.Secret, jwtOptions?: jwt.S
26
5
  * @returns The `user_id` extracted from the token's payload, or an empty string when the token is malformed.
27
6
  */
28
7
  export declare function UserFromToken(token: string): string;
29
- /**
30
- * Generates a development token for the given user.
31
- *
32
- * Development tokens are unsigned and must only be used in environments where token validation is disabled.
33
- *
34
- * @param userId - The ID of the user.
35
- * @returns The development token.
36
- */
37
- export declare function DevToken(userId: string): string;
38
- /**
39
- * Constant-time HMAC-SHA256 verification of `signature` against the digest of `body` using `secret`
40
- * as the key. The signature is always computed over the **uncompressed** JSON bytes, so callers that
41
- * decoded a gzipped or base64-wrapped payload must pass the inflated bytes here.
42
- *
43
- * The legacy `client.verifyWebhook` helper wraps this function, so callers that have already
44
- * migrated to {@link verifyAndParseWebhook}, {@link parseSqs}, or {@link parseSns} rarely need to
45
- * invoke this directly.
46
- *
47
- * @param body - The uncompressed payload bytes that Stream signed.
48
- * @param signature - The HMAC-SHA256 signature delivered alongside the payload.
49
- * @param secret - Your app's API secret used as the HMAC key.
50
- * @returns `true` when the signature matches the digest of `body`, otherwise `false`.
51
- */
52
- export declare function verifySignature(body: string | Buffer, signature: string, secret: string): boolean;
53
- /**
54
- * Verifies an HMAC-SHA256 signature with the legacy parameter order.
55
- *
56
- * @param body - The uncompressed payload bytes that Stream signed.
57
- * @param secret - Your app's API secret used as the HMAC key.
58
- * @param signature - The HMAC-SHA256 signature delivered alongside the payload.
59
- * @returns `true` when the signature matches the digest of `body`, otherwise `false`.
60
- * @deprecated Use {@link verifySignature} instead — same logic, parameters reordered to match the
61
- * cross-SDK contract (`verifySignature(body, signature, secret)`).
62
- */
63
- export declare function CheckSignature(body: string | Buffer, secret: string, signature: string): boolean;
64
- /**
65
- * Canonical failure-mode messages for {@link InvalidWebhookError}.
66
- *
67
- * Customers that prefer exact-match filtering (security logging, retry
68
- * policy) over substring matches can compare `err.message` to these
69
- * constants instead of pattern-matching free-form text.
70
- */
71
- export declare const InvalidWebhookErrorMessages: {
72
- readonly signatureMismatch: "signature mismatch";
73
- readonly invalidBase64: "invalid base64 encoding";
74
- readonly gzipFailed: "gzip decompression failed";
75
- readonly invalidJson: "invalid JSON payload";
76
- };
77
- /**
78
- * Thrown by {@link verifyAndParseWebhook} when the supplied `x-signature` does not
79
- * match the HMAC of the uncompressed payload, and by all webhook helpers (including
80
- * {@link parseSqs} / {@link parseSns}) when a gzip / base64 / JSON envelope is malformed.
81
- *
82
- * The message identifies which failure mode fired. See
83
- * {@link InvalidWebhookErrorMessages} for the canonical strings.
84
- */
85
- export declare class InvalidWebhookError extends Error {
86
- name: string;
87
- constructor(message?: string);
88
- }
89
- /**
90
- * Returns `body` as a `Buffer`, gzip-decompressed when its first two bytes match the gzip magic
91
- * (`1f 8b`, per RFC 1952). When the body is plain JSON (no compression, or middleware already
92
- * decompressed), the bytes are returned unchanged.
93
- *
94
- * Magic-byte detection (rather than relying on a header) keeps the same handler correct when
95
- * middleware — Express, Next.js, AWS Lambda — auto-decompresses the request before your code sees it.
96
- *
97
- * @param rawBody - The raw HTTP request body, either as a string or a `Buffer`.
98
- * @returns The uncompressed payload bytes.
99
- * @throws {@link InvalidWebhookError} when the gzip envelope is malformed.
100
- */
101
- export declare function gunzipPayload(rawBody: string | Buffer): Buffer;
102
- /**
103
- * Reverses the SQS firehose envelope: the message `Body` is base64-decoded, then the result is
104
- * gzip-decompressed when it begins with the gzip magic. Returns the raw JSON `Buffer` Stream signed.
105
- *
106
- * SQS bodies are always base64-encoded so they remain valid UTF-8 over the queue. The same call
107
- * works whether or not Stream is currently compressing payloads for this app.
108
- *
109
- * @param body - The base64-encoded SQS message body.
110
- * @returns The decoded (and decompressed, when gzipped) payload bytes.
111
- * @throws {@link InvalidWebhookError} when the body is not canonical base64 or the gzip envelope is malformed.
112
- */
113
- export declare function decodeSqsPayload(body: string): Buffer;
114
- /**
115
- * Reverses an SNS HTTP notification envelope. When `notificationBody` is a JSON envelope
116
- * (`{"Type":"Notification","MessageRequest":"..."}`), the inner `MessageRequest` field is extracted and run
117
- * through the SQS pipeline (base64-decode, then gzip-if-magic). When the input is not a JSON
118
- * envelope it is treated as the already-extracted `MessageRequest` string, so call sites that pre-unwrap
119
- * continue to work.
120
- *
121
- * @param notificationBody - The raw SNS notification body, or a pre-extracted `MessageRequest` string.
122
- * @returns The decoded (and decompressed, when gzipped) payload bytes.
123
- * @throws {@link InvalidWebhookError} when the body is not canonical base64 or the gzip envelope is malformed.
124
- */
125
- export declare function decodeSnsPayload(notificationBody: string): Buffer;
126
- /**
127
- * Parses a JSON-encoded webhook event into a typed {@link WSEvent}. New event types Stream
128
- * introduces still parse successfully — the runtime shape is the JSON Stream sent and the `type`
129
- * field stays preserved.
130
- *
131
- * @param payload - The raw event payload bytes or string.
132
- * @returns The parsed WebSocket event.
133
- * @throws {@link InvalidWebhookError} when the payload is not valid JSON.
134
- */
135
- export declare function parseEvent(payload: Buffer | string): WSEvent;
136
- /**
137
- * Decompress (when gzipped), verify the HMAC `signature`, and return the parsed {@link WSEvent}.
138
- *
139
- * @param rawBody - Raw HTTP request body bytes Stream signed.
140
- * @param signature - Value of the `X-Signature` header.
141
- * @param secret - Your app's API secret.
142
- * @returns The parsed WebSocket event.
143
- * @throws {@link InvalidWebhookError} when the signature does not match or the gzip envelope is malformed.
144
- */
145
- export declare function verifyAndParseWebhook(rawBody: string | Buffer, signature: string, secret: string): WSEvent;
146
- /**
147
- * Decodes the SQS message `Body` (base64, then gzip-if-magic) and returns the parsed {@link WSEvent}.
148
- * Stream does not attach an application-level HMAC to SQS deliveries — use
149
- * {@link verifyAndParseWebhook} for HTTP webhooks.
150
- *
151
- * @param messageBody - The base64-encoded SQS message body.
152
- * @returns The parsed WebSocket event.
153
- * @throws {@link InvalidWebhookError} when the body is malformed.
154
- */
155
- export declare function parseSqs(messageBody: string): WSEvent;
156
- /**
157
- * Decodes an SNS notification (unwraps the JSON envelope when needed; same inner format as SQS).
158
- * No application-level HMAC verification.
159
- *
160
- * @param notificationBody - The raw SNS notification body, or a pre-extracted `MessageRequest` string.
161
- * @returns The parsed WebSocket event.
162
- * @throws {@link InvalidWebhookError} when the body is malformed.
163
- */
164
- export declare function parseSns(notificationBody: string): WSEvent;
@@ -1,12 +1,15 @@
1
- import { StateStore } from './store';
2
- import type { DraftResponse, EventAPIResponse, LocalMessage, MarkReadRequest, MessageResponse, ReactionRequest, SendReactionRequest, ThreadStateResponse, UserResponse } from './types';
3
- import type { Channel, DeleteMessageWithStateUpdateParams, SendMessageWithStateUpdateParams, UpdateMessageWithStateUpdateParams } from './channel';
1
+ import { StateStore } from '@stream-io/state-store';
2
+ import type { DraftResponse, EventPayload, LocalMessage, MarkReadRequest, MarkReadResponse, MessageResponse, StreamResponse, ThreadStateResponse, TimestampNS, UserResponse } from './types';
3
+ import type { Channel } from './channel';
4
4
  import type { StreamChat } from './client';
5
5
  import type { CustomThreadData } from './custom_types';
6
6
  import { MessageComposer } from './messageComposer';
7
- import { MessageOperations } from './messageOperations';
7
+ import type { MessageOperations } from './messageOperations';
8
8
  import { WithSubscriptions } from './utils/WithSubscriptions';
9
9
  import { MessagePaginator } from './pagination';
10
+ import type { MergeNewestPageOptions } from './pagination';
11
+ import type { ThreadDeclarativeConfig } from './configuration/types';
12
+ import type { PipelineEvent } from './EventHandlerPipeline';
10
13
  export type ThreadState = {
11
14
  /**
12
15
  * Determines if the thread is currently opened and on-screen. When the thread is active,
@@ -14,9 +17,11 @@ export type ThreadState = {
14
17
  */
15
18
  active: boolean;
16
19
  channel: Channel;
17
- createdAt: Date;
20
+ /** Unix nanoseconds, as the API sends it. */
21
+ createdAt: TimestampNS;
18
22
  custom: CustomThreadData;
19
- deletedAt: Date | null;
23
+ /** Unix nanoseconds, as the API sends it. */
24
+ deletedAt: TimestampNS | null;
20
25
  isLoading: boolean;
21
26
  isStateStale: boolean;
22
27
  /**
@@ -28,10 +33,12 @@ export type ThreadState = {
28
33
  read: ThreadReadState;
29
34
  replyCount: number;
30
35
  title: string;
31
- updatedAt: Date | null;
36
+ /** Unix nanoseconds, as the API sends it. */
37
+ updatedAt: TimestampNS | null;
32
38
  };
33
39
  export type ThreadUserReadState = {
34
- lastReadAt: Date;
40
+ /** Unix nanoseconds, as the API sends it. */
41
+ lastReadAt: TimestampNS;
35
42
  unreadMessageCount: number;
36
43
  user: UserResponse;
37
44
  lastReadMessageId?: string;
@@ -41,21 +48,30 @@ export type ThreadReadState = Record<string, ThreadUserReadState | undefined>;
41
48
  export type CustomThreadMarkReadRequestFn = (params: {
42
49
  thread: Thread;
43
50
  options?: MarkReadRequest;
44
- }) => Promise<EventAPIResponse | null> | void;
45
- export type ThreadInstanceConfig = {
51
+ }) => Promise<Partial<StreamResponse<MarkReadResponse>> | null> | void;
52
+ export type ThreadConfig = {
46
53
  requestHandlers?: {
47
54
  markReadRequest?: CustomThreadMarkReadRequestFn;
48
55
  };
49
56
  };
57
+ /**
58
+ * Empty because every field of `ThreadConfig` is optional — a thread's own configuration is one handler
59
+ * wide. Declared and frozen anyway, so the entity carries the same defaults layer as every other
60
+ * configurable class rather than a special case.
61
+ */
62
+ export declare const DEFAULT_THREAD_CONFIG: ThreadConfig;
50
63
  export declare class Thread extends WithSubscriptions {
51
- readonly configState: StateStore<ThreadInstanceConfig>;
64
+ /** The shared configuration machinery — see {@link ConfigController}. */
65
+ private readonly configController;
52
66
  readonly state: StateStore<ThreadState>;
53
67
  readonly id: string;
54
68
  readonly messageComposer: MessageComposer;
55
- readonly messagePaginator: MessagePaginator;
56
69
  readonly messageOperations: MessageOperations;
70
+ readonly messagePaginator: MessagePaginator;
57
71
  private client;
58
72
  private failedRepliesMap;
73
+ /** How many activations (`activate()` calls) have not been released yet. */
74
+ private _activeRefCount;
59
75
  constructor({ client, threadData, channel, parentMessage, draft, }: {
60
76
  client: StreamChat;
61
77
  threadData?: ThreadStateResponse;
@@ -63,24 +79,101 @@ export declare class Thread extends WithSubscriptions {
63
79
  parentMessage?: MessageResponse | LocalMessage;
64
80
  draft?: DraftResponse;
65
81
  });
82
+ /**
83
+ * Derives this thread's configuration — and its reply paginator's — from the declarative slice.
84
+ *
85
+ * Called by the constructor and by `client.config.reset()`. The thread owns only its own
86
+ * `requestHandlers`; the paginator derives its own configuration.
87
+ */
88
+ initializeConfig(declarativeConfig?: ThreadDeclarativeConfig): void;
89
+ /**
90
+ * Resolved configuration as a store, so consumers can react to it — the shape every configurable class
91
+ * exposes.
92
+ */
93
+ get configState(): StateStore<ThreadConfig>;
94
+ /**
95
+ * This thread's resolved configuration. `Readonly` because the value is the store's live object —
96
+ * assigning to a field of it would change state without notifying anyone. Use {@link updateConfig}.
97
+ */
98
+ get config(): Readonly<ThreadConfig>;
99
+ /** Merges a partial configuration into the resolved config and notifies subscribers. */
100
+ updateConfig(config: Partial<ThreadConfig>): void;
66
101
  get channel(): Channel;
67
102
  get hasStaleState(): boolean;
68
103
  get ownUnreadCount(): number;
69
- activate: () => void;
70
- deactivate: () => void;
104
+ /**
105
+ * Declares that a consumer is displaying this thread, and returns the function that ends it, as
106
+ * `channel.activate()` does. Refcounted, as one `Thread` can be held by several consumers at once,
107
+ * so it stays active until the last one releases. Each call gets its own release, and calling a
108
+ * release again does nothing, so a consumer can't end another one's activation.
109
+ *
110
+ * `active` is also what {@link ConnectionRecoveryManager} filters on to decide which threads to
111
+ * reload on reconnect, so an activation that is never released costs more than a missed auto-read.
112
+ *
113
+ * The first activation also keeps the thread in `client.threads` for the rest of the session:
114
+ * it stays subscribed and resolvable through `client.threads.get(id)` after it is released,
115
+ * whether or not the thread list holds it. Reopening it therefore needs no fetch unless it went stale.
116
+ */
117
+ activate: () => (() => void);
118
+ /**
119
+ * Re-queries this thread's replies, sized to the loaded window, and reconciles them in place — the
120
+ * thread analogue of {@link Channel.reload}, and what connection recovery calls for every active
121
+ * thread.
122
+ *
123
+ * Preserves failed (unsent) replies. They are read out of the reply paginator rather than out of
124
+ * `failedRepliesMap`, because that map is only written by `upsertReplyLocally`, whose callers are
125
+ * this thread's own subscriptions and the offline-DB path resolved through `client.threads.get` —
126
+ * neither of which covers a thread that was never activated or listed. Reading the paginator
127
+ * is true for registered and unregistered threads alike. An overlap merge keeps them anyway (the
128
+ * reconcile's provenance guard never prunes a non-server message); only a disjoint rebuild can drop
129
+ * them, so any that actually fell out are re-ingested below.
130
+ *
131
+ * Rethrows, except for a not-found answer on a thread that never had replies (see the catch).
132
+ */
71
133
  reload: () => Promise<void>;
72
- hydrateState: (thread: Thread) => void;
134
+ hydrateState: (thread: Thread, options?: {
135
+ reconcile?: MergeNewestPageOptions;
136
+ }) => void;
73
137
  registerSubscriptions: () => void;
74
- private subscribeThreadUpdated;
138
+ /**
139
+ * Subscribes this thread to the `'thread'` configuration key. Registered through
140
+ * `WithSubscriptions`, so `unregisterSubscriptions()` runs the setup function's teardown.
141
+ *
142
+ * **This is where `Thread` differs from `Channel`,** which subscribes from its constructor. Everything
143
+ * below follows from that, and applies to a thread that never calls `registerSubscriptions()`:
144
+ *
145
+ * - no *setup function* runs for it — matching how `MessageComposer` already behaves;
146
+ * - it sees the declarative slice **as it stood when the thread was constructed**, because the
147
+ * constructor applies it directly, but no *later* `client.config.set({ thread: … })` or
148
+ * `set({ messagePaginator: … })` reaches it;
149
+ * - it is absent from the registry's `liveInstances`, so `client.config.reset()` skips it, and
150
+ * `hasLiveInstances('thread')` does not count it when deciding whether to warn about a
151
+ * construction-only path registered too late.
152
+ *
153
+ * So read "declarative configuration is unaffected" as *at construction only*. A thread registered
154
+ * with a `ThreadManager` that has itself registered is covered — the manager calls
155
+ * `registerSubscriptions()` on every thread the list holds or that is active — so the common path
156
+ * is fine. A thread that is neither, or held by an unregistered manager, is not.
157
+ *
158
+ * The alternative — applying the setup function at construction — would break the teardown symmetry
159
+ * `WithSubscriptions` provides, which is why the asymmetry stands.
160
+ */
161
+ private subscribeThreadSetupStateChange;
162
+ handleThreadUpdated: (event: EventPayload<"thread.updated">) => void;
75
163
  private subscribeMarkActiveThreadRead;
76
164
  private subscribeReloadActiveStaleThread;
77
- private subscribeMarkThreadStale;
78
- private subscribeRepliesUnread;
79
- private subscribeNewReplies;
80
- private subscribeRepliesRead;
81
- private subscribeMessageDeleted;
82
- private subscribeMessageUpdated;
83
- private subscribeUserMessagesDeleted;
165
+ /**
166
+ * A watch stopped while the connection stays up (`NotWatching`) ends the channel's events with no
167
+ * reconnect to catch it. A dropped connection (`WasWatching`) is left to recovery.
168
+ */
169
+ private subscribeMarkStaleOnStopWatching;
170
+ handleRepliesUnread: (event: EventPayload<"notification.mark_unread">) => void;
171
+ handleNewReply: (event: EventPayload<"message.new">) => void;
172
+ handleRepliesRead: (event: EventPayload<"message.read">) => void;
173
+ handleMessageDeleted: (event: EventPayload<"message.deleted">) => void;
174
+ handleMessageUpdated: (event: PipelineEvent) => void;
175
+ handleReactionChanged: (event: PipelineEvent) => void;
176
+ handleUserMessagesDeleted: (event: PipelineEvent) => void;
84
177
  private subscribeParentMessageFromStore;
85
178
  unregisterSubscriptions: () => symbol;
86
179
  deleteReplyLocally: ({ message }: {
@@ -94,51 +187,14 @@ export declare class Thread extends WithSubscriptions {
94
187
  message: MessageResponse;
95
188
  }) => void;
96
189
  updateParentMessageOrReplyLocally: (message: MessageResponse) => void;
97
- /**
98
- * Sends a message with optimistic local state update.
99
- */
100
- sendMessageWithLocalUpdate({ localMessage, message, options, sendMessageRequestFn, }: SendMessageWithStateUpdateParams): Promise<void>;
101
- /**
102
- * Retry sending a failed message.
103
- */
104
- retrySendMessageWithLocalUpdate(params: Omit<SendMessageWithStateUpdateParams, 'message'>): Promise<void>;
105
- /**
106
- * Updates a message with optimistic local state update.
107
- *
108
- * The update flows through `messagePaginator`, which is the sole reply source.
109
- */
110
- updateMessageWithLocalUpdate(params: UpdateMessageWithStateUpdateParams): Promise<void>;
111
- /**
112
- * Deletes a message with local state update.
113
- */
114
- deleteMessageWithLocalUpdate(params: DeleteMessageWithStateUpdateParams): Promise<void>;
115
- /**
116
- * Adds a reaction to a reply with an optimistic local state update, mirroring
117
- * {@link Channel.addReactionWithLocalUpdate}. The optimistic message is applied to THIS thread's
118
- * paginator (so pure replies get optimism the channel paginator can't give); the request routes
119
- * through the parent channel since reactions are channel-level.
120
- */
121
- addReactionWithLocalUpdate({ messageId, reaction, options, }: {
122
- messageId: string;
123
- reaction: ReactionRequest;
124
- options?: Pick<SendReactionRequest, 'enforce_unique' | 'skip_push'>;
125
- }): Promise<void>;
126
- /**
127
- * Removes the current user's reaction from a reply with an optimistic local state update,
128
- * mirroring {@link Thread.addReactionWithLocalUpdate}.
129
- */
130
- deleteReactionWithLocalUpdate({ messageId, type, }: {
131
- messageId: string;
132
- type: string;
133
- }): Promise<void>;
134
190
  markRead: ({ force }?: {
135
191
  force?: boolean;
136
- }) => Promise<EventAPIResponse | import("./types").StreamResponse<import(".").MarkReadResponse> | null>;
192
+ }) => Promise<Partial<StreamResponse<MarkReadResponse>> | null>;
137
193
  private throttledMarkRead;
138
194
  /**
139
195
  * @deprecated Use `thread.markRead` instead.
140
196
  */
141
197
  markAsRead: ({ force }?: {
142
198
  force?: boolean;
143
- }) => Promise<EventAPIResponse | import("./types").StreamResponse<import(".").MarkReadResponse> | null>;
199
+ }) => Promise<Partial<StreamResponse<MarkReadResponse>> | null>;
144
200
  }