@sitecore/sc-contenthub-webclient-sdk
Version:
Sitecore Content Hub WebClient SDK.
42 lines • 1.43 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RealtimeRequest = void 0;
const constants_1 = require("../../constants");
const notification_level_1 = require("./notification-level");
/**
* Base class for real-time notification (browser notification) requests.
*/
class RealtimeRequest {
constructor() {
this.notificationLevel = notification_level_1.NotificationLevel.Info;
this.options = {};
}
getBody() {
if (this.options == null || !(constants_1.NOTIFICATIONS.REALTIME.INFO.body in this.options)) {
return null;
}
const body = this.options[constants_1.NOTIFICATIONS.REALTIME.INFO.body];
return body;
}
setBody(body) {
if (this.options == null) {
this.options = {};
}
this.options[constants_1.NOTIFICATIONS.REALTIME.INFO.body] = body;
}
getIcon() {
if (this.options == null || !(constants_1.NOTIFICATIONS.REALTIME.INFO.body in this.options)) {
return null;
}
const icon = this.options[constants_1.NOTIFICATIONS.REALTIME.INFO.icon];
return icon;
}
setIcon(icon) {
if (this.options == null) {
this.options = {};
}
this.options[constants_1.NOTIFICATIONS.REALTIME.INFO.icon] = icon;
}
}
exports.RealtimeRequest = RealtimeRequest;
//# sourceMappingURL=realtime-request.js.map