Options
All
  • Public
  • Public/Protected
  • All
Menu

RongIMLib - v5.9.0

Index

Enum

Interface

其他

其他

EnableLogL: DEBUG | INFO | WARN | ERROR

有效的日志等级声明

IInitOption: { appkey: string; logLevel?: LogLevel; logOutputLevel?: EnableLogL; logStdout?: any; navigators?: string[]; connectType?: "websocket" | "comet"; customCMP?: string[]; detect?: { url: string; intervalTime: number }; debug?: boolean; indexDBSwitch?: boolean; checkCA?: boolean; httpInMainProcess?: boolean; logExpireTime: number }

Type declaration

  • appkey: string

    应用 appkey 标识

  • Optional logLevel?: LogLevel

    该配置已废弃,请使用 logOutputLevel 替代。

    deprecated

    修改 SDK 内部日志打印等级,默认为 LogLevel.WARN

  • Optional logOutputLevel?: EnableLogL

    修改内部日志打印等级,默认输出 LogL.WARN 及以上级别

  • logStdout?:function
    • logStdout(logLevel: LogLevel, content: string): void
    • deprecated
      • 配置已废弃

      Parameters

      Returns void

  • Optional navigators?: string[]

    自定义导航地址,公有云用户不推荐修改

  • Optional connectType?: "websocket" | "comet"

    连接方式,默认使用 'websocket'

    deprecated

    自 5.6.0 版本开始,不再支持 Comet 连接,该配置项失效。

  • Optional customCMP?: string[]

    小程序平台专属配置

  • Optional detect?: { url: string; intervalTime: number }
    deprecated
    • url: string

      网络嗅探地址。默认嗅探地址仅为测试 http 请求是否可以正常发送,并非真实地址,返回 404 属于正常情况

      default

      https://cdn.ronghub.com/im_detecting

    • intervalTime: number

      网络嗅探间隔时间,单位:毫秒

      default

      1500

  • Optional debug?: boolean
    deprecated
  • Optional indexDBSwitch?: boolean
    deprecated

    是否打开 IndexDB 存储, 默认为 true

  • Optional checkCA?: boolean
    deprecated

    已废弃,默认不再在 Electron 平台下校验导航服务的 CA 问题

  • Optional httpInMainProcess?: boolean

    开启后,SDK 内的 HTTP 请求将由 Electron 主进程内发送。

    since

    5.6.0

    description

    仅在 Electron 环境中搭配 @rongcloud/electron-renderer@rongcloud/electron 包时有效。

    • 当值为 true 时,HTTP 请求由 Electron 主进程内发送,不受浏览器安全沙箱策略限制。
    • 当值为 false 时,保持使用 Chromium 的 XMLHttpRequest 发送 HTTP 协议请求, 请求由渲染进程内发出,受浏览器安全沙箱策略限制。
    defautl

    false

  • logExpireTime: number

    IndexDB 数据库内的日志有效期,单位为小时,有效值为 24 - 168,默认 IndexDB 内日志数据有效期 168 小时

  • 初始化

    Parameters

    Returns IMClient

  • Returns IMClient

MESSAGE_DIRECTION: typeof MessageDirection = MessageDirection
deprecated
CONVERSATION_TYPE: typeof ConversationType = ConversationType
deprecated
FILE_TYPE: typeof FileType = FileType
deprecated
NOTIFICATION_STATUS: { DO_NOT_DISTURB: NotificationStatus; NOTIFY: NotificationStatus } = ...
deprecated

Type declaration

CHATROOM_ENTRY_TYPE: typeof ChatroomEntryType = ChatroomEntryType
deprecated
ERROR_CODE: { [ key in number | string]: number | string } = {}
CONNECT_TYPE: { COMET: string; WEBSOCKET: string } = ...
deprecated

从 5.6.0 版本开始,此定义失效

Type declaration

  • COMET: string
  • WEBSOCKET: string
