stream-chat-angular 4.65.3 → 4.66.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.
@@ -5,6 +5,7 @@ import { DefaultStreamChatGenerics } from '../types';
5
5
  import { ChatClientService } from '../chat-client.service';
6
6
  import { MessageService } from '../message.service';
7
7
  import { CustomTemplatesService } from '../custom-templates.service';
8
+ import { DateParserService } from '../date-parser.service';
8
9
  import * as i0 from "@angular/core";
9
10
  /**
10
11
  * The `ChannelPreview` component displays a channel preview in the channel list, it consists of the image, name and latest message of the channel.
@@ -14,6 +15,7 @@ export declare class ChannelPreviewComponent implements OnInit, OnDestroy {
14
15
  private ngZone;
15
16
  private chatClientService;
16
17
  customTemplatesService: CustomTemplatesService;
18
+ private dateParser;
17
19
  /**
18
20
  * The channel to be displayed
19
21
  */
@@ -23,11 +25,14 @@ export declare class ChannelPreviewComponent implements OnInit, OnDestroy {
23
25
  isUnread: boolean;
24
26
  unreadCount: number | undefined;
25
27
  latestMessageText: string;
26
- latestMessage?: FormatMessageResponse;
28
+ latestMessageStatus?: 'delivered' | 'read';
29
+ latestMessageTime?: string;
30
+ latestMessage?: FormatMessageResponse<DefaultStreamChatGenerics>;
27
31
  displayAs: 'text' | 'html';
32
+ userId?: string;
28
33
  private subscriptions;
29
34
  private canSendReadEvents;
30
- constructor(channelService: ChannelService, ngZone: NgZone, chatClientService: ChatClientService, messageService: MessageService, customTemplatesService: CustomTemplatesService);
35
+ constructor(channelService: ChannelService, ngZone: NgZone, chatClientService: ChatClientService, messageService: MessageService, customTemplatesService: CustomTemplatesService, dateParser: DateParserService);
31
36
  ngOnInit(): void;
32
37
  ngOnDestroy(): void;
33
38
  get avatarImage(): string | undefined;
@@ -3,6 +3,10 @@ import * as i0 from "@angular/core";
3
3
  * The `DateParserService` parses dates into user-friendly string representations.
4
4
  */
5
5
  export declare class DateParserService {
6
+ /**
7
+ * Custom parser to override `parseTime`
8
+ */
9
+ customTimeParser?: (date: Date) => string;
6
10
  /**
7
11
  * Custom parser to override `parseDate`
8
12
  */
@@ -12,6 +16,12 @@ export declare class DateParserService {
12
16
  */
13
17
  customDateTimeParser?: (date: Date) => string;
14
18
  constructor();
19
+ /**
20
+ * Return a user-friendly string representation of the time
21
+ * @param date
22
+ * @returns The parsed time
23
+ */
24
+ parseTime(date: Date): string;
15
25
  /**
16
26
  * Return a user-friendly string representation of the date (year, month and date)
17
27
  * @param date
@@ -1,5 +1,5 @@
1
1
  import * as i0 from "@angular/core";
2
- export declare type Icon = 'action-icon' | 'delivered-icon' | 'reaction-icon' | 'connection-error' | 'send' | 'file-upload' | 'retry' | 'close' | 'file' | 'audio-file' | 'reply' | 'close-no-outline' | 'reply-in-thread' | 'arrow-left' | 'arrow-right' | 'menu' | 'arrow-up' | 'arrow-down' | 'chat-bubble' | 'attach' | 'unspecified-filetype' | 'download' | 'error' | 'play' | 'pause';
2
+ export declare type Icon = 'action-icon' | 'delivered-icon' | 'read-icon' | 'reaction-icon' | 'connection-error' | 'send' | 'file-upload' | 'retry' | 'close' | 'file' | 'audio-file' | 'reply' | 'close-no-outline' | 'reply-in-thread' | 'arrow-left' | 'arrow-right' | 'menu' | 'arrow-up' | 'arrow-down' | 'chat-bubble' | 'attach' | 'unspecified-filetype' | 'download' | 'error' | 'play' | 'pause';
3
3
  /**
4
4
  * The `Icon` component can be used to display different icons (i. e. message delivered icon).
5
5
  */
@@ -0,0 +1 @@
1
+ export declare const isOnSeparateDate: (date1: Date, date2: Date) => boolean;
@@ -1 +1 @@
1
- export declare const parseDate: (date: Date, format?: 'date' | 'date-time') => string;
1
+ export declare const parseDate: (date: Date, format?: 'date' | 'date-time' | 'time') => string;
package/lib/types.d.ts CHANGED
@@ -99,6 +99,14 @@ export declare type ChannelPreviewInfoContext<T extends DefaultStreamChatGeneric
99
99
  * The title of the channel, or the name of the channel members
100
100
  */
101
101
  channelDisplayTitle: string;
102
+ /**
103
+ * The status of the last message (only available if the last message was sent by the current user)
104
+ */
105
+ latestMessageStatus?: 'delivered' | 'read';
106
+ /**
107
+ * The time of the last message (formatted to a user-friendly string)
108
+ */
109
+ latestMessageTime?: string;
102
110
  unreadCount: number;
103
111
  };
104
112
  export declare type MessageInputContext = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "4.65.3",
3
+ "version": "4.66.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/",
package/public-api.d.ts CHANGED
@@ -59,3 +59,4 @@ export * from './lib/message.service';
59
59
  export * from './lib/message-actions.service';
60
60
  export * from './lib/voice-recording/voice-recording.component';
61
61
  export * from './lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component';
62
+ export * from './lib/is-on-separate-date';