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

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 (269) hide show
  1. package/dist/cjs/index.browser.js +2196 -3902
  2. package/dist/cjs/index.browser.js.map +3 -3
  3. package/dist/cjs/index.node.js +2197 -3902
  4. package/dist/cjs/index.node.js.map +3 -3
  5. package/dist/esm/index.mjs +2199 -3905
  6. package/dist/esm/index.mjs.map +4 -4
  7. package/dist/types/ChannelManager.d.ts +120 -233
  8. package/dist/types/CooldownTimer.d.ts +8 -23
  9. package/dist/types/EventHandlerPipeline.d.ts +17 -37
  10. package/dist/types/LiveLocationManager.d.ts +22 -50
  11. package/dist/types/api-client.d.ts +9 -14
  12. package/dist/types/channel.d.ts +253 -448
  13. package/dist/types/channel_state.d.ts +48 -95
  14. package/dist/types/client.d.ts +245 -370
  15. package/dist/types/client_state.d.ts +1 -3
  16. package/dist/types/configuration/ConfigController.d.ts +30 -124
  17. package/dist/types/configuration/InstanceConfigurationRegistry.d.ts +31 -123
  18. package/dist/types/configuration/keys.d.ts +5 -19
  19. package/dist/types/configuration/shape.d.ts +12 -29
  20. package/dist/types/configuration/types.d.ts +59 -87
  21. package/dist/types/configuration/utils/applyInstanceConfiguration.d.ts +13 -35
  22. package/dist/types/configuration/utils/copyConfigPatch.d.ts +8 -0
  23. package/dist/types/configuration/utils/declarativeSlices.d.ts +5 -16
  24. package/dist/types/configuration/utils/deepFreezeConfig.d.ts +3 -17
  25. package/dist/types/configuration/utils/serverAuthority.d.ts +9 -29
  26. package/dist/types/connection/ConnectionIdManager.d.ts +18 -40
  27. package/dist/types/connection/ConnectionRecoveryManager.d.ts +29 -120
  28. package/dist/types/connection/networkConnection/NetworkConnectionObserver.d.ts +32 -103
  29. package/dist/types/connection/networkConnection/reporters.d.ts +9 -32
  30. package/dist/types/connection/networkConnection/types.d.ts +12 -27
  31. package/dist/types/connection/wsConnection/StableWSConnection.d.ts +37 -116
  32. package/dist/types/connection/wsConnection/WSConnection.d.ts +41 -104
  33. package/dist/types/connection/wsConnection/WSConnectionFallback.d.ts +8 -16
  34. package/dist/types/connection/wsConnection/config.d.ts +8 -28
  35. package/dist/types/connection/wsConnection/types.d.ts +17 -70
  36. package/dist/types/entityStore/EntityStore.d.ts +153 -113
  37. package/dist/types/entityStore/StoreBackedItemIndex.d.ts +13 -46
  38. package/dist/types/errors.d.ts +7 -19
  39. package/dist/types/gen/chat/ChannelApi.d.ts +2 -1
  40. package/dist/types/gen/chat/ChatApi.d.ts +28 -14
  41. package/dist/types/gen/models/index.d.ts +769 -86
  42. package/dist/types/gen/moderation/ModerationApi.d.ts +4 -4
  43. package/dist/types/index.d.ts +2 -4
  44. package/dist/types/languageNames.d.ts +9 -24
  45. package/dist/types/logger.d.ts +1 -3
  46. package/dist/types/messageComposer/LocationComposer.d.ts +1 -1
  47. package/dist/types/messageComposer/attachmentIdentity.d.ts +1 -6
  48. package/dist/types/messageComposer/attachmentManager.d.ts +10 -32
  49. package/dist/types/messageComposer/attachmentUtils.d.ts +3 -14
  50. package/dist/types/messageComposer/configuration/configuration.d.ts +2 -5
  51. package/dist/types/messageComposer/configuration/types.d.ts +29 -56
  52. package/dist/types/messageComposer/linkPreviewsManager.d.ts +6 -9
  53. package/dist/types/messageComposer/messageComposer.d.ts +30 -164
  54. package/dist/types/messageComposer/middleware/attachmentManager/postUpload/attachmentEnrichment.d.ts +4 -14
  55. package/dist/types/messageComposer/middleware/messageComposer/attachments.d.ts +2 -9
  56. package/dist/types/messageComposer/middleware/pollComposer/types.d.ts +2 -4
  57. package/dist/types/messageComposer/middleware/pollComposer/validation.d.ts +7 -19
  58. package/dist/types/messageComposer/middleware/textComposer/commands.d.ts +9 -0
  59. package/dist/types/messageComposer/middleware/textComposer/mentions.d.ts +11 -18
  60. package/dist/types/messageComposer/middleware/textComposer/textMiddlewareUtils.d.ts +9 -3
  61. package/dist/types/messageComposer/middleware/textComposer/types.d.ts +1 -6
  62. package/dist/types/messageComposer/pollComposer.d.ts +8 -4
  63. package/dist/types/messageComposer/textComposer.d.ts +3 -9
  64. package/dist/types/messageComposer/types.d.ts +5 -8
  65. package/dist/types/messageDelivery/MessageDeliveryReporter.d.ts +25 -79
  66. package/dist/types/messageDelivery/MessageReceiptsTracker.d.ts +15 -82
  67. package/dist/types/messageOperations/FailedSendCache.d.ts +4 -9
  68. package/dist/types/messageOperations/MessageOperationStatePolicy.d.ts +10 -20
  69. package/dist/types/messageOperations/MessageOperations.d.ts +20 -40
  70. package/dist/types/messageOperations/applyReactionLocally.d.ts +5 -22
  71. package/dist/types/messageOperations/createMessageOperations.d.ts +3 -5
  72. package/dist/types/messageOperations/reflectReactionEvent.d.ts +5 -13
  73. package/dist/types/messageOperations/sendOrdering.d.ts +4 -7
  74. package/dist/types/messageOperations/settlePendingAttachmentUploads.d.ts +7 -15
  75. package/dist/types/messageOperations/types.d.ts +15 -30
  76. package/dist/types/middleware.d.ts +7 -5
  77. package/dist/types/moderation.d.ts +21 -14
  78. package/dist/types/notifications/NotificationManager.d.ts +8 -31
  79. package/dist/types/notifications/types.d.ts +19 -59
  80. package/dist/types/offline-support/offline_support_api.d.ts +145 -539
  81. package/dist/types/offline-support/offline_sync_manager.d.ts +18 -42
  82. package/dist/types/offline-support/queueableOperations.d.ts +24 -52
  83. package/dist/types/offline-support/types.d.ts +24 -187
  84. package/dist/types/pagination/ItemIndex.d.ts +4 -12
  85. package/dist/types/pagination/cursorDerivation/aroundPaginationFlags.d.ts +13 -0
  86. package/dist/types/pagination/cursorDerivation/createdAtAroundPaginationFlags.d.ts +2 -4
  87. package/dist/types/pagination/cursorDerivation/linearPaginationFlags.d.ts +2 -3
  88. package/dist/types/pagination/paginators/BasePaginator.d.ts +235 -622
  89. package/dist/types/pagination/paginators/ChannelPaginator.d.ts +67 -125
  90. package/dist/types/pagination/paginators/MessageIntervalPaginator.d.ts +133 -292
  91. package/dist/types/pagination/paginators/MessagePaginator.d.ts +69 -118
  92. package/dist/types/pagination/paginators/PinnedMessagePaginator.d.ts +7 -26
  93. package/dist/types/pagination/paginators/ReminderPaginator.d.ts +2 -2
  94. package/dist/types/pagination/paginators/ThreadPaginator.d.ts +15 -23
  95. package/dist/types/pagination/paginators/UserGroupPaginator.d.ts +2 -6
  96. package/dist/types/pagination/sortCompiler.d.ts +11 -22
  97. package/dist/types/pagination/utility.normalization.d.ts +5 -23
  98. package/dist/types/pagination/utility.search.d.ts +3 -8
  99. package/dist/types/poll.d.ts +14 -14
  100. package/dist/types/poll_manager.d.ts +11 -2
  101. package/dist/types/poll_optimistic_votes.d.ts +10 -14
  102. package/dist/types/reminders/Reminder.d.ts +4 -4
  103. package/dist/types/reminders/ReminderManager.d.ts +7 -20
  104. package/dist/types/search/BaseSearchSource.d.ts +7 -12
  105. package/dist/types/search/ChannelSearchSource.d.ts +7 -7
  106. package/dist/types/search/MessageSearchSource.d.ts +7 -9
  107. package/dist/types/search/SearchController.d.ts +17 -22
  108. package/dist/types/search/types.d.ts +6 -10
  109. package/dist/types/signing.d.ts +12 -3
  110. package/dist/types/thread.d.ts +23 -71
  111. package/dist/types/thread_manager.d.ts +45 -70
  112. package/dist/types/token_manager.d.ts +8 -13
  113. package/dist/types/types.d.ts +64 -125
  114. package/dist/types/types.utility.d.ts +3 -3
  115. package/dist/types/upload-utils.d.ts +5 -10
  116. package/dist/types/uploadManager.d.ts +17 -45
  117. package/dist/types/utils/FixedSizeQueueCache.d.ts +6 -11
  118. package/dist/types/utils/WithSubscriptions.d.ts +5 -15
  119. package/dist/types/utils/concurrency.d.ts +11 -19
  120. package/dist/types/utils/mergeWith/mergeWith.d.ts +8 -11
  121. package/dist/types/utils/mergeWith/mergeWithCore.d.ts +5 -13
  122. package/dist/types/utils/mergeWith/mergeWithDiff.d.ts +22 -0
  123. package/dist/types/utils/objectPath.d.ts +6 -41
  124. package/dist/types/utils/retryable.d.ts +8 -12
  125. package/dist/types/utils/throttling/throttle.d.ts +8 -23
  126. package/dist/types/utils/time.d.ts +24 -64
  127. package/dist/types/utils.d.ts +40 -86
  128. package/package.json +7 -2
  129. package/src/ChannelManager.ts +159 -300
  130. package/src/CooldownTimer.ts +11 -29
  131. package/src/EventHandlerPipeline.ts +21 -44
  132. package/src/LiveLocationManager.ts +35 -74
  133. package/src/api-client.ts +43 -61
  134. package/src/campaign.ts +1 -1
  135. package/src/channel.ts +396 -749
  136. package/src/channel_batch_updater.ts +1 -1
  137. package/src/channel_state.ts +50 -105
  138. package/src/client.ts +360 -588
  139. package/src/client_state.ts +1 -6
  140. package/src/configuration/ConfigController.ts +41 -157
  141. package/src/configuration/InstanceConfigurationRegistry.ts +42 -171
  142. package/src/configuration/index.ts +1 -1
  143. package/src/configuration/keys.ts +13 -32
  144. package/src/configuration/shape.ts +67 -70
  145. package/src/configuration/types.ts +60 -100
  146. package/src/configuration/utils/applyInstanceConfiguration.ts +21 -53
  147. package/src/configuration/utils/copyConfigPatch.ts +11 -32
  148. package/src/configuration/utils/declarativeSlices.ts +9 -39
  149. package/src/configuration/utils/deepFreezeConfig.ts +3 -17
  150. package/src/configuration/utils/index.ts +2 -4
  151. package/src/configuration/utils/serverAuthority.ts +20 -68
  152. package/src/connection/ConnectionIdManager.ts +20 -49
  153. package/src/connection/ConnectionRecoveryManager.ts +51 -178
  154. package/src/connection/networkConnection/NetworkConnectionObserver.ts +37 -114
  155. package/src/connection/networkConnection/reporters.ts +9 -36
  156. package/src/connection/networkConnection/types.ts +12 -27
  157. package/src/connection/wsConnection/StableWSConnection.ts +73 -193
  158. package/src/connection/wsConnection/WSConnection.ts +56 -131
  159. package/src/connection/wsConnection/WSConnectionFallback.ts +22 -31
  160. package/src/connection/wsConnection/config.ts +13 -48
  161. package/src/connection/wsConnection/types.ts +17 -70
  162. package/src/constants.ts +4 -4
  163. package/src/entityStore/EntityStore.ts +162 -167
  164. package/src/entityStore/StoreBackedItemIndex.ts +14 -47
  165. package/src/errors.ts +7 -19
  166. package/src/formatMessageMemo.ts +3 -9
  167. package/src/gen/chat/ChannelApi.ts +19 -0
  168. package/src/gen/chat/ChatApi.ts +87 -13
  169. package/src/gen/models/index.ts +793 -71
  170. package/src/gen/moderation/ModerationApi.ts +0 -4
  171. package/src/index.ts +10 -14
  172. package/src/languageNames.ts +9 -24
  173. package/src/logger.ts +1 -3
  174. package/src/messageComposer/LocationComposer.ts +7 -23
  175. package/src/messageComposer/MessageComposerEffectHandlers.ts +1 -2
  176. package/src/messageComposer/attachmentIdentity.ts +2 -13
  177. package/src/messageComposer/attachmentManager.ts +17 -63
  178. package/src/messageComposer/attachmentUtils.ts +3 -17
  179. package/src/messageComposer/configuration/configuration.ts +5 -8
  180. package/src/messageComposer/configuration/types.ts +29 -56
  181. package/src/messageComposer/fileUtils.ts +1 -1
  182. package/src/messageComposer/linkPreviewsManager.ts +8 -20
  183. package/src/messageComposer/messageComposer.ts +54 -222
  184. package/src/messageComposer/middleware/attachmentManager/postUpload/attachmentEnrichment.ts +4 -16
  185. package/src/messageComposer/middleware/attachmentManager/postUpload/uploadErrorHandler.ts +1 -2
  186. package/src/messageComposer/middleware/messageComposer/attachments.ts +14 -40
  187. package/src/messageComposer/middleware/messageComposer/linkPreviews.ts +3 -4
  188. package/src/messageComposer/middleware/messageComposer/textComposer.ts +1 -1
  189. package/src/messageComposer/middleware/messageComposer/userDataInjection.ts +4 -11
  190. package/src/messageComposer/middleware/pollComposer/state.ts +2 -2
  191. package/src/messageComposer/middleware/pollComposer/types.ts +2 -4
  192. package/src/messageComposer/middleware/pollComposer/validation.ts +8 -26
  193. package/src/messageComposer/middleware/textComposer/TextComposerMiddlewareExecutor.ts +1 -6
  194. package/src/messageComposer/middleware/textComposer/commandUtils.ts +1 -2
  195. package/src/messageComposer/middleware/textComposer/commands.ts +11 -16
  196. package/src/messageComposer/middleware/textComposer/mentions.ts +32 -70
  197. package/src/messageComposer/middleware/textComposer/textMiddlewareUtils.ts +10 -4
  198. package/src/messageComposer/middleware/textComposer/types.ts +1 -6
  199. package/src/messageComposer/pollComposer.ts +11 -8
  200. package/src/messageComposer/textComposer.ts +9 -59
  201. package/src/messageComposer/types.ts +9 -12
  202. package/src/messageDelivery/MessageDeliveryReporter.ts +60 -113
  203. package/src/messageDelivery/MessageReceiptsTracker.ts +21 -105
  204. package/src/messageOperations/FailedSendCache.ts +4 -9
  205. package/src/messageOperations/MessageOperationStatePolicy.ts +40 -67
  206. package/src/messageOperations/MessageOperations.ts +33 -62
  207. package/src/messageOperations/applyReactionLocally.ts +9 -28
  208. package/src/messageOperations/createMessageOperations.ts +17 -33
  209. package/src/messageOperations/reflectReactionEvent.ts +5 -13
  210. package/src/messageOperations/sendOrdering.ts +4 -7
  211. package/src/messageOperations/settlePendingAttachmentUploads.ts +10 -21
  212. package/src/messageOperations/types.ts +15 -30
  213. package/src/middleware.ts +7 -10
  214. package/src/moderation.ts +25 -21
  215. package/src/notifications/NotificationManager.ts +11 -35
  216. package/src/notifications/types.ts +19 -59
  217. package/src/offline-support/offline_support_api.ts +178 -608
  218. package/src/offline-support/offline_sync_manager.ts +25 -69
  219. package/src/offline-support/queueableOperations.ts +31 -84
  220. package/src/offline-support/types.ts +25 -188
  221. package/src/pagination/ItemIndex.ts +4 -12
  222. package/src/pagination/cursorDerivation/aroundPaginationFlags.ts +29 -0
  223. package/src/pagination/cursorDerivation/createdAtAroundPaginationFlags.ts +13 -62
  224. package/src/pagination/cursorDerivation/idAroundPaginationFlags.ts +11 -39
  225. package/src/pagination/cursorDerivation/linearPaginationFlags.ts +4 -6
  226. package/src/pagination/filterCompiler.ts +11 -25
  227. package/src/pagination/paginators/BasePaginator.ts +422 -976
  228. package/src/pagination/paginators/ChannelPaginator.ts +130 -190
  229. package/src/pagination/paginators/MessageIntervalPaginator.ts +226 -457
  230. package/src/pagination/paginators/MessagePaginator.ts +135 -175
  231. package/src/pagination/paginators/PinnedMessagePaginator.ts +13 -38
  232. package/src/pagination/paginators/ReminderPaginator.ts +12 -15
  233. package/src/pagination/paginators/ThreadPaginator.ts +16 -26
  234. package/src/pagination/paginators/UserGroupPaginator.ts +6 -17
  235. package/src/pagination/paginators/stateThrottling.ts +5 -10
  236. package/src/pagination/sortCompiler.ts +23 -50
  237. package/src/pagination/utility.normalization.ts +8 -30
  238. package/src/pagination/utility.search.ts +4 -11
  239. package/src/poll.ts +19 -19
  240. package/src/poll_manager.ts +16 -20
  241. package/src/poll_optimistic_votes.ts +17 -22
  242. package/src/reminders/Reminder.ts +5 -6
  243. package/src/reminders/ReminderManager.ts +9 -34
  244. package/src/reminders/ReminderTimer.ts +1 -2
  245. package/src/search/BaseSearchSource.ts +14 -29
  246. package/src/search/ChannelSearchSource.ts +8 -8
  247. package/src/search/MessageSearchSource.ts +19 -25
  248. package/src/search/SearchController.ts +18 -24
  249. package/src/search/types.ts +6 -10
  250. package/src/segment.ts +1 -1
  251. package/src/signing.ts +23 -3
  252. package/src/thread.ts +72 -173
  253. package/src/thread_manager.ts +59 -76
  254. package/src/token_manager.ts +11 -21
  255. package/src/types.ts +78 -126
  256. package/src/types.utility.ts +3 -3
  257. package/src/upload-utils.ts +5 -10
  258. package/src/uploadManager.ts +22 -54
  259. package/src/utils/FixedSizeQueueCache.ts +13 -21
  260. package/src/utils/WithSubscriptions.ts +5 -15
  261. package/src/utils/concurrency.ts +16 -55
  262. package/src/utils/mergeWith/mergeWith.ts +10 -13
  263. package/src/utils/mergeWith/mergeWithCore.ts +24 -81
  264. package/src/utils/mergeWith/mergeWithDiff.ts +15 -33
  265. package/src/utils/objectPath.ts +6 -41
  266. package/src/utils/retryable.ts +10 -14
  267. package/src/utils/throttling/throttle.ts +9 -25
  268. package/src/utils/time.ts +26 -66
  269. package/src/utils.ts +72 -128
