@laplace.live/internal 1.2.56 → 1.3.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.
@@ -0,0 +1,124 @@
1
+ /** Used for brain-fucked bilibili devs */
2
+ export type StringBoolean = 'true' | 'false'
3
+
4
+ /** Emote list */
5
+ export interface SimpleEmotesList {
6
+ [key: string]: SimpleEmote
7
+ }
8
+
9
+ /**
10
+ * Used by bmotes and remote emotes
11
+ */
12
+ export interface SimpleEmote {
13
+ url: string
14
+ width?: number
15
+ height?: number
16
+ }
17
+
18
+ /**
19
+ * 用于 `DANMU` 事件中 @ 用户回复的 type
20
+ * Used by:
21
+ * - chat.laplace.chat
22
+ */
23
+ export interface DanmakuReplyProps {
24
+ uid: number
25
+ uname: string
26
+ }
27
+
28
+ /**
29
+ * LAPLACE fans medal
30
+ */
31
+ export interface FansMedal {
32
+ /**
33
+ * 当没佩戴粉丝勋章时,返回 0
34
+ */
35
+ level: number
36
+ /**
37
+ * 当没佩戴粉丝勋章时,返回空字符串
38
+ */
39
+ name: string
40
+ /**
41
+ * 当前粉丝勋章的房间号,并不是所有的事件都支持,例如弹幕事件支持,礼物事件就不支持
42
+ *
43
+ * 不支持的时候会返回 0,返回 0 时会影响千舰、万舰的头像框和粉丝勋章图标的判断
44
+ */
45
+ room: number
46
+ /**
47
+ * 此字段通过计算事件中返回的 `uinfo.medal.guard_icon` 而来,不过 guard_icon 并不是
48
+ * 所有的事件都会返回(例如大航海就返回空),因此仅作为兜底使用
49
+ * 目前大航海图标只区分是否千舰,不区分万舰,只有大航海头像框区分
50
+ */
51
+ resolvedPerkLevel?: number
52
+ /**
53
+ * 粉丝勋章图标,千舰、万舰会有区别
54
+ * @link https://i0.hdslb.com/bfs/live/98a201c14a64e860a758f089144dcf3f42e7038c.png
55
+ * @deprecated 直接传 URL 的方式已弃用,会增大事件体积,请使用上方的 `resolvedPerkLevel` 进行判断
56
+ */
57
+ guardIcon?: string
58
+ /**
59
+ * 粉丝牌所对应主播的 UID,当 `type` 为 1 时,此时为粉丝团套票,此处的 UID 等于粉丝团 id😅
60
+ */
61
+ uid?: number
62
+ /** Color in decimal color */
63
+ // colorBorder: number;
64
+ /** Color in decimal color */
65
+ // colorStart: number;
66
+ /** Color in decimal color */
67
+ // colorEnd: number;
68
+ /**
69
+ * 0: 白字
70
+ * 1: 总督
71
+ * 2: 提督
72
+ * 3: 舰长
73
+ */
74
+ guardType: number
75
+ /**
76
+ * 粉丝勋章是否点亮
77
+ *
78
+ * 1: 点亮
79
+ * 0: 未点亮
80
+ */
81
+ lightened: number
82
+ /**
83
+ * 粉丝勋章类型,后加的属性,为了兼容性,因此为可选
84
+ *
85
+ * 0: 普通粉丝牌
86
+ * 1: 大航海套票
87
+ */
88
+ type?: number
89
+ }
90
+
91
+ /**
92
+ * b豆 emote props
93
+ * @deprecated Use `SimpleBmote` instead
94
+ */
95
+ export interface Bmote {
96
+ emoticon_id: number
97
+ emoji: string
98
+ descript: string
99
+ url: string
100
+ width: number
101
+ height: number
102
+ emoticon_unique: string
103
+ count: number
104
+ }
105
+
106
+ /**
107
+ * `buvid` props
108
+ */
109
+ export interface BuvidProps {
110
+ token: string
111
+ }
112
+
113
+ /**
114
+ * Protobuf data from danmu v2 props
115
+ * @deprecated Not bilibili no longer returns protobuf
116
+ */
117
+ export type ProtobufDanmuV2Props = {
118
+ user: {
119
+ face: string
120
+ }
121
+ }
122
+
123
+ /** 内部连接方式 */
124
+ export type ConnectionModes = 'direct' | 'builtin' | 'qrcode' | 'open-platform'
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Steam API language codes for the Store API `l` parameter.
3
+ * @link https://partner.steamgames.com/doc/store/localization/languages
4
+ */
5
+ export const steamLanguages = [
6
+ 'arabic',
7
+ 'brazilian',
8
+ 'bulgarian',
9
+ 'czech',
10
+ 'danish',
11
+ 'dutch',
12
+ 'english',
13
+ 'finnish',
14
+ 'french',
15
+ 'german',
16
+ 'greek',
17
+ 'hungarian',
18
+ 'indonesian',
19
+ 'italian',
20
+ 'japanese',
21
+ 'koreana',
22
+ 'latam',
23
+ 'norwegian',
24
+ 'polish',
25
+ 'portuguese',
26
+ 'romanian',
27
+ 'russian',
28
+ 'schinese',
29
+ 'spanish',
30
+ 'swedish',
31
+ 'tchinese',
32
+ 'thai',
33
+ 'turkish',
34
+ 'ukrainian',
35
+ 'vietnamese',
36
+ ] as const
37
+
38
+ export type SteamLanguage = (typeof steamLanguages)[number]
@@ -0,0 +1,254 @@
1
+ /**
2
+ * danmakus.com API
3
+ * @link https://ukamnads.icu/swagger
4
+ */
5
+ export declare namespace Danmakus {
6
+ /**
7
+ * 直播实时排行榜
8
+ * @link https://ukamnads.icu/api/v2/living
9
+ */
10
+ export interface RankingProps {
11
+ /**
12
+ * 200: success
13
+ */
14
+ code: number
15
+ message: string
16
+ data: RankingItem[]
17
+ }
18
+
19
+ /** Item of `RankingProps` */
20
+ export interface RankingItem {
21
+ uId: number
22
+ uName: string
23
+ roomId: number
24
+ faceUrl: string
25
+ frameUrl: string
26
+ isLiving: boolean
27
+ title: string
28
+ tags: string[]
29
+ lastLiveDate: number
30
+ lastLiveDanmakuCount: number
31
+ totalDanmakuCount: number
32
+ totalIncome: {
33
+ value: string
34
+ type: 'Big Number'
35
+ }
36
+ totalLiveCount: number
37
+ totalLiveSecond: number
38
+ addDate: Date
39
+ /** can be empty in some rare case due to some program error */
40
+ livingInfo?: LiveItem
41
+ commentCount: number
42
+ lastLiveIncome: number
43
+ }
44
+
45
+ /**
46
+ * 频道信息(直播记录列表)
47
+ * @link https://ukamnads.icu/api/v2/channel?uId=2132180406
48
+ */
49
+ export interface ChannelProps {
50
+ /**
51
+ * 200: success
52
+ */
53
+ code: number
54
+ message: string
55
+ data: ChannelData
56
+ }
57
+
58
+ /** Data of `ChannelProps` */
59
+ export interface ChannelData {
60
+ channel: ChannelInfoProps
61
+ lives: LiveItem[]
62
+ extra?: {
63
+ fansHistory: {
64
+ archiveView: number
65
+ follower: number
66
+ time: number
67
+ }[]
68
+ guardHistory: {
69
+ guardNum: number
70
+ areaRank: number
71
+ time: number
72
+ }[]
73
+ }
74
+ }
75
+
76
+ /** Props of `ChannelData` */
77
+ export interface ChannelInfoProps {
78
+ uId: number
79
+ uName: string
80
+ roomId: number
81
+ faceUrl: string
82
+ frameUrl: string
83
+ isLiving: boolean
84
+ title: string
85
+ tags: string[]
86
+ lastLiveDate: number
87
+ lastLiveDanmakuCount: number
88
+ totalDanmakuCount: number
89
+ totalIncome: number
90
+ totalLiveCount: number
91
+ totalLiveSecond: number
92
+ addDate: Date
93
+ commentCount: number
94
+ lastLiveIncome: number
95
+ }
96
+
97
+ /** General live stream item */
98
+ export interface LiveItem {
99
+ liveId: string
100
+ isFinish: boolean
101
+ isFull: boolean
102
+ parentArea: string
103
+ area: string
104
+ coverUrl: string
105
+ danmakusCount: number
106
+ startDate: number
107
+ stopDate: number
108
+ title: string
109
+ totalIncome: number
110
+ watchCount: number
111
+ likeCount: number
112
+ payCount: number
113
+ interactionCount: number
114
+ onlineRank: number
115
+ maxOnlineCount: number
116
+ }
117
+
118
+ /** General danmaku event props */
119
+ export interface DanmakuProps {
120
+ uId: number
121
+ uName: string
122
+ /**
123
+ * - 0: 普通消息
124
+ * - 1: 礼物
125
+ * - 2: 上舰
126
+ * - 3: SuperChat
127
+ * - 4: 进入直播间
128
+ * - 5: 标题变动
129
+ * - 6: 分区变动
130
+ * - 7: 直播中止
131
+ * - 8: 直播继续
132
+ * - 9: 用户封禁
133
+ */
134
+ type: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10
135
+ sendDate: number
136
+ message: string
137
+ price: number
138
+ ct: string
139
+ count: number
140
+ }
141
+
142
+ /** Extra props for live item */
143
+ export interface ExtraProps {
144
+ wordCloud: { [key: string]: number }
145
+ onlineRank: { [key: string]: number }
146
+ blockUsers: number[]
147
+ }
148
+
149
+ /**
150
+ * 单场直播信息
151
+ * @link https://ukamnads.icu/api/v2/live?liveid=cafc0eb5-a79a-4a0d-b283-3360b6a1a814&includeExtra=true
152
+ */
153
+ export interface LiveProps {
154
+ /**
155
+ * 200: success
156
+ */
157
+ code: number
158
+ message: string
159
+ data: LiveData
160
+ }
161
+
162
+ /** Data of `LiveProps` */
163
+ export interface LiveData {
164
+ total: number
165
+ pageNum: number
166
+ pageSize: number
167
+ hasMore: boolean
168
+ data: {
169
+ channel: ChannelInfoProps
170
+ live: {
171
+ liveId: string
172
+ isFinish: boolean
173
+ isFull: boolean
174
+ parentArea: string
175
+ area: string
176
+ coverUrl: string
177
+ danmakusCount: number
178
+ startDate: number
179
+ stopDate: number
180
+ title: string
181
+ totalIncome: number
182
+ watchCount: number
183
+ likeCount: number
184
+ payCount: number
185
+ interactionCount: number
186
+ onlineRank: number
187
+ maxOnlineCount: number
188
+ extra: ExtraProps
189
+ }
190
+ danmakus: DanmakuProps[]
191
+ }
192
+ }
193
+
194
+ /**
195
+ * 用户看过的主播
196
+ * @link https://ukamnads.icu/api/v2/user/watchedChannels?uid=2132180406
197
+ */
198
+ export interface WatchedChannels {
199
+ /**
200
+ * 200: success
201
+ */
202
+ code: number
203
+ message: string
204
+ data: WatchedChannelsItem[]
205
+ }
206
+
207
+ /** Item of `WatchedChannels` */
208
+ export interface WatchedChannelsItem {
209
+ uId: number
210
+ uName: string
211
+ roomId: number
212
+ faceUrl: string
213
+ frameUrl: string
214
+ isLiving: boolean
215
+ title: string
216
+ tags: string[]
217
+ lastLiveDate: number
218
+ lastLiveDanmakuCount: number
219
+ totalDanmakuCount: number
220
+ totalIncome: number
221
+ totalLiveCount: number
222
+ totalLiveSecond: number
223
+ addDate: Date
224
+ commentCount: number
225
+ lastLiveIncome: number
226
+ }
227
+
228
+ /**
229
+ * 用户观看/事件记录
230
+ */
231
+ export interface User {
232
+ code: number
233
+ message: string
234
+ data: UserData
235
+ }
236
+
237
+ /** Data of `User` */
238
+ export interface UserData {
239
+ total: number
240
+ pageNum: number
241
+ pageSize: number
242
+ hasMore: boolean
243
+ data: {
244
+ records: UserDataRecordsItem[]
245
+ }
246
+ }
247
+
248
+ /** Item of `UserData` */
249
+ export interface UserDataRecordsItem {
250
+ channel: WatchedChannelsItem
251
+ live: LiveItem
252
+ danmakus: DanmakuProps[]
253
+ }
254
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The Global LAPLACE typings
3
+ * Maintained by laplace.live
4
+ */
5
+
6
+ export type { Aicu } from './aicu'
7
+ export type { Aliyun } from './aliyun'
8
+ export type { BilibiliInternal } from './bilibili'
9
+ export type { Danmakus } from './danmakus'
10
+ export type { Kuaidi100 } from './kuaidi100'
11
+ export type { LaplaceInternal } from './laplace'
12
+ export type { LoveAvA } from './loveava'
13
+ export type { Steam } from './steam'
14
+ export type { Vtbs } from './vtbs'
15
+ export type { Zeroroku } from './zeroroku'
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Kuaidi100 API
3
+ */
4
+ export declare namespace Kuaidi100 {
5
+ /**
6
+ * 地址解析
7
+ */
8
+ export interface AddressResolution {
9
+ code: number
10
+ data: {
11
+ taskId: string
12
+ result: {
13
+ /** 用户输入的地址 */
14
+ content: string
15
+ mobile: number[]
16
+ /** 姓名 */
17
+ name: string
18
+ /** 解析后的地址 */
19
+ address: string
20
+ xzq: {
21
+ /** 完整地址:广东省,深圳市,南山区 */
22
+ fullName: string
23
+ /** 本字段将返回省份简称,例如:广东 */
24
+ province: string
25
+ /** 本字段返回市级行政区简称,例如:深圳市 */
26
+ city: string
27
+ /** 本字段返回区县简称,例如:南山区 */
28
+ district: string
29
+ /** 详细地址 */
30
+ subArea: string
31
+ /** 行政区父节点编码 */
32
+ parentCode: string
33
+ /** 行政区编码 */
34
+ code: string
35
+ /** 行政区级别 */
36
+ level: 3
37
+ }
38
+ }[]
39
+ }
40
+ /** 是否成功,`success` */
41
+ message: string
42
+ /** 通常为 0,时间,可忽略 */
43
+ time: number
44
+ /** true提交成功,false失败 */
45
+ success: boolean
46
+ }
47
+
48
+ /**
49
+ * /fans-history API 中粉丝数项目
50
+ */
51
+ export interface FansItem {
52
+ fans: number
53
+ created_at: string
54
+ date: string
55
+ }
56
+ }