stream-chat-angular 2.12.3 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/assets/version.d.ts +1 -1
  2. package/bundles/stream-chat-angular.umd.js +450 -55
  3. package/bundles/stream-chat-angular.umd.js.map +1 -1
  4. package/esm2015/assets/version.js +2 -2
  5. package/esm2015/lib/attachment.service.js +29 -1
  6. package/esm2015/lib/channel-list/channel-list-toggle.service.js +20 -1
  7. package/esm2015/lib/channel.service.js +146 -3
  8. package/esm2015/lib/chat-client.service.js +25 -1
  9. package/esm2015/lib/message/message.component.js +5 -1
  10. package/esm2015/lib/message-actions-box/message-actions-box.component.js +1 -1
  11. package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +21 -9
  12. package/esm2015/lib/message-input/emoji-input.service.js +23 -0
  13. package/esm2015/lib/message-input/message-input-config.service.js +16 -1
  14. package/esm2015/lib/message-input/message-input.component.js +36 -20
  15. package/esm2015/lib/message-input/textarea/textarea.component.js +22 -6
  16. package/esm2015/lib/message-list/image-load.service.js +7 -1
  17. package/esm2015/lib/message-list/message-list.component.js +18 -5
  18. package/esm2015/lib/message-reactions/message-reactions.component.js +2 -2
  19. package/esm2015/lib/notification.service.js +19 -1
  20. package/esm2015/lib/stream-i18n.service.js +9 -1
  21. package/esm2015/lib/theme.service.js +23 -1
  22. package/esm2015/lib/transliteration.service.js +9 -1
  23. package/esm2015/public-api.js +2 -1
  24. package/fesm2015/stream-chat-angular.js +406 -40
  25. package/fesm2015/stream-chat-angular.js.map +1 -1
  26. package/lib/attachment.service.d.ts +34 -0
  27. package/lib/channel-list/channel-list-toggle.service.d.ts +22 -0
  28. package/lib/channel.service.d.ts +172 -0
  29. package/lib/chat-client.service.d.ts +39 -0
  30. package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +3 -1
  31. package/lib/message-input/emoji-input.service.d.ts +14 -0
  32. package/lib/message-input/message-input-config.service.d.ts +27 -1
  33. package/lib/message-input/message-input.component.d.ts +8 -3
  34. package/lib/message-input/textarea/textarea.component.d.ts +7 -3
  35. package/lib/message-list/image-load.service.d.ts +6 -0
  36. package/lib/message-list/message-list.component.d.ts +10 -2
  37. package/lib/notification.service.d.ts +21 -0
  38. package/lib/stream-i18n.service.d.ts +8 -0
  39. package/lib/theme.service.d.ts +22 -0
  40. package/lib/transliteration.service.d.ts +8 -0
  41. package/package.json +4 -3
  42. package/public-api.d.ts +1 -0
  43. package/src/assets/version.ts +1 -1
@@ -4,19 +4,53 @@ import { ChannelService } from './channel.service';
4
4
  import { NotificationService } from './notification.service';
5
5
  import { AttachmentUpload } from './types';
6
6
  import * as i0 from "@angular/core";
