UNPKG

@fork-anyone/node-nim

Version:

NetEase IM nodejs wrapper based on NetEase IM C++ SDK

71 lines 2.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QChatSystemNotificationModule = void 0; const eventemitter3_1 = require("eventemitter3"); class QChatSystemNotificationModule extends eventemitter3_1.EventEmitter { constructor(sdk) { super(); this.instance = new sdk.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