floating-live 0.10.1 → 0.11.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/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/plugin/acfun/acfunLive.d.ts +6 -3
- package/plugin/acfun/acfunLive.js +56 -27
- package/plugin/acfun/index.d.ts +3 -1
- package/plugin/acfun/index.js +8 -4
- package/plugin/bilibili/bilibiliLive.d.ts +10 -5
- package/plugin/bilibili/bilibiliLive.js +93 -65
- package/plugin/bilibili/index.d.ts +3 -1
- package/plugin/bilibili/index.js +8 -4
- package/plugin/chatPrint/chatPrint.js +4 -3
- package/plugin/chatPrint/index.d.ts +3 -1
- package/plugin/chatPrint/index.js +6 -2
- package/plugin/consoleEvent/index.d.ts +3 -1
- package/plugin/consoleEvent/index.js +6 -1
- package/plugin/msgSave/index.d.ts +7 -3
- package/plugin/msgSave/index.js +75 -20
- package/plugin/msgSave/msgSave.d.ts +75 -14
- package/plugin/msgSave/msgSave.js +130 -19
- package/src/enum.d.ts +34 -0
- package/src/enum.js +41 -0
- package/src/index.d.ts +3 -3
- package/src/index.js +9 -7
- package/src/lib/LiveRoom.d.ts +10 -9
- package/src/lib/LiveRoom.js +28 -27
- package/src/module/Command.d.ts +2 -1
- package/src/module/Command.js +3 -3
- package/src/module/Plugin.d.ts +4 -2
- package/src/module/Plugin.js +12 -4
- package/src/module/Room.js +7 -7
- package/src/types/index.d.ts +4 -0
- package/src/types/index.js +20 -0
- package/src/types/message/AttributeInfo.d.ts +5 -4
- package/src/types/message/MessageData.d.ts +20 -24
- package/src/types/plugin.d.ts +9 -0
- package/src/types/{room/PlatformInfo.d.ts → room.d.ts} +2 -0
- package/src/types/plugin/Plugin.d.ts +0 -5
- /package/src/types/{plugin/Plugin.js → plugin.js} +0 -0
- /package/src/types/{room/PlatformInfo.js → room.js} +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RoomInfo } from './../../lib/LiveRoom';
|
|
2
|
+
import { DanmakuMode, RoomStatus, UserAdmin } from '../../enum';
|
|
3
|
+
import { RoomViewInfo, RoomStatsInfo } from "../../lib/LiveRoom";
|
|
2
4
|
import { UserInfo, GiftInfo, ImageInfo } from "./AttributeInfo";
|
|
3
5
|
declare type MessageBase = {
|
|
4
6
|
/** 平台名称 */
|
|
@@ -7,8 +9,8 @@ declare type MessageBase = {
|
|
|
7
9
|
room: number | string;
|
|
8
10
|
/** 信息类型 */
|
|
9
11
|
type: string;
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
+
/** 时间戳 */
|
|
13
|
+
timestamp: number;
|
|
12
14
|
/** 其他属性 */
|
|
13
15
|
[attr: string]: any;
|
|
14
16
|
};
|
|
@@ -31,14 +33,12 @@ export declare type MessageChat = MessageBase & {
|
|
|
31
33
|
info: {
|
|
32
34
|
/** 用户信息 */
|
|
33
35
|
user: UserInfo;
|
|
34
|
-
/** 日期时间戳 */
|
|
35
|
-
timestamp: number;
|
|
36
36
|
/** 文本内容 */
|
|
37
37
|
content: string;
|
|
38
38
|
/** 文字颜色 */
|
|
39
39
|
color?: number | string;
|
|
40
40
|
/** 弹幕模式 */
|
|
41
|
-
mode?:
|
|
41
|
+
mode?: DanmakuMode;
|
|
42
42
|
/** 文字大小 */
|
|
43
43
|
size?: number | string;
|
|
44
44
|
/** 图片信息 */
|
|
@@ -57,8 +57,6 @@ export declare type MessageGift = MessageBase & {
|
|
|
57
57
|
info: {
|
|
58
58
|
/** 用户信息 */
|
|
59
59
|
user: UserInfo;
|
|
60
|
-
/** 日期时间戳 */
|
|
61
|
-
timestamp: number;
|
|
62
60
|
/** 礼物信息 */
|
|
63
61
|
gift: GiftInfo;
|
|
64
62
|
};
|
|
@@ -69,8 +67,6 @@ export declare type MessageInteract = MessageBase & {
|
|
|
69
67
|
info: {
|
|
70
68
|
/** 用户信息 */
|
|
71
69
|
user: UserInfo;
|
|
72
|
-
/** 日期时间戳 */
|
|
73
|
-
timestamp: number;
|
|
74
70
|
/** 信息标签 */
|
|
75
71
|
tag?: string | boolean;
|
|
76
72
|
};
|
|
@@ -81,8 +77,6 @@ export declare type MessageMembership = MessageBase & {
|
|
|
81
77
|
info: {
|
|
82
78
|
/** 用户信息 */
|
|
83
79
|
user: UserInfo;
|
|
84
|
-
/** 日期时间戳 */
|
|
85
|
-
timestamp: number;
|
|
86
80
|
/** 礼物信息 */
|
|
87
81
|
gift: GiftInfo;
|
|
88
82
|
/** 开通vip名称 */
|
|
@@ -101,8 +95,6 @@ export declare type MessageSuperchat = MessageBase & {
|
|
|
101
95
|
id?: string;
|
|
102
96
|
/** 用户信息 */
|
|
103
97
|
user: UserInfo;
|
|
104
|
-
/** 日期时间戳 */
|
|
105
|
-
timestamp: number;
|
|
106
98
|
/** 文本内容 */
|
|
107
99
|
content: string;
|
|
108
100
|
/** 文字颜色 */
|
|
@@ -119,11 +111,9 @@ export declare type MessageBlock = MessageBase & {
|
|
|
119
111
|
info: {
|
|
120
112
|
/** 用户信息 */
|
|
121
113
|
user: UserInfo;
|
|
122
|
-
/** 日期时间戳 */
|
|
123
|
-
timestamp?: number;
|
|
124
114
|
/** 操作者 */
|
|
125
115
|
operator: UserInfo | {
|
|
126
|
-
|
|
116
|
+
admin: null | UserAdmin;
|
|
127
117
|
};
|
|
128
118
|
};
|
|
129
119
|
};
|
|
@@ -131,8 +121,8 @@ export declare type MessageBlock = MessageBase & {
|
|
|
131
121
|
export declare type MessageLiveStart = MessageBase & {
|
|
132
122
|
type: "live_start";
|
|
133
123
|
info: {
|
|
134
|
-
/**
|
|
135
|
-
|
|
124
|
+
/** 直播id */
|
|
125
|
+
id: string;
|
|
136
126
|
};
|
|
137
127
|
};
|
|
138
128
|
/** 直播切断消息 */
|
|
@@ -143,15 +133,21 @@ export declare type MessageLiveCut = MessageBase & {
|
|
|
143
133
|
message: string;
|
|
144
134
|
};
|
|
145
135
|
};
|
|
136
|
+
/** 获取房间信息 */
|
|
137
|
+
export interface MessageRoomInfo extends MessageBase {
|
|
138
|
+
type: "room_info";
|
|
139
|
+
/** 数据信息 */
|
|
140
|
+
info: RoomInfo;
|
|
141
|
+
}
|
|
146
142
|
/** 直播数据更新 */
|
|
147
143
|
export declare type MessageLiveStats = MessageBase & {
|
|
148
144
|
type: "live_stats";
|
|
149
145
|
info: RoomStatsInfo;
|
|
150
146
|
};
|
|
151
|
-
/**
|
|
152
|
-
export declare type
|
|
153
|
-
type: "
|
|
154
|
-
info:
|
|
147
|
+
/** 直播展示信息更新 */
|
|
148
|
+
export declare type MessageLiveView = MessageBase & {
|
|
149
|
+
type: "live_view";
|
|
150
|
+
info: RoomViewInfo;
|
|
155
151
|
};
|
|
156
152
|
/** 直播结束 */
|
|
157
153
|
export declare type MessageLiveEnd = MessageBase & {
|
|
@@ -161,7 +157,7 @@ export declare type MessageLiveEnd = MessageBase & {
|
|
|
161
157
|
status: RoomStatus;
|
|
162
158
|
};
|
|
163
159
|
};
|
|
164
|
-
declare type AllMessageType = MessageChat | MessageGift | MessageInteract | MessageMembership | MessageSuperchat | MessageBlock | MessageLiveStart | MessageLiveEnd | MessageLiveCut |
|
|
160
|
+
declare type AllMessageType = MessageChat | MessageGift | MessageInteract | MessageMembership | MessageSuperchat | MessageBlock | MessageLiveStart | MessageLiveEnd | MessageLiveCut | MessageLiveView | MessageLiveStats;
|
|
165
161
|
export declare type MessageData<T extends AllMessageType["type"] = AllMessageType["type"]> = AllMessageType & {
|
|
166
162
|
type: T;
|
|
167
163
|
};
|
|
File without changes
|
|
File without changes
|