import {NotificationStore} from "../store/NotificationStore"; export class NotificationService { static store?: NotificationStore; static init(store: NotificationStore) { this.store = store; console.debug('NotificationService initialized'); } static error(message: string, title?: string) { if (!this.store) { console.log(`NotificationStore is not initialized\nMessage: ${message}\nTitle: ${title}`); return; } this.store.error(message, title); } static warn(message: string, title?: string) { if (!this.store) { console.log(`NotificationStore is not initialized\nMessage: ${message}\nTitle: ${title}`); return; } this.store.warn(message, title); } static info(message: string, title?: string) { if (!this.store) { console.log(`NotificationStore is not initialized\nMessage: ${message}\nTitle: ${title}`); return; } this.store.info(message, title); } static success(message: string, title?: string) { if (!this.store) { console.log(`NotificationStore is not initialized\nMessage: ${message}\nTitle: ${title}`); return; } this.store.success(message, title); } }