Skip to content

nim.global.NIMGlobal

Zvicii edited this page Feb 10, 2023 · 6 revisions

Class: NIMGlobal

nim/global.NIMGlobal

Hierarchy

Table of contents

Methods

Properties

Constructors

Methods

eventNames

eventNames(): "dbError"[]

Return an array listing the events for which the emitter has registered listeners.

Returns

"dbError"[]

Inherited from

EventEmitter.eventNames

Defined in

node_modules/eventemitter3/index.d.ts:15


listeners

listeners<T>(event): (...args: ArgumentMap<NIMGlobalEvents>[Extract<T, "dbError">]) => void[]

Return the listeners registered for a given event.

Type parameters

Name Type
T extends "dbError"

Parameters

Name Type
event T

Returns

(...args: ArgumentMap<NIMGlobalEvents>[Extract<T, "dbError">]) => void[]

Inherited from

EventEmitter.listeners

Defined in

node_modules/eventemitter3/index.d.ts:20


listenerCount

listenerCount(event): number

Return the number of listeners listening to a given event.

Parameters

Name Type
event "dbError"

Returns

number

Inherited from

EventEmitter.listenerCount

Defined in

node_modules/eventemitter3/index.d.ts:27


emit

emit<T>(event, ...args): boolean

Calls each of the listeners registered for a given event.

Type parameters

Name Type
T extends "dbError"

Parameters

Name Type
event T
...args ArgumentMap<NIMGlobalEvents>[Extract<T, "dbError">]

Returns

boolean

Inherited from

EventEmitter.emit

Defined in

node_modules/eventemitter3/index.d.ts:32


on

on<T>(event, fn, context?): NIMGlobal

Add a listener for a given event.

Type parameters

Name Type
T extends "dbError"

Parameters

Name Type
event T
fn (...args: ArgumentMap<NIMGlobalEvents>[Extract<T, "dbError">]) => void
context? any

Returns

NIMGlobal

Inherited from

EventEmitter.on

Defined in

node_modules/eventemitter3/index.d.ts:40


addListener

addListener<T>(event, fn, context?): NIMGlobal

Type parameters

Name Type
T extends "dbError"

Parameters

Name Type
event T
fn (...args: ArgumentMap<NIMGlobalEvents>[Extract<T, "dbError">]) => void
context? any

Returns

NIMGlobal

Inherited from

EventEmitter.addListener

Defined in

node_modules/eventemitter3/index.d.ts:45


once

once<T>(event, fn, context?): NIMGlobal

Add a one-time listener for a given event.

Type parameters

Name Type
T extends "dbError"

Parameters

Name Type
event T
fn (...args: ArgumentMap<NIMGlobalEvents>[Extract<T, "dbError">]) => void
context? any

Returns

NIMGlobal

Inherited from

EventEmitter.once

Defined in

node_modules/eventemitter3/index.d.ts:54


removeListener

removeListener<T>(event, fn?, context?, once?): NIMGlobal

Remove the listeners of a given event.

Type parameters

Name Type
T extends "dbError"

Parameters

Name Type
event T
fn? (...args: ArgumentMap<NIMGlobalEvents>[Extract<T, "dbError">]) => void
context? any
once? boolean

Returns

NIMGlobal

Inherited from

EventEmitter.removeListener

Defined in

node_modules/eventemitter3/index.d.ts:63


off

off<T>(event, fn?, context?, once?): NIMGlobal

Type parameters

Name Type
T extends "dbError"

Parameters

Name Type
event T
fn? (...args: ArgumentMap<NIMGlobalEvents>[Extract<T, "dbError">]) => void
context? any
once? boolean

Returns

NIMGlobal

Inherited from

EventEmitter.off

Defined in

node_modules/eventemitter3/index.d.ts:69


removeAllListeners

removeAllListeners(event?): NIMGlobal

Remove all listeners, or those of the specified event.

Parameters

Name Type
event? "dbError"

Returns

NIMGlobal

Inherited from

EventEmitter.removeAllListeners

Defined in

node_modules/eventemitter3/index.d.ts:79


