import { EventEmitter, TemplateRef } from '@angular/core'; import { KbqToastData, KbqToastStyle } from '@koobiq/components/toast'; import { BehaviorSubject, Observable } from 'rxjs'; import * as i0 from "@angular/core"; export interface KbqNotificationItem extends Omit { id?: string; /** Numeric id of the shown toast, set by `push()` and consumed by `hideToast()`. */ toastId?: number; title?: string | TemplateRef; style?: string | KbqToastStyle; icon?: boolean | TemplateRef; iconClass?: string; caption?: string | TemplateRef; content?: string | TemplateRef; actions?: TemplateRef; date: string; read?: boolean; } export declare const maxUnreadItemsLength = 99; type KbqNotificationsGroup = { title: string; items: KbqNotificationItem[]; }; /** Payload emitted by `KbqNotificationCenterService.onDelete`. */ export type KbqNotificationDeleteEvent = { /** What was removed: a single item, a whole date group, or all notifications. */ type: 'item' | 'group' | 'all'; /** The notification items that were removed. */ items: KbqNotificationItem[]; }; export declare class KbqNotificationCenterService { /** @docs-private */ private readonly adapter; /** @docs-private */ private readonly formatter; /** @docs-private */ private readonly toastService; /** @docs-private */ readonly silentMode: BehaviorSubject; /** @docs-private */ readonly loadingMode: BehaviorSubject; /** @docs-private */ readonly errorMode: BehaviorSubject; /** * Whether the bottom "load more" spinner is shown while the next page is being loaded. * Note: this is the infinite-scroll indicator and is distinct from `loadingMode`, * which renders the full-screen loader instead of the list. */ readonly loadingMore: BehaviorSubject; /** * Whether the bottom "load more" error row (with a retry button) is shown. * Distinct from `errorMode`, which replaces the whole list with the full-screen error state. */ readonly loadMoreErrorMode: BehaviorSubject; /** * Whether there are more notifications to load. While `true`, scrolling to the bottom * emits `onNextPage`; set it to `false` to stop further infinite-scroll requests. */ readonly hasMore: BehaviorSubject; /** @docs-private */ readonly onRead: BehaviorSubject; /** Triggers an event when the user presses the reload button. */ readonly onReload: EventEmitter; /** Triggers an event when the list is scrolled to the bottom and the next page should be loaded. */ readonly onNextPage: EventEmitter; /** Triggers an event when an item, a group, or all notifications are removed. */ readonly onDelete: EventEmitter; private originalItems; /** * Grouped notifications, always ordered from newest to oldest: day groups are sorted by date * descending, and notifications within each day are sorted by date descending. * @docs-private */ readonly groupedItems: Observable; /** Emits an event whenever the changes. */ readonly changes: Observable; /** Notification items */ get items(): KbqNotificationItem[]; set items(values: KbqNotificationItem[]); /** Number of unread notifications */ get unreadItemsCounter(): Observable; /** true if there are no notifications. */ get isEmpty(): boolean; constructor(); /** Set silent mode */ setSilentMode(value: boolean): void; /** Set loading mode */ setLoadingMode(value: boolean): void; /** Set error mode */ setErrorMode(value: boolean): void; /** Set the bottom "load more" spinner visibility. */ setLoadingMore(value: boolean): void; /** Set the bottom "load more" error state visibility. */ setLoadMoreErrorMode(value: boolean): void; /** Set whether there are more notifications to load via infinite scroll. */ setHasMore(value: boolean): void; /** Push new notification item in center */ push(item: KbqNotificationItem): void; /** Hides the toast that corresponds to the given notification item. */ hideToast(item: KbqNotificationItem): void; /** Remove notification item */ remove(removedItem: KbqNotificationItem): void; /** Remove group of notification items */ removeGroup(group: KbqNotificationsGroup): void; /** Remove all notification items */ removeAll(): void; private makeGroup; /** Compares two notifications by date so the newest comes first. */ private compareByDateDesc; private setIds; private setReadState; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export {};