@linktr.ee/messaging-react 1.25.1 → 1.26.1

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.
package/dist/index.d.ts CHANGED
@@ -77,6 +77,20 @@ export declare interface ChannelListProps {
77
77
  * channel belongs in the current list before inserting it.
78
78
  */
79
79
  onAddedToChannel?: ChannelListProps_2['onAddedToChannel'];
80
+ /**
81
+ * Client-side filter applied before rendering the channel list.
82
+ * Websocket events can add channels to the list that bypass server-side
83
+ * query filters. Use this to enforce visibility rules that can't be
84
+ * automatically derived from the filters prop (e.g. $or conditions).
85
+ *
86
+ * @example
87
+ * // Hide channels where the visitor hasn't sent a message yet,
88
+ * // but keep legacy channels that predate the has_visitor_message field
89
+ * channelRenderFilterFn={(channels) =>
90
+ * channels.filter(ch => ch.data?.has_visitor_message !== false)
91
+ * }
92
+ */
93
+ channelRenderFilterFn?: (channels: Channel[]) => Channel[];
80
94
  /**
81
95
  * Sort order for the channel list query.
82
96
  * Defaults to `{ last_message_at: -1 }` (most recent first).
@@ -346,6 +360,17 @@ export declare interface MessagingShellProps extends ChannelViewPassthroughProps
346
360
  * Filters for channel list. Passed through to StreamChat ChannelList.
347
361
  */
348
362
  filters?: ChannelFilters;
363
+ /**
364
+ * Client-side filter applied before rendering the channel list.
365
+ * Websocket events can add channels to the list that bypass server-side
366
+ * query filters. Use this to enforce visibility rules client-side.
367
+ *
368
+ * @example
369
+ * channelRenderFilterFn={(channels) =>
370
+ * channels.filter(ch => ch.data?.has_visitor_message !== false)
371
+ * }
372
+ */
373
+ channelRenderFilterFn?: (channels: Channel[]) => Channel[];
349
374
  /**
350
375
  * Custom empty state indicator component to render when the channel list is empty.
351
376
  * Useful for showing a custom empty state indicator when the channel list is empty.