stream-chat-angular 6.0.0-beta.5 → 6.0.0-rc.2

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 (202) hide show
  1. package/README.md +2 -2
  2. package/assets/i18n/en.d.ts +0 -1
  3. package/assets/version.d.ts +1 -1
  4. package/{esm2022 → esm2020}/assets/i18n/en.mjs +1 -2
  5. package/{esm2022 → esm2020}/assets/version.mjs +2 -2
  6. package/esm2020/lib/attachment-configuration.service.mjs +182 -0
  7. package/esm2020/lib/attachment-list/attachment-list.component.mjs +232 -0
  8. package/esm2020/lib/attachment-preview-list/attachment-preview-list.component.mjs +55 -0
  9. package/esm2020/lib/attachment.service.mjs +481 -0
  10. package/esm2020/lib/avatar/avatar.component.mjs +160 -0
  11. package/esm2020/lib/avatar-placeholder/avatar-placeholder.component.mjs +66 -0
  12. package/esm2020/lib/channel/channel.component.mjs +45 -0
  13. package/esm2020/lib/channel-header/channel-header.component.mjs +72 -0
  14. package/esm2020/lib/channel-list/channel-list.component.mjs +47 -0
  15. package/esm2020/lib/channel-preview/channel-preview.component.mjs +155 -0
  16. package/esm2020/lib/channel-query.mjs +77 -0
  17. package/esm2020/lib/channel.service.mjs +1561 -0
  18. package/esm2020/lib/chat-client.service.mjs +233 -0
  19. package/esm2020/lib/custom-templates.service.mjs +244 -0
  20. package/{esm2022 → esm2020}/lib/date-parser.service.mjs +5 -5
  21. package/esm2020/lib/file-utils.mjs +35 -0
  22. package/{esm2022 → esm2020}/lib/get-channel-display-text.mjs +1 -1
  23. package/esm2020/lib/get-message-translation.mjs +12 -0
  24. package/esm2020/lib/icon/icon-placeholder/icon-placeholder.component.mjs +28 -0
  25. package/{esm2022 → esm2020}/lib/icon/icon.component.mjs +5 -5
  26. package/{esm2022 → esm2020}/lib/icon/icon.module.mjs +11 -11
  27. package/{esm2022 → esm2020}/lib/icon/loading-indicator/loading-indicator.component.mjs +5 -5
  28. package/esm2020/lib/icon/loading-indicator-placeholder/loading-indicator-placeholder.component.mjs +20 -0
  29. package/{esm2022 → esm2020}/lib/list-users.mjs +1 -1
  30. package/esm2020/lib/message/message.component.mjs +486 -0
  31. package/esm2020/lib/message-actions-box/message-actions-box.component.mjs +123 -0
  32. package/esm2020/lib/message-actions.service.mjs +187 -0
  33. package/esm2020/lib/message-bounce-prompt/message-bounce-prompt.component.mjs +71 -0
  34. package/esm2020/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.mjs +333 -0
  35. package/{esm2022 → esm2020}/lib/message-input/emoji-input.service.mjs +7 -7
  36. package/esm2020/lib/message-input/message-input-config.service.mjs +50 -0
  37. package/esm2020/lib/message-input/message-input.component.mjs +507 -0
  38. package/{esm2022 → esm2020}/lib/message-input/textarea/textarea.component.mjs +6 -6
  39. package/{esm2022 → esm2020}/lib/message-input/textarea.directive.mjs +5 -5
  40. package/{esm2022 → esm2020}/lib/message-input/voice-recorder.service.mjs +5 -5
  41. package/{esm2022 → esm2020}/lib/message-list/group-styles.mjs +1 -1
  42. package/esm2020/lib/message-list/message-list.component.mjs +717 -0
  43. package/esm2020/lib/message-preview.mjs +21 -0
  44. package/esm2020/lib/message-reactions/message-reactions.component.mjs +168 -0
  45. package/esm2020/lib/message-reactions-selector/message-reactions-selector.component.mjs +61 -0
  46. package/{esm2022 → esm2020}/lib/message-reactions.service.mjs +6 -6
  47. package/esm2020/lib/message-text/message-text.component.mjs +143 -0
  48. package/esm2020/lib/message.service.mjs +43 -0
  49. package/{esm2022 → esm2020}/lib/modal/modal.component.mjs +6 -6
  50. package/esm2020/lib/notification/notification.component.mjs +20 -0
  51. package/esm2020/lib/notification-list/notification-list.component.mjs +36 -0
  52. package/{esm2022 → esm2020}/lib/notification.service.mjs +6 -6
  53. package/esm2020/lib/paginated-list/paginated-list.component.mjs +94 -0
  54. package/{esm2022 → esm2020}/lib/parse-date.mjs +1 -1
  55. package/esm2020/lib/read-by.mjs +12 -0
  56. package/esm2020/lib/stream-autocomplete-textarea.module.mjs +33 -0
  57. package/{esm2022 → esm2020}/lib/stream-avatar.module.mjs +5 -5
  58. package/{esm2022 → esm2020}/lib/stream-chat.module.mjs +59 -59
  59. package/{esm2022 → esm2020}/lib/stream-i18n.service.mjs +6 -6
  60. package/esm2020/lib/stream-textarea.module.mjs +31 -0
  61. package/{esm2022 → esm2020}/lib/theme.service.mjs +6 -6
  62. package/esm2020/lib/thread/thread.component.mjs +51 -0
  63. package/{esm2022 → esm2020}/lib/transliteration.service.mjs +5 -5
  64. package/esm2020/lib/types-custom.mjs +2 -0
  65. package/esm2020/lib/types.mjs +2 -0
  66. package/esm2020/lib/user-list/user-list.component.mjs +47 -0
  67. package/esm2020/lib/virtualized-list.service.mjs +271 -0
  68. package/{esm2022 → esm2020}/lib/virtualized-message-list.service.mjs +1 -1
  69. package/{esm2022 → esm2020}/lib/voice-recorder/amplitude-recorder.service.mjs +5 -5
  70. package/{esm2022 → esm2020}/lib/voice-recorder/audio-recorder.service.mjs +5 -5
  71. package/{esm2022 → esm2020}/lib/voice-recorder/media-recorder.mjs +1 -1
  72. package/esm2020/lib/voice-recorder/mp3-transcoder.mjs +61 -0
  73. package/esm2020/lib/voice-recorder/transcoder.service.mjs +121 -0
  74. package/esm2020/lib/voice-recorder/voice-recorder-wavebar/voice-recorder-wavebar.component.mjs +35 -0
  75. package/esm2020/lib/voice-recorder/voice-recorder.component.mjs +80 -0
  76. package/{esm2022 → esm2020}/lib/voice-recorder/voice-recorder.module.mjs +9 -9
  77. package/esm2020/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.mjs +112 -0
  78. package/esm2020/lib/voice-recording/voice-recording.component.mjs +91 -0
  79. package/{esm2022 → esm2020}/lib/voice-recording/voice-recording.module.mjs +5 -5
  80. package/{esm2022 → esm2020}/lib/wave-form-sampler.mjs +1 -1
  81. package/esm2020/public-api.mjs +86 -0
  82. package/esm2020/stream-chat.mjs +2 -0
  83. package/fesm2015/stream-chat-angular.mjs +9171 -0
  84. package/fesm2015/stream-chat-angular.mjs.map +1 -0
  85. package/{fesm2022 → fesm2020}/stream-chat-angular.mjs +1251 -961
  86. package/fesm2020/stream-chat-angular.mjs.map +1 -0
  87. package/lib/attachment-configuration.service.d.ts +12 -12
  88. package/lib/attachment-list/attachment-list.component.d.ts +15 -10
  89. package/lib/attachment-preview-list/attachment-preview-list.component.d.ts +1 -1
  90. package/lib/attachment.service.d.ts +12 -10
  91. package/lib/avatar/avatar.component.d.ts +7 -7
  92. package/lib/avatar-placeholder/avatar-placeholder.component.d.ts +5 -5
  93. package/lib/channel/channel.component.d.ts +1 -1
  94. package/lib/channel-header/channel-header.component.d.ts +2 -2
  95. package/lib/channel-list/channel-list.component.d.ts +3 -4
  96. package/lib/channel-preview/channel-preview.component.d.ts +6 -6
  97. package/lib/channel-query.d.ts +26 -0
  98. package/lib/channel.service.d.ts +146 -154
  99. package/lib/chat-client.service.d.ts +17 -15
  100. package/lib/custom-templates.service.d.ts +50 -50
  101. package/lib/get-channel-display-text.d.ts +1 -2
  102. package/lib/get-message-translation.d.ts +3 -3
  103. package/lib/icon/icon-placeholder/icon-placeholder.component.d.ts +2 -2
  104. package/lib/icon/icon.component.d.ts +2 -2
  105. package/lib/icon/loading-indicator-placeholder/loading-indicator-placeholder.component.d.ts +1 -1
  106. package/lib/message/message.component.d.ts +6 -6
  107. package/lib/message-actions-box/message-actions-box.component.d.ts +5 -4
  108. package/lib/message-actions.service.d.ts +10 -10
  109. package/lib/message-bounce-prompt/message-bounce-prompt.component.d.ts +1 -1
  110. package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +5 -5
  111. package/lib/message-input/emoji-input.service.d.ts +2 -2
  112. package/lib/message-input/message-input-config.service.d.ts +3 -3
  113. package/lib/message-input/message-input.component.d.ts +10 -33
  114. package/lib/message-input/textarea/textarea.component.d.ts +3 -3
  115. package/lib/message-input/textarea.directive.d.ts +1 -1
  116. package/lib/message-list/group-styles.d.ts +1 -1
  117. package/lib/message-list/message-list.component.d.ts +3 -2
  118. package/lib/message-preview.d.ts +2 -3
  119. package/lib/message-reactions/message-reactions.component.d.ts +9 -8
  120. package/lib/message-reactions-selector/message-reactions-selector.component.d.ts +6 -5
  121. package/lib/message-reactions.service.d.ts +4 -4
  122. package/lib/message-text/message-text.component.d.ts +5 -5
  123. package/lib/message.service.d.ts +6 -7
  124. package/lib/modal/modal.component.d.ts +1 -1
  125. package/lib/notification/notification.component.d.ts +2 -2
  126. package/lib/notification-list/notification-list.component.d.ts +1 -0
  127. package/lib/notification.service.d.ts +1 -1
  128. package/lib/paginated-list/paginated-list.component.d.ts +2 -5
  129. package/lib/read-by.d.ts +1 -2
  130. package/lib/stream-i18n.service.d.ts +1 -1
  131. package/lib/theme.service.d.ts +1 -1
  132. package/lib/thread/thread.component.d.ts +3 -3
  133. package/lib/types-custom.d.ts +15 -0
  134. package/lib/types.d.ts +116 -155
  135. package/lib/user-list/user-list.component.d.ts +2 -3
  136. package/lib/virtualized-message-list.service.d.ts +1 -1
  137. package/lib/voice-recorder/amplitude-recorder.service.d.ts +2 -2
  138. package/lib/voice-recorder/media-recorder.d.ts +2 -2
  139. package/lib/voice-recorder/transcoder.service.d.ts +4 -4
  140. package/lib/voice-recorder/voice-recorder-wavebar/voice-recorder-wavebar.component.d.ts +1 -0
  141. package/lib/voice-recorder/voice-recorder.component.d.ts +2 -2
  142. package/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.d.ts +3 -3
  143. package/lib/voice-recording/voice-recording.component.d.ts +2 -3
  144. package/package.json +21 -15
  145. package/public-api.d.ts +3 -0
  146. package/src/assets/i18n/en.ts +0 -1
  147. package/src/assets/version.ts +1 -1
  148. package/esm2022/lib/attachment-configuration.service.mjs +0 -185
  149. package/esm2022/lib/attachment-list/attachment-list.component.mjs +0 -212
  150. package/esm2022/lib/attachment-preview-list/attachment-preview-list.component.mjs +0 -55
  151. package/esm2022/lib/attachment.service.mjs +0 -479
  152. package/esm2022/lib/avatar/avatar.component.mjs +0 -157
  153. package/esm2022/lib/avatar-placeholder/avatar-placeholder.component.mjs +0 -66
  154. package/esm2022/lib/channel/channel.component.mjs +0 -45
  155. package/esm2022/lib/channel-header/channel-header.component.mjs +0 -72
  156. package/esm2022/lib/channel-list/channel-list.component.mjs +0 -50
  157. package/esm2022/lib/channel-preview/channel-preview.component.mjs +0 -150
  158. package/esm2022/lib/channel.service.mjs +0 -1393
  159. package/esm2022/lib/chat-client.service.mjs +0 -227
  160. package/esm2022/lib/custom-templates.service.mjs +0 -244
  161. package/esm2022/lib/file-utils.mjs +0 -35
  162. package/esm2022/lib/get-message-translation.mjs +0 -12
  163. package/esm2022/lib/icon/icon-placeholder/icon-placeholder.component.mjs +0 -28
  164. package/esm2022/lib/icon/loading-indicator-placeholder/loading-indicator-placeholder.component.mjs +0 -20
  165. package/esm2022/lib/message/message.component.mjs +0 -486
  166. package/esm2022/lib/message-actions-box/message-actions-box.component.mjs +0 -120
  167. package/esm2022/lib/message-actions.service.mjs +0 -187
  168. package/esm2022/lib/message-bounce-prompt/message-bounce-prompt.component.mjs +0 -71
  169. package/esm2022/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.mjs +0 -333
  170. package/esm2022/lib/message-input/message-input-config.service.mjs +0 -50
  171. package/esm2022/lib/message-input/message-input.component.mjs +0 -507
  172. package/esm2022/lib/message-list/message-list.component.mjs +0 -715
  173. package/esm2022/lib/message-preview.mjs +0 -21
  174. package/esm2022/lib/message-reactions/message-reactions.component.mjs +0 -165
  175. package/esm2022/lib/message-reactions-selector/message-reactions-selector.component.mjs +0 -57
  176. package/esm2022/lib/message-text/message-text.component.mjs +0 -143
  177. package/esm2022/lib/message.service.mjs +0 -43
  178. package/esm2022/lib/notification/notification.component.mjs +0 -20
  179. package/esm2022/lib/notification-list/notification-list.component.mjs +0 -33
  180. package/esm2022/lib/paginated-list/paginated-list.component.mjs +0 -94
  181. package/esm2022/lib/read-by.mjs +0 -12
  182. package/esm2022/lib/stream-autocomplete-textarea.module.mjs +0 -33
  183. package/esm2022/lib/stream-textarea.module.mjs +0 -31
  184. package/esm2022/lib/thread/thread.component.mjs +0 -51
  185. package/esm2022/lib/types.mjs +0 -2
  186. package/esm2022/lib/user-list/user-list.component.mjs +0 -47
  187. package/esm2022/lib/virtualized-list.service.mjs +0 -273
  188. package/esm2022/lib/voice-recorder/mp3-transcoder.mjs +0 -61
  189. package/esm2022/lib/voice-recorder/transcoder.service.mjs +0 -121
  190. package/esm2022/lib/voice-recorder/voice-recorder-wavebar/voice-recorder-wavebar.component.mjs +0 -32
  191. package/esm2022/lib/voice-recorder/voice-recorder.component.mjs +0 -80
  192. package/esm2022/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.mjs +0 -112
  193. package/esm2022/lib/voice-recording/voice-recording.component.mjs +0 -91
  194. package/esm2022/public-api.mjs +0 -82
  195. package/fesm2022/stream-chat-angular.mjs.map +0 -1
  196. /package/{esm2022 → esm2020}/lib/format-duration.mjs +0 -0
  197. /package/{esm2022 → esm2020}/lib/injection-tokens.mjs +0 -0
  198. /package/{esm2022 → esm2020}/lib/is-image-attachment.mjs +0 -0
  199. /package/{esm2022 → esm2020}/lib/is-on-separate-date.mjs +0 -0
  200. /package/{esm2022 → esm2020}/lib/is-safari.mjs +0 -0
  201. /package/{esm2022 → esm2020}/lib/message-input/textarea.interface.mjs +0 -0
  202. /package/{esm2022 → esm2020}/stream-chat-angular.mjs +0 -0
