import { PropertyValueMap } from 'lit'; import { ThemeController } from './controllers/theme-controller'; import { FormattedNotificationType, NotificationType, NotificationTypes } from './types/notifications.types'; import { getMarkNotificationMutation } from './data/notifications'; import { RealtimeNotificationEventType } from './types/realtime.types'; import { WeavyOptionalAppComponent } from './classes/weavy-optional-app-component'; declare global { interface HTMLElementTagNameMap { "wy-notification-toasts": WyNotificationToasts; } } /** * @import { WyLinkEventType } from "./types/notifications.events" */ /** * Weavy notification toast component to show overlay toasts in realtime when notifications are received. It shows in-app rendered notifications, native [browser notifications](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API) or just provide notification events without rendering. * * When in-app notifications are used, each notification is displayed with an avatar, a title, and additional summary/details with formatted text. * When clicked the notification fires a `"wy-link"` event with information about the originating Weavy component for the notification. * This can be used to [handle navigation](https://www.weavy.com/docs/learn/notifications) in the app, and navigate back to where the originating Weavy component is placed. * * Set `directory` to a directory ID or name to only deliver notifications originating from apps in that directory. * Filtering applies to in-app toasts, native browser notifications, and `wy-notification` events, including with `appearance="none"`. * Configure the directory independently on this component and any notification list, button, or badge. * * **Component Layout** * * When used with _in-app_ notifications, the notifications renders as overlays in the lower right corner of the [top layer](https://developer.mozilla.org/en-US/docs/Glossary/Top_layer). * That means that the component does not occupy any visual layout space where it's placed in the DOM, it only renders in the top layer. * * You can add additional styling using _CSS Custom Properties_ and _CSS Shadow Parts_ and further customization using _slots_. * * **Used sub components:** * * - [``](./components/ui/wy-toast.ts) * - [``](./components/ui/wy-toast.ts) * - [``](./components/wy-notification-list-item.ts) * * @tagname wy-notification-toasts * @fires {WyLinkEventType} wy-link - Fired when a notification is clicked. * @fires {WyNotificationEventType} wy-notification - Fired when a notification should be shown. * * @example In-app notifications * * Display rich html notification toasts on your page. * * ```html * * ``` * * @example Browser notifications * * Display notifications using the native browser notification API. * * ```html * * ``` * * @example Directory-filtered notifications * * Scope both the notification list and realtime toasts to the same directory. * * ```html * * * ``` */ export declare class WyNotificationToasts extends WeavyOptionalAppComponent { #private; static styles: import('lit').CSSResult[]; /** @internal */ protected theme: ThemeController; /** * Disabled link matching/consuming. * @internal */ matchesLink(): boolean; /** * Notification types to display. * * @type {"" | "activity" | "mention" | "reaction"} * @default "" */ typeFilter: NotificationTypes; /** * Optional directory identifier (`id` or `name`) to scope notifications. * Only notifications originating from apps in this directory are displayed or emitted as `wy-notification`. * Notifications without an originating app or whose membership cannot be verified are not delivered. */ directory?: string | number; /** * Notification delivery mode. * * - `internal` renders in-app toasts. * - `native` uses browser notifications. * - `none` only emits notification events. */ appearance: "internal" | "native" | "none"; /** * Require user consent before showing internal notifications. Native notifications always prompt automatically. */ requestUserPermission: boolean; /** * Duration in milliseconds for internal toast visibility. */ duration: number; /** @internal */ protected _notifications: NotificationType[]; /** @internal */ protected _nativeNotifications: Notification[]; /** @internal */ protected markNotificationMutation?: ReturnType; /** @internal */ protected handleEvent: (e: RealtimeNotificationEventType) => Promise; /** @internal */ addOrUpdateNotification(notification: NotificationType, isCurrent?: () => boolean): Promise; /** @internal */ updateNotification(notification: NotificationType, isCurrent?: () => boolean): Promise; /** @internal */ removeNotification(notificationId: number): void; /** @internal */ addOrUpdateNativeNotification(formattedNotification: FormattedNotificationType, isCurrent?: () => boolean): Promise; /** @internal */ removeNativeNotification(notificationId: number): boolean; /** @internal */ closeNativeNotification(notificationId: number): boolean; /** Checks if the user has granted permission for desktop notifications. A request will be made if permission has not yet been granted. */ hasUserPermission(): Promise; /** Clears queued internal toast notifications. */ clearNotifications(): void; /** * Marks a notification as read or unread. * @param notificationId - The ID of the notification to mark. * @param [markAsRead=true] - Whether to mark the notification as read (true) or unread (false). */ markAsRead(notificationId: number, markAsRead?: boolean): Promise; /** Invalidates in-flight deliveries and removes notifications from the previous scope. */ private resetNotificationScope; protected willUpdate(changedProperties: PropertyValueMap): Promise; render(): import('../node_modules/lit-html/node/lit-html.js').TemplateResult<1>; disconnectedCallback(): void; connectedCallback(): void; } //# sourceMappingURL=wy-notification-toasts.d.ts.map