UNPKG

matrix-react-sdk

Version:
48 lines (47 loc) 1.65 kB
import { TypedEventEmitter } from "matrix-js-sdk/src/matrix"; import { NotificationLevel } from "./NotificationLevel"; import { IDestroyable } from "../../utils/IDestroyable"; export interface INotificationStateSnapshotParams { symbol: string | null; count: number; level: NotificationLevel; muted: boolean; knocked: boolean; } export declare enum NotificationStateEvents { Update = "update" } type EventHandlerMap = { [NotificationStateEvents.Update]: () => void; }; export declare abstract class NotificationState extends TypedEventEmitter<NotificationStateEvents, EventHandlerMap> implements INotificationStateSnapshotParams, IDestroyable { protected _symbol: string | null; protected _count: number; protected _level: NotificationLevel; protected _muted: boolean; protected _knocked: boolean; private watcherReferences; constructor(); get symbol(): string | null; get count(): number; get level(): NotificationLevel; get muted(): boolean; get knocked(): boolean; get isIdle(): boolean; get isUnread(): boolean; get hasUnreadCount(): boolean; get hasMentions(): boolean; protected emitIfUpdated(snapshot: NotificationStateSnapshot): void; protected snapshot(): NotificationStateSnapshot; destroy(): void; } export declare class NotificationStateSnapshot { private readonly symbol; private readonly count; private readonly level; private readonly muted; private readonly knocked; constructor(state: INotificationStateSnapshotParams); isDifferentFrom(other: INotificationStateSnapshotParams): boolean; } export {};