initEventHandlers

initEventHandlers(): void

注册全局回调

Returns

void

Defined in

ts/nim/global.ts:33


setExceptionReportCallback

setExceptionReportCallback(jsonExtension, cb): Promise<[kNIMSDKExceptionSpaceEmpty, string]>

注册输出系统环境异常的回调

Parameters

Name Type Description
jsonExtension string json扩展参数(备用,目前不需要)
cb null | ExceptionCallback

Returns

Promise<[kNIMSDKExceptionSpaceEmpty, string]>

void 无返回值

Defined in

ts/nim/global.ts:42


setProxy

setProxy(type, host, port, user, password): void

设置SDK统一的网络代理。不需要代理时,type设置为kNIMProxyNone,其余参数都传空字符串(端口设为0)。有些代理不需要用户名和密码,相应参数也传空字符串。

Parameters

Name Type Description
type NIMProxyType 代理类型,见NIMProxyType定义
host string 代理地址
port number 代理端口
user string 代理用户名
password string 代理密码

Returns

void

void 无返回值

Defined in

ts/nim/global.ts:61


detectProxy

detectProxy(type, host, port, user, password, cb): Promise<[boolean, kNIMProxyDetectStepAllComplete, string]>

测试代理

Parameters

Name Type Description
type NIMProxyType 代理类型,见NIMProxyType定义
host string 代理地址
port number 代理端口
user string 代理用户名
password string 代理密码
cb null | DetectProxyCallback 回调函数

Returns

Promise<[boolean, kNIMProxyDetectStepAllComplete, string]>

void 无返回值

Defined in

ts/nim/global.ts:74


getSDKCachedFileInfoAsync

getSDKCachedFileInfoAsync(loginId, fileType, endTimestamp, jsonExtension, cb): Promise<[NIMResCode, CachedFileInfo]>

获取sdk缓存文件信息

Parameters

Name Type Description
loginId string 查询的账号ID
fileType NIMCachedFileType 文件类型,常量定义见NIMCachedFileType
endTimestamp number 查询时间截止点(查询全部填0)
jsonExtension string json扩展参数(备用,目前不需要)
cb null | GetCachedFileInfoCallback

Returns

Promise<[NIMResCode, CachedFileInfo]>

void 无返回值

Defined in

ts/nim/global.ts:100


deleteSDKCachedFileAsync

deleteSDKCachedFileAsync(loginId, fileType, endTimestamp, jsonExtension, cb): Promise<[NIMResCode]>

删除sdk缓存文件

Parameters

Name Type Description
loginId string 查询的账号ID
fileType NIMCachedFileType 文件类型,常量定义见NIMCachedFileType
endTimestamp number 删除时间截止点(查询全部填0)
jsonExtension string json扩展参数(备用,目前不需要)
cb null | DeleteCachedFileCallback

Returns

Promise<[NIMResCode]>

void 无返回值

Defined in

ts/nim/global.ts:125


sdkFeedbackAsync

sdkFeedbackAsync(url, jsonExtension, cb): Promise<[NIMResCode]>

SDK 反馈

Parameters

Name Type Description
url string 开发者需将所需要反馈的文件(dump,应用日志等)上传至nos。
jsonExtension string json扩展参数(备用,目前不需要)
cb null | SDKFeedbackCallback

Returns

Promise<[NIMResCode]>

void 无返回值

Defined in

ts/nim/global.ts:148


uploadSDKLog

uploadSDKLog(feedbackStr, cb): Promise<[NIMResCode]>

上传SDK日志到服务器

Parameters

Name Type Description
feedbackStr string 反馈信息
cb null | UploadSDKLogCallback 操作结果的回调函数

Returns

Promise<[NIMResCode]>

void

Defined in

ts/nim/global.ts:164

Properties

global

global: NIMGlobalAPI

Defined in

ts/nim/global.ts:26

Constructors

constructor

new NIMGlobal()

Overrides

EventEmitter<NIMGlobalEvents&gt;.constructor

Defined in

ts/nim/global.ts:27

Clone this wiki locally