import React from 'react'; import { ChannelListMessengerProps } from './ChannelListMessenger'; import { AvatarProps } from '../Avatar/Avatar'; import { ChannelPreviewUIComponentProps } from '../ChannelPreview/ChannelPreview'; import { ChannelSearchProps } from '../ChannelSearch/ChannelSearch'; import { ChatDownProps } from '../ChatDown/ChatDown'; import { EmptyStateIndicatorProps } from '../EmptyStateIndicator'; import { LoadMorePaginatorProps } from '../LoadMore/LoadMorePaginator'; import type { Channel, ChannelFilters, ChannelOptions, ChannelSort, Event } from 'stream-chat'; import type { DefaultStreamChatGenerics, PaginatorProps } from '../../types/types'; export declare type ChannelListProps = { /** Additional props for underlying ChannelSearch component and channel search controller, [available props](https://getstream.io/chat/docs/sdk/react/utility-components/channel_search/#props) */ additionalChannelSearchProps?: Omit, 'setChannels'>; /** * When the client receives `message.new`, `notification.message_new`, and `notification.added_to_channel` events, we automatically * push that channel to the top of the list. If the channel doesn't currently exist in the list, we grab the channel from * `client.activeChannels` and push it to the top of the list. You can disable this behavior by setting this prop * to false, which will prevent channels not in the list from incrementing the list. The default is true. */ allowNewMessagesFromUnfilteredChannels?: boolean; /** Custom UI component to display user avatar, defaults to and accepts same props as: [Avatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/Avatar.tsx) */ Avatar?: React.ComponentType; /** Optional function to filter channels prior to loading in the DOM. Do not use any complex or async logic that would delay the loading of the ChannelList. We recommend using a pure function with array methods like filter/sort/reduce. */ channelRenderFilterFn?: (channels: Array>) => Array>; /** Custom UI component to display search results, defaults to and accepts same props as: [ChannelSearch](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelSearch/ChannelSearch.tsx) */ ChannelSearch?: React.ComponentType>; /** Set a channel (with this ID) to active and manually move it to the top of the list */ customActiveChannel?: string; /** Custom UI component for rendering an empty list, defaults to and accepts same props as: [EmptyStateIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/EmptyStateIndicator/EmptyStateIndicator.tsx) */ EmptyStateIndicator?: React.ComponentType; /** An object containing channel query filters */ filters?: ChannelFilters; /** Custom UI component to display the container for the queried channels, defaults to and accepts same props as: [ChannelListMessenger](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelList/ChannelListMessenger.tsx) */ List?: React.ComponentType>; /** Custom UI component to display the loading error indicator, defaults to and accepts same props as: [ChatDown](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChatDown/ChatDown.tsx) */ LoadingErrorIndicator?: React.ComponentType; /** Custom UI component to display the loading state, defaults to and accepts same props as: [LoadingChannels](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/LoadingChannels.tsx) */ LoadingIndicator?: React.ComponentType; /** When true, channels won't dynamically sort by most recent message */ lockChannelOrder?: boolean; /** Function to override the default behavior when a user is added to a channel, corresponds to [notification.added\_to\_channel](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */ onAddedToChannel?: (setChannels: React.Dispatch>>>, event: Event) => void; /** Function to override the default behavior when a channel is deleted, corresponds to [channel.deleted](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */ onChannelDeleted?: (setChannels: React.Dispatch>>>, event: Event) => void; /** Function to override the default behavior when a channel is hidden, corresponds to [channel.hidden](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */ onChannelHidden?: (setChannels: React.Dispatch>>>, event: Event) => void; /** Function to override the default behavior when a channel is truncated, corresponds to [channel.truncated](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */ onChannelTruncated?: (setChannels: React.Dispatch>>>, event: Event) => void; /** Function to override the default behavior when a channel is updated, corresponds to [channel.updated](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */ onChannelUpdated?: (setChannels: React.Dispatch>>>, event: Event) => void; /** Function to override the default channel visible behavior, corresponds to [channel.visible](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */ onChannelVisible?: (setChannels: React.Dispatch>>>, event: Event) => void; /** Function to override the default behavior when a message is received on a channel not being watched, corresponds to [notification.message\_new](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */ onMessageNew?: (setChannels: React.Dispatch>>>, event: Event) => void; /** Function to override the default behavior when a user gets removed from a channel, corresponds to [notification.removed\_from\_channel](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */ onRemovedFromChannel?: (setChannels: React.Dispatch>>>, event: Event) => void; /** An object containing channel query options */ options?: ChannelOptions; /** Custom UI component to handle channel pagination logic, defaults to and accepts same props as: [LoadMorePaginator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/LoadMore/LoadMorePaginator.tsx) */ Paginator?: React.ComponentType; /** additional props for Paginator */ paginatorProps?: PaginatorProps | LoadMorePaginatorProps; /** Custom UI component to display the channel preview in the list, defaults to and accepts same props as: [ChannelPreviewMessenger](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelPreview/ChannelPreviewMessenger.tsx) */ Preview?: React.ComponentType>; /** Function to override the default behavior when rendering channels, so this function is called instead of rendering the Preview directly */ renderChannels?: (channels: Channel[], channelPreview: (item: Channel) => React.ReactNode) => React.ReactNode; /** If true, sends the list's currently loaded channels to the `List` component as the `loadedChannels` prop */ sendChannelsToList?: boolean; /** Last channel will be set as active channel if true, defaults to true */ setActiveChannelOnMount?: boolean; /** Whether or not to load the list with a search component, defaults to false */ showChannelSearch?: boolean; /** An object containing channel query sort parameters */ sort?: ChannelSort; /** An object containing query parameters for fetching channel watchers */ watchers?: { limit?: number; offset?: number; }; }; /** * Renders a preview list of Channels, allowing you to select the Channel you want to open */ export declare const ChannelList: (props: ChannelListProps) => JSX.Element; //# sourceMappingURL=ChannelList.d.ts.map