stream-chat-angular 4.43.0 → 4.45.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.
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
3
3
  import { Attachment, Channel, ChannelFilters, ChannelOptions, ChannelResponse, ChannelSort, Event, MessageResponse, UserResponse } from 'stream-chat';
4
4
  import { ChatClientService, ClientEvent } from './chat-client.service';
5
5
  import { NotificationService } from './notification.service';
6
- import { AttachmentUpload, ChannelQueryState, DefaultStreamChatGenerics, MessageReactionType, StreamMessage } from './types';
6
+ import { AttachmentUpload, ChannelQueryState, DefaultStreamChatGenerics, MessageInput, MessageReactionType, 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.
@@ -165,6 +165,14 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
165
165
  * 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.
166
166
  */
167
167
  messageDeleteConfirmationHandler?: (message: StreamMessage<T>) => Promise<boolean>;
168
+ /**
169
+ * 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.
170
+ */
171
+ beforeSendMessage?: (input: MessageInput<T>) => MessageInput<T> | Promise<MessageInput<T>>;
172
+ /**
173
+ * 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.
174
+ */
175
+ beforeUpdateMessage?: (message: StreamMessage<T>) => StreamMessage<T> | Promise<StreamMessage<T>>;
168
176
  private channelsSubject;
169
177
  private activeChannelSubject;
170
178
  private activeChannelMessagesSubject;
@@ -79,6 +79,7 @@ export declare class MessageComponent implements OnInit, OnChanges, OnDestroy, A
79
79
  canDisplayReadStatus: boolean;
80
80
  private quotedMessageAttachments;
81
81
  user: UserResponse<DefaultStreamChatGenerics> | undefined;
82
+ optionsRenderTimeoutEnded: boolean;
82
83
  private subscriptions;
83
84
  private container;
84
85
  private readonly urlRegexp;
@@ -71,7 +71,6 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
71
71
  parentMessage: StreamMessage | undefined;
72
72
  highlightedMessageId: string | undefined;
73
73
  isLoading: boolean;
74
- isScrollInProgress: boolean;
75
74
  scrollEndTimeout: any;
76
75
  lastReadMessageId?: string;
77
76
  isJumpingToLatestUnreadMessage: boolean;
package/lib/types.d.ts CHANGED
@@ -246,4 +246,12 @@ export declare type ChannelQueryState = {
246
246
  state: 'in-progress' | 'success' | 'error';
247
247
  error?: unknown;
248
248
  };
249
+ export declare type MessageInput<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
250
+ text: string;
251
+ attachments: Attachment<T>[];
252
+ mentionedUsers: UserResponse<T>[];
253
+ parentId: string | undefined;
254
+ quotedMessageId: string | undefined;
255
+ customData: undefined | Partial<T['messageType']>;
256
+ };
249
257
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "4.43.0",
3
+ "version": "4.45.0",
4
4
  "description": "Angular components to create chat conversations or livestream style chat",
5
5
  "author": "GetStream",
6
6
  "homepage": "https://getstream.io/chat/",
@@ -1 +1 @@
1
- export const version = '4.43.0';
1
+ export const version = '4.45.0';