UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

31 lines 1.32 kB
import type { Notification } from 'stream-chat'; import type { NotificationTargetPanel } from '../notificationTarget'; export type UseNotificationsFilter = (notification: Notification) => boolean; export type UseNotificationsOptions = { /** * When true, the configured Chat-level notificationDisplayFilter is applied after * panel routing and before the local filter. */ applyDisplayFilter?: boolean; /** * When provided, only notifications that pass this filter are returned. * Use to have a given NotificationList consume only a subset of client.notifications * (e.g. by origin.emitter, origin.context, or metadata). */ filter?: UseNotificationsFilter; /** * Panel target consumed by a specific notification list. */ panel?: NotificationTargetPanel; /** * Fallback panel used when origin.context.panel is absent. * Defaults to `channel`. */ fallbackPanel?: NotificationTargetPanel; }; /** * Subscribes to client.notifications.store and returns the list of notifications. * Optionally pass a filter so only notifications that match are returned (e.g. for a specific NotificationList). */ export declare const useNotifications: (options?: UseNotificationsOptions) => Notification[]; //# sourceMappingURL=useNotifications.d.ts.map