@@ -14,11 +14,11 @@ export declare class ModerationApi {
14
14
  bulkDeleteActionConfig(request: BulkDeleteActionConfigRequest, requestOptions?: StreamRequestOptions): Promise<StreamResponse<BulkDeleteActionConfigResponse>>;
15
15
  deleteActionConfig(pathParams: {
16
16
  id: string;
17
- }, _request?: Record<string, never>, requestOptions?: StreamRequestOptions): Promise<StreamResponse<DeleteActionConfigResponse>>;
17
+ }, requestOptions?: StreamRequestOptions): Promise<StreamResponse<DeleteActionConfigResponse>>;
18
18
  appeal(request: AppealRequest, requestOptions?: StreamRequestOptions): Promise<StreamResponse<AppealResponse>>;
19
19
  getAppeal(pathParams: {
20
20
  id: string;
21
- }, _request?: Record<string, never>, requestOptions?: StreamRequestOptions): Promise<StreamResponse<GetAppealResponse>>;
21
+ }, requestOptions?: StreamRequestOptions): Promise<StreamResponse<GetAppealResponse>>;
22
22
  queryAppeals(request?: QueryAppealsRequest, requestOptions?: StreamRequestOptions): Promise<StreamResponse<QueryAppealsResponse>>;
23
23
  bulkActionAppeals(request: BulkActionAppealsRequest, requestOptions?: StreamRequestOptions): Promise<StreamResponse<BulkActionAppealsResponse>>;
