prodap-chatbot-domain
Version:
Classes utilizadas na resposta de todas as Intents do Assistente Virtual
33 lines • 1.21 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ModalAbstract_1 = require("./ModalAbstract");
const ModalTypes_1 = require("./ModalTypes");
class AdditionalInfoItem {
constructor(title, value) {
this.title = title;
this.value = value;
}
}
class ModalAdditionalInfo extends ModalAbstract_1.default {
constructor(title, subtitle, dataTitle, dataSubtitle, props) {
super({}, ModalTypes_1.default.ADDITIONAL_INFO);
this.infoList = [];
this.dataList = [];
this.title = title;
this.subtitle = subtitle;
this.dataTitle = dataTitle;
this.dataSubtitle = dataSubtitle;
this.infoList = (props === null || props === void 0 ? void 0 : props.infoList) || [];
this.dataList = (props === null || props === void 0 ? void 0 : props.dataList) || [];
}
addInfo(textList) {
this.infoList = this.infoList.concat(textList);
return this;
}
addData(data) {
data.forEach(item => this.dataList.push(new AdditionalInfoItem(item.title, item.value)));
return this;
}
}
exports.default = ModalAdditionalInfo;
//# sourceMappingURL=ModalAdditionalInfo.js.map