stream-chat-angular 4.47.3 → 4.48.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, MessageInput, MessageReactionType, StreamMessage } from './types';
6
+ import { AttachmentUpload, ChannelQueryState, DefaultStreamChatGenerics, MessageInput, MessageReactionType, NextPageConfiguration, 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.
@@ -175,6 +175,10 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
175
175
  * 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.
176
176
  */
177
177
  beforeUpdateMessage?: (message: StreamMessage<T>) => StreamMessage<T> | Promise<StreamMessage<T>>;
178
+ /**
179
+ * By default the SDK uses an offset based pagination, you can change/extend this by providing your own custom paginator method. It will be called with the result of the latest channel query.
180
+ */
181
+ customPaginator?: (channelQueryResult: Channel<T>[]) => NextPageConfiguration;
178
182
  private channelsSubject;
179
183
  private activeChannelSubject;
180
184
  private activeChannelMessagesSubject;
@@ -203,6 +207,7 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
203
207
  private threadListSetter;
204
208
  private parentMessageSetter;
205
209
  private dismissErrorNotification?;
210
+ private nextPageConfiguration?;
206
211
  constructor(chatClientService: ChatClientService<T>, ngZone: NgZone, notificationService: NotificationService);
207
212
  /**
208
213
  * If set to false, read events won't be sent as new messages are received. If set to true active channel (if any) will immediately be marked as read.
@@ -427,6 +432,14 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
427
432
  * @param parentId The id of the parent message, if user were typing in a thread
428
433
  */
429
434
  typingStopped(parentId?: string): Promise<void>;
435
+ /**
436
+ * The current list of channels
437
+ */
438
+ get channels(): Channel<T>[];
439
+ /**
440
+ * The current active channel
441
+ */
442
+ get activeChannel(): Channel<T> | undefined;
430
443
  private messageUpdated;
431
444
  private messageReactionEventReceived;
432
445
  private formatMessage;
@@ -441,7 +454,6 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
441
454
  private handleChannelVisible;
442
455
  private handleChannelUpdate;
443
456
  private handleChannelTruncate;
444
- private get channels();
445
457
  private get canSendReadEvents();
446
458
  private transformToStreamMessage;
447
459
  private handleTypingStartEvent;
@@ -449,6 +461,7 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
449
461
  private updateLatestMessages;
450
462
  private setChannelState;
451
463
  private markRead;
464
+ private setNextPageConfiguration;
452
465
  static ɵfac: i0.ɵɵFactoryDeclaration<ChannelService<any>, never>;
453
466
  static ɵprov: i0.ɵɵInjectableDeclaration<ChannelService<any>>;
454
467
  }
package/lib/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { TemplateRef } from '@angular/core';
2
2
  import { Observable, Subject } from 'rxjs';
3
- import type { Attachment, Channel, ChannelMemberResponse, CommandResponse, Event, ExtendableGenerics, FormatMessageResponse, LiteralStringForUnion, MessageResponseBase, Mute, ReactionResponse, User, UserResponse } from 'stream-chat';
3
+ import type { Attachment, Channel, ChannelFilters, ChannelMemberResponse, CommandResponse, Event, ExtendableGenerics, FormatMessageResponse, LiteralStringForUnion, MessageResponseBase, Mute, ReactionResponse, User, UserResponse } from 'stream-chat';
4
4
  import { AttachmentService } from './attachment.service';
5
5
  import { Icon } from './icon/icon.component';
6
6
  export declare type UnknownType = Record<string, unknown>;
@@ -254,4 +254,13 @@ export declare type MessageInput<T extends DefaultStreamChatGenerics = DefaultSt
254
254
  quotedMessageId: string | undefined;
255
255
  customData: undefined | Partial<T['messageType']>;
256
256
  };
257
+ export declare type OffsetNextPageConfiguration = {
258
+ type: 'offset';
259
+ offset: number;
260
+ };
261
+ export declare type FiltertNextPageConfiguration<T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
262
+ type: 'filter';
263
+ paginationFilter: ChannelFilters<T>;
264
+ };
265
+ export declare type NextPageConfiguration = OffsetNextPageConfiguration | FiltertNextPageConfiguration;
257
266
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "4.47.3",
3
+ "version": "4.48.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.47.3';
1
+ export const version = '4.48.0';