-
Notifications
You must be signed in to change notification settings - Fork 2
nim.global.NIMGlobal
nim/global.NIMGlobal
-
EventEmitter
<NIMGlobalEvents
>↳
NIMGlobal
- eventNames
- listeners
- listenerCount
- emit
- on
- addListener
- once
- removeListener
- off
- removeAllListeners
- initEventHandlers
- setExceptionReportCallback
- setProxy
- detectProxy
- getSDKCachedFileInfoAsync
- deleteSDKCachedFileAsync
- sdkFeedbackAsync
- uploadSDKLog
▸ eventNames(): "dbError"
[]
Return an array listing the events for which the emitter has registered listeners.
"dbError"
[]
EventEmitter.eventNames
node_modules/eventemitter3/index.d.ts:15
▸ listeners<T
>(event
): (...args
: ArgumentMap
<NIMGlobalEvents
>[Extract
<T
, "dbError"
>]) => void
[]
Return the listeners registered for a given event.
Name | Type |
---|---|
T |
extends "dbError"
|
Name | Type |
---|---|
event |
T |
(...args
: ArgumentMap
<NIMGlobalEvents
>[Extract
<T
, "dbError"
>]) => void
[]
EventEmitter.listeners
node_modules/eventemitter3/index.d.ts:20
▸ listenerCount(event
): number
Return the number of listeners listening to a given event.
Name | Type |
---|---|
event |
"dbError" |
number
EventEmitter.listenerCount
node_modules/eventemitter3/index.d.ts:27
▸ emit<T
>(event
, ...args
): boolean
Calls each of the listeners registered for a given event.
Name | Type |
---|---|
T |
extends "dbError"
|
Name | Type |
---|---|
event |
T |
...args |
ArgumentMap <NIMGlobalEvents >[Extract <T , "dbError" >] |
boolean
EventEmitter.emit
node_modules/eventemitter3/index.d.ts:32
▸ on<T
>(event
, fn
, context?
): NIMGlobal
Add a listener for a given event.
Name | Type |
---|---|
T |
extends "dbError"
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMGlobalEvents >[Extract <T , "dbError" >]) => void
|
context? |
any |
EventEmitter.on
node_modules/eventemitter3/index.d.ts:40
▸ addListener<T
>(event
, fn
, context?
): NIMGlobal
Name | Type |
---|---|
T |
extends "dbError"
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMGlobalEvents >[Extract <T , "dbError" >]) => void
|
context? |
any |
EventEmitter.addListener
node_modules/eventemitter3/index.d.ts:45
▸ once<T
>(event
, fn
, context?
): NIMGlobal
Add a one-time listener for a given event.
Name | Type |
---|---|
T |
extends "dbError"
|
Name | Type |
---|---|
event |
T |
fn |
(...args : ArgumentMap <NIMGlobalEvents >[Extract <T , "dbError" >]) => void
|
context? |
any |
EventEmitter.once
node_modules/eventemitter3/index.d.ts:54
▸ removeListener<T
>(event
, fn?
, context?
, once?
): NIMGlobal
Remove the listeners of a given event.
Name | Type |
---|---|
T |
extends "dbError"
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMGlobalEvents >[Extract <T , "dbError" >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.removeListener
node_modules/eventemitter3/index.d.ts:63
▸ off<T
>(event
, fn?
, context?
, once?
): NIMGlobal
Name | Type |
---|---|
T |
extends "dbError"
|
Name | Type |
---|---|
event |
T |
fn? |
(...args : ArgumentMap <NIMGlobalEvents >[Extract <T , "dbError" >]) => void
|
context? |
any |
once? |
boolean |
EventEmitter.off
node_modules/eventemitter3/index.d.ts:69
▸ removeAllListeners(event?
): NIMGlobal
Remove all listeners, or those of the specified event.
Name | Type |
---|---|
event? |
"dbError" |
EventEmitter.removeAllListeners
node_modules/eventemitter3/index.d.ts:79
▸ initEventHandlers(): void
注册全局回调
void
ts/nim/global.ts:33
▸ setExceptionReportCallback(jsonExtension
, cb
): Promise
<[kNIMSDKExceptionSpaceEmpty
, string
]>
注册输出系统环境异常的回调
Name | Type | Description |
---|---|---|
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
cb |
null | ExceptionCallback
|
Promise
<[kNIMSDKExceptionSpaceEmpty
, string
]>
void 无返回值
ts/nim/global.ts:42
▸ setProxy(type
, host
, port
, user
, password
): void
设置SDK统一的网络代理。不需要代理时,type设置为kNIMProxyNone,其余参数都传空字符串(端口设为0)。有些代理不需要用户名和密码,相应参数也传空字符串。
Name | Type | Description |
---|---|---|
type |
NIMProxyType |
代理类型,见NIMProxyType定义 |
host |
string |
代理地址 |
port |
number |
代理端口 |
user |
string |
代理用户名 |
password |
string |
代理密码 |
void
void 无返回值
ts/nim/global.ts:61
▸ detectProxy(type
, host
, port
, user
, password
, cb
): Promise
<[boolean
, kNIMProxyDetectStepAllComplete
, string
]>
测试代理
Name | Type | Description |
---|---|---|
type |
NIMProxyType |
代理类型,见NIMProxyType定义 |
host |
string |
代理地址 |
port |
number |
代理端口 |
user |
string |
代理用户名 |
password |
string |
代理密码 |
cb |
null | DetectProxyCallback
|
回调函数 |
Promise
<[boolean
, kNIMProxyDetectStepAllComplete
, string
]>
void 无返回值
ts/nim/global.ts:74
▸ getSDKCachedFileInfoAsync(loginId
, fileType
, endTimestamp
, jsonExtension
, cb
): Promise
<[NIMResCode
, CachedFileInfo
]>
获取sdk缓存文件信息
Name | Type | Description |
---|---|---|
loginId |
string |
查询的账号ID |
fileType |
NIMCachedFileType |
文件类型,常量定义见NIMCachedFileType |
endTimestamp |
number |
查询时间截止点(查询全部填0) |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
cb |
null | GetCachedFileInfoCallback
|
Promise
<[NIMResCode
, CachedFileInfo
]>
void 无返回值
ts/nim/global.ts:100
▸ deleteSDKCachedFileAsync(loginId
, fileType
, endTimestamp
, jsonExtension
, cb
): Promise
<[NIMResCode
]>
删除sdk缓存文件
Name | Type | Description |
---|---|---|
loginId |
string |
查询的账号ID |
fileType |
NIMCachedFileType |
文件类型,常量定义见NIMCachedFileType |
endTimestamp |
number |
删除时间截止点(查询全部填0) |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
cb |
null | DeleteCachedFileCallback
|
Promise
<[NIMResCode
]>
void 无返回值
ts/nim/global.ts:125
▸ sdkFeedbackAsync(url
, jsonExtension
, cb
): Promise
<[NIMResCode
]>
SDK 反馈
Name | Type | Description |
---|---|---|
url |
string |
开发者需将所需要反馈的文件(dump,应用日志等)上传至nos。 |
jsonExtension |
string |
json扩展参数(备用,目前不需要) |
cb |
null | SDKFeedbackCallback
|
Promise
<[NIMResCode
]>
void 无返回值
ts/nim/global.ts:148
▸ uploadSDKLog(feedbackStr
, cb
): Promise
<[NIMResCode
]>
上传SDK日志到服务器
Name | Type | Description |
---|---|---|
feedbackStr |
string |
反馈信息 |
cb |
null | UploadSDKLogCallback
|
操作结果的回调函数 |
Promise
<[NIMResCode
]>
void
ts/nim/global.ts:164
• global: NIMGlobalAPI
ts/nim/global.ts:26
• new NIMGlobal()
EventEmitter<NIMGlobalEvents>.constructor
ts/nim/global.ts:27
- chatroom/chatroom
- chatroom_def/chatroom_def
- nim/client
- nim/data_sync
- nim/friend
- nim/global
- nim/msglog
- nim/nos
- nim/online_session
- nim/pass_through_proxy
- nim/plugin
- nim/session
- nim/subscribe_event
- nim/super_team
- nim/sysmsg
- nim/talk
- nim/talkex
- nim/team
- nim/tool
- nim/user
- nim_def/client_def
- nim_def/data_sync_def
- nim_def/doc_trans_def
- nim_def/friend_def
- nim_def/global_def
- nim_def/msglog_def
- nim_def/nos_def
- nim_def/online_session_def
- nim_def/pass_through_proxy_def
- nim_def/plugin_def
- nim_def/session_def
- nim_def/subscribe_event_def
- nim_def/super_team_def
- nim_def/sysmsg_def
- nim_def/talk_def
- nim_def/talkex_def
- nim_def/team_def
- nim_def/tool_def
- nim_def/user_def
- node-nim
- qchat/attachment
- qchat/channel
- qchat/channel_category
- qchat/instance
- qchat/message
- qchat/role
- qchat/server
- qchat/system_notification
- qchat_def/attachment_def
- qchat_def/channel_def
- qchat_def/instance_def
- qchat_def/message_def
- qchat_def/public_def
- qchat_def/role_def
- qchat_def/server_def
- qchat_def/system_notification_def