UNPKG

ui-framework-jps

Version:

A simple UI framework for state management and UI components

54 lines (53 loc) 2.62 kB
import { ChatEventListener } from "./ChatEventListener"; import { ChatLog, Invitation, Message, Priority } from "./Types"; import { ChatUserEventListener } from "./ChatUserEventListener"; import { DocumentLoaded } from "../CommonTypes"; export declare type NotificationControllerOptions = { showNormalPriorityMessageNotifications: boolean; showHighPriorityMessageNotifications: boolean; showUrgentPriorityMessageNotifications: boolean; showNormalPriorityMessageNotificationsInOS: boolean; showHighPriorityMessageNotificationsInOS: boolean; showUrgentPriorityMessageNotificationsInOS: boolean; showInvitationDeclinedNotifications: boolean; showInvitedNotifications: boolean; showOfflineMessageNotification: boolean; showFavouriteUserLoggedInNotification: boolean; showFavouriteUserLoggedOutNotification: boolean; showUserJoinLeaveChatNotification: boolean; normalMessageDuration: number; highMessageDuration: number; urgentMessageDuration: number; }; export declare class NotificationController implements ChatEventListener, ChatUserEventListener, DocumentLoaded { private static _instance; private chatManager; private chatListeners; private chatUserListeners; private notificationOptions; private constructor(); static getInstance(): NotificationController; setupOSNotifications(): void; onDocumentLoaded(): void; sendOSNotification(title: string, message: string, priority: Priority): void; handleInvitationDeclined(room: string, username: string): void; handleNewInviteReceived(invite: Invitation): boolean; addListener(listener: ChatEventListener): void; addUserListener(listener: ChatUserEventListener): void; blackListUser(username: string, isBlackedListed?: boolean): void; favouriteUser(username: string, isFavourited?: boolean): void; isFavouriteUser(username: string): boolean; isBlockedUser(username: string): boolean; handleChatLogsUpdated(): void; handleChatLogUpdated(log: ChatLog, wasOffline?: boolean): void; handleLoggedInUsersUpdated(usernames: string[]): void; handleFavouriteUserLoggedIn(username: string): void; handleFavouriteUserLoggedOut(username: string): void; handleBlockedUsersChanged(usernames: string[]): void; handleFavouriteUsersChanged(usernames: string[]): void; startChatWithUser(username: string): string | null; handleChatStarted(log: ChatLog): void; handleOfflineMessagesReceived(messages: Message[]): void; setOptions(options: NotificationControllerOptions): void; private checkNotificationPromise; }