import EventEmitter from 'events'; import { IDebugger } from 'debug'; /** @zh-cn * 连接状态改变原因 */ /** * Reasons for a connection state change. */ type ConnectionChangeReason = 'CONNECTING' /** @zh-cn * SDK 登录 Agora RTM 系统成功。 */ /** * The SDK has logged in the Agora RTM system. */ | 'LOGIN_SUCCESS' /** @zh-cn * SDK 登录 Agora RTM 系统失败。 */ /** * The SDK fails to log in the Agora RTM system, because, for example, the token has expired. */ | 'REJECTED_BY_SERVER' /** @zh-cn * SDK 无法登录 Agora RTM 系统超过 6 秒,停止登录。 */ /** * The login has timed out, and the SDK stops logging in. The current login timeout is set as six seconds. */ | 'LOST' /** @zh-cn * SDK 与 Agora RTM 系统的连接被中断超过 4 秒。 */ /** * The connection between the SDK and the Agora RTM system is interrupted for more than four seconds. */ | 'INTERRUPTED' /** @zh-cn * SDK 已登出 Agora RTM 系统。 */ /** * The SDK has logged out of the Agora RTM system. */ | 'LOGOUT' /** @zh-cn * SDK 被服务器禁止登录 Agora RTM 系统。 */ /** * Login is banned by the Agora RTM server. */ /** @zh-cn * 另一个用户正以相同的 uid 登陆 Agora RTM 系统。 */ /** * Another instance has logged in the Agora RTM system with the same uid. */ | 'SAME_UID_LOGIN' /** @zh-cn * 用户使用的token已过期。 */ /** * The token used by the user has expired. */ | 'TOKEN_EXPIRED' /** * @zh-cn * 服务暂不可用。 */ /**】 * The presence server not ready. */ | 'PRESENCE_NOT_READY'; /** @zh-cn * SDK 与 Agora RTM 系统的连接状态类型 */ /** * Connection states between the SDK and the Agora RTM system. */ type ConnectionState = /** @zh-cn * 初始状态。SDK 未连接到 Agora RTM 系统。 * * App 调用方法 {@link RTMClient.login} 时,SDK 开始登录 Agora RTM 系统,触发回调 {@link RTMEvents.status},并切换到 {@link CONNECTING} 状态。 * */ /** * When the app calls the {@link RTMClient.login} method, the SDK logs in the Agora RTM system, triggers the {@link RTMEvents.status} callback, and switches to the {@link CONNECTING} state. */ 'DISCONNECTED' /** @zh-cn * SDK 正在登录 Agora RTM 系统。 * * - 方法调用成功时,SDK 会触发回调 {@link RTMEvents.status},并切换到 {@link CONNECTED} 状态。 * - 法调用失败,SDK 会触发回调 {@link RTMEvents.status},并切换到 {@link DISCONNECTED} 状态。 * */ /** * The SDK has logged in the Agora RTM system. *