Options
All
  • Public
  • Public/Protected
  • All
Menu

Module types

Index

Type Aliases

LoginResult: { appkey: string; clientIP: string; clientPort: number; clientType: TClientType; consid: string; customClientType: number; deviceId: string; hasTokenPreviously: boolean; isAutoReconnect: boolean; loginTime: number; online: boolean; os: string; pushType: number }

Type declaration

  • appkey: string
  • clientIP: string

    端测的IP

  • clientPort: number

    端测的端口

  • clientType: TClientType

    端类型

  • consid: string

    连接 id

  • customClientType: number

    自定义的端类型

  • deviceId: string

    设备 id

  • hasTokenPreviously: boolean

    1 表示之前有推送

  • isAutoReconnect: boolean

    是否为自动连接(断线重连)

  • loginTime: number

    登录时间

  • online: boolean

    是否在线

  • os: string

    端的系统信息

  • pushType: number

    推送类型

MultiSpotLoginResult: { account: string; clientType: TClientType; connectionId: string; deviceId: string; ip: string; mac: string; online: boolean; os: string; time: number }

Type declaration

  • account: string

    account id

  • clientType: TClientType

    客户端类型

  • connectionId: string

    socket 连接 id

  • deviceId: string

    设备id

  • ip: string

    ip 地址

  • mac: string

    mac 地址

  • online: boolean

    是否在线

  • os: string

    系统版本

  • time: number

    登录时间

QChat: { announcement: string; broadcastUrl: string; createTime: number; creator: string; custom: string; id: string; mute: boolean; name: string; onlineMemberNum: number; updateTime: number }

Type declaration

  • announcement: string
  • broadcastUrl: string
  • createTime: number
  • creator: string
  • custom: string
  • id: string
  • mute: boolean
  • name: string
  • onlineMemberNum: number
  • updateTime: number
QChatInitializeOptions: { account: string; appkey: string; authType?: number; debugLevel?: string; isFixedDeviceId?: boolean; linkAddresses: string[]; loginExt?: string; needReconnect?: boolean; reconnectionAttempts?: number; token: string }

实例初始化参数

eg. new sdk({ ...QChatInitializeOptions })

Type declaration

  • account: string
  • appkey: string

    注意 k 是小写的

  • Optional authType?: number

    鉴权方式,默认0 0 表示最初的loginToken的校验方式, 1 表示基于appSecret计算的token鉴权方式, 2表示基于第三方回调的token鉴权方式,

  • Optional debugLevel?: string

    日志分级

    可选值,"off" | "error" | "warn" | "log" | "debug"

    这个参数仅在初始化有效,setOptionssetOptions中不生效

  • Optional isFixedDeviceId?: boolean

    是否 deviceId 需要固定下来。默认 false。

    true:sdk 随机对设备生成一个设备标识并存入 localstorage 缓存起来,也就是说一个浏览器来说所有 SDK 实例连接都被认为是共同的设备。

    false:每一个 sdk 实例连接时,使用随机的字符串作为设备标识,相当于每个实例采用的不同的设备连接上来的。

    注意:这个参数会影响多端互踢的策略。有关于多端互踢策略的配置可以参见服务器文档。

  • linkAddresses: string[]

    连接地址列表

    推荐使用服务器 API 获取。还可通过 NIM 连接实例获取,形式如 await nim.plugin.getQChatAddress({ipType: 0})

  • Optional loginExt?: string

    登录自定义字段,用于提交给用户的第三方回调服务进行登录检测

  • Optional needReconnect?: boolean

    是否需要自动重连

  • Optional reconnectionAttempts?: number

    自动重连尝试次数

  • token: string
QChatMessageUnread: { channelId: number; idClient: string; serverId: string }

Type declaration

  • channelId: number

    消息所属的频道的id

  • idClient: string

    SDK端测生成的消息id

  • serverId: string

    消息所属的服务器的id

QChatOtherOptions: { QChatMedia?: { neroom: any }; cloudStorageConfig: { s3?: any } }

Type declaration

  • Optional QChatMedia?: { neroom: any }

    QChatMedia模块配置

    • neroom: any

      neroom sdk

      QChatMedia强依赖neroom sdk(应用组那边开发的音视频频道的SDK)

  • cloudStorageConfig: { s3?: any }

    cloud storage 模块配置

    • Optional s3?: any

      amazon aws s3 sdk

      注:若传入 s3 sdk 后,本 SDK 根据融合存储策略配置,可能会 new 创建出它的实例并使用它的实例方法进行上传/存储。

StrAnyObj: {}

Type declaration

  • [key: string]: any
StrObj: {}

Type declaration

  • [key: string]: string
TClientType: keyof typeof EClientType
TKickedReason: { clientType: TClientType; customClientType: number; ext?: string; message: string; reason: "unknow" | "samePlatformKick" | "serverKick" | "otherPlatformKick" | "silentlyKick" }

Type declaration

  • clientType: TClientType

    踢了本链接的那个客户端的类型

  • customClientType: number

    踢了本链接的那个客户端的自定义端类型

  • Optional ext?: string

    扩展字段

  • message: string

    原因的详细描述

  • reason: "unknow" | "samePlatformKick" | "serverKick" | "otherPlatformKick" | "silentlyKick"

    未知 | 互斥类型的客户端互踢-不允许同一个帐号在多个地方同时登录 | 服务器端发起踢客户端指令-被服务器踢了 | 被自己账号所在的其他端踢掉 | 被悄悄踢掉, 表示这个链接已经废掉了

WillReconnectEventResult: { duration: number; retryCount: number }

Type declaration

  • duration: number

    重试间隔

  • retryCount: number

    重试次数