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
@@ -24,11 +24,7 @@ import type { PollComposerSnapshot } from './pollComposer';
24
24
  import type { TextComposerSnapshot } from './textComposer';
25
25
  import type { DeepPartial } from '../types.utility';
26
26
  type UnregisterSubscriptions = Unsubscribe;
27
- /**
28
- * Composer edit-audit clock. Both values are unix nanoseconds, so a locally stamped change and a
29
- * server-derived `created_at` / `updated_at` are directly comparable — which is the whole point of
30
- * this state.
31
- */
27
+ /** Unix nanoseconds, directly comparable with server `created_at` / `updated_at`. */
32
28
  export type LastComposerChange = {
33
29
  draftUpdate: TimestampNS | null;
34
30
  stateUpdate: TimestampNS;
@@ -54,18 +50,12 @@ export type MessageComposerSnapshot = {
54
50
  };
55
51
  export type CompositionContext = Channel | Thread | LocalMessage;
56
52
  /**
57
- * What a submit did, and by implication where the content now is.
58
- *
59
- * - `sent` - it went out.
60
- * - `nothing-to-send` - there was nothing to compose, or a middleware discarded the composition
61
- * (a command that is not ready, one disabled by the quoted or edited message, an upload still
62
- * running). **The composer keeps its contents**, and the reason has already been reported through
63
- * `client.notifications`.
64
- * - `failed` - the request failed. **The composer has been released**; the content is in the
65
- * message list marked `failed`, where the user retries it.
66
- *
67
- * The distinction matters because the last two leave the composer in opposite states, so a caller
68
- * that reopens or restores UI has to tell them apart.
53
+ * Outcome of `send()` and `update()`:
54
+ * - `sent`: the message or edit went out.
55
+ * - `nothing-to-send`: nothing to compose, or a middleware discarded the composition (reported through
56
+ * `client.notifications`). **The composer keeps its contents.**
57
+ * - `failed`: the request failed. **The composer is released**; the content is in the message list
58
+ * marked `failed`, where the user retries it.
69
59
  */
70
60
  export type MessageComposerSubmitResult = 'sent' | 'nothing-to-send' | 'failed';
71
61
  export type MessageComposerState = {
@@ -74,10 +64,7 @@ export type MessageComposerState = {
74
64
  pollId: string | null;
75
65
  quotedMessage: LocalMessage | null;
76
66
  showReplyInChannel: boolean;
77
- /**
78
- * Baseline snapshot of the message being edited (if any).
79
- * This is intentionally immutable with respect to the editing session and can be used for restore/cancel.
80
- */
67
+ /** Baseline of the message being edited, unchanged during the session (for restore or cancel). */
81
68
  editedMessage: LocalMessage | null;
82
69
  };
83
70
  export type MessageComposerOptions = {
@@ -90,11 +77,6 @@ export declare class MessageComposer extends WithSubscriptions {
90
77
  readonly channel: Channel;
91
78
  readonly state: StateStore<MessageComposerState>;
92
79
  readonly editingAuditState: StateStore<EditingAuditState>;
93
- /**
94
- * Resolved configuration, as a store — the shape every configurable class exposes
95
- * (`configState` / `config` / `updateConfig`). Delegates rather than holding a copy, so the field and
96
- * the controller's store cannot drift.
97
- */
98
80
  get configState(): StateStore<MessageComposerConfig>;
99
81
  readonly compositionContext: CompositionContext;
100
82
  readonly compositionMiddlewareExecutor: MessageComposerMiddlewareExecutor;
@@ -107,29 +89,11 @@ export declare class MessageComposer extends WithSubscriptions {
107
89
  customDataManager: CustomDataManager;
108
90
  private snapshots;
109
91
  private effectHandlers;
110
- /**
111
- * The shared configuration machinery, with the three hooks this entity is the only one to need:
112
- * `retainPatches` so an `updateConfig` request is *retained* and re-applied rather than written
113
- * into the result (**DV-18**), and `applyAuthority` for the server's last word.
114
- *
115
- * A third hook, `finalizeRequest`, was added here for `commands.sendValidator` and then removed: the
116
- * deep merge assigns function values directly and skips `undefined`, so the override it called reached
117
- * the same answer on every layer shape — a later layer that stays silent cannot erase an earlier
118
- * choice, because a merge only writes keys that are present.
119
- */
120
92
  private readonly configController;
121
93
  constructor({ composition, config, compositionContext, client, }: MessageComposerOptions);
122
94
  static evaluateContextType(compositionContext: CompositionContext): "message" | "channel" | "thread";
123
95
  static constructTag(compositionContext: CompositionContext): `${ReturnType<typeof MessageComposer.evaluateContextType>}_${string}`;
124
96
  static generateId: typeof generateUUIDv4;
125
- /**
126
- * The current resolved configuration.
127
- *
128
- * `Readonly` for the same reason every other configurable class's getter is: the value is the store's
129
- * live object, so assigning to a field would change state while notifying nobody. Use
130
- * {@link updateConfig}. `Readonly` is shallow, so nested writes are caught at runtime instead — the
131
- * whole resolution is deep-frozen by {@link resolvedConfig}, not only the untouched defaults.
132
- */
133
97
  get config(): Readonly<MessageComposerConfig>;
134
98
  get editedMessage(): LocalMessage | undefined;
135
99
  set editedMessage(editedMessage: LocalMessage | undefined);
@@ -148,120 +112,46 @@ export declare class MessageComposer extends WithSubscriptions {
148
112
  isCommandDisabled: (command: Command) => boolean;
149
113
  validateCommandSendability: (command: Command, text?: string) => CommandSendability;
150
114
  get isCommandSendable(): boolean;
151
- /**
152
- * Whether a message may be sent while its attachments are still uploading — see
153
- * {@link AttachmentManagerConfig.pendingUploadsEnabled}.
154
- */
115
+ /** See {@link AttachmentManagerConfig.pendingUploadsEnabled}. */
155
116
  get allowsPendingUploads(): boolean;
156
117
  /**
157
- * Where a composed message goes: the thread when this composer belongs to one, the channel
158
- * otherwise.
159
- *
160
- * Thread replies live in `thread.messagePaginator`, which is independent of the channel's, so
161
- * dispatching to the wrong one leaves the reply invisible where it was written. An edit composer
162
- * is built from the message rather than from its thread, so it finds the thread only when
163
- * `client.threads` has it registered — listed, or active (open somewhere).
118
+ * The thread when this composer belongs to one, else the channel. An edit composer finds its thread
119
+ * only if `client.threads` has it registered (listed or active).
164
120
  */
165
121
  get defaultSubmitTarget(): Channel | Thread;
166
122
  /**
167
- * Whether submitting keeps the composer's contents rather than clearing them - see
168
- * {@link MessageComposerConfig.retainCompositionOnSubmit}.
169
- *
170
- * Read by the attachments composition step too: content the composer keeps must not also ride
171
- * along on the submitted message, or one `localMetadata.id` ends up owned in two places.
123
+ * See {@link MessageComposerConfig.retainCompositionOnSubmit}. The attachments composition step reads
124
+ * it too, so retained content is not also sent on the message.
172
125
  */
173
126
  get retainsCompositionOnSubmit(): boolean;
174
127
  get hasSendableData(): boolean;
175
128
  get compositionIsEmpty(): boolean;
176
129
  get contentIsEmpty(): boolean;
177
130
  get lastChangeOriginIsLocal(): boolean;
178
- /**
179
- * Records a configuration change as something *you* asked for, then republishes.
180
- *
181
- * The patch is kept — see {@link imperativeConfig} — rather than merged into the published result and
182
- * forgotten. That is what makes the request survive a later re-resolution, including one triggered by
183
- * the server changing its mind.
184
- */
131
+ /** The patch is retained, so it survives later re-resolutions (e.g. a server change). */
185
132
  updateConfig(config: DeepPartial<MessageComposerConfig>): void;
186
- /**
187
- * What this composer has been **asked** for, before the server has any say — stages 1 to 5 of
188
- * `docs/instance-configuration.md` §3.
189
- *
190
- * Available on every entity that retains its patches, not just this one: it is the controller's, and
191
- * the split it exposes is what **FU-35** would extend elsewhere by switching on `retainPatches`.
192
- */
133
+ /** The config as requested, before server restrictions (`docs/instance-configuration.md` §3). */
193
134
  get requestedConfig(): Readonly<MessageComposerConfig>;
194
135
  /** The declarative slice for this composer, re-read live so a change is picked up. */
195
136
  private get declarativeConfig();
196
137
  /**
197
- * The configuration fields this composer's channel decides server-side.
198
- *
199
- * Reading them is the composer's job rather than the shared helper's: only the composer knows that
200
- * `location.enabled` is gated on `shared_locations`, and only an existing composer has a channel to
201
- * ask. `serverConfig` is re-read on every call, so a restriction that changes mid-session is picked up
202
- * rather than captured once.
203
- *
204
- * Every entry here is a boolean gate, so `mergeServerRestrictions` ANDs it with what was requested and
205
- * either side may switch the feature off — a client asking for less than the server grants is always
206
- * legitimate. That is the whole point of mirroring these flags into configuration rather than leaving
207
- * consumers to read `serverConfig` themselves: a raw server flag answers only the server's half, so a UI
208
- * reading it offers features the composer has already disabled and would refuse to compose.
209
- *
210
- * `commands` is deliberately absent. The server sends a *list* of commands rather than a gate, so there
211
- * is nothing to AND and no integrator intent to mirror; consumers read it from the channel's config.
212
- *
213
- * Takes the requested configuration because one restriction is conditional — see `uploads` below.
138
+ * Server-side gates from the channel config, re-read on every call. Each is a boolean that
139
+ * `mergeServerRestrictions` ANDs with the request. `commands` is absent (the server sends a list,
140
+ * not a gate).
214
141
  */
215
142
  private serverRestrictionsFor;
216
- /**
217
- * Ceilings this composer's channel imposes server-side.
218
- *
219
- * `max_message_length` caps both length limits rather than setting them: a composer asking for something
220
- * shorter keeps its own number, and one asking for nothing at all inherits the server's — which is the
221
- * default, and the case worth having. Left unlimited, the composer happily accepts text the send endpoint
222
- * then rejects, so the limit is enforced late and as an API error instead of in the editor.
223
- */
143
+ /** `max_message_length` caps both length limits: a smaller requested value wins, unset inherits it. */
224
144
  private get serverUpperBounds();
225
- /**
226
- * Resolves the configuration and publishes it, unless the result is deep-equal to what is already there.
227
- *
228
- * The guard is needed because `StateStore.next`'s own `===` no-op can never apply here: every resolution
229
- * allocates a new object, so without a comparison *every* publish notifies, whether or not any value
230
- * moved.
231
- *
232
- * Worth the walk: `isEqual` over a resolved composer config measures ~1.7µs, against a resolution at
233
- * ~3.5µs plus every subscriber's work. The dominant source of no-op publishes is fixed upstream in
234
- * `StreamChat._addChannelConfig`, which stops a repeated channel query from waking that channel's
235
- * composer at all; this
236
- * catches the rest — re-registering a declarative value that has not changed, a `reset` with nothing
237
- * registered, an empty `updateConfig({})`.
238
- */
239
145
  private publishConfig;
240
146
  /**
241
- * Rebuilds the configuration from its inputs and **discards imperative changes** — every
242
- * {@link updateConfig} patch, including those made through a sub-composer setter such as
243
- * `textComposer.defaultValue` or `attachmentManager.maxNumberOfFilesPerMessage`.
244
- *
245
- * Called by the constructor and by `client.config.reset()`, where dropping them is the point: a reset
246
- * means "back to what is registered". Anything that merely needs the configuration re-resolved — the
247
- * server's answer arriving, a declarative change — must use {@link publishConfig} or
248
- * {@link applyServerRestrictions}, which keep them.
147
+ * Rebuilds the configuration from its inputs and **discards every {@link updateConfig} patch**,
148
+ * including those from sub-composer setters. To re-resolve and keep them, use
149
+ * {@link applyServerRestrictions}.
249
150
  */
250
151
  initializeConfig: () => void;
251
152
  /**
252
- * Re-resolves the configuration against the channel's current server-side restrictions.
253
- *
254
- * Call this when the server's answer may have changed — its config has just arrived, or it was updated.
255
- * Safe in both directions, which is the whole reason it exists: a feature you disabled stays disabled
256
- * when the server permits it, and a feature the server *stops* restricting goes back to whatever you
257
- * asked for, because the restriction is applied to your request rather than to the previous result.
258
- *
259
- * Reachable rather than public: `Channel.query` is the only caller, covering a composer that has not
260
- * registered subscriptions and so cannot hear the answer change through
261
- * {@link subscribeChannelConfigChanged}. Nothing outside this package needs it — registering subscriptions
262
- * is the supported way to stay current, and a composer that has done so is already covered. Marked
263
- * `@internal` so it is not read as a supported extension point; the name is kept because what it does
264
- * is* re-assert the server's restrictions, even though the whole resolution is what performs that.
153
+ * Re-resolves the configuration against the channel's current server-side restrictions, keeping
154
+ * `updateConfig` patches. `Channel.query` calls it for composers without registered subscriptions.
265
155
  *
266
156
  * @internal
267
157
  */
@@ -276,10 +166,8 @@ export declare class MessageComposer extends WithSubscriptions {
276
166
  getSnapshot: () => MessageComposerSnapshot;
277
167
  restoreSnapshot: (snapshot: MessageComposerSnapshot) => void;
278
168
  /**
279
- * Moves this composition into `target`, replacing what `target` held, and clears this composer
280
- * locally: the text, attachments, poll, location, link previews, custom data, quoted message and
281
- * reply-in-channel choice. An upload still running keeps running and its result lands in `target`
282
- * (see {@link AttachmentManager.takeOver}). Nothing is sent.
169
+ * Moves this composition into `target`, replacing what `target` held, and clears this composer.
170
+ * Running uploads continue into `target` (see {@link AttachmentManager.takeOver}). Nothing is sent.
283
171
  *
284
172
  * @internal
285
173
  */
@@ -298,16 +186,6 @@ export declare class MessageComposer extends WithSubscriptions {
298
186
  registerSubscriptions: () => UnregisterSubscriptions;
299
187
  private subscribeMessageUpdated;
300
188
  private subscribeMessageComposerSetupStateChange;
301
- /**
302
- * The channel's server-side config (`client.channelServerConfigs[cid]`) is populated by `query`/`watch`,
303
- * which for a channel opened via `client.channelManager.ensure({ type, id })` happens *after* this composer was
304
- * constructed. Left unwatched, the composer would keep the defaults it derived when `serverConfig` was
305
- * still undefined — so `location.enabled` would stay `true` for an app that disables `shared_locations`
306
- * server-side. Re-deriving when the config lands keeps the server authoritative.
307
- *
308
- * Selected by cid, matching the store's key space: `shared_locations` and `max_message_length` are both
309
- * overridable per channel, so a sibling channel's config is not this composer's answer.
310
- */
311
189
  private subscribeChannelConfigChanged;
312
190
  private subscribeMessageDeleted;
313
191
  private subscribeDraftUpdated;
@@ -330,27 +208,15 @@ export declare class MessageComposer extends WithSubscriptions {
330
208
  deleteDraft: () => Promise<void>;
331
209
  getDraft: () => Promise<void>;
332
210
  createPoll: () => Promise<void>;
333
- /**
334
- * Lets go of what the submitted message took with it.
335
- *
336
- * A poll message carries no text or attachments of its own, so the composer keeps whatever else
337
- * was drafted and releases only the poll. Everything else is a full clear.
338
- */
211
+ /** Clears the composer, or only detaches the poll when `retainsCompositionOnSubmit`. */
339
212
  private releaseSubmittedComposition;
340
213
  private reportSubmitFailure;
341
214
  /**
342
- * Composes the message and sends it, releasing the composer as it goes.
343
- *
344
- * Never rejects - see {@link MessageComposerSubmitResult} for what each outcome means and where
345
- * the content ends up. A failure is reported through `client.notifications`, and the message
346
- * stays in the list marked `failed`, which is where the user retries it. Callers rendering their
347
- * own post-send feedback have to check the result.
215
+ * Composes and sends the message. Never rejects: see {@link MessageComposerSubmitResult}. A failure is
216
+ * reported through `client.notifications`.
348
217
  */
349
218
  send: () => Promise<MessageComposerSubmitResult>;
350
- /**
351
- * Composes the edit and saves it, on the same terms as {@link send} - including releasing the
352
- * composer before the request rather than after it.
353
- */
219
+ /** Composes and saves the edit, on the same terms as {@link send}. */
354
220
  update: () => Promise<MessageComposerSubmitResult>;
355
221
  sendLocation: () => Promise<void>;
356
222
  }
@@ -3,19 +3,9 @@ import type { MessageComposer } from '../../../messageComposer';
3
3
  /**
4
4
  * Writes the uploaded URL onto the attachment and releases its local preview.
5
5
  *
6
- * The preview is a blob URL the composer created for the file. Releasing it once the CDN URL is
7
- * in is what keeps the browser from holding the file in memory.
8
- *
9
- * Pass `composer` and the preview is released only while the attachment is still one of the
10
- * composer's own — still listed in `attachmentManager.attachments`, i.e. still shown above the
11
- * input, waiting to be sent.
12
- *
13
- * This runs when an upload finishes, which can be after the composer was cleared: `uploadFile`
14
- * executes this chain before the (by then no-op) `updateAttachment`. If the attachment is gone
15
- * from the composer, a message is rendering from the preview instead, and releasing it would
16
- * blank that message out. A message can be sent with uploads still running — see
17
- * {@link AttachmentManagerConfig.pendingUploadsEnabled}.
18
- *
19
- * Omit `composer` and the preview is always released.
6
+ * With `composer`, the preview is released only while the attachment is still in
7
+ * `attachmentManager.attachments`: an upload can finish after the composer was cleared (see
8
+ * {@link AttachmentManagerConfig.pendingUploadsEnabled}), and a sent message may still render from it.
9
+ * Without `composer`, it is always released.
20
10
  */
21
11
  export declare const createPostUploadAttachmentEnrichmentMiddleware: (composer?: MessageComposer) => AttachmentPostUploadMiddleware;
@@ -1,15 +1,8 @@
1
1
  import type { MessageComposer } from '../../messageComposer';
2
2
  import type { MessageCompositionMiddleware, MessageDraftCompositionMiddleware } from './types';
3
3
  /**
4
- * Composes the message's attachments.
5
- *
6
- * By default an upload still in flight blocks the send: the chain warns and discards the
7
- * composition. With {@link AttachmentManagerConfig.pendingUploadsEnabled} on it composes
8
- * anyway, leaving `message.attachments` without the unresolved ones — `MessageOperations` awaits
9
- * those uploads and fills in the URLs before the request goes out.
10
- *
11
- * The config is read per composition rather than at construction, so `updateConfig` takes effect
12
- * on the next send with no need to reinstall anything.
4
+ * Composes the message's attachments. An upload in flight blocks the send (warns and discards) unless
5
+ * {@link AttachmentManagerConfig.pendingUploadsEnabled} is on. The config is read per composition.
13
6
  */
14
7
  export declare const createAttachmentsCompositionMiddleware: (composer: MessageComposer) => MessageCompositionMiddleware;
15
8
  export declare const createDraftAttachmentsCompositionMiddleware: (composer: MessageComposer) => MessageDraftCompositionMiddleware;
@@ -14,10 +14,8 @@ export type UpdateFieldsData = Partial<Omit<PollComposerState['data'], 'options'
14
14
  options?: PollComposerOptionUpdate;
15
15
  };
16
16
  /**
17
- * Field validation errors, keyed by field. `options` errors are keyed by option id.
18
- *
19
- * Values carry a stable {@link PollComposerValidationError.code} rather than being bare English, so a UI can
20
- * localize them; see {@link POLL_COMPOSER_VALIDATION_CODE}.
17
+ * Field validation errors, keyed by field (`options` errors by option ID). Each carries a stable
18
+ * {@link PollComposerValidationError.code} for localization.
21
19
  */
22
20
  export type PollComposerFieldErrors = Partial<Omit<Record<keyof CreatePollRequest, PollComposerValidationError>, 'options'> & {
23
21
  options?: Record<string, PollComposerValidationError>;
@@ -1,13 +1,7 @@
1
1
  /**
2
- * Stable identifiers for poll-composer field validation failures.
3
- *
4
- * **Not notifications, despite the shared `domain:entity:operation:result` shape.** These are *field*
5
- * errors, rendered inline beside the input that produced them, and they never reach
6
- * `NotificationManager` — routing them there would raise a toast per keystroke. `CORE_NOTIFICATION_TYPE`
7
- * is the notification counterpart; the two sets are disjoint and neither substitutes for the other.
8
- *
9
- * **These values are public API.** UI SDKs key their translation tables on them, so renaming one is a
10
- * breaking change.
2
+ * Identifiers for poll-composer field validation failures. They are rendered inline and never reach
3
+ * `NotificationManager` (unlike `CORE_NOTIFICATION_TYPE`). **Public API:** UI SDKs key translations on
4
+ * them, so renaming one is breaking.
11
5
  */
12
6
  export declare const POLL_COMPOSER_VALIDATION_CODE: {
13
7
  readonly maxVotesNotNumeric: "validation:poll:maxVotes:notNumeric";
@@ -18,13 +12,7 @@ export declare const POLL_COMPOSER_VALIDATION_CODE: {
18
12
  readonly optionEmpty: "validation:poll:option:empty";
19
13
  };
20
14
  export type PollComposerValidationCode = (typeof POLL_COMPOSER_VALIDATION_CODE)[keyof typeof POLL_COMPOSER_VALIDATION_CODE];
21
- /**
22
- * A poll-composer field validation failure.
23
- *
24
- * `code` is the stable identifier to resolve localized copy from. `message` carries untranslated
25
- * English alongside it so a consumer with no i18n layer still renders something, and so an
26
- * identifier a consumer does not recognize degrades to readable text instead of a blank field.
27
- */
15
+ /** A poll-composer field validation failure. `message` is an English fallback for `code`. */
28
16
  export type PollComposerValidationError = {
29
17
  /** Stable identifier. See {@link POLL_COMPOSER_VALIDATION_CODE}. */
30
18
  code: PollComposerValidationCode;
@@ -36,9 +24,9 @@ export type PollComposerValidationError = {
36
24
  /** Builds a {@link PollComposerValidationError}, filling in the English fallback for `code`. */
37
25
  export declare const pollComposerValidationError: (code: PollComposerValidationCode, metadata?: Record<string, unknown>) => PollComposerValidationError;
38
26
  /**
39
- * Narrows a field's error to a single failure.
27
+ * Distinguishes a single failure from the per-option-ID record that `options` errors use.
40
28
  *
41
- * `options` errors are keyed by option id, so a field error is either one `PollComposerValidationError` or a
42
- * record of them; this distinguishes the two.
29
+ * @param value - A field error entry.
30
+ * @returns Whether `value` is a single `PollComposerValidationError`.
43
31
  */
44
32
  export declare const isPollComposerValidationError: (value: unknown) => value is PollComposerValidationError;
@@ -35,6 +35,15 @@ export declare class CommandSearchSource extends BaseSearchSourceSync<CommandSug
35
35
  protected filterQueryResults(items: CommandSuggestion[]): CommandSuggestion[];
36
36
  }
37
37
  export type CommandsMiddleware = Middleware<TextComposerMiddlewareExecutorState<CommandSuggestion>, 'onChange' | 'onSuggestionItemSelect'>;
38
+ /**
39
+ * Suggests and activates slash commands.
40
+ *
41
+ * @param channel - The channel whose commands are suggested.
42
+ * @param options - Middleware options. Defaults to `trigger: '/'` and `minChars: 1`.
43
+ * @param options.composer - Used to refuse commands disabled by the editing or quoting state.
44
+ * @param options.searchSource - A search source to use instead of a new one. Its state is reset.
45
+ * @returns The commands middleware.
46
+ */
38
47
  export declare const createCommandsMiddleware: (channel: Channel, options?: Partial<TextComposerMiddlewareOptions> & {
39
48
  composer?: MessageComposer;
40
49
  searchSource?: CommandSearchSource;
@@ -11,10 +11,13 @@ export declare const accentsMap: {
11
11
  export declare const removeDiacritics: (text?: string) => string;
12
12
  export declare const calculateLevenshtein: (query: string, name: string) => number;
13
13
  export type MentionsSearchSourceOptions = SearchSourceOptions & {
14
- /** Static base filters for the app-wide user query (mentionAllAppUsers). */
14
+ /** Base filters for the app-wide user query (`mentionAllAppUsers`). */
15
15
  userFilters?: UserFilters;
16
16
  userSort?: SortParamRequest[];
17
- /** Static base filters for the channel member query. */
17
+ /**
18
+ * Replaces the default `name` autocomplete filter of the channel member query, so the typed text
19
+ * is not applied.
20
+ */
18
21
  memberFilters?: MemberFilters;
19
22
  memberSort?: SortParamRequest[];
20
23
  searchOptions?: Omit<UserOptions, 'limit' | 'offset'>;
@@ -210,25 +213,15 @@ export declare class MentionsSearchSource extends BaseSearchSource<MentionSugges
210
213
  filterQueryResults(items: MentionSuggestion[]): MentionSuggestion[];
211
214
  resetState(): void;
212
215
  }
216
+ export type MentionsMiddleware = Middleware<TextComposerMiddlewareExecutorState<MentionSuggestion>, 'onChange' | 'onSuggestionItemSelect'>;
213
217
  /**
214
- * TextComposer middleware for mentions
215
- * Usage:
216
- *
217
- * const textComposer = new TextComposer(options);
218
+ * Suggests and inserts mentions.
218
219
  *
219
- * textComposer.use(createMentionsMiddleware(channel, {
220
- * trigger: '$',
221
- * minChars: 2
222
- * }));
223
- *
224
- * @param channel
225
- * @param {{
226
- * minChars: number;
227
- * trigger: string;
228
- * }} options
229
- * @returns
220
+ * @param channel - The channel to search mentions in.
221
+ * @param options - Middleware options. Defaults to `trigger: '@'` and `minChars: 1`.
222
+ * @param options.searchSource - A search source to use instead of a new one. Its state is reset.
223
+ * @returns The mentions middleware.
230
224
  */
231
- export type MentionsMiddleware = Middleware<TextComposerMiddlewareExecutorState<MentionSuggestion>, 'onChange' | 'onSuggestionItemSelect'>;
232
225
  export declare const createMentionsMiddleware: (channel: Channel, options?: Partial<TextComposerMiddlewareOptions> & {
233
226
  searchSource?: MentionsSearchSource;
234
227
  }) => MentionsMiddleware;
@@ -1,8 +1,14 @@
1
1
  import type { TextSelection } from './types';
2
2
  /**
3
- * For commands, we want to match all patterns except:
4
- * 1. Text not starting with trigger
5
- * 2. Trigger in middle of text
3
+ * Finds the trigger-prefixed token that ends `text`.
4
+ *
5
+ * @param params.trigger - The trigger character, e.g. `@` or `/`.
6
+ * @param params.text - The text to search.
7
+ * @param params.isCommand - Require the trigger to start the text and the token to contain no
8
+ * whitespace. Defaults to `false`.
9
+ * @param params.acceptTrailingSpaces - Let the token span one whitespace character. Ignored with
10
+ * `isCommand`. Defaults to `true`.
11
+ * @returns The trimmed token with its trigger, or `null`.
6
12
  */
7
13
  export declare const getTriggerCharWithToken: ({ trigger, text, isCommand, acceptTrailingSpaces, }: {
8
14
  trigger: string;
@@ -1,6 +1,6 @@
1
1
  import type { MessageComposer } from '../../messageComposer';
2
2
  import type { MessageComposerEffect } from '../../messageComposer';
3
- import type { Command, Event, UserResponse } from '../../../types';
3
+ import type { Command, UserResponse } from '../../../types';
4
4
  import type { TokenizationPayload } from './textMiddlewareUtils';
5
5
  import type { SearchSource, SearchSourceSync } from '../../../search';
6
6
  import type { CustomTextComposerSuggestion } from '../../types.custom';
@@ -95,11 +95,6 @@ export type TextComposerState<T extends Suggestion = Suggestion> = {
95
95
  mentions?: MentionEntity[];
96
96
  selection: TextSelection;
97
97
  text: string;
98
- /**
99
- * Live typing events keyed by user id.
100
- * Maps `user.id` -> latest typing event (`typing.start`/`typing.stop`) for that user.
101
- */
102
- typing: Record<string, Event>;
103
98
  command?: Command | null;
104
99
  suggestions?: Suggestions<T>;
105
100
  };
@@ -35,11 +35,15 @@ export declare class PollComposer {
35
35
  /**
36
36
  * Updates specified fields and generates relevant errors.
37
37
  *
38
- * @param data - Partial poll data with the fields to update.
39
- * @param injectedFieldErrors - Errors produced externally that will take precedence over the
40
- * errors generated in the middleware chain.
38
+ * @param params - The fields to update and any externally produced errors.
39
+ * @param params.data - Partial poll data with the fields to update.
40
+ * @param params.injectedFieldErrors - Errors produced externally that will take precedence over
41
+ * the errors generated in the middleware chain (optional).
41
42
  */
42
- updateFields: (data: UpdateFieldsData, injectedFieldErrors?: PollComposerFieldErrors) => Promise<void>;
43
+ updateFields: ({ data, injectedFieldErrors, }: {
44
+ data: UpdateFieldsData;
45
+ injectedFieldErrors?: PollComposerFieldErrors;
46
+ }) => Promise<void>;
43
47
  handleFieldBlur: (field: keyof PollComposerState["data"]) => Promise<void>;
44
48
  compose: () => Promise<import("..").PollComposerCompositionMiddlewareValueState | undefined>;
45
49
  }
@@ -5,7 +5,7 @@ import type { TextSelection } from './middleware/textComposer/types';
5
5
  import type { MentionEntity, TextComposerState, TextComposerStateSnapshot } from './middleware/textComposer/types';
6
6
  import type { Suggestions } from './middleware/textComposer/types';
7
7
  import type { MessageComposer } from './messageComposer';
8
- import type { Command, DraftMessage, Event, LocalMessage, UserResponse } from '../types';
8
+ import type { Command, DraftMessage, LocalMessage, UserResponse } from '../types';
9
9
  export type TextComposerOptions = {
10
10
  composer: MessageComposer;
11
11
  message?: DraftMessage | LocalMessage;
@@ -35,19 +35,13 @@ export declare class TextComposer {
35
35
  get selection(): TextSelection;
36
36
  get suggestions(): Suggestions<import("..").Suggestion> | undefined;
37
37
  get text(): string;
38
- get typing(): Record<string, Event>;
39
- set typing(typing: Record<string, Event>);
40
- setTyping: (typing: Record<string, Event>) => void;
41
- setTypingEvent: (userId: string, event: Event) => void;
42
- removeTypingEvent: (userId: string) => void;
43
38
  get textIsEmpty(): boolean;
44
39
  initState: ({ message }?: {
45
40
  message?: DraftMessage | LocalMessage;
46
41
  }) => void;
47
42
  /**
48
- * Takes over `source`'s text: the text, selection, mentions and command. Not its suggestions,
49
- * which belong to `source`'s open search, nor its typing events, which are the other users' in
50
- * `source`'s channel.
43
+ * Takes over `source`'s text, selection, mentions and command, not its suggestions (they belong to
44
+ * `source`'s open search).
51
45
  *
52
46
  * @internal
53
47
  */
@@ -40,24 +40,21 @@ export type BaseLocalAttachmentMetadata = {
40
40
  };
41
41
  export type LocalAttachmentUploadMetadata = {
42
42
  file: File | FileReference;
43
- /**
44
- * Local preview URI, typically a Blob URL from `URL.createObjectURL(file)`
45
- * or (for React Native `FileReference`) the provided `uri`.
46
- */
43
+ /** Local preview URI: a Blob URL for a `File`, or the `uri` of a React Native `FileReference`. */
47
44
  previewUri?: string;
48
45
  uploadState: AttachmentLoadingState;
49
46
  /**
50
- * Mirrors {@link UploadRecord.uploadConfirmationPending}: every byte has been sent, but the server has
51
- * not confirmed yet - not returned response to the upload request. Render an indeterminate indicator rather than a full bar.
47
+ * Mirrors {@link UploadRecord.uploadConfirmationPending}: every byte is sent but the server has not
48
+ * confirmed. Render an indeterminate indicator rather than a full bar.
52
49
  */
53
50
  uploadConfirmationPending?: boolean;
54
51
  uploadPermissionCheck?: UploadPermissionCheckResult;
55
- /** 0–100 while uploading when progress tracking is enabled; undefined otherwise or when indeterminate */
52
+ /** 0 to 100 while uploading with progress tracking on; `undefined` otherwise or when indeterminate. */
56
53
  uploadProgress?: number;
57
54
  };
58
55
  export type LocalImageAttachmentUploadMetadata = LocalAttachmentUploadMetadata & {
59
56
  /**
60
- * @deprecated `previewUri` is now available on `LocalAttachmentUploadMetadata`.
57
+ * @deprecated Use `LocalAttachmentUploadMetadata.previewUri` instead.
61
58
  */
62
59
  previewUri?: string;
63
60
  };