floating-live 0.8.7 → 0.10.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/README.md +6 -4
- package/index.d.ts +7 -2
- package/index.js +23 -4
- package/package.json +1 -1
- package/plugin/acfun/acfunLive.d.ts +24 -30
- package/plugin/acfun/acfunLive.js +38 -51
- package/plugin/acfun/index.d.ts +1 -1
- package/plugin/acfun/index.js +1 -3
- package/plugin/bilibili/bilibiliLive.d.ts +7 -15
- package/plugin/bilibili/bilibiliLive.js +86 -117
- package/plugin/bilibili/index.d.ts +1 -1
- package/plugin/bilibili/index.js +1 -3
- package/plugin/chatPrint/chatPrint.d.ts +6 -7
- package/plugin/chatPrint/chatPrint.js +12 -18
- package/plugin/chatPrint/index.d.ts +2 -2
- package/plugin/chatPrint/index.js +2 -5
- package/plugin/consoleEvent/index.d.ts +1 -1
- package/plugin/consoleEvent/index.js +14 -2
- package/plugin/msgSave/index.d.ts +1 -1
- package/plugin/msgSave/index.js +6 -6
- package/plugin/msgSave/msgSave.d.ts +3 -3
- package/src/index.d.ts +51 -25
- package/src/index.js +98 -41
- package/src/lib/LiveRoom.d.ts +88 -0
- package/src/lib/LiveRoom.js +72 -0
- package/src/lib/{Registerable.d.ts → Reglist.d.ts} +6 -8
- package/src/lib/{Registerable.js → Reglist.js} +13 -19
- package/src/module/Command.d.ts +2 -0
- package/src/{types/room/RoomInfo.js → module/Command.js} +4 -0
- package/src/module/Plugin.d.ts +24 -0
- package/src/module/Plugin.js +74 -0
- package/src/{controller → module}/Room.d.ts +7 -13
- package/src/{controller → module}/Room.js +24 -16
- package/src/types/message/AttributeInfo.d.ts +8 -6
- package/src/types/message/MessageData.d.ts +132 -44
- package/src/types/plugin/Plugin.d.ts +4 -2
- package/src/types/room/PlatformInfo.d.ts +1 -1
- package/plugin/chat/ChatCommand.d.ts +0 -9
- package/plugin/chat/ChatCommand.js +0 -39
- package/plugin/chat/ChatFilter.d.ts +0 -9
- package/plugin/chat/ChatFilter.js +0 -44
- package/plugin/chat/chatProcessor.d.ts +0 -12
- package/plugin/chat/chatProcessor.js +0 -24
- package/src/controller/Message.d.ts +0 -9
- package/src/controller/Message.js +0 -15
- package/src/controller/index.d.ts +0 -39
- package/src/controller/index.js +0 -74
- package/src/types/message/MessageInfo.d.ts +0 -123
- package/src/types/message/MessageInfo.js +0 -2
- package/src/types/room/LiveInfo.d.ts +0 -24
- package/src/types/room/LiveInfo.js +0 -2
- package/src/types/room/LiveRoom.d.ts +0 -20
- package/src/types/room/LiveRoom.js +0 -2
- package/src/types/room/RoomInfo.d.ts +0 -16
- package/src/utils/getRoomInfo.d.ts +0 -4
- package/src/utils/getRoomInfo.js +0 -25
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { UserInfo, ImageInfo, GiftInfo } from "./AttributeInfo";
|
|
2
|
-
/** 聊天板信息 */
|
|
3
|
-
export interface MessageInfo {
|
|
4
|
-
/** 消息id */
|
|
5
|
-
msg_id?: string;
|
|
6
|
-
/** id */
|
|
7
|
-
id?: string;
|
|
8
|
-
/** 用户信息 */
|
|
9
|
-
user?: UserInfo;
|
|
10
|
-
/** 日期时间戳 */
|
|
11
|
-
timestamp?: number;
|
|
12
|
-
/** 文本内容 */
|
|
13
|
-
text?: string;
|
|
14
|
-
/** 文字颜色 */
|
|
15
|
-
color?: number | string;
|
|
16
|
-
/** 弹幕模式 */
|
|
17
|
-
mode?: number | string;
|
|
18
|
-
/** 文字大小 */
|
|
19
|
-
size?: number | string;
|
|
20
|
-
/** 图片信息 */
|
|
21
|
-
image?: ImageInfo;
|
|
22
|
-
/** 礼物信息 */
|
|
23
|
-
gift?: GiftInfo;
|
|
24
|
-
/** (SC)持续时间 */
|
|
25
|
-
duration?: number;
|
|
26
|
-
/** 其他属性 */
|
|
27
|
-
[attr: string]: any;
|
|
28
|
-
}
|
|
29
|
-
/** 文字聊天信息 */
|
|
30
|
-
export interface MsgInfoText {
|
|
31
|
-
/** 用户信息 */
|
|
32
|
-
user: UserInfo;
|
|
33
|
-
/** 日期时间戳 */
|
|
34
|
-
timestamp: number;
|
|
35
|
-
/** 文本内容 */
|
|
36
|
-
text: string;
|
|
37
|
-
/** 文字颜色 */
|
|
38
|
-
color?: number | string;
|
|
39
|
-
/** 弹幕模式 */
|
|
40
|
-
mode?: number | string;
|
|
41
|
-
/** 文字大小 */
|
|
42
|
-
size?: number | string;
|
|
43
|
-
/** 信息标签 */
|
|
44
|
-
tag?: string | boolean;
|
|
45
|
-
}
|
|
46
|
-
/** 图片聊天信息 */
|
|
47
|
-
export interface MsgInfoImage {
|
|
48
|
-
/** 用户信息 */
|
|
49
|
-
user: UserInfo;
|
|
50
|
-
/** 日期时间戳 */
|
|
51
|
-
timestamp: number;
|
|
52
|
-
/** 弹幕模式 */
|
|
53
|
-
mode?: number | string;
|
|
54
|
-
/** 文字大小 */
|
|
55
|
-
size?: number | string;
|
|
56
|
-
/** 图片信息 */
|
|
57
|
-
image: ImageInfo;
|
|
58
|
-
/** 信息标签 */
|
|
59
|
-
tag?: string | boolean;
|
|
60
|
-
}
|
|
61
|
-
/** 礼物信息 */
|
|
62
|
-
export interface MsgInfoGift {
|
|
63
|
-
/** 用户信息 */
|
|
64
|
-
user: UserInfo;
|
|
65
|
-
/** 日期时间戳 */
|
|
66
|
-
timestamp: number;
|
|
67
|
-
/** 礼物信息 */
|
|
68
|
-
gift: GiftInfo;
|
|
69
|
-
}
|
|
70
|
-
/** 互动信息 */
|
|
71
|
-
export interface MsgInfoInteract {
|
|
72
|
-
/** 用户信息 */
|
|
73
|
-
user: UserInfo;
|
|
74
|
-
/** 日期时间戳 */
|
|
75
|
-
timestamp: number;
|
|
76
|
-
/** 信息标签 */
|
|
77
|
-
tag?: string | boolean;
|
|
78
|
-
}
|
|
79
|
-
/** 粉丝付费会员开通信息 */
|
|
80
|
-
export interface MsgInfoPrivilege {
|
|
81
|
-
/** 用户信息 */
|
|
82
|
-
user: UserInfo;
|
|
83
|
-
/** 日期时间戳 */
|
|
84
|
-
timestamp: number;
|
|
85
|
-
/** 礼物信息 */
|
|
86
|
-
gift: GiftInfo;
|
|
87
|
-
/** 开通vip名称 */
|
|
88
|
-
name: string;
|
|
89
|
-
/** 开通vip等级 */
|
|
90
|
-
level?: number;
|
|
91
|
-
/** 持续时间(天数) */
|
|
92
|
-
duration: number;
|
|
93
|
-
/** 续费类型(0为非续费开通, 1为续费, 2为自动续费) */
|
|
94
|
-
renew?: 0 | 1 | 2;
|
|
95
|
-
}
|
|
96
|
-
/** 付费留言信息 */
|
|
97
|
-
export interface MsgInfoSuperchat {
|
|
98
|
-
/** 留言id */
|
|
99
|
-
id?: string;
|
|
100
|
-
/** 用户信息 */
|
|
101
|
-
user: UserInfo;
|
|
102
|
-
/** 日期时间戳 */
|
|
103
|
-
timestamp: number;
|
|
104
|
-
/** 文本内容 */
|
|
105
|
-
text: string;
|
|
106
|
-
/** 文字颜色 */
|
|
107
|
-
color?: number | string;
|
|
108
|
-
/** 礼物信息 */
|
|
109
|
-
gift: GiftInfo;
|
|
110
|
-
/** (SC)持续时间 */
|
|
111
|
-
duration: number;
|
|
112
|
-
}
|
|
113
|
-
/** 禁言信息 */
|
|
114
|
-
export interface MsgInfoBlock {
|
|
115
|
-
/** 用户信息 */
|
|
116
|
-
user: UserInfo;
|
|
117
|
-
/** 日期时间戳 */
|
|
118
|
-
timestamp?: number;
|
|
119
|
-
/** 操作者 */
|
|
120
|
-
operator: UserInfo | {
|
|
121
|
-
admin: number;
|
|
122
|
-
};
|
|
123
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** 直播信息 */
|
|
2
|
-
export interface LiveInfo {
|
|
3
|
-
/** 直播标题 */
|
|
4
|
-
title: string;
|
|
5
|
-
/** 分区 */
|
|
6
|
-
area?: string[];
|
|
7
|
-
/** 封面url */
|
|
8
|
-
cover?: string;
|
|
9
|
-
/** 直播状态(直播/关播/轮播/封禁) */
|
|
10
|
-
status: "live" | "off" | "round" | "banned";
|
|
11
|
-
/** 开始直播时间 */
|
|
12
|
-
start_time: number;
|
|
13
|
-
}
|
|
14
|
-
/** 直播统计信息 */
|
|
15
|
-
export interface LiveStats {
|
|
16
|
-
/** 在线人数 */
|
|
17
|
-
online?: number;
|
|
18
|
-
/** 已观看人数 */
|
|
19
|
-
watched?: number;
|
|
20
|
-
/** 点赞数 */
|
|
21
|
-
like?: number;
|
|
22
|
-
/** 人气值 */
|
|
23
|
-
popularity?: number;
|
|
24
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import RoomInfo from "./RoomInfo";
|
|
2
|
-
interface LiveRoom extends RoomInfo {
|
|
3
|
-
/** 直播平台 */
|
|
4
|
-
readonly platform: string;
|
|
5
|
-
/** 房间id */
|
|
6
|
-
readonly id: number | string;
|
|
7
|
-
/** 打开连接 */
|
|
8
|
-
open: () => void;
|
|
9
|
-
/** 关闭连接 */
|
|
10
|
-
close: () => void;
|
|
11
|
-
/** 销毁 */
|
|
12
|
-
destory: () => void;
|
|
13
|
-
/** 从服务器获取信息 */
|
|
14
|
-
getInfo: () => void;
|
|
15
|
-
/** 事件监听 */
|
|
16
|
-
on: (eventName: string | symbol, listener: (...args: any[]) => void) => this;
|
|
17
|
-
/** 移除事件监听 */
|
|
18
|
-
removeAllListeners: () => void;
|
|
19
|
-
}
|
|
20
|
-
export default LiveRoom;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LiveInfo } from "./LiveInfo";
|
|
2
|
-
import { UserInfo } from "../message/AttributeInfo";
|
|
3
|
-
export default interface RoomInfo {
|
|
4
|
-
/** 平台id */
|
|
5
|
-
platform: string;
|
|
6
|
-
/** 房间id */
|
|
7
|
-
id: number | string;
|
|
8
|
-
/** 直播信息 */
|
|
9
|
-
live: LiveInfo;
|
|
10
|
-
/** 主播信息 */
|
|
11
|
-
anchor: UserInfo;
|
|
12
|
-
/** 直播间是否可用 */
|
|
13
|
-
available: boolean;
|
|
14
|
-
/** 房间是否打开 */
|
|
15
|
-
opening: boolean;
|
|
16
|
-
}
|
package/src/utils/getRoomInfo.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/** 从房间中获取房间信息 */
|
|
4
|
-
function getRoomInfo(liveroom) {
|
|
5
|
-
let { platform, id, live: { title, cover, area, status, start_time, }, anchor, available, opening, } = liveroom;
|
|
6
|
-
return {
|
|
7
|
-
platform,
|
|
8
|
-
id,
|
|
9
|
-
live: {
|
|
10
|
-
title,
|
|
11
|
-
cover,
|
|
12
|
-
area: area ? [...area] : undefined,
|
|
13
|
-
status,
|
|
14
|
-
start_time,
|
|
15
|
-
},
|
|
16
|
-
anchor: {
|
|
17
|
-
name: anchor.name,
|
|
18
|
-
id: anchor.id,
|
|
19
|
-
avatar: anchor.avatar
|
|
20
|
-
},
|
|
21
|
-
available,
|
|
22
|
-
opening,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
exports.default = getRoomInfo;
|