UNPKG

node-nim

Version:

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

26 lines (25 loc) 1.06 kB
import { V2NIMBroadcastNotification, V2NIMCustomNotification, V2NIMSendCustomNotificationParams } from '../v2_def/v2_nim_struct_def'; import { EventEmitter } from 'eventemitter3'; export declare interface V2NIMNotificationListener { /** 收到自定义通知 */ receiveCustomNotifications: [Array<V2NIMCustomNotification>]; /** 收到广播通知 */ receiveBroadcastNotifications: [Array<V2NIMBroadcastNotification>]; } /** @brief 通知服务 */ export declare class V2NIMNotificationService extends EventEmitter<V2NIMNotificationListener> { instance: any; constructor(); /** * @brief 发送自定义通知 * @param conversationId 会话 ID * @param content 通知内容 * @param params 发送通知相关配置参数 * @returns void * @example * ```javascript * await v2.notificationService.sendCustomNotification(conversationId, content, params) * ``` */ sendCustomNotification(conversationId: string, content: string, params: V2NIMSendCustomNotificationParams): Promise<void>; }