stream-chat-angular 2.20.1 → 2.22.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.
@@ -27,6 +27,7 @@ export declare class AttachmentListComponent implements OnChanges {
27
27
  isImage(attachment: Attachment): boolean;
28
28
  isFile(attachment: Attachment): boolean;
29
29
  isGallery(attachment: Attachment): boolean;
30
+ isVideo(attachment: Attachment): boolean | "" | undefined;
30
31
  isCard(attachment: Attachment): boolean;
31
32
  imageLoaded(): void;
32
33
  hasFileSize(attachment: Attachment<DefaultAttachmentType>): boolean | "" | 0 | undefined;
@@ -2,8 +2,8 @@ import { NgZone } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { Attachment, Channel, ChannelFilters, ChannelOptions, ChannelResponse, ChannelSort, Event, UserResponse } from 'stream-chat';
4
4
  import { ChatClientService, Notification } from './chat-client.service';
5
- import { MessageReactionType } from './message-reactions/message-reactions.component';
6
5
  import { AttachmentUpload, StreamMessage } from './types';
6
+ import { MessageReactionType } from './message-reactions/message-reactions.component';
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. TEST
@@ -119,6 +119,26 @@ export declare class ChannelService {
119
119
  * 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)
120
120
  */
121
121
  customNewMessageHandler?: (event: Event, channel: Channel, channelListSetter: (channels: (Channel | ChannelResponse)[]) => void, messageListSetter: (messages: StreamMessage[]) => void, threadListSetter: (messages: StreamMessage[]) => void, parentMessageSetter: (message: StreamMessage | undefined) => void) => void;
122
+ /**
123
+ * You can override the default file upload request - you can use this to upload files to your own CDN
124
+ */
125
+ customFileUploadRequest?: (file: File, channel: Channel) => Promise<{
126
+ file: string;
127
+ }>;
128
+ /**
129
+ * You can override the default image upload request - you can use this to upload images to your own CDN
130
+ */
131
+ customImageUploadRequest?: (file: File, channel: Channel) => Promise<{
132
+ file: string;
133
+ }>;
134
+ /**
135
+ * You can override the default file delete request - override this if you use your own CDN
136
+ */
137
+ customFileDeleteRequest?: (url: string, channel: Channel) => Promise<void>;
138
+ /**
139
+ * You can override the default image delete request - override this if you use your own CDN
140
+ */
141
+ customImageDeleteRequest?: (url: string, channel: Channel) => Promise<void>;
122
142
  private channelsSubject;
123
143
  private activeChannelSubject;
124
144
  private activeChannelMessagesSubject;
@@ -144,6 +164,10 @@ export declare class ChannelService {
144
164
  * @param channel
145
165
  */
146
166
  setAsActiveChannel(channel: Channel): void;
167
+ /**
168
+ * Deselects the currently active (if any) channel
169
+ */
170
+ deselectActiveChannel(): void;
147
171
  /**
148
172
  * Sets the given `message` as an active parent message. If `undefined` is provided, it will deleselect the current parent message.
149
173
  * @param message
@@ -162,8 +186,10 @@ export declare class ChannelService {
162
186
  * @param filters
163
187
  * @param sort
164
188
  * @param options
189
+ * @param shouldSetActiveChannel Decides if the first channel in the result should be made as an active channel, or no channel should be marked as active
190
+ * @returns the list of channels found by the query
165
191
  */
166
- init(filters: ChannelFilters, sort?: ChannelSort, options?: ChannelOptions): Promise<void>;
192
+ init(filters: ChannelFilters, sort?: ChannelSort, options?: ChannelOptions, shouldSetActiveChannel?: boolean): Promise<Channel<import("stream-chat").UR, import("stream-chat").UR, import("stream-chat").LiteralStringForUnion, import("stream-chat").UR, import("stream-chat").UR, import("stream-chat").UR, import("stream-chat").UR>[]>;
167
193
  /**
168
194
  * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./ChatClientService.mdx/#disconnectuser).
169
195
  */
package/lib/types.d.ts CHANGED
@@ -41,7 +41,7 @@ export declare type AttachmentUpload = {
41
41
  file: File;
42
42
  state: 'error' | 'success' | 'uploading';
43
43
  url?: string;
44
- type: 'image' | 'file';
44
+ type: 'image' | 'file' | 'video';
45
45
  previewUri?: string | ArrayBuffer;
46
46
  };
47
47
  export declare type MentionAutcompleteListItemContext = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "2.20.1",
3
+ "version": "2.22.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 = '2.20.1';
1
+ export const version = '2.22.0';