@aotearoan/neon
Version:
Neon is a lightweight design library of Vue 3 components with minimal dependencies.
55 lines (54 loc) • 1.2 kB
JavaScript
import { NeonEventBus as a } from "./NeonEventBus.es.js";
import { NeonAlertLevel as s } from "../enums/NeonAlertLevel.es.js";
class e {
/**
* Send an info message.
*
* @param alert The info message to display.
*/
static info(t) {
e.emit(s.Info, t);
}
/**
* Send a success message.
*
* @param alert The success message to display.
*/
static success(t) {
e.emit(s.Success, t);
}
/**
* Send a warning message.
*
* @param alert The warning message to display.
*/
static warn(t) {
e.emit(s.Warn, t);
}
/**
* Send an error message.
*
* @param alert The error message to display.
*/
static error(t) {
e.emit(s.Error, t);
}
/**
* Generate an event key so that all events are published on the correct topic.
*
* @param eventType Alert level of the event.
*
* @returns The event key for sending a message on <a href="/utils/NeonEventBus">NeonEventBus</a>.
*/
static generateEventKey(t) {
return `${a.messagePrefix}-alert-${t}`;
}
static emit(t, i) {
const r = e.generateEventKey(t);
a.emit(r, i);
}
}
export {
e as NeonAlertService
};
//# sourceMappingURL=NeonAlertService.es.js.map