7
+ /**
8
+ * The `AttachmentService` manages the uploads of a message input.
9
+ */
7
10
  export declare class AttachmentService {
8
11
  private channelService;
9
12
  private notificationService;
13
+ /**
14
+ * Emits the number of uploads in progress.
15
+ */
10
16
  attachmentUploadInProgressCounter$: Observable<number>;
17
+ /**
18
+ * Emits the state of the uploads ([`AttachmentUpload[]`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)), it adds a state (`success`, `error` or `uploading`) to each file the user selects for upload. It is used by the [`AttachmentPreviewList`](../components/attachment-preview-list.mdx) to display the attachment previews.
19
+ */
11
20
  attachmentUploads$: Observable<AttachmentUpload[]>;
12
21
  private attachmentUploadInProgressCounterSubject;
13
22
  private attachmentUploadsSubject;
14
23
  constructor(channelService: ChannelService, notificationService: NotificationService);
24
+ /**
25
+ * Resets the attachments uploads (for example after the message with the attachments sent successfully)
26
+ */
15
27
  resetAttachmentUploads(): void;
28
+ /**
29
+ * Uploads the selected files, and creates preview for image files. The result is propagated throught the `attachmentUploads$` stream.
30
+ * @param fileList The files selected by the user
31
+ * @returns A promise with the result
32
+ */
16
33
  filesSelected(fileList: FileList | null): Promise<void>;
34
+ /**
35
+ * Retries to upload an attachment.
36
+ * @param file
37
+ * @returns A promise with the result
38
+ */
17
39
  retryAttachmentUpload(file: File): Promise<void>;
40
+ /**
41
+ * Deletes an attachment, the attachment can have any state (`error`, `uploading` or `success`).
42
+ * @param upload
43
+ */
18
44
  deleteAttachment(upload: AttachmentUpload): Promise<void>;
45
+ /**
46
+ * Maps the current uploads to a format that can be sent along with the message to the Stream API.
47
+ * @returns the attachments
48
+ */
19
49
  mapToAttachments(): Attachment<import("stream-chat").UR>[];
50
+ /**
51
+ * Maps attachments received from the Stream API to uploads. This is useful when editing a message.
52
+ * @param attachments Attachemnts received with the message
53
+ */
20
54
  createFromAttachments(attachments: Attachment[]): void;
21
55
  private createPreview;
22
56
  private uploadAttachments;
@@ -1,14 +1,36 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import * as i0 from "@angular/core";
3
+ /**
4
+ * The `ChannelListToggleService` can be used to toggle the channel list.
5
+ */
3
6
  export declare class ChannelListToggleService {
7
+ /**
8
+ * Emits `true` if the channel list is in open state, otherwise it emits `false`
9
+ */
4
10
  isOpen$: Observable<boolean>;
5
11
  private isOpenSubject;
6
12
  private menuElement;
7
13
  constructor();
14
+ /**
15
+ * Opens the channel list.
16
+ */
8
17
  open(): void;
18
+ /**
19
+ * Closes the channel list.
20
+ */
9
21
  close(): void;
22
+ /**
23
+ * Opens the channel list if it was closed, and closes if it was opened.
24
+ */
10
25
  toggle(): void;
26
+ /**
27
+ * Sets the channel list element, on mobile screen size if the user opens the channel list, and clicks outside, the service automatically closes the channel list if a reference to the HTML element is provided.
28
+ * @param element
29
+ */
11
30
  setMenuElement(element: HTMLElement | undefined): void;
31
+ /**
32
+ * This method should be called if a channel was selected, if on mobile, the channel list will be closed.
33
+ */
12
34
  channelSelected(): void;
13
35
  private watchForOutsideClicks;
14
36
  static ɵfac: i0.ɵɵFactoryDeclaration<ChannelListToggleService, never>;
@@ -5,25 +5,104 @@ import { ChatClientService, Notification } from './chat-client.service';
5
5
  import { MessageReactionType } from './message-reactions/message-reactions.component';
6
6
  import { AttachmentUpload, StreamMessage } from './types';
7
7
  import * as i0 from "@angular/core";
8
+ /**
9
+ * The `ChannelService` provides data and interaction for the channel list and message list. TEST
10
+ */
8
11
  export declare class ChannelService {
9
12
  private chatClientService;
10
13
  private ngZone;
14
+ /**
15
+ * Emits `false` if there are no more pages of channels that can be loaded.
16
+ */
11
17
  hasMoreChannels$: Observable<boolean>;
18
+ /**
19
+ * Emits the currently loaded and [watched](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript) channel list.
20
+ *
21
+ * :::important
22
+ * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.
23
+ * :::
24
+ *
25
+ * Apart from pagination, the channel list is also updated on the following events:
26
+ *
27
+ * | Event type | Default behavior | Custom handler to override |
28
+ * | ----------------------------------- | ------------------------------------------------------------------ | --------------------------------------------- |
29
+ * | `channel.deleted` | Remove channel from the list | `customChannelDeletedHandler` |
30
+ * | `channel.hidden` | Remove channel from the list | `customChannelHiddenHandler` |
31
+ * | `channel.truncated` | Updates the channel | `customChannelTruncatedHandler` |
32
+ * | `channel.updated` | Updates the channel | `customChannelUpdatedHandler` |
33
+ * | `channel.visible` | Adds the channel to the list | `customChannelVisibleHandler` |
34
+ * | `message.new` | Moves the channel to top of the list | `customNewMessageHandler` |
35
+ * | `notification.added_to_channel` | Adds the new channel to the top of the list and starts watching it | `customAddedToChannelNotificationHandler` |
36
+ * | `notification.message_new` | Adds the new channel to the top of the list and starts watching it | `customNewMessageNotificationHandler` |
37
+ * | `notification.removed_from_channel` | Removes the channel from the list | `customRemovedFromChannelNotificationHandler` |
38
+ *
39
+ * It's important to note that filters don't apply to updates to the list from events.
40
+ *
41
+ * Our platform documentation covers the topic of [channel events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript#events) in depth.
42
+ */
12
43
  channels$: Observable<Channel[] | undefined>;
44
+ /**
45
+ * Emits the currently active channel.
46
+ *
47
+ * :::important
48
+ * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.
49
+ * :::
50
+ */
13
51
  activeChannel$: Observable<Channel | undefined>;
52
+ /**
53
+ * Emits the list of currently loaded messages of the active channel.
54
+ */
14
55
  activeChannelMessages$: Observable<StreamMessage[]>;
56
+ /**
57
+ * Emits the id of the currently selected parent message. If no message is selected, it emits undefined.
58
+ */
15
59
  activeParentMessageId$: Observable<string | undefined>;
60
+ /**
61
+ * 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.
62
+ */
16
63
  activeThreadMessages$: Observable<StreamMessage[]>;
64
+ /**
65
+ * Emits the currently selected parent message. If no message is selected, it emits undefined.
66
+ */
17
67
  activeParentMessage$: Observable<StreamMessage | undefined>;
18
68
  messageToQuote$: Observable<StreamMessage | undefined>;
69
+ /**
70
+ * 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](./ChannelService.mdx/#channels)
71
+ */
72
+ usersTypingInChannel$: Observable<UserResponse[]>;
73
+ usersTypingInThread$: Observable<UserResponse[]>;
19
74
  customNewMessageNotificationHandler?: (notification: Notification, channelListSetter: (channels: Channel[]) => void) => void;
75
+ /**
76
+ * 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](./ChannelService.mdx/#channels)
77
+ */
20
78
  customAddedToChannelNotificationHandler?: (notification: Notification, channelListSetter: (channels: Channel[]) => void) => void;
79
+ /**
80
+ * 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](./ChannelService.mdx/#channels)
81
+ */
21
82
  customRemovedFromChannelNotificationHandler?: (notification: Notification, channelListSetter: (channels: Channel[]) => void) => void;
83
+ /**
84
+ * Custom event handler to call when a channel is deleted, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)
85
+ */
22
86
  customChannelDeletedHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[]) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
87
+ /**
88
+ * Custom event handler to call when a channel is updated, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)
89
+ */
23
90
  customChannelUpdatedHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[]) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
91
+ /**
92
+ * Custom event handler to call when a channel is truncated, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)
93
+ */
24
94
  customChannelTruncatedHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[]) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