24
24
  ban(request: BanRequest, requestOptions?: StreamRequestOptions): Promise<StreamResponse<ModerationBanResponse>>;
@@ -36,11 +36,11 @@ export declare class ModerationApi {
36
36
  queryModerationConfigs(request?: QueryModerationConfigsRequest, requestOptions?: StreamRequestOptions): Promise<StreamResponse<QueryModerationConfigsResponse>>;
37
37
  flag(request: FlagRequest, requestOptions?: StreamRequestOptions): Promise<StreamResponse<FlagItemResponse>>;
38
38
  mute(request: MuteRequest, requestOptions?: StreamRequestOptions): Promise<StreamResponse<MuteResponse>>;
39
- listQueues(_request?: Record<string, never>, requestOptions?: StreamRequestOptions): Promise<StreamResponse<ListQueuesResponse>>;
39
+ listQueues(requestOptions?: StreamRequestOptions): Promise<StreamResponse<ListQueuesResponse>>;
40
40
  createQueue(request: CreateQueueRequest, requestOptions?: StreamRequestOptions): Promise<StreamResponse<QueueResponse>>;
41
41
  getQueue(pathParams: {
42
42
  id: string;
43
- }, _request?: Record<string, never>, requestOptions?: StreamRequestOptions): Promise<StreamResponse<QueueResponse>>;
43
+ }, requestOptions?: StreamRequestOptions): Promise<StreamResponse<QueueResponse>>;
44
44
  updateQueue(pathParams: {
45
45
  id: string;
46
46
  }, request?: UpdateQueueRequest, requestOptions?: StreamRequestOptions): Promise<StreamResponse<QueueResponse>>;
