import { Injectable } from '@angular/core'; import { Report } from 'notiflix'; type ReportMessage = { header: string; message: string; button: string; }; type ReportType = Exclude; @Injectable({ providedIn: 'root' }) export class ReportService { //success, failure, warning, info report(message: ReportMessage, type: ReportType = 'info') { return new Promise((resolve, _) => { Report[type]( message.header, message.message, message.button, () => resolve() ); }); } }