95
+ /**
96
+ * Custom event handler to call when a channel becomes hidden, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)
97
+ */
25
98
  customChannelHiddenHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[]) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
99
+ /**
100
+ * Custom event handler to call when a channel becomes visible, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)
101
+ */
26
102
  customChannelVisibleHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[]) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
103
+ /**
104
+ * 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](./ChannelService.mdx/#channels)
105
+ */
27
106
  customNewMessageHandler?: (event: Event, channel: Channel, channelListSetter: (channels: Channel[]) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
28
107
  private channelsSubject;
29
108
  private activeChannelSubject;
@@ -37,28 +116,109 @@ export declare class ChannelService {
37
116
  private options;
38
117
  private readonly messagePageSize;
39
118
  private messageToQuoteSubject;
119
+ private usersTypingInChannelSubject;
120
+ private usersTypingInThreadSubject;
40
121
  private channelListSetter;
41
122
  private messageListSetter;
42
123
  private threadListSetter;
43
124
  private parentMessageSetter;
44
125
  constructor(chatClientService: ChatClientService, ngZone: NgZone);
126
+ /**
127
+ * Sets the given `channel` as active.
128
+ * @param channel
129
+ */
45
130
  setAsActiveChannel(channel: Channel): void;
131
+ /**
132
+ * Sets the given `message` as an active parent message. If `undefined` is provided, it will deleselect the current parent message.
133
+ * @param message
134
+ */
46
135
  setAsActiveParentMessage(message: StreamMessage | undefined): Promise<void>;
136
+ /**
137
+ * Loads the next page of messages of the active channel. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.
138
+ */
47
139
  loadMoreMessages(): Promise<void>;
140
+ /**
141
+ * Loads the next page of messages of the active thread. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.
142
+ */
48
143
  loadMoreThreadReplies(): Promise<void>;
144
+ /**
145
+ * Queries the channels with the given filters, sorts and options. More info about [channel querying](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript) can be found in the platform documentation.
146
+ * @param filters
147
+ * @param sort
148
+ * @param options
149
+ */
49
150
  init(filters: ChannelFilters, sort?: ChannelSort, options?: ChannelOptions): Promise<void>;
151
+ /**
152
+ * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./chat-client.mdx/#disconnectuser).
153
+ */
50
154
  reset(): void;
155
+ /**
156
+ * Loads the next page of channels. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.
157
+ */
51
158
  loadMoreChannels(): Promise<void>;
159
+ /**
160
+ * Adds a reaction to a message.
161
+ * @param messageId The id of the message to add the reaction to
162
+ * @param reactionType The type of the reaction
163
+ */
52
164
  addReaction(messageId: string, reactionType: MessageReactionType): Promise<void>;
165
+ /**
166
+ * Removes a reaction from a message.
167
+ * @param messageId The id of the message to remove the reaction from
168
+ * @param reactionType Thr type of reaction to remove
169
+ */
53
170
  removeReaction(messageId: string, reactionType: MessageReactionType): Promise<void>;
171
+ /**
172
+ * Sends a message to the active channel. The message is immediately added to the message list, if an error occurs and the message can't be sent, the error is indicated in `state` of the message.
173
+ * @param text The text of the message
174
+ * @param attachments The attachments
175
+ * @param mentionedUsers Mentioned users
176
+ * @param parentId Id of the parent message (if sending a thread reply)
177
+ * @param quotedMessageId Id of the message to quote (if sending a quote reply)
178
+ */
54
179
  sendMessage(text: string, attachments?: Attachment[], mentionedUsers?: UserResponse[], parentId?: string | undefined, quotedMessageId?: string | undefined): Promise<void>;
180
+ /**
181
+ * Resends the given message to the active channel
182
+ * @param message The message to resend
183
+ */
55
184
  resendMessage(message: StreamMessage): Promise<void>;
185
+ /**
186
+ * Updates the message in the active channel
187
+ * @param message Mesage to be updated
188
+ */
56
189
  updateMessage(message: StreamMessage): Promise<void>;
190
+ /**
191
+ * Deletes the message from the active channel
192
+ * @param message Message to be deleted
193
+ */
57
194
  deleteMessage(message: StreamMessage): Promise<void>;
195
+ /**
196
+ * Uploads files to the channel. If you want to know more about [file uploads](https://getstream.io/chat/docs/javascript/file_uploads/?language=javascript) check out the platform documentation.
197
+ * @param uploads the attachments to upload (output of the [`AttachmentService`](./AttachmentService.mdx))
198
+ * @returns the result of file upload requests
199
+ */
58
200
  uploadAttachments(uploads: AttachmentUpload[]): Promise<AttachmentUpload[]>;
201
+ /**
202
+ * Deletes an uploaded file by URL. If you want to know more about [file uploads](https://getstream.io/chat/docs/javascript/file_uploads/?language=javascript) check out the platform documentation
203
+ * @param attachmentUpload Attachment to be deleted (output of the [`AttachmentService`](./AttachmentService.mdx))
204
+ */
59
205
  deleteAttachment(attachmentUpload: AttachmentUpload): Promise<void>;
206
+ /**
207
+ * Returns the autocomplete options for current channel members. If the channel has less than 100 members, it returns the channel members, otherwise sends a [search request](https://getstream.io/chat/docs/javascript/query_members/?language=javascript#pagination-and-ordering) with the given search term.
208
+ * @param searchTerm Text to search for in the names of members
209
+ * @returns The list of members matching the search filter
210
+ */
60
211
  autocompleteMembers(searchTerm: string): Promise<import("stream-chat").ChannelMemberResponse<import("stream-chat").UR>[]>;
212
+ /**
213
+ * [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).
214
+ * @param messageId
215
+ * @param formData
216
+ */
61
217
  sendAction(messageId: string, formData: Record<string, string>): Promise<void>;
218
+ /**
219
+ * Selects or deselects the current message to quote reply to
220
+ * @param message The message to select, if called with `undefined`, it deselects the message
221
+ */
62
222
  selectMessageToQuote(message: StreamMessage | undefined): void;
63
223
  private sendMessageRequest;
64
224
  private handleNotification;
@@ -68,6 +228,16 @@ export declare class ChannelService {
68
228
  private addChannelFromNotification;
69
229
  private removeFromChannelList;
70
230
  private watchForActiveChannelEvents;
231
+ /**
232
+ * Call this method if user started typing in the active channel
233
+ * @param parentId The id of the parent message, if user is typing in a thread
234
+ */
235
+ typingStarted(parentId?: string): Promise<void>;
236
+ /**
237
+ * Call this method if user stopped typing in the active channel
238
+ * @param parentId The id of the parent message, if user were typing in a thread
239
+ */
240
+ typingStopped(parentId?: string): Promise<void>;
71
241
  private messageUpdated;
72
242
  private messageReactionEventReceived;
73
243
  private formatMessage;
@@ -85,6 +255,8 @@ export declare class ChannelService {
85
255
  private get channels();
86
256
  private get canSendReadEvents();
87
257
  private transformToStreamMessage;
258
+ private handleTypingStartEvent;
259
+ private handleTypingStopEvent;
88
260
  static ɵfac: i0.ɵɵFactoryDeclaration<ChannelService, never>;
89
261
  static ɵprov: i0.ɵɵInjectableDeclaration<ChannelService>;
90
262
  }
@@ -8,21 +8,60 @@ export declare type Notification = {
8
8
  eventType: string;
9
9
  event: Event;
10
10
  };
11
+ /**
12
+ * The `ChatClient` service connects the user to the Stream chat.
13
+ */
11
14
  export declare class ChatClientService {
12
15
  private ngZone;
13
16
  private notificationService;
17
+ /**
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.
19
+ */
14
20
  chatClient: StreamChat;
21
+ /**
22
+ * Emits [`Notification`](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 and notification events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript).
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](../concepts/change-detection.mdx) explains this in detail.
25
+ * :::
26
+ */
15
27
  notification$: Observable<Notification>;
28
+ /**
29
+ * Emits the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript). 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.
30
+ */
16
31
  appSettings$: Observable<AppSettings | undefined>;
32
+ /**
33
+ * Emits the current connection state of the user (`online` or `offline`)
34
+ */
17
35
  connectionState$: Observable<'offline' | 'online'>;
18
36
  private notificationSubject;
19
37
  private connectionStateSubject;
20
38
  private appSettingsSubject;
21
39
  constructor(ngZone: NgZone, notificationService: NotificationService);
40
+ /**
41
+ * Creates a [`StreamChat`](https://github.com/GetStream/stream-chat-js/blob/668b3e5521339f4e14fc657834531b4c8bf8176b/src/client.ts#L124) instance using the provided `apiKey`, and connects a user with the given meta data and token. More info about [connecting users](https://getstream.io/chat/docs/javascript/init_and_users/?language=javascript) can be found in the platform documentation.
42
+ * @param apiKey
43
+ * @param userOrId
44
+ * @param userTokenOrProvider
45
+ */
22
46
  init(apiKey: string, userOrId: string | OwnUserResponse | UserResponse, userTokenOrProvider: TokenOrProvider): Promise<void>;
47
+ /**
48
+ * Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](./ChannelService.mdx/#reset).
49
+ */
23
50
  disconnectUser(): Promise<void>;
51
+ /**
52
+ * Loads the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript), if the application settings have already been loaded, it does nothing.
53
+ */
24
54
  getAppSettings(): Promise<void>;
55
+ /**
56
+ * Flag the message with the given ID. If you want to know [more about flags](https://getstream.io/chat/docs/javascript/moderation/?language=javascript) check out the platform documentation.
57
+ * @param messageId
58
+ */
25
59
  flagMessage(messageId: string): Promise<void>;
60
+ /**
61
+ * Searches for users in the application that have ID or name matching the provided search term
62
+ * @param searchTerm
63
+ * @returns The users matching the search
64
+ */
26
65
  autocompleteUsers(searchTerm: string): Promise<UserResponse<import("stream-chat").UR>[]>;
27
66
  static ɵfac: i0.ɵɵFactoryDeclaration<ChatClientService, never>;
28
67
  static ɵprov: i0.ɵɵInjectableDeclaration<ChatClientService>;
@@ -6,11 +6,13 @@ import { ChannelService } from '../../channel.service';
6
6
  import { TextareaInterface } from '../textarea.interface';
7
7
  import { ChatClientService } from '../../chat-client.service';
8
8
  import { TransliterationService } from '../../transliteration.service';
9
+ import { EmojiInputService } from '../emoji-input.service';
9
10
  import * as i0 from "@angular/core";
10
11
  export declare class AutocompleteTextareaComponent implements TextareaInterface, OnChanges {
11
12
  private channelService;
12
13
  private chatClientService;
13
14
  private transliterationService;
15
+ private emojiInputService;
14
16
  class: string;
15
17
  value: string;
16
18
  areMentionsEnabled: boolean | undefined;
@@ -30,7 +32,7 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
30
32
  private userMentionConfig;
31
33
  private slashCommandConfig;
32
34
  private searchTerm$;
33
- constructor(channelService: ChannelService, chatClientService: ChatClientService, transliterationService: TransliterationService);
35
+ constructor(channelService: ChannelService, chatClientService: ChatClientService, transliterationService: TransliterationService, emojiInputService: EmojiInputService);
34
36
  ngOnChanges(changes: SimpleChanges): void;
35
37
  filter(searchString: string, items: {
36
38
  autocompleteLabel: string;
@@ -0,0 +1,14 @@
1
+ import { Subject } from 'rxjs';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this service, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)
5
+ */
6
+ export declare class EmojiInputService {
7
+ /**
8
+ * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this Subject, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)
9
+ */
10
+ emojiInput$: Subject<string>;
11
+ constructor();
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<EmojiInputService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<EmojiInputService>;
14
+ }
@@ -1,16 +1,42 @@
1
1
  import { TemplateRef } from '@angular/core';
2
2
  import { CommandAutocompleteListItemContext, MentionAutcompleteListItemContext } from '../types';
3
3
  import * as i0 from "@angular/core";
4
+ /**
5
+ * The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](../components/message-input.mdx) components if your UI has more than one input component.
6
+ */
4
7
  export declare class MessageInputConfigService {
8
+ /**
9
+ * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
10
+ */
5
11
  isFileUploadEnabled: boolean | undefined;
12
+ /**
13
+ * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.
14
+ */
6
15
  areMentionsEnabled: boolean | undefined;
16
+ /**
17
+ * You can provide your own template for the autocomplete list for user mentions. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.
18
+ */
7
19
  mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
20
+ /**
21
+ * You can provide your own template for the autocomplete list for commands. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.
22
+ */
8
23
  commandAutocompleteItemTemplate: TemplateRef<CommandAutocompleteListItemContext> | undefined;
9
24
  /**
10
- * @deprecated https://getstream.io/chat/docs/sdk/angular/services/message-input-config/#overview
25
+ * You can add an emoji picker by [providing your own emoji picker template](../code-examples/emoji-picker.mdx)
26
+ */
27
+ emojiPickerTemplate: TemplateRef<void> | undefined;
28
+ /**
29
+ * You can narrow the accepted file types by providing the [accepted types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept). By default every file type is accepted.
30
+ * @deprecated use [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript#file-uploads) instead
11
31
  */
12
32
  acceptedFileTypes: string[] | undefined;
33
+ /**
34
+ * If `false`, users can only upload one attachment per message
35
+ */
13
36
  isMultipleFileUploadEnabled: boolean | undefined;
37
+ /**
38
+ * The scope for user mentions, either members of the current channel of members of the application
39
+ */
14
40
  mentionScope: 'channel' | 'application' | undefined;
15
41
  constructor();
16
42
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputConfigService, never>;
@@ -1,6 +1,6 @@
1
1
  import { AfterViewInit, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges, TemplateRef, Type } from '@angular/core';
2
2
  import { ChatClientService } from '../chat-client.service';
3
- import { Observable } from 'rxjs';
3
+ import { Observable, Subject } from 'rxjs';
4
4
  import { UserResponse } from 'stream-chat';
5
5
  import { AttachmentService } from '../attachment.service';
6
6
  import { ChannelService } from '../channel.service';
@@ -8,6 +8,7 @@ import { NotificationService } from '../notification.service';
8
8
  import { AttachmentUpload, CommandAutocompleteListItemContext, MentionAutcompleteListItemContext, StreamMessage } from '../types';
9
9
  import { MessageInputConfigService } from './message-input-config.service';
10
10
  import { TextareaInterface } from './textarea.interface';
11
+ import { EmojiInputService } from './emoji-input.service';
11
12
  import * as i0 from "@angular/core";
12
13
  export declare class MessageInputComponent implements OnChanges, OnDestroy, AfterViewInit {
13
14
  private channelService;
@@ -18,11 +19,13 @@ export declare class MessageInputComponent implements OnChanges, OnDestroy, Afte
18
19
  private componentFactoryResolver;
19
20
  private cdRef;
20
21
  private chatClient;
22
+ emojiInputService: EmojiInputService;
21
23
  isFileUploadEnabled: boolean | undefined;
22
24
  areMentionsEnabled: boolean | undefined;
23
25
  mentionScope: 'channel' | 'application' | undefined;
24
26
  mentionAutocompleteItemTemplate: TemplateRef<MentionAutcompleteListItemContext> | undefined;
25
27
  commandAutocompleteItemTemplate: TemplateRef<CommandAutocompleteListItemContext> | undefined;
28
+ emojiPickerTemplate: TemplateRef<void> | undefined;
26
29
  mode: 'thread' | 'main';
27
30
  /**
28
31
  * @deprecated https://getstream.io/chat/docs/sdk/angular/components/message-input/#caution-acceptedfiletypes
@@ -39,6 +42,7 @@ export declare class MessageInputComponent implements OnChanges, OnDestroy, Afte
39
42
  textareaRef: ComponentRef<TextareaInterface> | undefined;
40
43
  mentionedUsers: UserResponse[];
41
44
  quotedMessage: undefined | StreamMessage;
45
+ typingStart$: Subject<void>;
42
46
  private fileInput;
43
47
  private textareaAnchor;
44
48
  private subscriptions;
@@ -46,7 +50,7 @@ export declare class MessageInputComponent implements OnChanges, OnDestroy, Afte
46
50
  private isViewInited;
47
51
  private appSettings;
48
52
  private channel;
49
- constructor(channelService: ChannelService, notificationService: NotificationService, attachmentService: AttachmentService, configService: MessageInputConfigService, textareaType: Type<TextareaInterface>, componentFactoryResolver: ComponentFactoryResolver, cdRef: ChangeDetectorRef, chatClient: ChatClientService);
53
+ constructor(channelService: ChannelService, notificationService: NotificationService, attachmentService: AttachmentService, configService: MessageInputConfigService, textareaType: Type<TextareaInterface>, componentFactoryResolver: ComponentFactoryResolver, cdRef: ChangeDetectorRef, chatClient: ChatClientService, emojiInputService: EmojiInputService);
50
54
  ngAfterViewInit(): void;
51
55
  ngOnChanges(changes: SimpleChanges): void;
52
56
  ngOnDestroy(): void;
@@ -61,6 +65,7 @@ export declare class MessageInputComponent implements OnChanges, OnDestroy, Afte
61
65
  private initTextarea;
62
66
  private areAttachemntsValid;
63
67
  private setCanSendMessages;
68
+ private get parentMessageId();
64
69
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputComponent, never>;
65
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "stream-message-input", never, { "isFileUploadEnabled": "isFileUploadEnabled"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "mentionAutocompleteItemTemplate": "mentionAutocompleteItemTemplate"; "commandAutocompleteItemTemplate": "commandAutocompleteItemTemplate"; "mode": "mode"; "acceptedFileTypes": "acceptedFileTypes"; "isMultipleFileUploadEnabled": "isMultipleFileUploadEnabled"; "message": "message"; }, { "messageUpdate": "messageUpdate"; }, never, never>;
70
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "stream-message-input", never, { "isFileUploadEnabled": "isFileUploadEnabled"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "mentionAutocompleteItemTemplate": "mentionAutocompleteItemTemplate"; "commandAutocompleteItemTemplate": "commandAutocompleteItemTemplate"; "emojiPickerTemplate": "emojiPickerTemplate"; "mode": "mode"; "acceptedFileTypes": "acceptedFileTypes"; "isMultipleFileUploadEnabled": "isMultipleFileUploadEnabled"; "message": "message"; }, { "messageUpdate": "messageUpdate"; }, never, never>;
66
71
  }
@@ -1,14 +1,18 @@
1
- import { EventEmitter, OnChanges } from '@angular/core';
1
+ import { EventEmitter, OnChanges, OnDestroy } from '@angular/core';
2
+ import { EmojiInputService } from '../emoji-input.service';
2
3
  import { TextareaInterface } from '../textarea.interface';
3
4
  import * as i0 from "@angular/core";
4
- export declare class TextareaComponent implements TextareaInterface, OnChanges {
5
+ export declare class TextareaComponent implements TextareaInterface, OnChanges, OnDestroy {
6
+ private emojiInputService;
5
7
  class: string;
6
8
  value: string;
7
9
  readonly valueChange: EventEmitter<string>;
8
10
  readonly send: EventEmitter<void>;
9
11
  private messageInput;
10
- constructor();
12
+ private subscriptions;
13
+ constructor(emojiInputService: EmojiInputService);
11
14
  ngOnChanges(): void;
15
+ ngOnDestroy(): void;
12
16
  inputChanged(): void;
13
17
  sent(event: Event): void;
14
18
  static ɵfac: i0.ɵɵFactoryDeclaration<TextareaComponent, never>;
@@ -1,6 +1,12 @@
1
1
  import { Subject } from 'rxjs';
2
2
  import * as i0 from "@angular/core";
3
+ /**
4
+ * The `ImageLoadService` is used to position the scrollbar in the message list
5
+ */
3
6
  export declare class ImageLoadService {
7
+ /**
8
+ * A subject that can be used to notify the message list if an image attachment finished loading
9
+ */
4
10
  imageLoad$: Subject<void>;
5
11
  constructor();
6
12
  static ɵfac: i0.ɵɵFactoryDeclaration<ImageLoadService, never>;
@@ -1,10 +1,11 @@
1
1
  import { AfterViewChecked, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
2
2
  import { ChannelService } from '../channel.service';
3
3
  import { Observable } from 'rxjs';
4
- import { StreamMessage } from '../types';
4
+ import { DefaultUserType, StreamMessage } from '../types';
5
5
  import { ChatClientService } from '../chat-client.service';
6
6
  import { GroupStyle } from './group-styles';
7
7
  import { ImageLoadService } from './image-load.service';
8
+ import { UserResponse } from 'stream-chat';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class MessageListComponent implements AfterViewChecked, OnChanges, OnInit, OnDestroy {
10
11
  private channelService;
@@ -13,6 +14,9 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
13
14
  messageTemplate: TemplateRef<any> | undefined;
14
15
  messageInputTemplate: TemplateRef<any> | undefined;
15
16
  mentionTemplate: TemplateRef<any> | undefined;
17
+ typingIndicatorTemplate: TemplateRef<{
18
+ usersTyping$: Observable<UserResponse<DefaultUserType>[]>;
19
+ }> | undefined;
16
20
  /**
17
21
  * @deprecated https://getstream.io/chat/docs/sdk/angular/components/message_list/#caution-arereactionsenabled-deprecated
18
22
  */
@@ -44,12 +48,16 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
44
48
  private readonly isUserScrolledUpThreshold;
45
49
  private subscriptions;
46
50
  private prevScrollTop;
51
+ private usersTypingInChannel$;
52
+ private usersTypingInThread$;
47
53
  constructor(channelService: ChannelService, chatClientService: ChatClientService, imageLoadService: ImageLoadService);
48
54
  ngOnInit(): void;
49
55
  ngOnChanges(changes: SimpleChanges): void;
50
56
  ngAfterViewChecked(): void;
51
57
  ngOnDestroy(): void;
58
+ get usersTyping$(): Observable<UserResponse<DefaultUserType<import("../types").DefaultUserTypeInternal>>[]>;
52
59
  trackByMessageId(index: number, item: StreamMessage): string;
60
+ trackByUserId(index: number, user: UserResponse): string;
53
61
  scrollToBottom(): void;
54
62
  scrolled(): void;
55
63
  private preserveScrollbarPosition;
@@ -57,5 +65,5 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
57
65
  private setMessages$;
58
66
  private resetScrollState;
59
67
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageListComponent, never>;
60
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "stream-message-list", never, { "messageTemplate": "messageTemplate"; "messageInputTemplate": "messageInputTemplate"; "mentionTemplate": "mentionTemplate"; "areReactionsEnabled": "areReactionsEnabled"; "enabledMessageActionsInput": "enabledMessageActions"; "mode": "mode"; }, {}, never, never>;
68
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "stream-message-list", never, { "messageTemplate": "messageTemplate"; "messageInputTemplate": "messageInputTemplate"; "mentionTemplate": "mentionTemplate"; "typingIndicatorTemplate": "typingIndicatorTemplate"; "areReactionsEnabled": "areReactionsEnabled"; "enabledMessageActionsInput": "enabledMessageActions"; "mode": "mode"; }, {}, never, never>;
61
69
  }