@@ -41,10 +41,8 @@ export { isOwnUser, chatCodes, logChatPromiseExecution, localMessageToNewMessage
41
41
  export { FixedSizeQueueCache } from './utils/FixedSizeQueueCache';
42
42
  export { asTimestampNS, convertTimestampToDate, dateToNs, msToNs, nowNs, NS_PER_MS, nsToDate, nsToMs, nsToRfc3339, } from './utils/time';
43
43
  /**
44
- * Tag-keyed async runners. Exported so the UI SDKs (and integrators) serialize their own
45
- * actions with the same primitive the SDK uses internally instead of hand-rolling promise
46
- * chains. Tags share one process-wide map, so namespace yours (`my-app/thing/${id}`) to avoid
47
- * colliding with another caller's.
44
+ * Tag-keyed async runners. Tags share one process-wide map, so namespace yours
45
+ * (`my-app/thing/${id}`).
48
46
  */
49
47
  export { hasPending, settled, withCancellation, withoutConcurrency, } from './utils/concurrency';
50
48
  export * from './ChannelManager';
@@ -1,20 +1,8 @@
1
1
  /**
2
- * The human-readable name of each language the API can auto-translate a message into.
3
- *
4
- * These are display copy for a **core-owned** set: `message.i18n.language` is typed
5
- * {@link TranslationLanguage}, so core defines which languages exist and therefore owns their names
6
- * too. A UI SDK uses them to say "Translated from German" rather than "Translated from de".
7
- *
8
- * `satisfies Record<TranslationLanguage, string>` is the drift gate, and it works in both
9
- * directions: adding a language to the API union fails to compile until a name is supplied here, and a
10
- * name for a language the union does not contain is rejected as an excess property. Before this lived
11
- * in core, each UI SDK hand-maintained its own copy with nothing tying it to the union — so a miss
12
- * could only be detected at runtime, by comparing the rendered string against the key.
13
- *
14
- * Names are in English on purpose. A language picker conventionally shows each language endonymously
15
- * ("Deutsch", not "German"), but this is the *source* language of an auto-translated message rendered
16
- * inside a sentence in the reader's own language, so it has to agree with the surrounding copy. An
17
- * integrator wanting endonyms overrides the `language.*` keys.
2
+ * The human-readable name of each {@link TranslationLanguage}, for text like "Translated from
3
+ * German". `satisfies Record<TranslationLanguage, string>` fails to compile when the union and this
4
+ * table disagree. Names are in English so they fit inside the reader's sentence; override the
5
+ * `language.*` keys for endonyms.
18
6
  */
19
7
  export declare const LANGUAGE_NAMES: {
20
8
  readonly af: "Afrikaans";
@@ -76,10 +64,8 @@ export declare const LANGUAGE_NAMES: {
76
64
  readonly 'zh-TW': "Chinese (Traditional)";
77
65
  };
78
66
  /**
79
- * The `language.*` slice of a translation catalog.
80
- *
81
- * A UI SDK intersects this into its own generated catalog, which makes `t('language.de')` a checked
82
- * key rather than something that has to go through `asDynamicKey()`:
67
+ * The `language.*` slice of a translation catalog, to intersect into a UI SDK's own catalog so
68
+ * `t('language.de')` is a checked key:
83
69
  *
84
70
  * ```ts
85
71
  * type TranslationCatalog = GeneratedCatalog & LanguageNameCatalog;
@@ -89,9 +75,8 @@ export type LanguageNameCatalog = {
89
75
  [K in keyof typeof LANGUAGE_NAMES as `language.${K & string}`]: (typeof LANGUAGE_NAMES)[K];
90
76
  };
91
77
  /**
92
- * {@link LANGUAGE_NAMES} keyed the way a catalog is, ready to merge into an SDK's bundled defaults.
93
- *
94
- * These keys are resolved from a runtime value (the message's source language), so there is no call
95
- * site to carry an inline default — which is exactly why they have to ship as data.
78
+ * {@link LANGUAGE_NAMES} keyed as a catalog (`language.<code>`), ready to merge into an SDK's
79
+ * bundled defaults. The keys are resolved from a runtime value, so there is no call site for an
80
+ * inline default.
96
81
  */
97
82
  export declare const languageNameDefaults: Record<string, string>;
@@ -1,8 +1,6 @@
1
1
  import * as scopedLogger from '@stream-io/logger';
2
2
  export type ChatLoggerScope = 'api-client' | 'channel' | 'channel-manager' | 'client' | 'connection' | 'instance-configuration' | 'message-composer' | 'offline-db' | 'state-store' | 'text-composer' | 'thread' | 'thread-manager' | 'token-manager' | 'upload-manager' | 'utils';
3
- /**
4
- * @internal
5
- */
3
+ /** @internal */
6
4
  export type ScopedLogger = scopedLogger.Logger<ChatLoggerScope>;
7
5
  export { LogLevelEnum } from '@stream-io/logger';
8
6
  export type { ConfigureLoggersOptions, LogLevel, Sink } from '@stream-io/logger';
@@ -33,7 +33,7 @@ export declare class LocationComposer {
33
33
  message?: DraftMessage | LocalMessage;
34
34
  }) => void;
35
35
  /**
36
- * Takes over `source`'s location, now for this composer's message (`message_id`).
36
+ * Takes over `source`'s location, re-keyed to this composer's message (`message_id`).
37
37
  *
38
38
  * @internal
39
39
  */
@@ -7,12 +7,7 @@ export declare const isLocalUploadAttachment: (attachment: unknown) => attachmen
7
7
  export declare const isPendingUpload: (attachment: unknown) => attachment is LocalUploadAttachment;
8
8
  /** Whether this attachment's upload already resolved to a URL. */
9
9
  export declare const isFinishedUpload: (attachment: unknown) => attachment is LocalUploadAttachment;
10
- /**
11
- * Whether this attachment's upload resolved to a failure the user can retry.
12
- *
13
- * Distinct from `blocked`, which the server's upload configuration rejected outright - that one
14
- * can never succeed, however many times it is retried.
15
- */
10
+ /** Whether this attachment's upload failed in a way that can be retried (unlike `blocked`). */
16
11
  export declare const isFailedUpload: (attachment: unknown) => attachment is LocalUploadAttachment;
17
12
  export declare const isFileAttachment: (attachment: Attachment | LocalAttachment, supportedVideoFormat?: string[]) => attachment is FileAttachment;
18
13
  export declare const isLocalFileAttachment: (attachment: Attachment | LocalAttachment) => attachment is LocalFileAttachment;
@@ -42,25 +42,14 @@ export declare class AttachmentManager {
42
42
  get hasCustomDoUploadRequest(): boolean;
43
43
  get hasAvailableUploadSlots(): boolean;
44
44
  /**
45
- * Whether uploaded bytes reach Stream, and therefore whether Stream's rules govern attachments here.
46
- *
47
- * Declared through {@link AttachmentManagerConfig.customCdn}, not inferred from `doUploadRequest`. A
48
- * custom upload function says how files are sent, not where: wrapping the request to add retries,
49
- * headers or a proxy through your own backend still ends at Stream. Inferring a different destination
50
- * from it waived Stream's constraints for those integrators too.
45
+ * Whether uploaded bytes reach Stream (and so Stream's rules apply). Set by
46
+ * {@link AttachmentManagerConfig.customCdn}, not inferred from `doUploadRequest`.
51
47
  */
52
48
  get usesStreamStorage(): boolean;
53
49
  /**
54
- * Whether this composer can accept a file right now — **the** answer to that question, for the SDK and
55
- * for any UI deciding whether to offer an upload control. `uploadFiles` enforces exactly this; two
56
- * predicates for one question could only agree by coincidence.
57
- *
58
- * - `config.enabled` — the configured answer, already ANDed with the channel type's `uploads` flag by
59
- * the composer's server restrictions (which apply only when files go to Stream, for the same reason
60
- * as below). The integrator's own switch, which nothing overrides.
61
- * - a free slot under `maxNumberOfFilesPerMessage`.
62
- * - the `upload-file` capability, **only when files go to Stream**. It governs Stream's upload
63
- * endpoint, so on storage Stream does not host there is nothing for it to permit or refuse.
50
+ * Whether this composer can accept a file (`uploadFiles` enforces it): `config.enabled` (already
51
+ * ANDed with the channel type's `uploads` flag when files go to Stream), a free slot, and the
52
+ * `upload-file` capability (only when files go to Stream).
64
53
  */
65
54
  get isUploadEnabled(): boolean;
66
55
  get successfulUploads(): LocalAttachment[];
@@ -77,11 +66,9 @@ export declare class AttachmentManager {
77
66
  message?: DraftMessage | LocalMessage;
78
67
  }) => void;
79
68
  /**
80
- * Moves `source`'s attachments here, as they are, replacing this manager's own (whose uploads are
81
- * cancelled) and leaving `source` with none. An upload still running keeps running: it isn't
82
- * cancelled, and this manager attaches to it (`UploadManager` runs one request per attachment), so
83
- * its result lands here. `source`'s list is emptied without touching the uploads, so clearing
84
- * `source` afterwards doesn't cancel them either.
69
+ * Moves `source`'s attachments here, replacing this manager's own (their uploads are cancelled) and
70
+ * emptying `source`. Running uploads are not cancelled: this manager joins them (`UploadManager` runs
71
+ * one request per attachment), so their results land here.
85
72
  *
86
73
  * @internal
87
74
  */
@@ -94,23 +81,14 @@ export declare class AttachmentManager {
94
81
  private prepareAttachmentUpdate;
95
82
  updateAttachment: (attachmentToUpdate: LocalAttachment) => void;
96
83
  upsertAttachments: (attachmentsToUpsert: LocalAttachment[]) => void;
97
- /**
98
- * Releases a local preview URL the SDK minted, if it minted one.
99
- *
100
- * Only `blob:` URLs are ours to revoke: `toLocalUploadAttachment` puts a
101
- * `URL.createObjectURL` result in `previewUri` for a `File`, but for a React Native
102
- * `FileReference` it stores the caller's own native file URI, which must be left alone.
103
- */
84
+ /** Revokes `blob:` preview URLs only. A React Native `FileReference` keeps the caller's own URI. */
104
85
  private revokePreviewUri;
105
86
  removeAttachments: (localAttachmentIds: string[]) => void;
106
87
  getUploadConfigCheck: (fileLike: FileReference | FileLike) => Promise<UploadPermissionCheckResult>;
107
88
  static toLocalUploadAttachment: (fileLike: FileReference | FileLike) => LocalUploadAttachment;
108
89
  fileToLocalUploadAttachment: (fileLike: FileReference | FileLike) => Promise<LocalUploadAttachment>;
109
90
  private ensureLocalUploadAttachment;
110
- /**
111
- * Method to perform the default upload behavior without checking for custom upload functions
112
- * to prevent recursive calls
113
- */
91
+ /** The default upload, skipping the custom `doUploadRequest` so a custom one can delegate here. */
114
92
  doDefaultUploadRequest: (fileLike: FileReference | FileLike, options?: UploadRequestOptions) => Promise<MinimumUploadRequestResult>;
115
93
  /**
116
94
  * todo: docs how to customize the image and file upload by overriding do
@@ -1,26 +1,15 @@
1
1
  import type { Attachment } from '../types';
2
2
  import type { LocalAttachment } from './types';
3
- /**
4
- * The URL to render an attachment from, falling back to the local blob preview while its upload is
5
- * in flight. Lives here because the preview is this package's: created by `AttachmentManager`,
6
- * revoked by `settlePendingAttachmentUploads`.
7
- */
3
+ /** The first truthy URL, else the local preview URL while the upload is in flight. */
8
4
  export declare const getAttachmentPreviewUrl: (attachment?: Attachment | LocalAttachment, ...urls: (string | undefined)[]) => string | undefined;
9
- /**
10
- * An attachment's declared file size. v10 moved these fields under `attachment.custom`; the flat
11
- * one remains a fallback for older or hand-built payloads. Where the field lives is this package's
12
- * schema knowledge, not a UI SDK's.
13
- */
5
+ /** The declared file size: `custom.file_size`, falling back to a flat `file_size`. */
14
6
  export declare const resolveAttachmentFileSize: (attachment?: {
15
7
  custom?: {
16
8
  file_size?: number | string;
17
9
  } | null;
18
10
  file_size?: number | string;
19
11
  }) => number | string | undefined;
20
- /**
21
- * Size in bytes, preferring the held `File` — during an upload that is the only exact figure,
22
- * since `file_size` may be absent until the server answers.
23
- */
12
+ /** Size in bytes, preferring the held `File` (`file_size` may be absent until the server answers). */
24
13
  export declare const resolveAttachmentFullByteSize: (attachment?: {
25
14
  custom?: {
26
15
  file_size?: number | string;
@@ -5,10 +5,7 @@ export declare const DEFAULT_TEXT_COMPOSER_CONFIG: TextComposerConfig;
5
5
  export declare const DEFAULT_POLL_COMPOSER_CONFIG: PollComposerConfig;
6
6
  export declare const DEFAULT_LOCATION_COMPOSER_CONFIG: LocationComposerConfig;
7
7
  /**
8
- * Frozen, because `MessageComposer.requestedConfig` seeds its merge with a *shallow* spread of this
9
- * object: any subtree no configuration layer names stays identical by reference to the one here, and is
10
- * reachable through the public `composer.config`. Without the freeze,
11
- * `composer.config.drafts.enabled = true` changed the default for every composer on every client in the
12
- * process. See {@link deepFreezeConfig}.
8
+ * Deep-frozen: composers share these subtrees by reference through `composer.config`. See
9
+ * {@link deepFreezeConfig}.
13
10
  */
14
11
  export declare const DEFAULT_COMPOSER_CONFIG: MessageComposerConfig;
@@ -9,8 +9,8 @@ export type MinimumUploadRequestResult = {
9
9
  } & Partial<Record<string, unknown>>;
10
10
  /**
11
11
  * Optional second argument to `UploadRequestFn`.
12
- * - Call `onProgress` to report 0–100 or `undefined` when indeterminate.
13
- * - Forward `abortSignal` to your upload implementation to cancel the upload if the user deletes the attachment while it's uploading.
12
+ * - Call `onProgress` to report 0 to 100, or `undefined` when indeterminate.
13
+ * - Forward `abortSignal` to your upload to cancel it when the attachment is deleted mid-upload.
14
14
  */
15
15
  export type UploadRequestOptions = {
16
16
  onProgress?: (percent: number | undefined) => void;
@@ -23,7 +23,7 @@ export type DraftsConfiguration = {
23
23
  export type TextComposerConfig = {
24
24
  /** If false, the text input, change and selection events are disabled */
25
25
  enabled: boolean;
26
- /** If true, triggers typing events on text input keystroke. Disabled for threads and message editing by default. */
26
+ /** If true, triggers typing events on text input keystroke. Defaults to `true`. */
27
27
  publishTypingEvents: boolean;
28
28
  /** Default value for the message input */
29
29
  defaultValue?: string;
@@ -51,64 +51,51 @@ export type CommandsConfig = {
51
51
  };
52
52
  export type AttachmentManagerConfig = {
53
53
  /**
54
- * Allows for toggling file attachments (defaults to `true`). The feature also has to be enabled at the
55
- * channel-level config via `uploads`; the two are ANDed, so either side can switch it off.
54
+ * Toggles file attachments. ANDed with the channel config's `uploads` unless `customCdn` is set.
55
+ * Defaults to `true`.
56
56
  */
57
57
  enabled: boolean;
58
- /**
59
- * Function that allows to prevent uploading files based on the functions output.
60
- * Use this option to simulate deprecated prop noFiles which was actually a filter to upload only image files.
61
- */
58
+ /** Prevents uploading a file when it returns `false`. */
62
59
  fileUploadFilter: FileUploadFilter;
63
60
  /** Maximum number of attachments allowed per message */
64
61
  maxNumberOfFilesPerMessage: number;
65
62
  /**
66
- * Array of one or more file types, or unique file type specifiers (https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/accept#unique_file_type_specifiers),
67
- * describing which file types are allowed to be selected when uploading files.
63
+ * File types or unique file type specifiers
64
+ * (https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/accept#unique_file_type_specifiers)
65
+ * allowed for selection. Empty means all files.
68
66
  */
69
67
  acceptedFiles: string[];
70
68
  /** Function that allows to customize the upload request. */
71
69
  doUploadRequest?: UploadRequestFn;
72
70
  /**
73
- * Whether a custom {@link AttachmentManagerConfig.doUploadRequest} stores files somewhere Stream does
74
- * not host (defaults to `false`).
75
- *
76
- * Left `false`, uploads are treated as reaching Stream — which covers the built-in request *and* a
77
- * custom one that still posts to Stream, such as a wrapper adding retries or headers, or a proxy
78
- * through your own backend. Stream's rules then govern attachments: the `upload-file` capability and
79
- * the channel type's `uploads` flag.
80
- *
81
- * Set it to `true` when the bytes never reach Stream. Stream has no say over storage it does not host,
82
- * so neither rule applies and the feature is governed by {@link AttachmentManagerConfig.enabled} alone.
83
- *
84
- * Declared rather than inferred from the presence of `doUploadRequest`, because supplying an upload
85
- * function says *how* files are sent, not *where* — and treating it as a destination waived Stream's
86
- * constraints for integrators who were still uploading to Stream.
71
+ * Whether a custom {@link AttachmentManagerConfig.doUploadRequest} stores files outside Stream.
72
+ * When `false`, Stream's rules apply (the `upload-file` capability and the channel type's
73
+ * `uploads` flag). When `true`, only {@link AttachmentManagerConfig.enabled} governs uploads.
74
+ * Defaults to `false`.
87
75
  */
88
76
  customCdn: boolean;
89
77
  /**
90
- * When `true`, a message may be sent while its attachments are still uploading (defaults to
91
- * `false`). The message is composed and shown right away, and the send request waits for those
92
- * uploads to settle before it goes out; if one of them fails, the whole message fails.
78
+ * When `true`, a message may be sent while its attachments are still uploading. The message is
79
+ * composed and shown right away, and the send request waits for those uploads to settle before
80
+ * it goes out; if one of them fails, the whole message fails. Defaults to `false`.
93
81
  */
94
82
  pendingUploadsEnabled: boolean;
95
83
  /**
96
84
  * When `true`, the attachment manager sets `localMetadata.uploadProgress` and passes
97
85
  * `options.onProgress` to `doUploadRequest` (built-in and custom). Set to `false` to disable
98
- * progress tracking (defaults to `true`).
86
+ * progress tracking. Defaults to `true`.
99
87
  */
100
88
  trackUploadProgress: boolean;
101
89
  };
102
90
  export type LinkPreviewsManagerConfig = {
103
- /** Number of milliseconds to debounce firing the URL enrichment queries when typing (defaults to `1500`). */
91
+ /**
92
+ * Number of milliseconds to debounce firing the URL enrichment queries when typing. Defaults to
93
+ * `1500`.
94
+ */
104
95
  debounceURLEnrichmentMs: number;
105
96
  /**
106
- * Allows for toggling URL enrichment and link previews in `MessageInput` (defaults to `true`).
107
- *
108
- * ANDed with the channel type's `url_enrichment`, so previews appear only where the server will
109
- * actually enrich the message. `true` is the default for the same reason every other server-gated
110
- * feature uses it: it means "no opinion — let the server decide". A `false` default double-gated the
111
- * feature, leaving it off even where the server had enabled it.
97
+ * Toggles URL enrichment and link previews. ANDed with the channel type's `url_enrichment`.
98
+ * Defaults to `true`.
112
99
  */
113
100
  enabled: boolean;
114
101
  /** Custom function to identify URLs in a string and request OG data */
@@ -118,45 +105,31 @@ export type LinkPreviewsManagerConfig = {
118
105
  };
119
106
  export type LocationComposerConfig = {
120
107
  /**
121
- * Allows for toggling the location addition (defaults to `true`). The feature also has to be
122
- * enabled at the channel-level config via `shared_locations`.
108
+ * Toggles location sharing. ANDed with the channel config's `shared_locations`. Defaults to
109
+ * `true`.
123
110
  */
124
111
  enabled: boolean;
125
112
  /** Function that provides a stable ID for the device from which the location is shared. */
126
113
  getDeviceId: () => string;
127
- /**
128
- * Shortest live-location duration accepted as valid (defaults to 60s). A shorter `durationMs` makes
129
- * the composed location invalid rather than clamping it, so this is a product decision about the
130
- * minimum useful sharing window — not a protocol limit.
131
- */
114
+ /** Shortest live-location duration in ms. A shorter `durationMs` is invalid. Defaults to 60s. */
132
115
  minShareDurationMs: number;
133
116
  };
134
117
  export type PollComposerConfig = {
135
- /**
136
- * Allows for toggling poll composition (defaults to `true`). The feature also has to be enabled at the
137
- * channel-level config via `polls`; the two are ANDed, so either side can switch it off.
138
- */
118
+ /** Toggles poll composition. ANDed with the channel config's `polls`. Defaults to `true`. */
139
119
  enabled: boolean;
140
120
  };
141
121
  export type MessageComposerConfig = {
142
122
  /** If true, enables creating drafts on the server */
143
123
  drafts: DraftsConfiguration;
144
- /** Configuration for command sendability validation */
145
124
  commands: CommandsConfig;
146
- /** Configuration for the attachment manager */
147
125
  attachments: AttachmentManagerConfig;
148
- /** Configuration for the link previews manager */
149
126
  linkPreviews: LinkPreviewsManagerConfig;
150
- /** Configuration for the location composer */
151
127
  location: LocationComposerConfig;
152
- /** Configuration for the poll composer */
153
128
  polls: PollComposerConfig;
154
129
  /**
155
- * Decides whether submitting keeps the composer's contents instead of clearing them, and whether
156
- * the attachments composition step leaves unresolved uploads behind with them. Defaults to
157
- * retaining for a poll message, which carries no text or attachments of its own.
130
+ * Whether submitting keeps the composer's contents instead of clearing them (also leaving unresolved
131
+ * uploads in place). Defaults to retaining for a poll message.
158
132
  */
159
133
  retainCompositionOnSubmit: (composer: MessageComposer) => boolean;
160
- /** Maximum number of characters in a message */
161
134
  text: TextComposerConfig;
162
135
  };
@@ -7,13 +7,13 @@ export type LinkPreview = OGAttachment & {
7
7
  status: LinkPreviewStatus;
8
8
  };
9
9
  export interface ILinkPreviewsManager {
10
- /** Function cancels all scheduled or in-progress URL enrichment queries. */
10
+ /** Cancels all scheduled or in-progress URL enrichment queries. */
11
11
  cancelURLEnrichment: () => void;
12
- /** Function that triggers the search for URLs and their enrichment. */
12
+ /** Searches the text for URLs and enriches them. */
13
13
  findAndEnrichUrls?: DebouncedFunc<(text: string) => void>;
14
14
  }
15
15
  export declare enum LinkPreviewStatus {
16
- /** Link preview has been dismissed using */
16
+ /** Link preview has been dismissed (`dismissPreview`). */
17
17
  DISMISSED = "dismissed",
18
18
  /** Link preview could not be loaded, the enrichment request has failed. */
19
19
  FAILED = "failed",
@@ -70,10 +70,7 @@ export declare class LinkPreviewsManager implements ILinkPreviewsManager {
70
70
  restoreSnapshot: (snapshot: LinkPreviewsManagerSnapshot) => void;
71
71
  private _findAndEnrichUrls;
72
72
  cancelURLEnrichment: () => void;
73
- /**
74
- * Clears all non-dismissed previews when the text composer is cleared.
75
- * This ensures that dismissed previews are not re-enriched in the future.
76
- */
73
+ /** Clears all previews except dismissed ones, so those are not re-enriched. */
77
74
  clearPreviews: () => void;
78
75
  updatePreview: (url: LinkURL, preview: Partial<LinkPreview>) => void;
79
76
  dismissPreview: (url: LinkURL) => void;
@@ -83,10 +80,10 @@ export declare class LinkPreviewsManager implements ILinkPreviewsManager {
83
80
  static previewIsFailed: (preview: LinkPreview) => boolean;
84
81
  static previewIsPending: (preview: LinkPreview) => boolean;
85
82
  static getPreviewData: (preview: LinkPreview) => {
86
- type?: string | undefined;
87
- actions?: Array<import("..").Action> | undefined;
88
83
  custom: import("..").CustomAttachmentData;
84
+ type?: string | undefined;
89
85
  text?: string | undefined;
86
+ actions?: Array<import("..").Action> | undefined;
90
87
  giphy?: import("..").Images | undefined;
91
88
  title?: string | undefined;
92
89
  fields?: Array<import("..").Field> | undefined;