stream-chat-angular 4.36.2 → 4.38.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.
@@ -1,4 +1,4 @@
1
- import { OnChanges } from '@angular/core';
1
+ import { AfterViewInit, ChangeDetectorRef, ElementRef, OnChanges, OnDestroy } from '@angular/core';
2
2
  import { Channel, User } from 'stream-chat';
3
3
  import { CustomTemplatesService } from '../custom-templates.service';
4
4
  import { AvatarContext, AvatarLocation, AvatarType, DefaultStreamChatGenerics } from '../types';
@@ -6,8 +6,10 @@ import * as i0 from "@angular/core";
6
6
  /**
7
7
  * The `AvatarPlaceholder` component displays the [default avatar](./AvatarComponent.mdx) unless a [custom template](../services/CustomTemplatesService.mdx) is provided. This component is used by the SDK internally, you likely won't need to use it.
8
8
  */
9
- export declare class AvatarPlaceholderComponent implements OnChanges {
9
+ export declare class AvatarPlaceholderComponent implements OnChanges, AfterViewInit, OnDestroy {
10
10
  customTemplatesService: CustomTemplatesService;
11
+ private hostElement;
12
+ private cdRef;
11
13
  /**
12
14
  * An optional name of the image, used for fallback image or image title (if `imageUrl` is provided)
13
15
  */
@@ -41,8 +43,13 @@ export declare class AvatarPlaceholderComponent implements OnChanges {
41
43
  */
42
44
  initialsType: 'first-letter-of-first-word' | 'first-letter-of-each-word';
43
45
  context: AvatarContext;
44
- constructor(customTemplatesService: CustomTemplatesService);
46
+ isVisible: boolean;
47
+ private mutationObserver?;
48
+ constructor(customTemplatesService: CustomTemplatesService, hostElement: ElementRef<HTMLElement>, cdRef: ChangeDetectorRef);
49
+ ngAfterViewInit(): void;
45
50
  ngOnChanges(): void;
51
+ ngOnDestroy(): void;
52
+ private checkIfVisible;
46
53
  static ɵfac: i0.ɵɵFactoryDeclaration<AvatarPlaceholderComponent, never>;
47
54
  static ɵcmp: i0.ɵɵComponentDeclaration<AvatarPlaceholderComponent, "stream-avatar-placeholder", never, { "name": "name"; "imageUrl": "imageUrl"; "size": "size"; "location": "location"; "channel": "channel"; "user": "user"; "type": "type"; "initialsType": "initialsType"; }, {}, never, never>;
48
55
  }
@@ -1,6 +1,6 @@
1
1
  import { NgZone } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
- import { Attachment, Channel, ChannelFilters, ChannelOptions, ChannelResponse, ChannelSort, Event, UserResponse } from 'stream-chat';
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
6
  import { AttachmentUpload, ChannelQueryState, DefaultStreamChatGenerics, MessageReactionType, StreamMessage } from './types';
@@ -261,7 +261,7 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
261
261
  * @param quotedMessageId Id of the message to quote (if sending a quote reply)
262
262
  * @param customData
263
263
  */
264
- sendMessage(text: string, attachments?: Attachment<T>[], mentionedUsers?: UserResponse<T>[], parentId?: string | undefined, quotedMessageId?: string | undefined, customData?: undefined | Partial<T['messageType']>): Promise<void>;
264
+ sendMessage(text: string, attachments?: Attachment<T>[], mentionedUsers?: UserResponse<T>[], parentId?: string | undefined, quotedMessageId?: string | undefined, customData?: undefined | Partial<T['messageType']>): Promise<NonNullable<StreamMessage<T>>>;
265
265
  /**
266
266
  * Resends the given message to the active channel
267
267
  * @param message The message to resend
@@ -271,7 +271,124 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
271
271
  * Updates the message in the active channel
272
272
  * @param message Mesage to be updated
273
273
  */
274
- updateMessage(message: StreamMessage<T>): Promise<void>;
274
+ updateMessage(message: StreamMessage<T>): Promise<StreamMessage<T> | (T["messageType"] & {
275
+ id: string;
276
+ attachments?: Attachment<T>[] | undefined;
277
+ html?: string | undefined;
278
+ mml?: string | undefined;
279
+ parent_id?: string | undefined;
280
+ pin_expires?: string | null | undefined;
281
+ pinned?: boolean | undefined;
282
+ pinned_at?: string | null | undefined;
283
+ quoted_message_id?: string | undefined;
284
+ show_in_channel?: boolean | undefined;
285
+ silent?: boolean | undefined;
286
+ text?: string | undefined;
287
+ user?: UserResponse<T> | null | undefined;
288
+ user_id?: string | undefined;
289
+ } & {
290
+ type: import("stream-chat").MessageLabel;
291
+ args?: string | undefined;
292
+ channel?: ChannelResponse<T> | undefined;
293
+ cid?: string | undefined;
294
+ command?: string | undefined;
295
+ command_info?: {
296
+ name?: string | undefined;
297
+ } | undefined;
298
+ created_at?: string | undefined;
299
+ deleted_at?: string | undefined;
300
+ i18n?: (import("stream-chat").RequireAtLeastOne<Record<"_text" | "so_text" | "hr_text" | "th_text" | "tr_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" | "hu_text" | "id_text" | "it_text" | "ja_text" | "ka_text" | "ko_text" | "lv_text" | "ms_text" | "nl_text" | "pl_text" | "ps_text" | "pt_text" | "ro_text" | "ru_text" | "sk_text" | "sl_text" | "sq_text" | "sr_text" | "sv_text" | "sw_text" | "ta_text" | "tl_text" | "uk_text" | "ur_text" | "vi_text" | "zh_text" | "zh-TW_text", string>> & {
301
+ language: import("stream-chat").TranslationLanguages;
302
+ }) | undefined;
303
+ latest_reactions?: import("stream-chat").ReactionResponse<T>[] | undefined;
304
+ mentioned_users?: UserResponse<T>[] | undefined;
305
+ own_reactions?: import("stream-chat").ReactionResponse<T>[] | null | undefined;
306
+ pin_expires?: string | null | undefined;
307
+ pinned_at?: string | null | undefined;
308
+ pinned_by?: UserResponse<T> | null | undefined;
309
+ reaction_counts?: {
310
+ [key: string]: number;
311
+ } | null | undefined;
312
+ reaction_scores?: {
313
+ [key: string]: number;
314
+ } | null | undefined;
315
+ reply_count?: number | undefined;
316
+ shadowed?: boolean | undefined;
317
+ status?: string | undefined;
318
+ thread_participants?: UserResponse<T>[] | undefined;
319
+ updated_at?: string | undefined;
320
+ } & {
321
+ quoted_message?: import("stream-chat").MessageResponseBase<T> | undefined;
322
+ } & Omit<MessageResponse<{
323
+ attachmentType: import("stream-chat").UR;
324
+ channelType: import("stream-chat").UR;
325
+ commandType: import("stream-chat").LiteralStringForUnion;
326
+ eventType: import("stream-chat").UR;
327
+ messageType: {};
328
+ reactionType: import("stream-chat").UR;
329
+ userType: import("stream-chat").UR;
330
+ }>, "created_at" | "pinned_at" | "updated_at" | "status"> & import("stream-chat").UR & {
331
+ readBy: UserResponse<import("stream-chat").DefaultGenerics>[];
332
+ translation: string | undefined;
333
+ created_at: Date;
334
+ pinned_at: Date | null;
335
+ status: string;
336
+ updated_at: Date;
337
+ }) | (T["messageType"] & {
338
+ id: string;
339
+ attachments?: Attachment<T>[] | undefined;
340
+ html?: string | undefined;
341
+ mml?: string | undefined;
342
+ parent_id?: string | undefined;
343
+ pin_expires?: string | null | undefined;
344
+ pinned?: boolean | undefined;
345
+ pinned_at?: string | null | undefined;
346
+ quoted_message_id?: string | undefined;
347
+ show_in_channel?: boolean | undefined;
348
+ silent?: boolean | undefined;
349
+ text?: string | undefined;
350
+ user?: UserResponse<T> | null | undefined;
351
+ user_id?: string | undefined;
352
+ } & {
353
+ type: import("stream-chat").MessageLabel;
354
+ args?: string | undefined;
355
+ channel?: ChannelResponse<T> | undefined;
356
+ cid?: string | undefined;
357
+ command?: string | undefined;
358
+ command_info?: {
359
+ name?: string | undefined;
360
+ } | undefined;
361
+ created_at?: string | undefined;
362
+ deleted_at?: string | undefined;
363
+ i18n?: (import("stream-chat").RequireAtLeastOne<Record<"_text" | "so_text" | "hr_text" | "th_text" | "tr_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" | "hu_text" | "id_text" | "it_text" | "ja_text" | "ka_text" | "ko_text" | "lv_text" | "ms_text" | "nl_text" | "pl_text" | "ps_text" | "pt_text" | "ro_text" | "ru_text" | "sk_text" | "sl_text" | "sq_text" | "sr_text" | "sv_text" | "sw_text" | "ta_text" | "tl_text" | "uk_text" | "ur_text" | "vi_text" | "zh_text" | "zh-TW_text", string>> & {
364
+ language: import("stream-chat").TranslationLanguages;
365
+ }) | undefined;
366
+ latest_reactions?: import("stream-chat").ReactionResponse<T>[] | undefined;
367
+ mentioned_users?: UserResponse<T>[] | undefined;
368
+ own_reactions?: import("stream-chat").ReactionResponse<T>[] | null | undefined;
369
+ pin_expires?: string | null | undefined;
370
+ pinned_at?: string | null | undefined;
371
+ pinned_by?: UserResponse<T> | null | undefined;
372
+ reaction_counts?: {
373
+ [key: string]: number;
374
+ } | null | undefined;
375
+ reaction_scores?: {
376
+ [key: string]: number;
377
+ } | null | undefined;
378
+ reply_count?: number | undefined;
379
+ shadowed?: boolean | undefined;
380
+ status?: string | undefined;
381
+ thread_participants?: UserResponse<T>[] | undefined;
382
+ updated_at?: string | undefined;
383
+ } & {
384
+ readBy: UserResponse<import("stream-chat").DefaultGenerics>[];
385
+ translation: string | undefined;
386
+ pinned_at: Date | null;
387
+ created_at: Date;
388
+ updated_at: Date;
389
+ status: string;
390
+ quoted_message?: import("stream-chat").MessageResponseBase<T> | undefined;
391
+ })>;
275
392
  /**
276
393
  * Deletes the message from the active channel
277
394
  * @param message Message to be deleted
@@ -61,7 +61,9 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
61
61
  /**
62
62
  * Emits when a message was successfuly sent or updated
63
63
  */
64
- readonly messageUpdate: EventEmitter<void>;
64
+ readonly messageUpdate: EventEmitter<{
65
+ message: StreamMessage;
66
+ }>;
65
67
  class: string;
66
68
  isFileUploadAuthorized: boolean | undefined;
67
69
  canSendLinks: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "4.36.2",
3
+ "version": "4.38.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.36.2';
1
+ export const version = '4.38.0';