MESSAGS_TIME_ORDER: { DESC: number; ASC: number } = ...

Type declaration

  • DESC: number
  • ASC: number
CHATROOM_ORDER: { ASC: number; DESC: number } = ...

Type declaration

  • ASC: number
  • DESC: number
RECALL_MESSAGE_TYPE: "RC:RcCmd" = 'RC:RcCmd'
MENTIONED_TYPE: { ALL: number; SINGAL: number } = ...

Type declaration

  • ALL: number
  • SINGAL: number
MESSAGE_TYPE: { TEXT: string; VOICE: string; HQ_VOICE: string; IMAGE: string; GIF: string; RICH_CONTENT: string; LOCATION: string; FILE: string; SIGHT: string; COMBINE: string; CHRM_KV_NOTIFY: string; LOG_COMMAND: string; EXPANSION_NOTIFY: string; REFERENCE: string } = ...

Type declaration

  • TEXT: string
  • VOICE: string
  • HQ_VOICE: string
  • IMAGE: string
  • GIF: string
  • RICH_CONTENT: string
  • LOCATION: string
  • FILE: string
  • SIGHT: string
  • COMBINE: string
  • CHRM_KV_NOTIFY: string
  • LOG_COMMAND: string
  • EXPANSION_NOTIFY: string
  • REFERENCE: string
RECEIVED_STATUS: { READ: number; LISTENED: number; DOWNLOADED: number; RETRIEVED: number; UNREAD: number } = ...

Type declaration

  • READ: number
  • LISTENED: number
  • DOWNLOADED: number
  • RETRIEVED: number
  • UNREAD: number
SDK_VERSION: string = __VERSION__
CONNECTION_STATUS: { CONNECTED: number; CONNECTING: number; DISCONNECTED: number; NETWORK_UNAVAILABLE: number; SOCKET_ERROR: number; KICKED_OFFLINE_BY_OTHER_CLIENT: number; BLOCKED: number } = ...
deprecated

Type declaration

  • CONNECTED: number
  • CONNECTING: number
  • DISCONNECTED: number
  • NETWORK_UNAVAILABLE: number
  • SOCKET_ERROR: number
  • KICKED_OFFLINE_BY_OTHER_CLIENT: number
  • BLOCKED: number
ISetChatroomEntryOption: { key: string; value: string; isAutoDelete?: boolean; isSendNotification?: boolean; notificationExtra?: string }

Type declaration

  • key: string
  • value: string
  • Optional isAutoDelete?: boolean
  • Optional isSendNotification?: boolean
  • Optional notificationExtra?: string
ISetChatroomEntriesOption: { entries: { key: string; value: string }[]; isAutoDelete?: boolean; notificationExtra?: string; isForce?: boolean }

Type declaration

  • entries: { key: string; value: string }[]
  • Optional isAutoDelete?: boolean
  • Optional notificationExtra?: string
  • Optional isForce?: boolean
IRemoveChatroomEntryOption: { key: string; isSendNotification?: boolean; notificationExtra?: string }

Type declaration

  • key: string
  • Optional isSendNotification?: boolean
  • Optional notificationExtra?: string
GetHistoryMessageOption: { timestamp?: number; count?: number; order?: 0 | 1 }

Type declaration

  • Optional timestamp?: number

    获取此时间之前的消息,0 为从当前时间拉取

  • Optional count?: number

    获取消息的数量,范围: 1-20

  • Optional order?: 0 | 1

    获取消息的排列顺序

    • 0: 升序
    • 1: 降序
GetHistoryMessageResult: { list: IAReceivedMessage[]; hasMore: boolean }

Type declaration

MentionedInfo: { type?: 1 | 2; userIdList?: string[] }

Type declaration

  • Optional type?: 1 | 2

    @ 类型,其中 1 为 @ 所有人,2 为 @ 部分人

  • Optional userIdList?: string[]

    被 @ 的用户 Id 列表,仅在 type2 时有效