@@ -1,14 +1,14 @@
1
1
  import { NgZone } from '@angular/core';
2
2
  import { BehaviorSubject, Observable } from 'rxjs';
3
- import { Attachment, Channel, FormatMessageResponse, MessageResponse, ReactionResponse, UserResponse } from 'stream-chat';
4
- import { ChatClientService } from './chat-client.service';
3
+ import { Attachment, Channel, ChannelFilters, ChannelOptions, ChannelSort, CustomMessageData, CustomReactionData, Event, FormatMessageResponse, MessageResponse, ReactionResponse, UserResponse } from 'stream-chat';
4
+ import { ChatClientService, ClientEvent } from './chat-client.service';
5
5
  import { NotificationService } from './notification.service';
6
- import { AttachmentUpload, ChannelQueryConfigInput, ChannelQueryResult, ChannelQueryState, ChannelQueryType, ChannelServiceOptions, DefaultStreamChatGenerics, MessageInput, MessageReactionType, StreamMessage } from './types';
6
+ import { AttachmentUpload, ChannelQueryResult, ChannelQueryState, ChannelQueryType, MessageInput, MessageReactionType, NextPageConfiguration, StreamMessage } from './types';
7
7
  import * as i0 from "@angular/core";
8
8
  /**
9
9
  * The `ChannelService` provides data and interaction for the channel list and message list.
10
10
  */
