UNPKG

@selenite/graph-editor

Version:

A graph editor for visual programming, based on rete and svelte.

47 lines (46 loc) 1.61 kB
import type { Setup } from '../../setup/Setup'; export type NotificationParams = { title?: string; message?: string; color?: string; id?: string; autoClose?: boolean | number; withCloseButton?: boolean; }; export type DisplayedNotification = { notif: NotificationParams; visible: boolean; remove: () => void; }; export type NotificationsManager = { show: (params: NotificationParams) => void; success: (params: Omit<NotificationParams, 'color'>) => void; warn: (params: Omit<NotificationParams, 'color'>) => void; error: (params: Omit<NotificationParams, 'color'>) => void; info: (params: Omit<NotificationParams, 'color'>) => void; hide: (id: string) => void; }; /** * This class is a singleton that manages a queue of notifications. */ declare class Notifications implements NotificationsManager { #private; static get instance(): Notifications; queue: NotificationParams[]; maxNotifs: number; autoHideTime: number; hideAnimTime: number; displayed: DisplayedNotification[]; private constructor(); hide(id: string): void; show(notif: NotificationParams): Promise<void>; success(notif: Omit<NotificationParams, 'color'>): void; warn(notif: Omit<NotificationParams, 'color'>): void; error(notif: Omit<NotificationParams, 'color'>): void; info(notif: Omit<NotificationParams, 'color'>): void; removeDisplayed(notif: DisplayedNotification): void; updateDisplayed(): void; } export declare const notifications: Notifications; export declare const notificationsSetup: Setup; export {};