zcw-shared 2.16.0 → 2.18.0
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/package.json +2 -1
- package/types/im-call.d.ts +44 -0
- package/types/im-wallet-message.d.ts +16 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcw-shared",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"references",
|
|
6
6
|
"dist",
|
|
@@ -435,6 +435,7 @@
|
|
|
435
435
|
"./types/geometry": "./types/geometry.d.ts",
|
|
436
436
|
"./types/hybrid": "./types/hybrid.d.ts",
|
|
437
437
|
"./types/im-api": "./types/im-api.d.ts",
|
|
438
|
+
"./types/im-call": "./types/im-call.d.ts",
|
|
438
439
|
"./types/im-chat": "./types/im-chat.d.ts",
|
|
439
440
|
"./types/im-forward": "./types/im-forward.d.ts",
|
|
440
441
|
"./types/im-message-display": "./types/im-message-display.d.ts",
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** IM 实时通话媒体类型(WebRTC,非文件消息) */
|
|
2
|
+
export type ImCallMedia = 'audio' | 'video'
|
|
3
|
+
|
|
4
|
+
/** WebRTC 信令类型 */
|
|
5
|
+
export type ImCallSignalType = 'offer' | 'answer' | 'ice-candidate'
|
|
6
|
+
|
|
7
|
+
export interface ImCallSignalPayload {
|
|
8
|
+
callId: string
|
|
9
|
+
type: ImCallSignalType
|
|
10
|
+
sdp?: RTCSessionDescriptionInit
|
|
11
|
+
candidate?: RTCIceCandidateInit
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ImCallInviteSentPayload {
|
|
15
|
+
callId: string
|
|
16
|
+
conversationId: string
|
|
17
|
+
media: ImCallMedia
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ImCallIncomingPayload {
|
|
21
|
+
callId: string
|
|
22
|
+
conversationId: string
|
|
23
|
+
media: ImCallMedia
|
|
24
|
+
callerId: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ImCallAcceptedPayload {
|
|
28
|
+
callId: string
|
|
29
|
+
conversationId: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ImCallEndedPayload {
|
|
33
|
+
callId: string
|
|
34
|
+
conversationId?: string
|
|
35
|
+
reason?: 'rejected' | 'cancelled' | 'ended' | 'busy' | 'timeout'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ImCallSignalEventPayload extends ImCallSignalPayload {
|
|
39
|
+
fromUserId: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ImCallIceServersResponse {
|
|
43
|
+
iceServers: RTCIceServer[]
|
|
44
|
+
}
|
|
@@ -4,21 +4,37 @@ export type ImWalletTransferStatus = 'completed'
|
|
|
4
4
|
|
|
5
5
|
export type ImRedEnvelopeStatus = 'pending' | 'claimed' | 'expired'
|
|
6
6
|
|
|
7
|
+
export type ImRedEnvelopePacketType = 'fixed' | 'lucky'
|
|
8
|
+
|
|
9
|
+
export interface ImRedEnvelopeClaim {
|
|
10
|
+
user_id: string
|
|
11
|
+
amount: number
|
|
12
|
+
claimed_at?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
export interface ImWalletTransferExtra {
|
|
8
16
|
transfer_no: string
|
|
9
17
|
amount: number
|
|
10
18
|
currency: string
|
|
11
19
|
greeting?: string
|
|
12
20
|
receiver_id: string
|
|
21
|
+
/** 收款方展示昵称(服务端或客户端映射写入) */
|
|
22
|
+
receiver_name?: string
|
|
13
23
|
status: ImWalletTransferStatus
|
|
14
24
|
}
|
|
15
25
|
|
|
16
26
|
export interface ImRedEnvelopeExtra {
|
|
17
27
|
envelope_no: string
|
|
28
|
+
/** 总金额 */
|
|
18
29
|
amount: number
|
|
19
30
|
currency: string
|
|
20
31
|
greeting?: string
|
|
21
32
|
status: ImRedEnvelopeStatus
|
|
33
|
+
packet_type?: ImRedEnvelopePacketType
|
|
34
|
+
packet_count?: number
|
|
35
|
+
claimed_count?: number
|
|
36
|
+
claims?: ImRedEnvelopeClaim[]
|
|
37
|
+
/** fixed 单领红包 */
|
|
22
38
|
claimed_by?: string
|
|
23
39
|
claimed_at?: string
|
|
24
40
|
}
|