11
- export declare class ChannelService<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> {
11
+ export declare class ChannelService {
12
12
  private chatClientService;
13
13
  private ngZone;
14
14
  private notificationService;
@@ -18,32 +18,34 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
18
18
  hasMoreChannels$: Observable<boolean>;
19
19
  /**
20
20
  * Emits the currently loaded and [watched](/chat/docs/javascript/watch_channel/) channel list.
21
+ *
22
+ * :::important
23
+ * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/v6-rc/concepts/change-detection/) explains this in detail.
24
+ * :::
21
25
  */
22
- channels$: Observable<Channel<T>[] | undefined>;
26
+ channels$: Observable<Channel[] | undefined>;
23
27
  /**
24
28
  * The result of the latest channel query request.
25
29
  */
26
30
  channelQueryState$: Observable<ChannelQueryState | undefined>;
27
- /**
28
- * Emits `true` when the state needs to be recovered after an error
29
- *
30
- * You can recover it by calling the `recoverState` method
31
- */
32
- shouldRecoverState$: Observable<boolean>;
33
31
  /**
34
32
  * Emits the currently active channel.
35
33
  *
34
+ * :::important
35
+ * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/v6-rc/concepts/change-detection/) explains this in detail.
36
+ * :::
37
+ *
36
38
  * The active channel will always be marked as read when a new message is received
37
39
  */
38
- activeChannel$: Observable<Channel<T> | undefined>;
40
+ activeChannel$: Observable<Channel | undefined>;
39
41
  /**
40
42
  * Emits the list of currently loaded messages of the active channel.
41
43
  */
42
- activeChannelMessages$: Observable<StreamMessage<T>[]>;
44
+ activeChannelMessages$: Observable<StreamMessage[]>;
43
45
  /**
44
46
  * Emits the list of pinned messages of the active channel.
45
47
  */
46
- activeChannelPinnedMessages$: Observable<StreamMessage<T>[]>;
48
+ activeChannelPinnedMessages$: Observable<StreamMessage[]>;
47
49
  /**
48
50
  * Emits the id of the currently selected parent message. If no message is selected, it emits undefined.
49
51
  */
@@ -51,15 +53,15 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
51
53
  /**
52
54
  * Emits the list of currently loaded thread replies belonging to the selected parent message. If there is no currently active thread it emits an empty array.
53
55
  */
54
- activeThreadMessages$: Observable<StreamMessage<T>[]>;
56
+ activeThreadMessages$: Observable<StreamMessage[]>;
55
57
  /**
56
58
  * Emits the currently selected parent message. If no message is selected, it emits undefined.
57
59
  */
58
- activeParentMessage$: Observable<StreamMessage<T> | undefined>;
60
+ activeParentMessage$: Observable<StreamMessage | undefined>;
59
61
  /**
60
62
  * Emits the currently selected message to quote
61
63
  */
62
- messageToQuote$: Observable<StreamMessage<T> | undefined>;
64
+ messageToQuote$: Observable<StreamMessage | undefined>;
63
65
  /**
64
66
  * Emits the ID of the message the message list should jump to (can be a channel message or thread message)
65
67
  */
@@ -70,11 +72,11 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
70
72
  /**
71
73
  * Emits the list of users that are currently typing in the channel (current user is not included)
72
74
  */
73
- usersTypingInChannel$: Observable<UserResponse<T>[]>;
75
+ usersTypingInChannel$: Observable<UserResponse[]>;
74
76
  /**
75
77
  * Emits the list of users that are currently typing in the active thread (current user is not included)
76
78
  */
77
- usersTypingInThread$: Observable<UserResponse<T>[]>;
79
+ usersTypingInThread$: Observable<UserResponse[]>;
78
80
  /**
79
81
  * Emits a map that contains the date of the latest message sent by the current user by channels (this is used to detect if slow mode countdown should be started)
80
82
  */
@@ -84,9 +86,9 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
84
86
  /**
85
87
  * If you're using [semantic filters for moderation](/moderation/docs/) you can set up rules for bouncing messages.
86
88
  *
87
- * If a message is bounced, it will be emitted via this `Observable`. The built-in [`MessageBouncePrompt` component](/chat/docs/sdk/angular/components/MessageBouncePromptComponent/) will display the bounce option to the user if a bounced message is clicked.
89
+ * If a message is bounced, it will be emitted via this `Observable`. The built-in [`MessageBouncePrompt` component](/chat/docs/sdk/angular/v6-rc/components/MessageBouncePromptComponent/) will display the bounce option to the user if a bounced message is clicked.
88
90
  */
89
- bouncedMessage$: BehaviorSubject<StreamMessage<T> | undefined>;
91
+ bouncedMessage$: BehaviorSubject<StreamMessage | undefined>;
90
92
  /**
91
93
  * The last read message id of the active channel, it's used by the message list component to display unread UI, and jump to latest read message
92
94
  *
@@ -99,38 +101,92 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
99
101
  * This property isn't always updated, please use `channel.read` to display up-to-date read information
100
102
  */
101
103
  activeChannelUnreadCount?: number;
104
+ /**
105
+ * Custom event handler to call if a new message received from a channel that is not being watched, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/)
106
+ *
107
+ * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
108
+ */
109
+ customNewMessageNotificationHandler?: (clientEvent: ClientEvent, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void) => void;
110
+ /**
111
+ * Custom event handler to call when the user is added to a channel, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/).
112
+ *
113
+ * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
114
+ */
115
+ customAddedToChannelNotificationHandler?: (clientEvent: ClientEvent, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void) => void;
116
+ /**
117
+ * Custom event handler to call when the user is removed from a channel, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/).
118
+ *
119
+ * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
120
+ */
121
+ customRemovedFromChannelNotificationHandler?: (clientEvent: ClientEvent, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void) => void;
122
+ /**
123
+ * Custom event handler to call when a channel is deleted, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/).
124
+ *
125
+ * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
126
+ */
127
+ customChannelDeletedHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
128
+ /**
129
+ * Custom event handler to call when a channel is updated, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/).
130
+ *
131
+ * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
132
+ */
133
+ customChannelUpdatedHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
134
+ /**
135
+ * Custom event handler to call when a channel is truncated, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/).
136
+ *
137
+ * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
138
+ */
139
+ customChannelTruncatedHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
140
+ /**
141
+ * Custom event handler to call when a channel becomes hidden, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/).
142
+ *
143
+ * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
144
+ */
145
+ customChannelHiddenHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
146
+ /**
147
+ * Custom event handler to call when a channel becomes visible, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/).
148
+ *
149
+ * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
150
+ */
151
+ customChannelVisibleHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
152
+ /**
153
+ * Custom event handler to call if a new message received from a channel that is being watched, provide an event handler if you want to override the [default channel list ordering](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#channels/).
154
+ *
155
+ * If you're adding a new channel, make sure that it's a [watched](/chat/docs/javascript/watch_channel/) channel.
156
+ */
157
+ customNewMessageHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[], shouldStopWatchingRemovedChannels?: boolean) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
102
158
  /**
103
159
  * You can override the default file upload request - you can use this to upload files to your own CDN
104
160
  */
105
- customFileUploadRequest?: (file: File, channel: Channel<T>) => Promise<{
161
+ customFileUploadRequest?: (file: File, channel: Channel) => Promise<{
106
162
  file: string;
107
163
  }>;
108
164
  /**
109
165
  * You can override the default image upload request - you can use this to upload images to your own CDN
110
166
  */
111
- customImageUploadRequest?: (file: File, channel: Channel<T>) => Promise<{
167
+ customImageUploadRequest?: (file: File, channel: Channel) => Promise<{
112
168
  file: string;
113
169
  }>;
114
170
  /**
115
171
  * You can override the default file delete request - override this if you use your own CDN
116
172
  */
117
- customFileDeleteRequest?: (url: string, channel: Channel<T>) => Promise<void>;
173
+ customFileDeleteRequest?: (url: string, channel: Channel) => Promise<void>;
118
174
  /**
119
175
  * You can override the default image delete request - override this if you use your own CDN
120
176
  */
121
- customImageDeleteRequest?: (url: string, channel: Channel<T>) => Promise<void>;
177
+ customImageDeleteRequest?: (url: string, channel: Channel) => Promise<void>;
122
178
  /**
123
179
  * The provided method will be called before deleting a message. If the returned Promise resolves to `true` to deletion will go ahead. If `false` is returned, the message won't be deleted.
124
180
  */
125
- messageDeleteConfirmationHandler?: (message: StreamMessage<T>) => Promise<boolean>;
181
+ messageDeleteConfirmationHandler?: (message: StreamMessage) => Promise<boolean>;
126
182
  /**
127
183
  * The provided method will be called before a new message is sent to Stream's API. You can use this hook to tranfrom or enrich the message being sent.
128
184
  */
129
- beforeSendMessage?: (input: MessageInput<T>) => MessageInput<T> | Promise<MessageInput<T>>;
185
+ beforeSendMessage?: (input: MessageInput) => MessageInput | Promise<MessageInput>;
130
186
  /**
131
187
  * The provided method will be called before a message is sent to Stream's API for update. You can use this hook to tranfrom or enrich the message being updated.
132
188
  */
133
- beforeUpdateMessage?: (message: StreamMessage<T>) => StreamMessage<T> | Promise<StreamMessage<T>>;
189
+ beforeUpdateMessage?: (message: StreamMessage) => StreamMessage | Promise<StreamMessage>;
134
190
  /**
135
191
  * @internal
136
192
  */
@@ -139,9 +195,6 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
139
195
  * @internal
140
196
  */
141
197
  isMessageLoadingInProgress: boolean;
142
- /**
143
- * @internal
144
- */
145
198
  messagePageSize: number;
146
199
  private channelsSubject;
147
200
  private activeChannelSubject;
@@ -149,6 +202,7 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
149
202
  private activeChannelPinnedMessagesSubject;
150
203
  private hasMoreChannelsSubject;
151
204
  private activeChannelSubscriptions;
205
+ private channelSubscriptions;
152
206
  private activeParentMessageIdSubject;
153
207
  private activeThreadMessagesSubject;
154
208
  private jumpToMessageSubject;
@@ -160,18 +214,20 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
160
214
  private _shouldMarkActiveChannelAsRead;
161
215
  private shouldSetActiveChannel;
162
216
  private clientEventsSubscription;
163
- private isStateRecoveryInProgress$;
217
+ private isStateRecoveryInProgress;
164
218
  private channelQueryStateSubject;
165
- private customChannelQuery?;
166
- private channelManager?;
167
- private channelQueryConfig?;
219
+ private channelQuery?;
220
+ private _customPaginator;
221
+ private channelListSetter;
222
+ private messageListSetter;
223
+ private threadListSetter;
224
+ private parentMessageSetter;
168
225
  private dismissErrorNotification?;
169
226
  private areReadEventsPaused;
170
227
  private markReadThrottleTime;
171
228
  private markReadTimeout?;
172
229
  private scheduledMarkReadRequest?;
173
- private channelManagerSubscriptions;
174
- constructor(chatClientService: ChatClientService<T>, ngZone: NgZone, notificationService: NotificationService);
230
+ constructor(chatClientService: ChatClientService, ngZone: NgZone, notificationService: NotificationService);
175
231
  /**
176
232
  * If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.
177
233
  */
@@ -180,12 +236,20 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
180
236
  * If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.
181
237
  */
182
238
  set shouldMarkActiveChannelAsRead(shouldMarkActiveChannelAsRead: boolean);
239
+ /**
240
+ * By default the SDK uses an offset based pagination, you can change/extend this by providing your own custom paginator method.
241
+ *
242
+ * The method will be called with the result of the latest channel query.
243
+ *
244
+ * You can return either an offset, or a filter using the [`$lte`/`$gte` operator](/chat/docs/javascript/query_syntax_operators/). If you return a filter, it will be merged with the filter provided for the `init` method.
245
+ */
246
+ set customPaginator(paginator: ((channelQueryResult: Channel[]) => NextPageConfiguration) | undefined);
183
247
  /**
184
248
  * Sets the given `channel` as active and marks it as read.
185
249
  * If the channel wasn't previously part of the channel, it will be added to the beginning of the list.
186
250
  * @param channel
187
251
  */
188
- setAsActiveChannel(channel: Channel<T>): void;
252
+ setAsActiveChannel(channel: Channel): void;
189
253
  /**
190
254
  * Deselects the currently active (if any) channel
191
255
  */
@@ -195,12 +259,12 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
195
259
  * @param message
196
260
  * @param loadMessagesForm
197
261
  */
198
- setAsActiveParentMessage(message: StreamMessage<T> | undefined, loadMessagesForm?: 'request' | 'state'): Promise<void>;
262
+ setAsActiveParentMessage(message: StreamMessage | undefined, loadMessagesForm?: 'request' | 'state'): Promise<void>;
199
263
  /**
200
264
  * Loads the next page of messages of the active channel. The page size can be set in the [query option](/chat/docs/javascript/query_channels/#query-options) object.
201
265
  * @param direction
202
266
  */
203
- loadMoreMessages(direction?: 'older' | 'newer'): false | Promise<import("stream-chat").QueryChannelAPIResponse<T>> | undefined;
267
+ loadMoreMessages(direction?: 'older' | 'newer'): false | Promise<import("stream-chat").QueryChannelAPIResponse> | undefined;
204
268
  /**
205
269
  * Loads the next page of messages of the active thread. The page size can be set in the [query option](/chat/docs/javascript/query_channels/#query-options) object.
206
270
  * @param direction
@@ -208,23 +272,27 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
208
272
  loadMoreThreadReplies(direction?: 'older' | 'newer'): false | Promise<void>;
209
273
  /**
210
274
  * Queries the channels with the given filters, sorts and options. More info about [channel querying](/chat/docs/javascript/query_channels/) can be found in the platform documentation. By default the first channel in the list will be set as active channel and will be marked as read.
211
- * @param queryConfig the filter, sort and options for the query
212
- * @param options behavior customization for the channel list and WebSocket event handling
275
+ * @param filters
276
+ * @param sort
277
+ * @param options
278
+ * @param shouldSetActiveChannel Decides if the first channel in the result should be made as an active channel or not.
213
279
  * @returns the list of channels found by the query
214
280
  */
215
- init(queryConfig: ChannelQueryConfigInput<T>, options?: ChannelServiceOptions<T>): Promise<Channel<T>[]>;
281
+ init(filters: ChannelFilters, sort?: ChannelSort, options?: ChannelOptions, shouldSetActiveChannel?: boolean): Promise<Channel[]>;
216
282
  /**
217
283
  * Queries the channels with the given query function. More info about [channel querying](/chat/docs/javascript/query_channels/) can be found in the platform documentation.
218
284
  * @param query
219
- * @param options behavior customization for the channel list and WebSocket event handling
285
+ * @param options
286
+ * @param options.shouldSetActiveChannel The `shouldSetActiveChannel` specifies if the first channel in the result should be selected as the active channel or not. Default is `true`.
220
287
  * @param options.messagePageSize How many messages should we load? The default is 25
221
288
  * @returns the channels that were loaded
222
289
  */
223
- initWithCustomQuery(query: (queryType: ChannelQueryType) => Promise<ChannelQueryResult<T>>, options?: ChannelServiceOptions<T> & {
290
+ initWithCustomQuery(query: (queryType: ChannelQueryType) => Promise<ChannelQueryResult>, options?: {
291
+ shouldSetActiveChannel: boolean;
224
292
  messagePageSize: number;
225
- }): Promise<Channel<T>[]>;
293
+ }): Promise<Channel[]>;
226
294
  /**
227
- * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](/chat/docs/sdk/angular/services/ChatClientService/#disconnectuser/).
295
+ * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](/chat/docs/sdk/angular/v6-rc/services/ChatClientService/#disconnectuser/).
228
296
  */
229
297
  reset(): void;
230
298
  /**
@@ -237,7 +305,7 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
237
305
  * @param reactionType The type of the reaction
238
306
  * @param customData
239
307
  */
240
- addReaction(messageId: string, reactionType: MessageReactionType, customData?: T['reactionType']): Promise<void>;
308
+ addReaction(messageId: string, reactionType: MessageReactionType, customData?: CustomReactionData): Promise<void>;
241
309
  /**
242
310
  * Removes a reaction from a message.
243
311
  * @param messageId The id of the message to remove the reaction from
@@ -253,93 +321,17 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
253
321
  * @param quotedMessageId Id of the message to quote (if sending a quote reply)
254
322
  * @param customData
255
323
  */
256
- sendMessage(text: string, attachments?: Attachment<T>[], mentionedUsers?: UserResponse<T>[], parentId?: string | undefined, quotedMessageId?: string | undefined, customData?: undefined | Partial<T['messageType']>): Promise<StreamMessage<T>>;
324
+ sendMessage(text: string, attachments?: Attachment[], mentionedUsers?: UserResponse[], parentId?: string | undefined, quotedMessageId?: string | undefined, customData?: undefined | CustomMessageData): Promise<StreamMessage>;
257
325
  /**
258
326
  * Resends the given message to the active channel
259
327
  * @param message The message to resend
260
328
  */
261
- resendMessage(message: StreamMessage): Promise<StreamMessage<T>>;
329
+ resendMessage(message: StreamMessage): Promise<StreamMessage>;
262
330
  /**
263
331
  * Updates the message in the active channel
264
332
  * @param message Mesage to be updated
265
333
  */
266
- updateMessage(message: StreamMessage<T>): Promise<StreamMessage<T> | (T["messageType"] & {
267
- id: string;
268
- attachments?: Attachment<T>[] | undefined;
269
- html?: string | undefined;
270
- mml?: string | undefined;
271
- parent_id?: string | undefined;
272
- pin_expires?: string | null | undefined;
273
- pinned?: boolean | undefined;
274
- pinned_at?: string | null | undefined;
275
- poll_id?: string | undefined;
276
- quoted_message_id?: string | undefined;
277
- restricted_visibility?: string[] | undefined;
278
- show_in_channel?: boolean | undefined;
279
- silent?: boolean | undefined;
280
- text?: string | undefined;
281
- user?: UserResponse<T> | null | undefined;
282
- user_id?: string | undefined;
283
- } & {
284
- type: import("stream-chat").MessageLabel;
285
- args?: string | undefined;
286
- before_message_send_failed?: boolean | undefined;
287
- channel?: import("stream-chat").ChannelResponse<T> | undefined;
288
- cid?: string | undefined;
289
- command?: string | undefined;
290
- command_info?: {
291
- name?: string | undefined;
292
- } | undefined;
293
- created_at?: string | undefined;
294
- deleted_at?: string | undefined;
295
- deleted_reply_count?: number | undefined;
296
- i18n?: (import("stream-chat").RequireAtLeastOne<Record<"_text" | "id_text" | "no_text" | "af_text" | "am_text" | "ar_text" | "az_text" | "bg_text" | "bn_text" | "bs_text" | "cs_text" | "da_text" | "de_text" | "el_text" | "en_text" | "es_text" | "es-MX_text" | "et_text" | "fa_text" | "fa-AF_text" | "fi_text" | "fr_text" | "fr-CA_text" | "ha_text" | "he_text" | "hi_text" | "hr_text" | "hu_text" | "it_text" | "ja_text" | "ka_text" | "ko_text" | "lt_text" | "lv_text" | "ms_text" | "nl_text" | "pl_text" | "ps_text" | "pt_text" | "ro_text" | "ru_text" | "sk_text" | "sl_text" | "so_text" | "sq_text" | "sr_text" | "sv_text" | "sw_text" | "ta_text" | "th_text" | "tl_text" | "tr_text" | "uk_text" | "ur_text" | "vi_text" | "zh_text" | "zh-TW_text", string>> & {
297
- language: import("stream-chat").TranslationLanguages;
298
- }) | undefined;
299
- latest_reactions?: ReactionResponse<T>[] | undefined;
300
- mentioned_users?: UserResponse<T>[] | undefined;
301
- message_text_updated_at?: string | undefined;
302
- moderation?: import("stream-chat").ModerationResponse | undefined;
303
- moderation_details?: import("stream-chat").ModerationDetailsResponse | undefined;
304
- own_reactions?: ReactionResponse<T>[] | null | undefined;
305
- pin_expires?: string | null | undefined;
306
- pinned_at?: string | null | undefined;
307
- pinned_by?: UserResponse<T> | null | undefined;
308
- poll?: import("stream-chat").PollResponse<T> | undefined;
309
- reaction_counts?: {
310
- [key: string]: number;
311
- } | null | undefined;
312
- reaction_groups?: {
313
- [key: string]: import("stream-chat").ReactionGroupResponse;
314
- } | null | undefined;
315
- reaction_scores?: {
316
- [key: string]: number;
317
- } | null | undefined;
318
- reply_count?: number | undefined;
319
- shadowed?: boolean | undefined;
320
- status?: string | undefined;
321
- thread_participants?: UserResponse<T>[] | undefined;
322
- updated_at?: string | undefined;
323
- } & {
324
- quoted_message?: import("stream-chat").MessageResponseBase<T> | undefined;
325
- } & Omit<MessageResponse<{
326
- attachmentType: import("stream-chat").UR;
327
- channelType: import("stream-chat").UR;
328
- commandType: import("stream-chat").LiteralStringForUnion;
329
- eventType: import("stream-chat").UR;
330
- memberType: import("stream-chat").UR;
331
- messageType: {};
332
- pollOptionType: import("stream-chat").UR;
333
- pollType: import("stream-chat").UR;
334
- reactionType: import("stream-chat").UR;
335
- userType: import("stream-chat").UR;
336
- }>, "created_at" | "pinned_at" | "updated_at" | "deleted_at" | "status"> & import("stream-chat").UR & {
337
- created_at: Date;
338
- deleted_at: Date | null;
339
- pinned_at: Date | null;
340
- status: string;
341
- updated_at: Date;
342
- })>;
334
+ updateMessage(message: StreamMessage): Promise<StreamMessage>;
343
335
  /**
344
336
  * Deletes the message from the active channel
345
337
  * @param message Message to be deleted
@@ -348,13 +340,13 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
348
340
  deleteMessage(message: StreamMessage, isLocalDelete?: boolean): Promise<void>;
349
341
  /**
350
342
  * Uploads files to the channel. If you want to know more about [file uploads](/chat/docs/javascript/file_uploads/) check out the platform documentation.
351
- * @param uploads the attachments to upload (output of the [`AttachmentService`](/chat/docs/sdk/angular/services/AttachmentService/))
343
+ * @param uploads the attachments to upload (output of the [`AttachmentService`](/chat/docs/sdk/angular/v6-rc/services/AttachmentService/))
352
344
  * @returns the result of file upload requests
353
345
  */
354
346
  uploadAttachments(uploads: AttachmentUpload[]): Promise<AttachmentUpload[]>;
355
347
  /**
356
348
  * Deletes an uploaded file by URL. If you want to know more about [file uploads](/chat/docs/javascript/file_uploads/) check out the platform documentation
357
- * @param attachmentUpload Attachment to be deleted (output of the [`AttachmentService`](/chat/docs/sdk/angular/services/AttachmentService/))
349
+ * @param attachmentUpload Attachment to be deleted (output of the [`AttachmentService`](/chat/docs/sdk/angular/v6-rc/services/AttachmentService/))
358
350
  */
359
351
  deleteAttachment(attachmentUpload: AttachmentUpload): Promise<void>;
360
352
  /**
@@ -362,7 +354,7 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
362
354
  * @param searchTerm Text to search for in the names of members
363
355
  * @returns The list of members matching the search filter
364
356
  */
365
- autocompleteMembers(searchTerm: string): Promise<import("stream-chat").ChannelMemberResponse<T>[]>;
357
+ autocompleteMembers(searchTerm: string): Promise<import("stream-chat").ChannelMemberResponse[]>;
366
358
  /**
367
359
  * [Runs a message action](https://getstream.io/chat/docs/rest/#messages-runmessageaction) in the current channel. Updates the message list based on the action result (if no message is returned, the message will be removed from the message list).
368
360
  * @param messageId
@@ -380,12 +372,13 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
380
372
  * The channel will be added to the beginning of the channel list
381
373
  * @param channel
382
374
  */
383
- addChannel(channel: Channel<T>): void;
375
+ addChannel(channel: Channel): void;
384
376
  /**
385
377
  *
386
378
  * @param cid
379
+ * @param shouldStopWatching
387
380
  */
388
- removeChannel(cid: string): void;
381
+ removeChannel(cid: string, shouldStopWatching?: boolean): void;
389
382
  private sendMessageRequest;
390
383
  /**
391
384
  * Jumps to the selected message inside the message list, if the message is not yet loaded, it'll load the message (and it's surroundings) from the API.
@@ -401,22 +394,17 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
401
394
  * Pins the given message in the channel
402
395
  * @param message
403
396
  */
404
- pinMessage(message: StreamMessage<DefaultStreamChatGenerics>): Promise<void>;
397
+ pinMessage(message: StreamMessage): Promise<void>;
405
398
  /**
406
399
  * Removes the given message from pinned messages
407
400
  * @param message
408
401
  */
409
- unpinMessage(message: StreamMessage<DefaultStreamChatGenerics>): Promise<void>;
410
- /**
411
- * Reloads all channels and messages. Useful if state is empty due to an error.
412
- *
413
- * The SDK will automatically call this after `connection.recovered` event. In other cases it's up to integrators to recover state.
414
- *
415
- * Use the `shouldRecoverState$` to know if state recover is necessary.
416
- * @returns when recovery is completed
417
- */
418
- recoverState(): Promise<void>;
402
+ unpinMessage(message: StreamMessage): Promise<void>;
419
403
  private handleNotification;
404
+ private handleRemovedFromChannelNotification;
405
+ private handleNewMessageNotification;
406
+ private handleAddedToChannelNotification;
407
+ private addChannelFromNotification;
420
408
  private watchForActiveChannelEvents;
421
409
  /**
422
410
  * Call this method if user started typing in the active channel
@@ -431,26 +419,26 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
431
419
  /**
432
420
  * The current list of channels
433
421
  */
434
- get channels(): Channel<T>[];
422
+ get channels(): Channel[];
435
423
  /**
436
424
  * The current active channel
437
425
  */
438
- get activeChannel(): Channel<T> | undefined;
426
+ get activeChannel(): Channel | undefined;
439
427
  /**
440
428
  * The current active channel messages
441
429
  */
442
- get activeChannelMessages(): (StreamMessage<T> | MessageResponse<T> | FormatMessageResponse<T>)[];
430
+ get activeChannelMessages(): (MessageResponse | FormatMessageResponse | StreamMessage)[];
443
431
  /**
444
432
  * The current thread replies
445
433
  */
446
- get activeChannelThreadReplies(): (StreamMessage<T> | MessageResponse<T> | FormatMessageResponse<T>)[];
434
+ get activeChannelThreadReplies(): (MessageResponse | FormatMessageResponse | StreamMessage)[];
447
435
  /**
448
436
  * Get the last 1200 reactions of a message in the current active channel. If you need to fetch more reactions please use the [following endpoint](/chat/docs/javascript/send_reaction/#paginating-reactions).
449
- * @deprecated use [`messageReactionsService.queryReactions()`](/chat/docs/sdk/angular/services/MessageReactionsService/#queryreactions) instead
437
+ * @deprecated use [`messageReactionsService.queryReactions()`](/chat/docs/sdk/angular/v6-rc/services/MessageReactionsService/#queryreactions) instead
450
438
  * @param messageId
451
439
  * @returns all reactions of a message
452
440
  */
453
- getMessageReactions(messageId: string): Promise<ReactionResponse<T>[]>;
441
+ getMessageReactions(messageId: string): Promise<ReactionResponse[]>;
454
442
  /**
455
443
  * Marks the channel from the given message as unread
456
444
  * @param messageId
@@ -464,6 +452,13 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
464
452
  private isFormatMessageResponse;
465
453
  private stopWatchForActiveChannelEvents;
466
454
  private queryChannels;
455
+ private watchForChannelEvents;
456
+ private handleNewMessage;
457
+ private handleChannelHidden;
458
+ private handleChannelDeleted;
459
+ private handleChannelVisible;
460
+ private handleChannelUpdate;
461
+ private handleChannelTruncate;
467
462
  private get canSendReadEvents();
468
463
  private transformToStreamMessage;
469
464
  private handleTypingStartEvent;
@@ -474,9 +469,6 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
474
469
  private markReadThrottled;
475
470
  private flushMarkReadQueue;
476
471
  private _init;
477
- private createChannelManager;
478
- private destroyChannelManager;
479
- private maybeRestoreActiveChannelAfterRecovery;
480
- static ɵfac: i0.ɵɵFactoryDeclaration<ChannelService<any>, never>;
481
- static ɵprov: i0.ɵɵInjectableDeclaration<ChannelService<any>>;
472
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChannelService, never>;
473
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChannelService>;
482
474
  }
@@ -3,26 +3,28 @@ import { Observable } from 'rxjs';
3
3
  import { Channel, ConnectAPIResponse, OwnUserResponse, StreamChatOptions, UserResponse } from 'stream-chat';
4
4
  import { AppSettings, Event, StreamChat, TokenOrProvider } from 'stream-chat';
5
5
  import { NotificationService } from './notification.service';
6
- import { DefaultStreamChatGenerics } from './types';
7
6
  import * as i0 from "@angular/core";
8
- export type ClientEvent<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
7
+ export declare type ClientEvent = {
9
8
  eventType: string;
10
- event: Event<T>;
9
+ event: Event;
11
10
  };
12
11
  /**
13
12
  * The `ChatClient` service connects the user to the Stream chat.
14
13
  */
15
- export declare class ChatClientService<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> {
14
+ export declare class ChatClientService {
16
15
  private ngZone;
17
16
  private notificationService;
18
17
  /**
19
18
  * The [StreamChat client](https://github.com/GetStream/stream-chat-js/blob/master/src/client.ts) instance. In general you shouldn't need to access the client, but it's there if you want to use it.
20
19
  */
21
- chatClient: StreamChat<T>;
20
+ chatClient: StreamChat;
22
21
  /**
23
22
  * Emits [`ClientEvent`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/chat-client.service.ts) events. The platform documentation covers [the list of client, user presence and notification events](/chat/docs/javascript/event_object/).
23
+ * :::important
24
+ * For performance reasons this Observable operates outside of the Angular change detection zone. If you subscribe to it, you need to manually reenter Angular's change detection zone, our [Change detection guide](/chat/docs/sdk/angular/v6-rc/concepts/change-detection/) explains this in detail.
25
+ * :::
24
26
  */
25
- events$: Observable<ClientEvent<T>>;
27
+ events$: Observable<ClientEvent>;
26
28
  /**
27
29
  * Emits the current [application settings](/chat/docs/javascript/app_setting_overview/). Since getting the application settings is an expensive API call and we don't always need the result, this is not initialized by default, you need to call `getApplicationSettings` to load them.
28
30
  */
@@ -32,13 +34,13 @@ export declare class ChatClientService<T extends DefaultStreamChatGenerics = Def
32
34
  */
33
35
  connectionState$: Observable<'offline' | 'online'>;
34
36
  /**
35
- * Emits the list of pending invites of the user. It emits every pending invitation during initialization and then extends the list when a new invite is received. More information can be found in the [channel invitations](/chat/docs/sdk/angular/code-examples/channel-invites/) guide.
37
+ * Emits the list of pending invites of the user. It emits every pending invitation during initialization and then extends the list when a new invite is received. More information can be found in the [channel invitations](/chat/docs/sdk/angular/v6-rc/code-examples/channel-invites/) guide.
36
38
  */
37
- pendingInvites$: Observable<Channel<T>[]>;
39
+ pendingInvites$: Observable<Channel[]>;
38
40
  /**
39
41
  * Emits the current chat user
40
42
  */
41
- user$: Observable<OwnUserResponse<T> | UserResponse<T> | undefined>;
43
+ user$: Observable<OwnUserResponse | UserResponse | undefined>;
42
44
  private notificationSubject;
43
45
  private connectionStateSubject;
44
46
  private appSettingsSubject;
@@ -60,11 +62,11 @@ export declare class ChatClientService<T extends DefaultStreamChatGenerics = Def
60
62
  * </ul>
61
63
  * @param clientOptions Setting to provide to the Stream client instance
62
64
  */
63
- init(apiKey: string, userOrId: string | OwnUserResponse<T> | UserResponse<T> | undefined, userTokenOrProvider: TokenOrProvider, clientOptions?: StreamChatOptions & {
65
+ init(apiKey: string, userOrId: string | OwnUserResponse | UserResponse | undefined, userTokenOrProvider: TokenOrProvider, clientOptions?: StreamChatOptions & {
64
66
  trackPendingChannelInvites?: boolean;
65
- }): ConnectAPIResponse<T>;
67
+ }): ConnectAPIResponse;
66
68
  /**
67
- * Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](/chat/docs/sdk/angular/services/ChannelService/#reset/).
69
+ * Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](/chat/docs/sdk/angular/v6-rc/services/ChannelService/#reset/).
68
70
  */
69
71
  disconnectUser(): Promise<void>;
70
72
  /**
@@ -81,9 +83,9 @@ export declare class ChatClientService<T extends DefaultStreamChatGenerics = Def
81
83
  * @param searchTerm
82
84
  * @returns The users matching the search
83
85
  */
84
- autocompleteUsers(searchTerm: string): Promise<UserResponse<T>[]>;
86
+ autocompleteUsers(searchTerm: string): Promise<UserResponse[]>;
85
87
  private updatePendingInvites;
86
88
  private updateUser;
87
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatClientService<any>, never>;
88
- static ɵprov: i0.ɵɵInjectableDeclaration<ChatClientService<any>>;
89
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatClientService, never>;
90
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChatClientService>;
89
91
  }