go-chat-sdk 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +8 -15
- package/dist/index.mjs +3615 -75
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -16,10 +16,8 @@ interface Message {
|
|
|
16
16
|
client_msg_id: string;
|
|
17
17
|
/** 发送者ID */
|
|
18
18
|
sender_id: string;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
/** 聊天类型: single(单聊) / group(群聊) */
|
|
22
|
-
chat_type: ChatType;
|
|
19
|
+
/** 房间ID */
|
|
20
|
+
room_id: string;
|
|
23
21
|
/** 服务器时间戳(微秒级) */
|
|
24
22
|
server_time: number;
|
|
25
23
|
/** 回复的消息ID(可选) */
|
|
@@ -35,11 +33,9 @@ interface Message {
|
|
|
35
33
|
}
|
|
36
34
|
interface SendMessageRequest {
|
|
37
35
|
/** 客户端生成的唯一消息ID */
|
|
38
|
-
client_msg_id
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
/** 聊天类型 */
|
|
42
|
-
chat_type: ChatType;
|
|
36
|
+
client_msg_id: string;
|
|
37
|
+
/** 房间ID */
|
|
38
|
+
room_id: string;
|
|
43
39
|
/** 消息类型 */
|
|
44
40
|
msg_type: MessageType;
|
|
45
41
|
/** 消息内容负载 */
|
|
@@ -162,10 +158,8 @@ type ChatEvent<T extends ChatEventType = ChatEventType> = {
|
|
|
162
158
|
};
|
|
163
159
|
type EventListener<T extends ChatEventType = ChatEventType> = (event: ChatEvent<T>) => void;
|
|
164
160
|
interface HistoryQueryParams {
|
|
165
|
-
/**
|
|
166
|
-
|
|
167
|
-
/** 聊天类型 */
|
|
168
|
-
chat_type: ChatType;
|
|
161
|
+
/** 房间ID */
|
|
162
|
+
room_id: string;
|
|
169
163
|
/** 查询此时间戳之前的消息(微秒级,默认为当前时间) */
|
|
170
164
|
before_server_time?: number;
|
|
171
165
|
/** 每页数量(默认20) */
|
|
@@ -384,8 +378,7 @@ declare class WebSocketManager {
|
|
|
384
378
|
*
|
|
385
379
|
* // 发送文本消息
|
|
386
380
|
* sdk.sendTextMessage({
|
|
387
|
-
*
|
|
388
|
-
* chat_type: ChatType.Single,
|
|
381
|
+
* room_id: 'xxx',
|
|
389
382
|
* text: 'Hello!',
|
|
390
383
|
* });
|
|
391
384
|
* ```
|