dimsum-chat 0.5.3 → 0.5.4
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/dimsum-chat.js +487 -180
- package/dist/dimsum-chat.umd.cjs +4 -4
- package/dist/parser.d.ts +2 -0
- package/dist/protobuf.d.ts +56 -0
- package/package.json +1 -1
package/dist/parser.d.ts
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight, zero-dependency protobuf decoder for Bilibili SEND_GIFT_V2.
|
|
3
|
+
*
|
|
4
|
+
* Handles only the subset of wire types and fields required by SendGiftV2.
|
|
5
|
+
* Designed for performance: no reflection, no codegen, no allocations beyond
|
|
6
|
+
* the target object.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://github.com/lovelyyoshino/Bilibili-Live-API/blob/master/API.live_websocket.md}
|
|
9
|
+
*/
|
|
10
|
+
export interface SendGiftV2Medal {
|
|
11
|
+
anchor_uid: number;
|
|
12
|
+
medal_level: number;
|
|
13
|
+
medal_name: string;
|
|
14
|
+
color_start: number;
|
|
15
|
+
color: number;
|
|
16
|
+
color_border: number;
|
|
17
|
+
color_end: number;
|
|
18
|
+
guard_level: number;
|
|
19
|
+
}
|
|
20
|
+
export interface SendGiftV2Effect {
|
|
21
|
+
img_basic: string;
|
|
22
|
+
img_2: string;
|
|
23
|
+
img_gif: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SendGiftV2Receiver {
|
|
26
|
+
uname: string;
|
|
27
|
+
uid: number;
|
|
28
|
+
}
|
|
29
|
+
export interface SendGiftV2Gift {
|
|
30
|
+
gift_id: number;
|
|
31
|
+
gift_name: string;
|
|
32
|
+
num: number;
|
|
33
|
+
price: number;
|
|
34
|
+
total_coin: number;
|
|
35
|
+
coin_type: string;
|
|
36
|
+
tid: string;
|
|
37
|
+
timestamp: number;
|
|
38
|
+
action: string;
|
|
39
|
+
receiver: SendGiftV2Receiver;
|
|
40
|
+
effect?: SendGiftV2Effect;
|
|
41
|
+
}
|
|
42
|
+
export interface SendGiftV2Data {
|
|
43
|
+
uid: number;
|
|
44
|
+
uname: string;
|
|
45
|
+
face: string;
|
|
46
|
+
medal?: SendGiftV2Medal;
|
|
47
|
+
gift: SendGiftV2Gift;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Decode a base64-encoded SEND_GIFT_V2 protobuf payload.
|
|
51
|
+
*
|
|
52
|
+
* @param base64 - The raw `data.pb` string from a SEND_GIFT_V2 message.
|
|
53
|
+
* @returns Decoded gift data.
|
|
54
|
+
* @throws If the input is not valid base64 or protobuf.
|
|
55
|
+
*/
|
|
56
|
+
export declare function decodeSendGiftV2(base64: string): SendGiftV2Data;
|