node-nim
Version:
NetEase IM nodejs wrapper based on NetEase IM C++ SDK
75 lines • 2.41 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.QChatSystemNotificationModule = void 0;
const loader_1 = __importDefault(require("../loader"));
const eventemitter3_1 = require("eventemitter3");
class QChatSystemNotificationModule extends eventemitter3_1.EventEmitter {
constructor() {
super();
this.instance = new loader_1.default.QChatSystemNotification({ emit: this.emit.bind(this) });
}
/** 注册全局回调 */
initEventHandlers() {
return this.instance.InitEventHandlers();
}
/** @fn send(param: QChatSendSystemNotificationParam)
* 发送系统消息
* @param[in] param 接口参数
* @return void
*/
send(param) {
const p = new Promise((resolve) => {
param.cb = (resp) => {
resolve(resp);
};
this.instance.Send(param);
});
return p;
}
/** @fn update(param: QChatUpdateSystemNotificationParam)
* @brief 更新系统消息
* @param[in] param 接口参数
*/
update(param) {
const p = new Promise((resolve) => {
param.cb = (resp) => {
resolve(resp);
};
this.instance.Update(param);
});
return p;
}
/** @fn markSystemNotificationsRead(param: QChatMarkSystemNotificationsReadParam)
* @brief 标记系统通知消息已读
* @param param 接口参数
* @return void
*/
markSystemNotificationsRead(param) {
const p = new Promise((resolve) => {
param.cb = (resp) => {
resolve(resp);
};
this.instance.MarkSystemNotificationsRead(param);
});
return p;
}
/** @fn sendTypingEvent(param: QChatSendTypingEventParam)
* @brief 发送正在输入事件
* @param param 接口参数
* @return void
*/
sendTypingEvent(param) {
const p = new Promise((resolve) => {
param.cb = (resp) => {
resolve(resp);
};
this.instance.SendTypingEvent(param);
});
return p;
}
}
exports.QChatSystemNotificationModule = QChatSystemNotificationModule;
//# sourceMappingURL=system_notification.js.map