karin-plugin-kkk 2.41.2 → 2.42.1

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +46 -19
  2. package/config/default_config/config.json +5 -0
  3. package/lib/apps/__ready.js +1 -0
  4. package/lib/apps/admin.js +1 -0
  5. package/lib/apps/help.js +1 -0
  6. package/lib/apps/push.js +1 -0
  7. package/lib/apps/qrlogin.js +1 -0
  8. package/lib/apps/statistics.js +1 -0
  9. package/lib/apps/testPush.js +1 -0
  10. package/lib/apps/tools.js +1 -0
  11. package/lib/apps/update.js +1 -0
  12. package/lib/build-metadata.json +5 -5
  13. package/lib/core_chunk/amagi.d.mts +242 -1249
  14. package/lib/core_chunk/amagi.js +3 -2
  15. package/lib/core_chunk/amagiClient.js +2 -1
  16. package/lib/core_chunk/api.js +3 -0
  17. package/lib/core_chunk/db.js +2 -1
  18. package/lib/core_chunk/lexer-DQCqS3nf.js +3 -0
  19. package/lib/core_chunk/main.js +19593 -21137
  20. package/lib/core_chunk/richtext.d.mts +267 -1
  21. package/lib/core_chunk/richtext.js +2 -1
  22. package/lib/core_chunk/rolldown-runtime.js +1 -0
  23. package/lib/core_chunk/setup.js +1 -0
  24. package/lib/core_chunk/template.d.mts +6 -2440
  25. package/lib/core_chunk/template.js +3 -2
  26. package/lib/core_chunk/vendor.js +45366 -31184
  27. package/lib/index.js +1 -0
  28. package/lib/ktr-assets.json +1 -0
  29. package/lib/root.js +2 -1
  30. package/lib/{karin-plugin-kkk.css → style.css} +332 -1127
  31. package/lib/template-registry.js +3 -0
  32. package/lib/web/assets/CronEditor-CoI7gVfa.js +1 -0
  33. package/lib/web/assets/{DesktopLayout-D87sxpYp.js → DesktopLayout-CRQdcmvy.js} +1 -1
  34. package/lib/web/assets/MobileLayout-ClOVwJEp.js +1 -0
  35. package/lib/web/assets/ThemeSwitch-DxWaxUmy.js +1 -0
  36. package/lib/web/assets/index-CScw9ngf.js +47 -0
  37. package/lib/web/assets/{index-BjheeBw6.css → index-D39hMurO.css} +1 -1
  38. package/lib/web/assets/{separator-B4jt1kVO.js → separator-B6VKhTtv.js} +1 -1
  39. package/lib/web/index.html +2 -2
  40. package/lib/web.config.js +2 -1
  41. package/package.json +3 -7
  42. package/lib/core_chunk/index-CZWy-8Jl.d.mts +0 -268
  43. package/lib/web/assets/CronEditor-xoZMMEWs.js +0 -1
  44. package/lib/web/assets/MobileLayout-HwaDlCUG.js +0 -1
  45. package/lib/web/assets/ThemeSwitch-CJXARLzz.js +0 -1
  46. package/lib/web/assets/index-84SfgXJi.js +0 -47
  47. package/resources/font/bilifont/bilifont.1.woff2 +0 -0
  48. package/resources/font/bilifont/bilifont.2.woff2 +0 -0
  49. package/resources/font/bilifont/font.css +0 -17
  50. package/resources/font/fansmedal-num/fansmedal-num.1.woff2 +0 -0
  51. package/resources/font/fansmedal-num/font.css +0 -9
  52. package/resources/font/mono/JetBrainsMono-Bold.woff2 +0 -0
  53. package/resources/font/mono/JetBrainsMono-BoldItalic.woff2 +0 -0
  54. package/resources/font/mono/JetBrainsMono-ExtraBold.woff2 +0 -0
  55. package/resources/font/mono/JetBrainsMono-ExtraBoldItalic.woff2 +0 -0
  56. package/resources/font/mono/JetBrainsMono-ExtraLight.woff2 +0 -0
  57. package/resources/font/mono/JetBrainsMono-ExtraLightItalic.woff2 +0 -0
  58. package/resources/font/mono/JetBrainsMono-Italic.woff2 +0 -0
  59. package/resources/font/mono/JetBrainsMono-Light.woff2 +0 -0
  60. package/resources/font/mono/JetBrainsMono-LightItalic.woff2 +0 -0
  61. package/resources/font/mono/JetBrainsMono-Medium.woff2 +0 -0
  62. package/resources/font/mono/JetBrainsMono-MediumItalic.woff2 +0 -0
  63. package/resources/font/mono/JetBrainsMono-Regular.woff2 +0 -0
  64. package/resources/font/mono/JetBrainsMono-SemiBold.woff2 +0 -0
  65. package/resources/font/mono/JetBrainsMono-SemiBoldItalic.woff2 +0 -0
  66. package/resources/font/mono/JetBrainsMono-Thin.woff2 +0 -0
  67. package/resources/font/mono/JetBrainsMono-ThinItalic.woff2 +0 -0
  68. package/resources/font/mono/font.css +0 -137
@@ -1,2442 +1,4 @@
1
- import { o as RichTextDocument } from "./index-CZWy-8Jl.mjs";
2
- import { EventEmitter as EventEmitter$1 } from "node:events";
3
- import { AxiosRequestConfig, AxiosResponse } from "axios";
4
- import React$1 from "react";
5
- //#region ../template/src/types/platforms/douyin/articleWork.d.ts
6
- /**
7
- * 文章图片信息
8
- */
9
- interface ArticleImage {
10
- /** AI高清图片URL */
11
- ai_high_image_url: string;
12
- /** 高清图片URL */
13
- high_image_url: string;
14
- /** Markdown图片URL */
15
- markdown_url: string;
16
- /** 原始图片URL */
17
- origin_image_url: string;
18
- }
19
- /**
20
- * 抖音文章作品组件属性接口
21
- */
22
- interface DouyinArticleWorkProps extends BaseComponentProps<{
23
- /** 文章标题 */
24
- title: string;
25
- /** 文章Markdown内容 */
26
- markdown: string;
27
- /** 文章图片列表 */
28
- images: ArticleImage[];
29
- /** 阅读时间(分钟) */
30
- read_time: number;
31
- /** 点赞数 */
32
- dianzan: string;
33
- /** 评论数 */
34
- pinglun: string;
35
- /** 收藏数 */
36
- shouchang: string;
37
- /** 分享数 */
38
- share: string;
39
- /** 创建时间 */
40
- create_time: string;
41
- /** 用户头像URL */
42
- avater_url: string;
43
- /** 用户名 */
44
- username: string;
45
- /** 抖音号 */
46
- 抖音号: string;
47
- /** 获赞数 */
48
- 获赞: string;
49
- /** 关注数 */
50
- 关注: string;
51
- /** 粉丝数 */
52
- 粉丝: string;
53
- /** 分享链接 */
54
- share_url: string;
55
- }> {}
56
- //#endregion
57
- //#region ../template/src/types/platforms/douyin/comment.d.ts
58
- /**
59
- * 抖音评论组件属性接口
60
- */
61
- interface DouyinCommentProps extends BaseComponentProps<{
62
- /** 作品类型:视频/图集/合辑/文章 */
63
- Type: '视频' | '图集' | '合辑' | '文章';
64
- /** 评论数量 */
65
- CommentLength: number;
66
- /** 视频大小(MB) */
67
- VideoSize?: string;
68
- /** 视频帧率(Hz) */
69
- VideoFPS?: number;
70
- /** 图片数量 */
71
- ImageLength?: number;
72
- /** 区域 */
73
- Region: string;
74
- /** 相关搜索(大家都在搜) */
75
- suggestWrod: string[];
76
- /** 视频分辨率 */
77
- Resolution: string | null;
78
- /** 分享链接 */
79
- share_url: string;
80
- /** 作者昵称 */
81
- Author: string;
82
- /** 作者头像 */
83
- AuthorAvatar: string;
84
- /** 作品统计 */
85
- Statistics: {
86
- digg_count: number;
87
- comment_count: number;
88
- share_count: number;
89
- collect_count: number;
90
- };
91
- /** 发布时间戳(秒) */
92
- CreateTime: number;
93
- /** 评论数据列表 */
94
- CommentsData: Array<{
95
- /** 评论ID */
96
- id?: number;
97
- /** 评论CID */
98
- cid?: string;
99
- /** 作品ID */
100
- aweme_id?: string;
101
- /** 用户头像URL */
102
- userimageurl: string;
103
- /** 用户昵称 */
104
- nickname: string;
105
- /** 标签类型 (1=作者) */
106
- label_type?: number;
107
- /** 状态标签 */
108
- status_label?: string;
109
- /** 评论内容 */
110
- text: RichTextDocument;
111
- /** 评论图片 */
112
- commentimage?: string;
113
- /** 贴纸 */
114
- sticker?: string;
115
- /** 创建时间戳(秒) */
116
- create_time: number;
117
- /** IP标签 */
118
- ip_label: string;
119
- /** 点赞数 */
120
- digg_count: number;
121
- /** 搜索文本 */
122
- search_text?: Array<{
123
- /** 搜索文本内容 */
124
- search_text: string;
125
- /** 搜索查询ID */
126
- search_query_id: string;
127
- }> | null;
128
- /** 是否@用户ID */
129
- is_At_user_id?: any;
130
- /** 回复评论数据 */
131
- replyComment?: DouyinSubComment[];
132
- /** 作者是否点赞 */
133
- is_author_digged?: boolean;
134
- }>;
135
- /** 最大嵌套层级 */
136
- maxDepth?: number;
137
- }> {}
138
- /**
139
- * 抖音子评论数据接口
140
- */
141
- interface DouyinSubComment {
142
- /** 创建时间戳(秒) */
143
- create_time: number;
144
- /** 用户昵称 */
145
- nickname: string;
146
- /** 用户头像URL */
147
- userimageurl: string;
148
- /** 评论内容 */
149
- text: RichTextDocument;
150
- /** 点赞数 */
151
- digg_count: number;
152
- /** IP标签 */
153
- ip_label: string;
154
- /** 文本额外信息 */
155
- text_extra: any[];
156
- /** 标签文本 */
157
- label_text: string;
158
- /** 评论图片 */
159
- image_list: string[] | null;
160
- /** 评论ID */
161
- cid: string;
162
- /** 回复的评论ID */
163
- reply_to_reply_id: string;
164
- /** 回复的用户昵称 */
165
- reply_to_username: string;
166
- }
167
- //#endregion
168
- //#region ../template/src/types/platforms/douyin/dynamic.d.ts
169
- /**
170
- * 抖音动态组件属性接口
171
- */
172
- interface DouyinDynamicProps extends BaseComponentProps<{
173
- /** 图片URL */
174
- image_url: string;
175
- /** 描述内容 */
176
- desc: string;
177
- /** 点赞数 */
178
- dianzan: string;
179
- /** 评论数 */
180
- pinglun: string;
181
- /** 收藏数 */
182
- shouchang: string;
183
- /** 分享数 */
184
- share: string;
185
- /** 创建时间 */
186
- create_time: string;
187
- /** 用户头像URL */
188
- avater_url: string;
189
- /** 用户名 */
190
- username: string;
191
- /** 抖音号 */
192
- 抖音号: string;
193
- /** 获赞数 */
194
- 获赞: string;
195
- /** 关注数 */
196
- 关注: string;
197
- /** 粉丝数 */
198
- 粉丝: string;
199
- /** 分享链接 */
200
- share_url: string;
201
- /** 动态类型 */
202
- dynamicTYPE?: string;
203
- /** 合作信息 */
204
- cooperation_info?: {
205
- co_creator_nums: number;
206
- co_creators: Array<{
207
- avatar_url?: string;
208
- nickname: string;
209
- role_title: string;
210
- }>;
211
- };
212
- }> {}
213
- //#endregion
214
- //#region ../template/src/types/platforms/douyin/favorite-list.d.ts
215
- /**
216
- * 抖音喜欢列表组件属性接口
217
- * 用于展示"谁喜欢了谁的作品"
218
- */
219
- interface DouyinFavoriteListProps extends BaseComponentProps<{
220
- /** 作品封面图片URL */
221
- image_url: string;
222
- /** 作品描述内容 */
223
- desc: string;
224
- /** 点赞数 */
225
- dianzan: string;
226
- /** 评论数 */
227
- pinglun: string;
228
- /** 收藏数 */
229
- shouchang: string;
230
- /** 分享数 */
231
- share: string;
232
- /** 推荐数 */
233
- tuijian: string;
234
- /** 作品创建时间 */
235
- create_time: string;
236
- /** 点赞者(订阅者)用户名 */
237
- liker_username: string;
238
- /** 点赞者头像URL */
239
- liker_avatar: string;
240
- /** 点赞者抖音号 */
241
- liker_douyin_id: string;
242
- /** 作品作者用户名 */
243
- author_username: string;
244
- /** 作品作者头像URL */
245
- author_avatar: string;
246
- /** 作品作者抖音号 */
247
- author_douyin_id: string;
248
- /** 分享链接 */
249
- share_url: string;
250
- }> {}
251
- //#endregion
252
- //#region ../template/src/types/platforms/douyin/imageWork.d.ts
253
- /** 抖音图文中单张媒体的类型。 */
254
- type DouyinImageMediaType = 'static' | 'live' | 'clip';
255
- /**
256
- * 抖音图文作品组件属性接口
257
- */
258
- interface DouyinImageWorkProps extends BaseComponentProps<{
259
- /** 图文图片列表(首项为封面;组件从索引 1 起最多展示 3 张预览图) */
260
- image_list: {
261
- /** 图片列表,按原始顺序排列 */
262
- images: Array<{
263
- /** 图片 URL */
264
- url: string;
265
- /** 媒体类型 */
266
- media_type: DouyinImageMediaType;
267
- }>;
268
- /** 作品总图片数(包含封面) */
269
- total_count: number;
270
- };
271
- /** 标题(从描述中按首个句号拆分,含有效 @ 用户与 topic 节点) */
272
- title?: RichTextDocument;
273
- /** 描述内容(去除标题后的正文,含有效 @ 用户、topic/lineBreak 节点) */
274
- desc: RichTextDocument;
275
- /** IP 属地 */
276
- ip_location?: string;
277
- /** 热点搜索词 */
278
- suggest_word?: {
279
- hint_text: string;
280
- word: string;
281
- };
282
- /** 背景音乐信息 */
283
- music?: {
284
- /** 音乐作者 */
285
- author: string;
286
- /** 音乐标题 */
287
- title: string;
288
- /** 音乐封面 URL */
289
- cover?: string;
290
- };
291
- /** 点赞数 */
292
- dianzan: string;
293
- /** 评论数 */
294
- pinglun: string;
295
- /** 收藏数 */
296
- shouchang: string;
297
- /** 分享数 */
298
- share: string;
299
- /** 创建时间(Unix 时间戳,秒) */
300
- create_time: number;
301
- /** 用户头像URL */
302
- avater_url: string;
303
- /** 用户名 */
304
- username: string;
305
- /** 抖音号 */
306
- 抖音号: string;
307
- /** 获赞数 */
308
- 获赞: string;
309
- /** 关注数 */
310
- 关注: string;
311
- /** 粉丝数 */
312
- 粉丝: string;
313
- /** 分享链接 */
314
- share_url: string;
315
- /** 动态类型 */
316
- dynamicTYPE?: string;
317
- /** 合作信息 */
318
- cooperation_info?: {
319
- co_creator_nums: number;
320
- co_creators: Array<{
321
- avatar_url?: string;
322
- nickname: string;
323
- role_title: string;
324
- }>;
325
- };
326
- }> {}
327
- //#endregion
328
- //#region ../template/src/types/platforms/douyin/live.d.ts
329
- /**
330
- * 抖音直播组件属性接口
331
- */
332
- interface DouyinLiveProps extends BaseComponentProps<{
333
- /** 直播封面图片URL */
334
- image_url: string;
335
- /** 直播标题/描述 */
336
- text: string;
337
- /** 直播分区标题 */
338
- partition_title: string;
339
- /** 房间号 */
340
- room_id: string;
341
- /** 总观看次数 */
342
- total_viewers: string;
343
- /** 在线观众数 */
344
- online_viewers: string;
345
- /** 用户头像URL */
346
- avater_url: string;
347
- /** 用户名 */
348
- username: string;
349
- /** 粉丝数 */
350
- fans: string;
351
- /** 动态类型 */
352
- dynamicTYPE: string;
353
- /** 分享链接 */
354
- share_url: string;
355
- /** 点赞数 */
356
- like_count: string;
357
- /** 在线人数文本 */
358
- user_count_str: string;
359
- /** 直播分辨率 */
360
- resolution: string;
361
- /** 主播签名 */
362
- signature: string;
363
- /** 城市 */
364
- city: string;
365
- /** 作品数 */
366
- aweme_count: string;
367
- /** 关注数 */
368
- following_count: string;
369
- /** 获赞数 */
370
- total_favorited: string;
371
- /** 是否有商品 */
372
- has_commerce_goods: boolean;
373
- }> {}
374
- //#endregion
375
- //#region ../template/src/types/platforms/douyin/musicinfo.d.ts
376
- /**
377
- * 抖音音乐信息组件属性接口
378
- */
379
- interface DouyinMusicInfoProps extends BaseComponentProps<{
380
- /** 音乐封面图片URL */
381
- image_url: string;
382
- /** 音乐描述/标题 */
383
- desc: string;
384
- /** 音乐ID */
385
- music_id: string;
386
- /** 创建时间 */
387
- create_time: string;
388
- /** 使用该音乐的用户数量 */
389
- user_count: string;
390
- /** 用户头像URL */
391
- avater_url: string;
392
- /** 用户名 */
393
- username: string;
394
- /** 用户短ID */
395
- user_shortid: string;
396
- /** 获赞数 */
397
- total_favorited: number;
398
- /** 关注数 */
399
- following_count: number;
400
- /** 粉丝数 */
401
- fans: number;
402
- /** 分享链接 */
403
- share_url: string;
404
- }> {}
405
- //#endregion
406
- //#region ../template/src/types/platforms/douyin/recommend-list.d.ts
407
- /**
408
- * 抖音推荐列表组件属性接口
409
- */
410
- interface DouyinRecommendListProps extends BaseComponentProps<{
411
- /** 图片URL */
412
- image_url: string;
413
- /** 描述内容 */
414
- desc: string;
415
- /** 点赞数 */
416
- dianzan: string;
417
- /** 评论数 */
418
- pinglun: string;
419
- /** 收藏数 */
420
- shouchang: string;
421
- /** 推荐数 */
422
- tuijian: string;
423
- /** 分享数 */
424
- share: string;
425
- /** 创建时间 */
426
- create_time: string;
427
- /** 推荐者(订阅者)用户名 */
428
- recommender_username: string;
429
- /** 推荐者头像URL */
430
- recommender_avatar: string;
431
- /** 推荐者抖音号 */
432
- recommender_douyin_id: string;
433
- /** 作品作者用户名 */
434
- author_username: string;
435
- /** 作品作者头像URL */
436
- author_avatar: string;
437
- /** 作品作者抖音号 */
438
- author_douyin_id: string;
439
- /** 分享链接 */
440
- share_url: string;
441
- }> {}
442
- //#endregion
443
- //#region ../template/src/types/platforms/douyin/userlist.d.ts
444
- /**
445
- * 抖音用户列表组件属性接口
446
- */
447
- interface DouyinUserListProps extends BaseComponentProps<{
448
- /** 群组信息 */
449
- groupInfo: {
450
- /** 群号 */
451
- groupId: string;
452
- /** 群名称 */
453
- groupName: string;
454
- /** 群头像 */
455
- groupAvatar: string;
456
- };
457
- /** 用户列表数据 */
458
- renderOpt: {
459
- /** 用户头像图片URL */
460
- avatar_img: string;
461
- /** 用户名 */
462
- username: string;
463
- /** 抖音短ID */
464
- short_id: string;
465
- /** 粉丝数 */
466
- fans: string;
467
- /** 获赞总数 */
468
- total_favorited: string;
469
- /** 关注数 */
470
- following_count: string;
471
- /** 全局推送开关状态 */
472
- switch: boolean;
473
- /** 推送类型列表 */
474
- pushTypes: string[];
475
- }[];
476
- }> {}
477
- //#endregion
478
- //#region ../template/src/types/platforms/douyin/UserVideoList.d.ts
479
- /**
480
- * 用户视频列表页面的数据类型定义
481
- */
482
- type VideoListItem = {
483
- /** 视频ID */
484
- aweme_id: string;
485
- /** 视频索引 */
486
- index?: number;
487
- /** 是否置顶 */
488
- is_top: boolean;
489
- /** 视频标题/描述 */
490
- title: string;
491
- /** 视频封面URL */
492
- cover: string;
493
- /** 视频时长(秒) */
494
- duration: number;
495
- /** 创建时间戳 */
496
- create_time: number;
497
- /** 统计数据 */
498
- statistics: {
499
- /** 点赞数 */
500
- like_count: number;
501
- /** 评论数 */
502
- comment_count: number;
503
- /** 分享数 */
504
- share_count: number;
505
- /** 收藏数 */
506
- collect_count: number;
507
- };
508
- /** 是否为视频(true)还是图集(false) */
509
- is_video: boolean;
510
- /** 背景音乐信息 */
511
- music?: {
512
- /** 音乐标题 */
513
- title: string;
514
- /** 音乐作者 */
515
- author: string;
516
- };
517
- };
518
- type UserVideoListData = {
519
- /** 用户基本信息 */
520
- user: {
521
- /** 头像图片(可能为 null) */
522
- head_image: string | null;
523
- /** 用户昵称 */
524
- nickname: string;
525
- /** 抖音号 */
526
- short_id: string;
527
- /** 头像URL */
528
- avatar: string;
529
- /** 用户签名/简介 */
530
- signature: string;
531
- /** 粉丝数 */
532
- follower_count: number;
533
- /** 关注数 */
534
- following_count: number;
535
- /** 获赞总数 */
536
- total_favorited: number;
537
- /** 是否认证 */
538
- verified: boolean;
539
- /** IP属地 */
540
- ip_location: string;
541
- };
542
- /** 视频列表 */
543
- videos: Array<VideoListItem>;
544
- /** 超时秒数 */
545
- timeoutSeconds?: number;
546
- };
547
- interface DouyinUserVideoListProps {
548
- data: UserVideoListData;
549
- }
550
- //#endregion
551
- //#region ../template/src/types/platforms/douyin/videoWork.d.ts
552
- /**
553
- * 抖音视频作品组件属性接口
554
- */
555
- interface DouyinVideoWorkProps extends BaseComponentProps<{
556
- /** 视频封面URL */
557
- image_url: string;
558
- /** 标题(视频作品主文案,含有效 @ 用户与 topic 节点) */
559
- title?: RichTextDocument;
560
- /** 描述内容(视频作品通常为空文档) */
561
- desc: RichTextDocument;
562
- /** IP 属地 */
563
- ip_location?: string;
564
- /** 热点搜索词 */
565
- suggest_word?: {
566
- hint_text: string;
567
- word: string;
568
- };
569
- /** 背景音乐信息 */
570
- music?: {
571
- /** 音乐作者 */
572
- author: string;
573
- /** 音乐标题 */
574
- title: string;
575
- /** 音乐封面 URL */
576
- cover?: string;
577
- };
578
- /** 视频时长(毫秒) */
579
- duration?: number;
580
- /** 点赞数 */
581
- dianzan: string;
582
- /** 评论数 */
583
- pinglun: string;
584
- /** 收藏数 */
585
- shouchang: string;
586
- /** 分享数 */
587
- share: string;
588
- /** 创建时间(Unix 时间戳,秒) */
589
- create_time: number;
590
- /** 用户头像URL */
591
- avater_url: string;
592
- /** 用户名 */
593
- username: string;
594
- /** 抖音号 */
595
- 抖音号: string;
596
- /** 获赞数 */
597
- 获赞: string;
598
- /** 关注数 */
599
- 关注: string;
600
- /** 粉丝数 */
601
- 粉丝: string;
602
- /** 分享链接 */
603
- share_url: string;
604
- /** 动态类型 */
605
- dynamicTYPE?: string;
606
- /** 合作信息 */
607
- cooperation_info?: {
608
- co_creator_nums: number;
609
- co_creators: Array<{
610
- avatar_url?: string;
611
- nickname: string;
612
- role_title: string;
613
- }>;
614
- subscriber_role?: string;
615
- };
616
- }> {}
617
- //#endregion
618
- //#region ../template/src/types/platforms/douyin/index.d.ts
619
- /** 抖音二维码登录组件属性 */
620
- interface DouyinQrcodeImgProps extends BaseComponentProps<{
621
- /** 分享链接(用于生成自定义二维码) */
622
- share_url?: string;
623
- }> {
624
- /** 是否使用深色主题 */
625
- useDarkTheme?: boolean;
626
- }
627
- //#endregion
628
- //#region ../template/src/types/platforms/bilibili/bangumi.d.ts
629
- /**
630
- * 徽章信息接口
631
- */
632
- interface BangumiBilibiliEpisodeBadgeInfo {
633
- /** 背景颜色 */
634
- bg_color: string;
635
- /** 夜间模式背景颜色 */
636
- bg_color_night: string;
637
- /** 徽章文本 */
638
- text: string;
639
- }
640
- /**
641
- * 番剧剧集信息接口
642
- */
643
- interface BangumiBilibiliEpisode {
644
- /** 剧集封面图片URL */
645
- cover: string;
646
- /** 视频BV号 */
647
- bvid: string;
648
- /** 剧集链接 */
649
- link: string;
650
- /** 剧集完整标题 */
651
- long_title: string;
652
- /** 发布时间戳 */
653
- pub_time: number;
654
- /** 徽章标识(如:限免、会员) */
655
- badge: string;
656
- /** 徽章详细信息 */
657
- badge_info: BangumiBilibiliEpisodeBadgeInfo;
658
- }
659
- /**
660
- * 番剧最新剧集信息接口
661
- */
662
- interface BangumiBilibiliNewEP {
663
- /** 剧集描述 */
664
- desc: string;
665
- /** 剧集ID */
666
- id: number;
667
- /** 是否为新剧集 */
668
- is_new: number;
669
- /** 剧集标题 */
670
- title: string;
671
- }
672
- /**
673
- * 番剧统计数据接口
674
- */
675
- interface BangumiBilibiliStat {
676
- /** 硬币数 */
677
- coins: number;
678
- /** 弹幕数 */
679
- danmakus: number;
680
- /** 收藏数 */
681
- favorite: number;
682
- /** 总收藏数 */
683
- favorites: number;
684
- /** 追番文本 */
685
- follow_text: string;
686
- /** 点赞数 */
687
- likes: number;
688
- /** 评论数 */
689
- reply: number;
690
- /** 分享数 */
691
- share: number;
692
- /** 播放量 */
693
- views: number;
694
- /** VT标识 */
695
- vt: number;
696
- }
697
- /**
698
- * UP主挂件信息接口
699
- */
700
- interface BangumiBilibiliPendant {
701
- /** 挂件图片URL */
702
- image: string;
703
- /** 挂件名称 */
704
- name: string;
705
- /** 挂件ID */
706
- pid: number;
707
- }
708
- /**
709
- * UP主VIP标签信息接口
710
- */
711
- interface BangumiBilibiliVipLabel {
712
- /** 背景颜色 */
713
- bg_color: string;
714
- /** 背景样式 */
715
- bg_style: number;
716
- /** 边框颜色 */
717
- border_color: string;
718
- /** 标签文本 */
719
- text: string;
720
- /** 文本颜色 */
721
- text_color: string;
722
- }
723
- /**
724
- * UP主信息接口
725
- */
726
- interface BangumiBilibiliUPInfo {
727
- /** 头像URL */
728
- avatar: string;
729
- /** 头像角标URL */
730
- avatar_subscript_url: string;
731
- /** 粉丝数 */
732
- follower: number;
733
- /** 是否已关注 */
734
- is_follow: number;
735
- /** 用户ID */
736
- mid: number;
737
- /** 昵称颜色 */
738
- nickname_color: string;
739
- /** 挂件信息 */
740
- pendant: BangumiBilibiliPendant;
741
- /** 主题类型 */
742
- theme_type: number;
743
- /** 用户名 */
744
- uname: string;
745
- /** 认证类型 */
746
- verify_type: number;
747
- /** VIP标签信息 */
748
- vip_label: BangumiBilibiliVipLabel;
749
- /** VIP状态 */
750
- vip_status: number;
751
- /** VIP类型 */
752
- vip_type: number;
753
- }
754
- /**
755
- * B站番剧组件数据接口
756
- */
757
- interface BangumiBilibiliData {
758
- /** 主封面图片URL */
759
- mainCover: string;
760
- /** 演员信息 */
761
- Actors: string;
762
- /** 番剧评价描述 */
763
- Evaluate: string;
764
- /** 番剧链接 */
765
- Link: string;
766
- /** 最新剧集信息 */
767
- newEP: BangumiBilibiliNewEP;
768
- /** 番剧标题 */
769
- Title: string;
770
- /** 番剧风格标签 */
771
- Styles: string[];
772
- /** 季度ID */
773
- seasonID: number;
774
- /** 副标题信息 */
775
- subtitle: string;
776
- /** UP主信息 */
777
- UPInfo: BangumiBilibiliUPInfo;
778
- /** 版权信息 */
779
- Copyright: string;
780
- /** 统计数据 */
781
- Stat: BangumiBilibiliStat;
782
- /** 剧集列表 */
783
- Episodes: BangumiBilibiliEpisode[];
784
- /** 剧集总数 */
785
- length: number;
786
- }
787
- /**
788
- * B站番剧组件属性接口
789
- */
790
- interface BilibiliBangumiProps extends BaseComponentProps<BangumiBilibiliData> {}
791
- //#endregion
792
- //#region ../template/src/types/platforms/bilibili/comment.d.ts
793
- /**
794
- * B站评论组件属性接口
795
- */
796
- interface BilibiliCommentProps extends BaseComponentProps<{
797
- /** 作品类型:视频/图集/动态 */
798
- Type: '视频' | '动态';
799
- /** 评论数量 */
800
- CommentLength: string;
801
- /** 视频大小(MB) */
802
- VideoSize?: string;
803
- /** 视频画质 */
804
- Clarity?: string;
805
- /** 图片数量 */
806
- ImageLength?: number;
807
- /** 分享链接 */
808
- shareurl: string;
809
- /** 分享URL */
810
- share_url: string;
811
- /** 视频分辨率 */
812
- Resolution: string | null;
813
- /** 评论数据 */
814
- CommentsData: CommentItem[];
815
- }> {}
816
- /**
817
- * 粉丝卡片信息接口
818
- */
819
- interface FanCardInfo {
820
- /** 卡片背景图片 */
821
- image: string | null;
822
- /** 序号前缀 */
823
- numPrefix: string;
824
- /** 序号描述 */
825
- numDesc: string;
826
- /** 渐变色样式 */
827
- gradientStyle: string;
828
- }
829
- /**
830
- * B站二级评论项数据接口
831
- */
832
- interface SubCommentItem {
833
- /** 用户头像URL */
834
- avatar: string;
835
- /** 用户昵称 */
836
- uname: string;
837
- /** 用户昵称颜色 */
838
- unameColor?: string | null;
839
- /** 用户等级 */
840
- level: number;
841
- /** 头像框 */
842
- frame?: string;
843
- /** 评论内容 */
844
- message: RichTextDocument;
845
- /** 评论所有图片 */
846
- pictures: string[];
847
- /** 创建时间戳(秒) */
848
- ctime: number;
849
- /** IP标签/地理位置 */
850
- location: string;
851
- /** 点赞数 */
852
- like: number;
853
- /** 是否为UP主评论 */
854
- isUP: boolean;
855
- /** VIP状态 */
856
- vipstatus?: number;
857
- /** 粉丝卡片信息 */
858
- fanCard?: FanCardInfo | null;
859
- /** 粉丝勋章详情 */
860
- fansDetail?: FansDetail | null;
861
- }
862
- /**
863
- * 粉丝勋章详情
864
- */
865
- interface FansDetail {
866
- /** 用户ID */
867
- uid: number;
868
- /** 勋章ID */
869
- medal_id: number;
870
- /** 勋章名称 */
871
- medal_name: string;
872
- /** 分数 */
873
- score: number;
874
- /** 等级 */
875
- level: number;
876
- /** 亲密度 */
877
- intimacy: number;
878
- /** 主播状态 */
879
- master_status: number;
880
- /** 是否领取 */
881
- is_receive: number;
882
- /** 勋章颜色(起始) */
883
- medal_color: number;
884
- /** 勋章颜色(结束) */
885
- medal_color_end: number;
886
- /** 边框颜色 */
887
- medal_color_border: number;
888
- /** 名称颜色 */
889
- medal_color_name: number;
890
- /** 等级颜色 */
891
- medal_color_level: number;
892
- /** 守护等级 */
893
- guard_level: number;
894
- /** 守护图标 */
895
- guard_icon: string;
896
- /** 荣誉图标 */
897
- honor_icon: string;
898
- /** 首图标(可选) */
899
- first_icon?: string;
900
- /** 等级背景色 */
901
- medal_level_bg_color: number;
902
- }
903
- /**
904
- * B站评论项数据接口
905
- */
906
- interface CommentItem {
907
- /** 用户头像URL */
908
- avatar: string;
909
- /** 用户昵称 */
910
- uname: string;
911
- /** 用户昵称颜色 */
912
- unameColor?: string | null;
913
- /** 用户等级 */
914
- level: number;
915
- /** 头像框 */
916
- frame?: string;
917
- /** 标签类型 (1=作者) */
918
- label_type?: number;
919
- /** 状态标签 */
920
- status_label?: string | null;
921
- /** 评论内容 */
922
- message: RichTextDocument;
923
- /** 评论所有图片 */
924
- pictures: string[];
925
- /** VIP状态 */
926
- vipstatus?: number;
927
- /** 贴纸 */
928
- sticker?: string;
929
- /** 创建时间戳(秒) */
930
- ctime: number;
931
- /** IP标签/地理位置 */
932
- location: string;
933
- /** 回复数量 */
934
- replylength: number;
935
- /** 点赞数 */
936
- like: number;
937
- /** 是否置顶评论 */
938
- isTop: boolean;
939
- /** 是否为UP主评论 */
940
- isUP: boolean;
941
- /** 二级评论列表 */
942
- replies?: SubCommentItem[];
943
- /** 粉丝卡片信息 */
944
- fanCard?: FanCardInfo | null;
945
- /** 粉丝勋章详情 */
946
- fansDetail?: FansDetail | null;
947
- }
948
- //#endregion
949
- //#region ../template/src/types/platforms/bilibili/dynamic/normal.d.ts
950
- /**
951
- * 装饰卡片数据
952
- */
953
- interface DecorationCardData {
954
- /** 卡片背景图片URL */
955
- card_url: string;
956
- /** 渐变颜色数组 */
957
- colors: string[];
958
- /** 卡片显示文字 */
959
- text: string;
960
- }
961
- /**
962
- * 用户名元数据,用于传递 VIP 状态和颜色信息
963
- */
964
- interface UsernameMetadata {
965
- /** 用户名 */
966
- name: string;
967
- /** VIP状态,1为年度大会员 */
968
- vipStatus: number;
969
- /** 昵称颜色,VIP用户特有 */
970
- nicknameColor: string | null;
971
- }
972
- /**
973
- * B站动态基础数据接口(所有动态类型共有的字段)
974
- */
975
- interface BilibiliDynamicBaseData {
976
- /** 用户头像URL */
977
- avatar_url: string;
978
- /** 头像框 */
979
- frame?: string;
980
- /** 用户名元数据 */
981
- usernameMeta: UsernameMetadata;
982
- /** 动态创建时间 */
983
- create_time: string;
984
- /** 装饰卡片 */
985
- decoration_card?: DecorationCardData;
986
- /** 点赞数 */
987
- dianzan: string | number;
988
- /** 评论数 */
989
- pinglun: string | number;
990
- /** 分享数 */
991
- share: string | number;
992
- /** 渲染时间 */
993
- render_time: string;
994
- /** 用户短ID */
995
- user_shortid: string | number;
996
- /** 获赞总数 */
997
- total_favorited: string | number;
998
- /** 关注数 */
999
- following_count: string | number;
1000
- /** 粉丝数 */
1001
- fans: string | number;
1002
- /** 动态类型 */
1003
- dynamicTYPE: string;
1004
- /** 动态ID */
1005
- dynamic_id: string;
1006
- /** 分享链接 */
1007
- share_url: string;
1008
- }
1009
- /**
1010
- * B站普通动态组件属性接口
1011
- */
1012
- interface BilibiliDynamicProps extends BaseComponentProps<BilibiliDynamicBaseData & {
1013
- /** 图文动态标题 */
1014
- title?: string;
1015
- /** 动态文本内容(富文本文档) */
1016
- text: RichTextDocument | null;
1017
- /** 图片URL数组 */
1018
- image_url: Array<{
1019
- image_src: string;
1020
- }>;
1021
- /** 图片布局方式 */
1022
- imageLayout: string;
1023
- /** 相关内容卡片 */
1024
- additional?: BilibiliAdditionalData;
1025
- }> {}
1026
- /**
1027
- * B站预约卡片数据接口
1028
- */
1029
- interface BilibiliReserveData {
1030
- /** 预约标题 */
1031
- title: string;
1032
- /** 时间信息 */
1033
- desc1: string;
1034
- /** 预约人数 */
1035
- desc2: string;
1036
- /** 预约奖励信息(可选) */
1037
- desc3?: string;
1038
- /** 按钮文本 */
1039
- buttonText: string;
1040
- }
1041
- /**
1042
- * B站投票卡片数据接口
1043
- */
1044
- interface BilibiliVoteData {
1045
- /** 投票标题 */
1046
- title: string;
1047
- /** 参与人数描述(如 "1703人参与") */
1048
- desc: string;
1049
- /** 投票状态: 4-已结束 */
1050
- status: number;
1051
- }
1052
- /**
1053
- * B站通用卡片数据接口(游戏等)
1054
- */
1055
- interface BilibiliCommonData {
1056
- /** 封面图 */
1057
- cover: string;
1058
- /** 标题 */
1059
- title: string;
1060
- /** 描述1(标签) */
1061
- desc1: string;
1062
- /** 描述2(副标题) */
1063
- desc2: string;
1064
- /** 按钮文本 */
1065
- button_text?: string;
1066
- /** 头部文本(如"相关游戏") */
1067
- head_text?: string;
1068
- /** 子类型 */
1069
- sub_type?: string;
1070
- }
1071
- /**
1072
- * B站视频跳转卡片数据接口(UGC)
1073
- */
1074
- interface BilibiliUgcData {
1075
- /** 封面图 */
1076
- cover: string;
1077
- /** 标题 */
1078
- title: string;
1079
- /** 时长(如 "08:01") */
1080
- duration: string;
1081
- /** 播放量(如 "12.6万播放") */
1082
- play: string;
1083
- /** 弹幕数(如 "1061弹幕") */
1084
- danmaku: string;
1085
- }
1086
- /**
1087
- * B站相关内容卡片联合类型
1088
- */
1089
- interface BilibiliAdditionalData {
1090
- /** 卡片类型 */
1091
- type: 'ADDITIONAL_TYPE_RESERVE' | 'ADDITIONAL_TYPE_VOTE' | 'ADDITIONAL_TYPE_COMMON' | 'ADDITIONAL_TYPE_UGC' | 'ADDITIONAL_TYPE_GOODS' | 'ADDITIONAL_TYPE_UPOWER_LOTTERY' | 'ADDITIONAL_TYPE_NONE';
1092
- /** 预约数据 */
1093
- reserve?: BilibiliReserveData;
1094
- /** 投票数据 */
1095
- vote?: BilibiliVoteData;
1096
- /** 通用卡片数据 */
1097
- common?: BilibiliCommonData;
1098
- /** 视频跳转数据 */
1099
- ugc?: BilibiliUgcData;
1100
- }
1101
- /**
1102
- * B站纯文动态组件属性接口
1103
- */
1104
- interface BilibiliWordDynamicProps extends BaseComponentProps<BilibiliDynamicBaseData & {
1105
- /** 动态文本内容(富文本文档) */
1106
- text: RichTextDocument | null;
1107
- /** 相关内容卡片 */
1108
- additional?: BilibiliAdditionalData;
1109
- }> {}
1110
- //#endregion
1111
- //#region ../template/src/types/platforms/bilibili/dynamic/article.d.ts
1112
- /**
1113
- * B站专栏动态组件属性接口
1114
- */
1115
- interface BilibiliArticleDynamicProps extends BaseComponentProps<{
1116
- /** 用户头像URL */
1117
- avatar_url: string;
1118
- /** 头像框 */
1119
- frame?: string;
1120
- /** 用户名元数据 */
1121
- usernameMeta: UsernameMetadata;
1122
- /** 动态创建时间 */
1123
- create_time: string;
1124
- /** 装饰卡片 */
1125
- decoration_card?: DecorationCardData;
1126
- /** 专栏标题 */
1127
- title: string;
1128
- /** 专栏摘要 */
1129
- summary: string;
1130
- /** 专栏封面图片URL */
1131
- banner_url?: string;
1132
- /** 专栏分类 */
1133
- categories: Array<{
1134
- id: number;
1135
- name: string;
1136
- parent_id: number;
1137
- }>;
1138
- /** 专栏字数 */
1139
- words: number;
1140
- /** 专栏统计数据 */
1141
- stats: {
1142
- /** 阅读数 */
1143
- view: number;
1144
- /** 点赞数 */
1145
- like: number;
1146
- /** 收藏数 */
1147
- favorite: number;
1148
- /** 评论数 */
1149
- reply: number;
1150
- /** 分享数 */
1151
- share: number;
1152
- /** 投币数 */
1153
- coin: number;
1154
- /** 转发动态 */
1155
- dynamic: number;
1156
- };
1157
- /** 专栏正文(richtext 格式) */
1158
- body: RichTextDocument;
1159
- /** 渲染时间 */
1160
- render_time: string;
1161
- /** 动态类型 */
1162
- dynamicTYPE: string;
1163
- /** 分享链接 */
1164
- share_url: string;
1165
- /** 用户短ID */
1166
- user_shortid: string | number;
1167
- /** 获赞总数 */
1168
- total_favorited: string | number;
1169
- /** 关注数 */
1170
- following_count: string | number;
1171
- /** 粉丝数 */
1172
- fans: string | number;
1173
- }> {}
1174
- //#endregion
1175
- //#region ../template/src/types/platforms/bilibili/dynamic/forward.d.ts
1176
- /**
1177
- * 原始内容AV类型接口
1178
- */
1179
- interface OriginalContentAV {
1180
- /** 用户头像URL */
1181
- avatar_url: string;
1182
- /** 头像框 */
1183
- frame?: string;
1184
- /** 用户名元数据 */
1185
- usernameMeta: UsernameMetadata;
1186
- /** 创建时间 */
1187
- create_time: string;
1188
- /** 装饰卡片 */
1189
- decoration_card?: DecorationCardData;
1190
- /** 视频封面 */
1191
- cover: string;
1192
- /** 视频时长文本 */
1193
- duration_text: string;
1194
- /** 播放量 */
1195
- play: string;
1196
- /** 弹幕数 */
1197
- danmaku: string;
1198
- /** 视频标题 */
1199
- title: RichTextDocument;
1200
- /** 动态文本内容(富文本文档) */
1201
- text: RichTextDocument;
1202
- }
1203
- /**
1204
- * 原始内容图文类型接口
1205
- */
1206
- interface OriginalContentDraw {
1207
- /** 标题 */
1208
- title?: string;
1209
- /** 用户头像URL */
1210
- avatar_url: string;
1211
- /** 头像框 */
1212
- frame?: string;
1213
- /** 用户名元数据 */
1214
- usernameMeta: UsernameMetadata;
1215
- /** 创建时间 */
1216
- create_time: string;
1217
- /** 装饰卡片 */
1218
- decoration_card?: DecorationCardData;
1219
- /** 动态文本内容(富文本文档) */
1220
- text: RichTextDocument;
1221
- /** 图片URL数组 */
1222
- image_url: Array<{
1223
- image_src: string;
1224
- }>;
1225
- }
1226
- /**
1227
- * 原始内容文字类型接口
1228
- */
1229
- interface OriginalContentWord {
1230
- /** 用户头像URL */
1231
- avatar_url: string;
1232
- /** 头像框 */
1233
- frame?: string;
1234
- /** 用户名元数据 */
1235
- usernameMeta: UsernameMetadata;
1236
- /** 创建时间 */
1237
- create_time: string;
1238
- /** 装饰卡片 */
1239
- decoration_card?: DecorationCardData;
1240
- /** 动态文本内容(富文本文档) */
1241
- text: RichTextDocument;
1242
- /** 相关内容卡片 */
1243
- additional?: BilibiliAdditionalData;
1244
- }
1245
- /**
1246
- * 原始内容直播推荐类型接口
1247
- */
1248
- interface OriginalContentLiveRcmd {
1249
- /** 用户头像URL */
1250
- avatar_url: string;
1251
- /** 头像框 */
1252
- frame?: string;
1253
- /** 用户名元数据 */
1254
- usernameMeta: UsernameMetadata;
1255
- /** 创建时间 */
1256
- create_time: string;
1257
- /** 装饰卡片 */
1258
- decoration_card?: DecorationCardData;
1259
- /** 直播封面 */
1260
- cover: string;
1261
- /** 分区名称 */
1262
- area_name: string;
1263
- /** 大文本 */
1264
- text_large: string;
1265
- /** 在线人数 */
1266
- online: string;
1267
- /** 直播标题 */
1268
- title: RichTextDocument;
1269
- }
1270
- /**
1271
- * 转发动态原始内容Props接口
1272
- */
1273
- interface BilibiliForwardOriginalContentProps {
1274
- /** 原始内容 */
1275
- original_content: {
1276
- /** AV类型内容 */
1277
- DYNAMIC_TYPE_AV?: OriginalContentAV;
1278
- /** 图文类型内容 */
1279
- DYNAMIC_TYPE_DRAW?: OriginalContentDraw;
1280
- /** 文字类型内容 */
1281
- DYNAMIC_TYPE_WORD?: OriginalContentWord;
1282
- /** 直播推荐类型内容 */
1283
- DYNAMIC_TYPE_LIVE_RCMD?: OriginalContentLiveRcmd;
1284
- };
1285
- }
1286
- /**
1287
- * B站转发动态组件属性接口
1288
- */
1289
- interface BilibiliForwardDynamicProps extends BaseComponentProps<BilibiliDynamicBaseData & {
1290
- /** 动态文本内容(富文本文档) */
1291
- text: RichTextDocument;
1292
- /** 原始内容 */
1293
- original_content: BilibiliForwardOriginalContentProps['original_content'];
1294
- /** 图片URL */
1295
- imgList: string[] | null;
1296
- }> {}
1297
- //#endregion
1298
- //#region ../template/src/types/platforms/bilibili/dynamic/live.d.ts
1299
- interface BilibiliPosterPalette {
1300
- bgColor: string;
1301
- primaryColor: string;
1302
- secondaryColor: string;
1303
- mutedColor: string;
1304
- accentColor: string;
1305
- deepColor: string;
1306
- coverShade: string;
1307
- }
1308
- interface BilibiliPosterPalettes {
1309
- light: BilibiliPosterPalette;
1310
- dark: BilibiliPosterPalette;
1311
- }
1312
- /**
1313
- * B站直播动态组件属性接口
1314
- */
1315
- interface BilibiliLiveDynamicProps extends BaseComponentProps<{
1316
- /** 直播封面 */
1317
- image_url: string;
1318
- /** 直播标题 */
1319
- text: RichTextDocument;
1320
- /** 直播房间信息(分区 | 房间号) */
1321
- liveinf: string;
1322
- /** 用户名元数据 */
1323
- usernameMeta: UsernameMetadata;
1324
- /** 用户头像URL */
1325
- avatar_url: string;
1326
- /** 头像框 */
1327
- frame?: string;
1328
- /** 粉丝数 */
1329
- fans: string;
1330
- /** 时间信息 */
1331
- create_time: string;
1332
- /** 直播开始时间 */
1333
- now_time: string;
1334
- /** 分享和配置 */
1335
- share_url: string;
1336
- /** 动态类型 */
1337
- dynamicTYPE: string;
1338
- }> {
1339
- /** 服务端预计算的海报色板(亮色/深色) */
1340
- posterPalettes?: BilibiliPosterPalettes;
1341
- /** 服务端预计算的海报色板 */
1342
- posterPalette?: BilibiliPosterPalette;
1343
- }
1344
- //#endregion
1345
- //#region ../template/src/types/platforms/bilibili/dynamic/video.d.ts
1346
- /**
1347
- * B站视频动态组件属性接口
1348
- */
1349
- interface BilibiliVideoDynamicProps extends BaseComponentProps<BilibiliDynamicBaseData & {
1350
- /** 视频标题 */
1351
- text: RichTextDocument;
1352
- /** 视频描述 */
1353
- desc: RichTextDocument;
1354
- /** 动态正文(富文本文档) */
1355
- dynamic_text: RichTextDocument | null;
1356
- /** 视频封面图片URL */
1357
- image_url: string;
1358
- /** 硬币数 */
1359
- coin: string | number;
1360
- /** 浏览量 */
1361
- view: string | number;
1362
- /** 视频时长 */
1363
- duration_text: string;
1364
- /** 视频分P数量 */
1365
- page_length: number;
1366
- /** 共创者列表 (可选) */
1367
- staff?: Array<{
1368
- /** 用户ID */
1369
- mid: number;
1370
- /** 职位标题 (UP主/参演) */
1371
- title: string;
1372
- /** 用户名 */
1373
- name: string;
1374
- /** 头像URL */
1375
- face: string;
1376
- /** 粉丝数 */
1377
- follower: number;
1378
- }>;
1379
- }> {}
1380
- //#endregion
1381
- //#region ../template/src/types/platforms/bilibili/userlist.d.ts
1382
- /**
1383
- * B站用户列表组件属性接口
1384
- */
1385
- interface BilibiliUserListProps extends BaseComponentProps<{
1386
- /** 群组信息 */
1387
- groupInfo: {
1388
- /** 群号 */
1389
- groupId: string;
1390
- /** 群名称 */
1391
- groupName: string;
1392
- /** 群头像 */
1393
- groupAvatar: string;
1394
- };
1395
- /** 用户列表数据 */
1396
- renderOpt: {
1397
- /** 用户头像图片URL */
1398
- avatar_img: string;
1399
- /** 用户名 */
1400
- username: string;
1401
- /** 用户UID */
1402
- host_mid: string;
1403
- /** 粉丝数 */
1404
- fans: string;
1405
- /** 获赞总数 */
1406
- total_favorited: string;
1407
- /** 关注数 */
1408
- following_count: string;
1409
- /** 全局推送开关状态 */
1410
- switch: boolean;
1411
- /** 推送类型列表 */
1412
- pushTypes?: ('video' | 'draw' | 'word' | 'live' | 'forward' | 'article')[];
1413
- }[];
1414
- }> {}
1415
- //#endregion
1416
- //#region ../template/src/types/platforms/bilibili/videoInfo.d.ts
1417
- /**
1418
- * B站视频统计数据接口
1419
- */
1420
- interface BilibiliVideoStat {
1421
- /** 视频AV号 */
1422
- aid: number;
1423
- /** 播放量 */
1424
- view: number;
1425
- /** 弹幕数 */
1426
- danmaku: number;
1427
- /** 评论数 */
1428
- reply: number;
1429
- /** 收藏数 */
1430
- favorite: number;
1431
- /** 投币数 */
1432
- coin: number;
1433
- /** 分享数 */
1434
- share: number;
1435
- /** 当前排名 */
1436
- now_rank: number;
1437
- /** 历史最高排名 */
1438
- his_rank: number;
1439
- /** 点赞数 */
1440
- like: number;
1441
- /** 点踩数 */
1442
- dislike: number;
1443
- /** 评价 */
1444
- evaluation: string;
1445
- /** VT标识 */
1446
- vt: number;
1447
- }
1448
- /**
1449
- * B站视频UP主信息接口
1450
- */
1451
- interface BilibiliVideoOwner {
1452
- /** UP主用户ID */
1453
- mid: number;
1454
- /** UP主昵称 */
1455
- name: string;
1456
- /** UP主头像URL */
1457
- face: string;
1458
- /** 用户名元数据(VIP颜色等) */
1459
- usernameMeta?: UsernameMetadata;
1460
- /** 头像框图片URL */
1461
- frame?: string;
1462
- }
1463
- /**
1464
- * 热门弹幕项接口(相同内容的弹幕聚合)
1465
- */
1466
- interface BilibiliHotDanmaku {
1467
- /** 弹幕内容 */
1468
- content: string;
1469
- /** 出现次数 */
1470
- count: number;
1471
- }
1472
- /**
1473
- * B站视频信息数据接口
1474
- */
1475
- interface BilibiliVideoInfoData {
1476
- /** 分享链接 */
1477
- share_url: string;
1478
- /** 视频标题 */
1479
- title: string;
1480
- /** 视频简介(富文本格式) */
1481
- desc: RichTextDocument;
1482
- /** 统计数据 */
1483
- stat: BilibiliVideoStat;
1484
- /** 视频BV号 */
1485
- bvid: string;
1486
- /** 创建时间戳 */
1487
- ctime: number;
1488
- /** 视频封面图片URL */
1489
- pic: string;
1490
- /** UP主信息 */
1491
- owner: BilibiliVideoOwner;
1492
- /** 出现次数最多的热门弹幕(可选,按次数降序) */
1493
- hotDanmaku?: BilibiliHotDanmaku[];
1494
- }
1495
- /**
1496
- * B站视频信息组件属性接口
1497
- */
1498
- interface BilibiliVideoInfoProps extends BaseComponentProps<BilibiliVideoInfoData> {}
1499
- //#endregion
1500
- //#region ../template/src/types/platforms/bilibili/index.d.ts
1501
- /** B站二维码登录组件属性 */
1502
- interface BilibiliQrcodeImgProps extends BaseComponentProps<{
1503
- /** 分享链接 */
1504
- share_url: string;
1505
- }> {}
1506
- //#endregion
1507
- //#region ../template/src/types/platforms/kuaishou/comment.d.ts
1508
- /**
1509
- * 快手评论组件属性接口
1510
- */
1511
- interface KuaishouCommentProps extends BaseComponentProps<{
1512
- /** 作品类型:视频/图集 */
1513
- Type: '视频' | '图集';
1514
- /** 评论数量 */
1515
- CommentLength: number;
1516
- /** 视频大小(MB) */
1517
- VideoSize?: string;
1518
- /** 点赞数量 */
1519
- likeCount?: number;
1520
- /** 观看次数 */
1521
- viewCount?: number;
1522
- /** 图片数量 */
1523
- ImageLength?: number;
1524
- /** 分享链接 */
1525
- share_url: string;
1526
- /** 评论数据 */
1527
- CommentsData: KuaishouCommentItem[];
1528
- }> {}
1529
- /**
1530
- * 快手评论项数据接口
1531
- */
1532
- interface KuaishouCommentItem {
1533
- /** 评论ID */
1534
- cid: string;
1535
- /** 作品ID */
1536
- aweme_id: string;
1537
- /** 用户昵称 */
1538
- nickname: string;
1539
- /** 用户头像URL */
1540
- userimageurl: string;
1541
- /** 评论内容 */
1542
- text: RichTextDocument;
1543
- /** 点赞数 */
1544
- digg_count: number;
1545
- /** 创建时间戳(毫秒) */
1546
- create_time: number;
1547
- /** 评论图片 */
1548
- commentimage?: string;
1549
- /** 贴纸 */
1550
- sticker?: string;
1551
- /** 回复数量 */
1552
- reply_comment_total?: number;
1553
- /** IP标签 */
1554
- ip_label?: string;
1555
- }
1556
- //#endregion
1557
- //#region ../template/src/types/platforms/xiaohongshu/comment.d.ts
1558
- /**
1559
- * 小红书评论组件属性接口
1560
- */
1561
- interface XiaohongshuCommentProps extends BaseComponentProps<{
1562
- /** 笔记类型:图文/视频 */
1563
- Type: '图文' | '视频';
1564
- /** 评论数量 */
1565
- CommentLength: number;
1566
- /** 图片数量 */
1567
- ImageLength?: number;
1568
- /** 分享链接 */
1569
- share_url: string;
1570
- /** 评论数据 - 简化为直接的评论数组 */
1571
- CommentsData: XiaohongshuCommentItem[];
1572
- }> {}
1573
- /**
1574
- * 小红书评论项数据接口
1575
- */
1576
- interface XiaohongshuCommentItem {
1577
- /** 评论ID */
1578
- id: string;
1579
- /** 笔记ID */
1580
- note_id: string;
1581
- /** 评论内容 */
1582
- content: RichTextDocument;
1583
- /** 用户信息 */
1584
- user_info: {
1585
- user_id: string;
1586
- nickname: string;
1587
- image: string;
1588
- xsec_token: string;
1589
- };
1590
- /** 创建时间戳(毫秒) */
1591
- create_time: number;
1592
- /** IP位置 */
1593
- ip_location: string;
1594
- /** 点赞数 */
1595
- like_count: string;
1596
- /** 是否已点赞 */
1597
- liked: boolean;
1598
- /** 评论图片 */
1599
- pictures: Array<{
1600
- height: number;
1601
- width: number;
1602
- url_pre: string;
1603
- url_default: string;
1604
- info_list: Array<{
1605
- image_scene: string;
1606
- url: string;
1607
- }>;
1608
- }>;
1609
- /** 子评论数量 */
1610
- sub_comment_count: string;
1611
- /** 子评论列表 */
1612
- sub_comments: XiaohongshuSubComment[];
1613
- /** 显示标签 */
1614
- show_tags: string[];
1615
- /** @用户列表 */
1616
- at_users: string[];
1617
- /** 状态 */
1618
- status: number;
1619
- }
1620
- /**
1621
- * 小红书子评论数据接口
1622
- */
1623
- interface XiaohongshuSubComment {
1624
- /** 子评论ID */
1625
- id: string;
1626
- /** 笔记ID */
1627
- note_id: string;
1628
- /** 评论内容 */
1629
- content: RichTextDocument;
1630
- /** 用户信息 */
1631
- user_info: {
1632
- user_id: string;
1633
- nickname: string;
1634
- image: string;
1635
- xsec_token: string;
1636
- };
1637
- /** 创建时间戳(毫秒) */
1638
- create_time: number;
1639
- /** IP位置 */
1640
- ip_location: string;
1641
- /** 点赞数 */
1642
- like_count: string;
1643
- /** 是否已点赞 */
1644
- liked: boolean;
1645
- /** 评论图片 */
1646
- pictures: string[];
1647
- /** 显示标签 */
1648
- show_tags: string[];
1649
- /** @用户列表 */
1650
- at_users: string[];
1651
- /** 状态 */
1652
- status: number;
1653
- /** 目标评论 */
1654
- target_comment?: {
1655
- id: string;
1656
- user_info: {
1657
- user_id: string;
1658
- nickname: string;
1659
- image: string;
1660
- xsec_token: string;
1661
- };
1662
- };
1663
- }
1664
- //#endregion
1665
- //#region ../template/src/types/platforms/xiaohongshu/noteInfo.d.ts
1666
- /**
1667
- * 小红书笔记统计信息接口
1668
- */
1669
- interface XiaohongshuNoteStatistics {
1670
- /** 分享数 */
1671
- share_count: string | number;
1672
- /** 是否已关注 */
1673
- followed: boolean;
1674
- /** 关系状态 */
1675
- relation: string;
1676
- /** 是否已点赞 */
1677
- liked: boolean;
1678
- /** 点赞数 */
1679
- liked_count: string | number;
1680
- /** 是否已收藏 */
1681
- collected: boolean;
1682
- /** 收藏数 */
1683
- collected_count: string | number;
1684
- /** 评论数 */
1685
- comment_count: string | number;
1686
- }
1687
- /**
1688
- * 小红书作者信息接口
1689
- */
1690
- interface XiaohongshuAuthor {
1691
- /** xsec_token */
1692
- xsec_token?: string;
1693
- /** 用户ID */
1694
- user_id: string;
1695
- /** 用户昵称 */
1696
- nickname: string;
1697
- /** 用户头像URL */
1698
- avatar: string;
1699
- }
1700
- /**
1701
- * 小红书笔记信息数据接口
1702
- */
1703
- interface XiaohongshuNoteInfoData {
1704
- /** 笔记标题 */
1705
- title: string;
1706
- /** 笔记描述 */
1707
- desc: RichTextDocument;
1708
- /** 统计信息 */
1709
- statistics: XiaohongshuNoteStatistics;
1710
- /** 笔记ID */
1711
- note_id: string;
1712
- /** 作者信息 */
1713
- author: XiaohongshuAuthor;
1714
- /** 笔记封面图片URL */
1715
- image_url: string;
1716
- /** 创建时间戳 */
1717
- time: number;
1718
- /** IP位置 */
1719
- ip_location: string;
1720
- }
1721
- /**
1722
- * 小红书笔记信息组件属性接口
1723
- */
1724
- interface XiaohongshuNoteInfoProps extends BaseComponentProps<XiaohongshuNoteInfoData> {}
1725
- //#endregion
1726
- //#region ../template/src/types/platforms/other/help.d.ts
1727
- /**
1728
- * 帮助页面组件属性接口
1729
- */
1730
- interface HelpProps extends BaseComponentProps<{
1731
- /** 页面标题 */
1732
- title?: string;
1733
- /** 角色:主人/普通 */
1734
- role?: 'master' | 'member';
1735
- /** 菜单数据:按角色筛选后的分组 */
1736
- menu?: MenuGroup[];
1737
- /** 简单的列表数据 (用于 Help.tsx 渲染) */
1738
- list: {
1739
- title: string;
1740
- description: string;
1741
- }[];
1742
- }> {}
1743
- /**
1744
- * 菜单项接口
1745
- */
1746
- interface MenuItem {
1747
- /** 菜单项标题 */
1748
- title: string;
1749
- /** 菜单项描述 */
1750
- description: string;
1751
- /** 图标:可以是图标名称字符串,或带颜色的对象 */
1752
- icon?: string | {
1753
- name: string;
1754
- color?: string;
1755
- };
1756
- }
1757
- /**
1758
- * 菜单分组接口
1759
- */
1760
- interface MenuGroup {
1761
- /** 分组标题 */
1762
- title: string;
1763
- /** 菜单项列表 */
1764
- items: MenuItem[];
1765
- /** 子分组(可选) */
1766
- subGroups?: {
1767
- /** 子分组标题 */
1768
- title: string;
1769
- /** 子分组菜单项 */
1770
- items: MenuItem[];
1771
- }[];
1772
- }
1773
- //#endregion
1774
- //#region ../../node_modules/.pnpm/node-karin@1.16.2/node_modules/node-karin/dist/index.d.ts
1775
- //#endregion
1776
- //#region src/types/adapter/info.d.ts
1777
- /**
1778
- * 适配器所属平台
1779
- * - `qq`: QQ
1780
- * - `wechat`: 微信
1781
- * - `wecom`: 企业微信
1782
- * - `telegram`: Telegram
1783
- * - `discord`: Discord
1784
- * - `koko`: 开黑吧
1785
- * - `dingtalk`: 钉钉
1786
- * - `feishu`: 飞书
1787
- * - `slack`: Slack
1788
- * - `whatsapp`: WhatsApp
1789
- * - `other`: 其他
1790
- */
1791
- type AdapterPlatform = 'qq' | 'wechat' | 'telegram' | 'discord' | 'koko' | 'dingtalk' | 'feishu' | 'slack' | 'wecom' | 'whatsapp' | 'other' | (string & {});
1792
- /**
1793
- * 适配器所使用的标准接口协议
1794
- * - `onebot11`: OneBot v11 标准
1795
- * - `onebot12`: OneBot v12 标准
1796
- * - `oicq`: OICQ 标准
1797
- * - `icqq`: OICQ fork 标准
1798
- * - `milky`: Milky 标准
1799
- * - `satori`: Satori 标准
1800
- * - `other`: 其他标准
1801
- */
1802
- type AdapterStandard = 'onebot11' | 'onebot12' | 'oicq' | 'icqq' | 'milky' | 'satori' | 'other' | (string & {});
1803
- /**
1804
- * 适配器协议实现名称
1805
- * - `console`: 控制台
1806
- * - `qqbot`: https://bot.q.qq.com/wiki
1807
- * - `icqq`: https://github.com/icqqjs/icqq
1808
- * - `gocq-http`: https://docs.go-cqhttp.org/
1809
- * - `napcat`: https://napneko.github.io/zh-CN/
1810
- * - `oicq`: https://github.com/takayama-lily/oicq
1811
- * - `llonebot`: https://llonebot.github.io/zh-CN/
1812
- * - `conwechat`: https://justundertaker.github.io/ComWeChatBotClient/
1813
- * - `lagrange`: https://lagrangedev.github.io/Lagrange.Doc/Lagrange.OneBot/
1814
- * - `yogurt`: https://acidify.ntqqrev.org/
1815
- */
1816
- type AdapterProtocol = 'qqbot' | 'icqq' | 'gocq-http' | 'napcat' | 'oicq' | 'llonebot' | 'conwechat' | 'lagrange' | 'console' | 'yogurt' | 'other' | (string & {});
1817
- /**
1818
- * 适配器通信方式
1819
- * - `http`: HTTP 通信
1820
- * - `webSocketServer`: WebSocket 服务端
1821
- * - `webSocketClient`: WebSocket 客户端
1822
- * - `grpc`: gRPC 通信
1823
- * - `sse`: Server-Sent Events 通信
1824
- * - `other`: 其他通信方式
1825
- */
1826
- type AdapterCommunication = 'http' | 'webSocketServer' | 'webSocketClient' | 'grpc' | 'sse' | 'other' | (string & {});
1827
- /**
1828
- * 适配器基本信息
1829
- */
1830
- interface AdapterInfo$1 {
1831
- /** 适配器索引 默认为-1 在注册适配器时会自动更改为对应的索引 */
1832
- index: number;
1833
- /** 适配器名称 如lagrange-onebot */
1834
- name: string;
1835
- /** 适配器版本 */
1836
- version: string;
1837
- /** 适配器平台 */
1838
- platform: AdapterPlatform;
1839
- /** 适配器使用的协议标准 如onebot11 */
1840
- standard: AdapterStandard;
1841
- /** 适配器协议实现 如gocq、napcat */
1842
- protocol: AdapterProtocol;
1843
- /** 适配器通信方式 */
1844
- communication: AdapterCommunication;
1845
- /**
1846
- * 适配器通信地址
1847
- * @example `http://127.0.0.1:7000`
1848
- * @example `ws://127.0.0.1:7000/ws`
1849
- * @example `grpc://127.0.0.1:7001`
1850
- * @example `internal://127.0.0.1`
1851
- */
1852
- address: string;
1853
- /** 连接时间 */
1854
- connectTime: number;
1855
- /** 鉴权秘钥 */
1856
- secret: string | null;
1857
- }
1858
- //#endregion
1859
- //#region ../template/src/types/platforms/other/handlerError.d.ts
1860
- /**
1861
- * 业务错误类型
1862
- */
1863
- interface BusinessError {
1864
- /** 错误消息 */
1865
- message: string;
1866
- /** 错误名称 */
1867
- name: string;
1868
- /** 调用栈信息 */
1869
- stack: string;
1870
- /** 业务名称 */
1871
- businessName: string;
1872
- }
1873
- /**
1874
- * 日志等级类型
1875
- */
1876
- type LogLevel = 'TRAC' | 'DEBU' | 'MARK' | 'INFO' | 'ERRO' | 'WARN' | 'FATA';
1877
- /**
1878
- * 日志条目接口
1879
- */
1880
- interface LogEntry {
1881
- /** 时间戳 */
1882
- timestamp: string;
1883
- /** 日志等级 */
1884
- level: LogLevel;
1885
- /** 日志内容 */
1886
- message: string;
1887
- /** 原始日志字符串 */
1888
- raw: string;
1889
- }
1890
- /**
1891
- * 适配器信息接口
1892
- */
1893
- type AdapterInfo = Omit<AdapterInfo$1, 'index' | 'secret' | 'connectTime' | 'address'>;
1894
- /**
1895
- * API错误组件属性接口
1896
- */
1897
- interface ApiErrorProps extends BaseComponentProps<{
1898
- /** 错误类型 */
1899
- type: 'business_error';
1900
- /** 平台名称 */
1901
- platform: 'douyin' | 'bilibili' | 'kuaishou' | 'system' | 'unknown';
1902
- /** 错误信息 */
1903
- error: BusinessError;
1904
- /** 调用的方法名 */
1905
- method: string;
1906
- /** 错误发生时间 */
1907
- timestamp: string;
1908
- /** 收集到的日志信息 */
1909
- logs?: LogEntry[];
1910
- /** 触发命令 */
1911
- triggerCommand?: string;
1912
- /** 框架版本 */
1913
- frameworkVersion: string;
1914
- /** 插件版本 */
1915
- pluginVersion: string;
1916
- /** 构建时间 */
1917
- buildTime?: string;
1918
- /** Commit ID */
1919
- commitHash?: string;
1920
- /** 适配器信息 */
1921
- adapterInfo?: AdapterInfo;
1922
- /** 是否为验证流程 */
1923
- isVerification?: boolean;
1924
- /** 验证链接 */
1925
- verificationUrl?: string;
1926
- /** 分享链接(用于生成二维码) */
1927
- share_url?: string;
1928
- }> {}
1929
- //#endregion
1930
- //#region ../template/src/types/platforms/other/changelog.d.ts
1931
- /**
1932
- * 更新日志组件属性接口
1933
- */
1934
- interface ChangelogProps extends BaseComponentProps<{
1935
- /** 是否包含更新提示 */
1936
- Tip?: boolean;
1937
- /** 后端传入的 Markdown 源码 */
1938
- markdown: string;
1939
- /** 本地版本号 */
1940
- localVersion: string;
1941
- /** 远程版本号 */
1942
- remoteVersion: string;
1943
- /** 落后的版本数量 */
1944
- lagVersionCount?: number;
1945
- /** 构建时间 */
1946
- buildTime?: string;
1947
- /** 版本差异对比页面分享链接 */
1948
- share_url?: string;
1949
- }> {}
1950
- //#endregion
1951
- //#region ../template/src/types/platforms/other/runtime.d.ts
1952
- type RuntimeBuildState = 'matched' | 'mismatched' | 'unavailable';
1953
- /**
1954
- * 运行环境诊断海报属性。
1955
- *
1956
- * 所有字段均由 core 在消息触发时采集,模板只负责展示经过脱敏的可序列化数据。
1957
- */
1958
- interface RuntimeReportProps extends BaseComponentProps<{
1959
- /** 快照生成时间 */
1960
- snapshotAt: string;
1961
- /** 插件、框架与构建身份 */
1962
- identity: {
1963
- pluginName: string;
1964
- pluginVersion: string;
1965
- karinVersion: string;
1966
- releaseType: 'Stable' | 'Preview';
1967
- requiredNodeVersion: string;
1968
- requiredKarinVersion: string;
1969
- };
1970
- /** 当前构建指纹 */
1971
- build: {
1972
- state: RuntimeBuildState;
1973
- version?: string;
1974
- buildTime?: string;
1975
- shortCommitHash?: string;
1976
- };
1977
- /** Node.js 与操作系统运行时 */
1978
- runtime: {
1979
- nodeVersion: string;
1980
- nodeEnv: string;
1981
- os: string;
1982
- platform: string;
1983
- arch: string;
1984
- timezone: string;
1985
- container: boolean;
1986
- systemUptime: string;
1987
- processUptime: string;
1988
- };
1989
- /** 当前消息所使用的适配器 */
1990
- adapter: {
1991
- name: string;
1992
- version: string;
1993
- platform: string;
1994
- protocol: string;
1995
- standard: string;
1996
- communication: string;
1997
- connectedFor: string;
1998
- };
1999
- /** 截图渲染配置 */
2000
- renderer: {
2001
- scale: string;
2002
- timeout: string;
2003
- multiPage: boolean;
2004
- };
2005
- /** 不含主机身份信息的资源快照 */
2006
- resources: {
2007
- cpuModel: string;
2008
- cpuCores: number;
2009
- totalMemory: string;
2010
- usedMemory: string;
2011
- memoryUsagePercent: string;
2012
- processRss: string;
2013
- heapUsed: string;
2014
- };
2015
- /** 当前插件版本的变更日志 */
2016
- releaseNotes: {
2017
- markdown: string;
2018
- available: boolean;
2019
- };
2020
- }> {}
2021
- //#endregion
2022
- //#region ../template/src/types/platforms/other/VersionWarningProps.d.ts
2023
- interface VersionWarningProps extends BaseComponentProps<{
2024
- /** 插件构建时的 karin 版本 */
2025
- requireVersion: string;
2026
- /** 当前运行的 karin 版本 */
2027
- currentVersion: string;
2028
- }> {}
2029
- //#endregion
2030
- //#region ../template/src/types/platforms/other/qrlogin.d.ts
2031
- /** APP 扫码登录组件属性 */
2032
- interface QrLoginProps extends BaseComponentProps<{
2033
- /** 服务器地址 */
2034
- serverUrl: string;
2035
- /** 分享链接(用于生成二维码) */
2036
- share_url: string;
2037
- }> {}
2038
- //#endregion
2039
- //#region ../template/src/types/platforms/other/livePhotoTip.d.ts
2040
- interface LivePhotoTipProps extends BaseComponentProps<{
2041
- /** 提示标题 */
2042
- title?: string;
2043
- /** 附加说明 */
2044
- description?: string;
2045
- }> {}
2046
- //#endregion
2047
- //#region ../template/src/types/platforms/other/statistics.d.ts
2048
- /**
2049
- * 群组解析统计数据接口
2050
- */
2051
- interface GroupStatisticsProps extends BaseComponentProps<{
2052
- /** 群组ID */
2053
- groupId: string;
2054
- /** 群组名称 */
2055
- groupName?: string;
2056
- /** 群组人数 */
2057
- groupMemberCount?: number;
2058
- /** 群组头像 */
2059
- groupAvatar?: string;
2060
- /** 群组总解析次数 */
2061
- groupTotalParses: number;
2062
- /** 群组唯一用户数 */
2063
- groupUniqueUsers: number;
2064
- /** 各平台解析数据 */
2065
- platformData: {
2066
- douyin: number;
2067
- bilibili: number;
2068
- kuaishou: number;
2069
- xiaohongshu: number;
2070
- };
2071
- /** 全局总群组数 */
2072
- globalTotalGroups: number;
2073
- /** 全局总解析次数 */
2074
- globalTotalParses: number;
2075
- }> {}
2076
- /**
2077
- * 全局解析统计数据接口
2078
- */
2079
- interface GlobalStatisticsProps extends BaseComponentProps<{
2080
- /** 所有统计数据 */
2081
- allStats: Array<{
2082
- id: number;
2083
- groupId: string;
2084
- userId: string;
2085
- platform: 'douyin' | 'bilibili' | 'kuaishou' | 'xiaohongshu';
2086
- parseCount: number;
2087
- createdAt: string;
2088
- updatedAt: string;
2089
- }>;
2090
- /** 历史数据(最近30天) */
2091
- historyData: Array<{
2092
- date: string;
2093
- totalParses: number;
2094
- douyin: number;
2095
- bilibili: number;
2096
- kuaishou: number;
2097
- xiaohongshu: number;
2098
- }>;
2099
- /** 群组信息映射 */
2100
- groupInfoMap: Record<string, {
2101
- groupName?: string;
2102
- groupAvatar?: string;
2103
- }>;
2104
- }> {}
2105
- //#endregion
2106
- //#region ../template/src/types/index.d.ts
2107
- /**
2108
- * 渲染请求参数接口
2109
- */
2110
- interface RenderRequest<T = Record<string, unknown>> {
2111
- /** 模板类型 */
2112
- templateType: 'douyin' | 'bilibili' | 'kuaishou' | 'other' | 'apiError';
2113
- /** 模板名称 */
2114
- templateName: string;
2115
- /** 缩放比例 */
2116
- scale?: number;
2117
- /** 是否使用深色主题 */
2118
- useDarkTheme: boolean;
2119
- /** 版本信息 */
2120
- version?: {
2121
- /** 框架插件 */
2122
- plugin: string;
2123
- /** 插件名称 */
2124
- pluginName: string;
2125
- /** 插件版本 */
2126
- pluginVersion: string;
2127
- /** 发布类型 */
2128
- releaseType: 'Stable' | 'Preview';
2129
- /** 驱动框架 */
2130
- poweredBy: string;
2131
- /** 框架版本 */
2132
- frameworkVersion: string;
2133
- /** 是否有可用更新 */
2134
- hasUpdate?: boolean;
2135
- };
2136
- /** 水印比特大小 */
2137
- watermarkTextBitSize: number;
2138
- /** 渲染数据 */
2139
- data: T & {
2140
- /** 是否使用深色主题 */
2141
- useDarkTheme?: boolean;
2142
- /** 二维码分享链接 */
2143
- share_url?: string;
2144
- };
2145
- }
2146
- /**
2147
- * 渲染响应结果接口
2148
- */
2149
- interface RenderResponse {
2150
- /** 是否成功 */
2151
- success: boolean;
2152
- /** HTML文件路径 */
2153
- htmlPath: string;
2154
- /** 错误信息 */
2155
- error?: string;
2156
- }
2157
- /**
2158
- * 组件属性基础接口 - 泛型T为子组件的具体数据类型
2159
- * @template T 子组件的数据类型
2160
- */
2161
- interface BaseComponentProps<T = Record<string, any>> extends Pick<RenderRequest, 'version' | 'scale'> {
2162
- /** 水印比特大小 */
2163
- watermarkTextBitSize?: RenderRequest['watermarkTextBitSize'];
2164
- /** 渲染数据 - 子组件的具体参数 */
2165
- data: T & {
2166
- /** 是否使用深色主题 */
2167
- useDarkTheme: boolean;
2168
- };
2169
- }
2170
- /**
2171
- * 抖音平台组件ID
2172
- */
2173
- type DouyinComponentIds = 'article-work' | 'comment' | 'dynamic' | 'favorite-list' | 'image-work' | 'live' | 'musicinfo' | 'recommend-list' | 'user_profile' | 'userlist' | 'video-work' | 'user_videolist' | 'qrcodeImg';
2174
- /**
2175
- * B站平台组件ID
2176
- */
2177
- type BilibiliComponentIds = 'comment' | 'userlist' | 'bangumi' | 'videoInfo' | 'qrcodeImg' | 'dynamic/DYNAMIC_TYPE_DRAW' | 'dynamic/DYNAMIC_TYPE_AV' | 'dynamic/DYNAMIC_TYPE_FORWARD' | 'dynamic/DYNAMIC_TYPE_LIVE_RCMD' | 'dynamic/DYNAMIC_TYPE_WORD' | 'dynamic/DYNAMIC_TYPE_ARTICLE';
2178
- /**
2179
- * 快手平台组件ID
2180
- */
2181
- type KuaishouComponentIds = 'comment';
2182
- /**
2183
- * 小红书平台组件ID
2184
- */
2185
- type XiaohongshuComponentIds = 'noteInfo' | 'comment';
2186
- /**
2187
- * 其他平台组件ID
2188
- */
2189
- type OtherComponentIds = 'help' | 'handlerError' | 'changelog' | 'runtime' | 'version_warning' | 'qrlogin' | 'live-photo-tip';
2190
- /**
2191
- * 统计平台组件ID
2192
- */
2193
- type StatisticsComponentIds = 'group' | 'global';
2194
- /**
2195
- * 路径类型
2196
- */
2197
- type DynamicRenderPath = `douyin/${DouyinComponentIds}` | `bilibili/${BilibiliComponentIds}` | `kuaishou/${KuaishouComponentIds}` | `xiaohongshu/${XiaohongshuComponentIds}` | `other/${OtherComponentIds}` | `statistics/${StatisticsComponentIds}`;
2198
- /**
2199
- * 路径到数据类型的精确映射接口
2200
- */
2201
- interface PathToDataTypeMap {
2202
- 'douyin/comment': DouyinCommentProps['data'];
2203
- 'douyin/dynamic': DouyinDynamicProps['data'];
2204
- 'douyin/favorite-list': DouyinFavoriteListProps['data'];
2205
- 'douyin/image-work': DouyinImageWorkProps['data'];
2206
- 'douyin/article-work': DouyinArticleWorkProps['data'];
2207
- 'douyin/live': DouyinLiveProps['data'];
2208
- 'douyin/musicinfo': DouyinMusicInfoProps['data'];
2209
- 'douyin/recommend-list': DouyinRecommendListProps['data'];
2210
- 'douyin/user_profile': DouyinUserVideoListProps['data'];
2211
- 'douyin/userlist': DouyinUserListProps['data'];
2212
- 'douyin/video-work': DouyinVideoWorkProps['data'];
2213
- 'douyin/qrcodeImg': DouyinQrcodeImgProps['data'];
2214
- 'bilibili/comment': BilibiliCommentProps['data'];
2215
- 'bilibili/userlist': BilibiliUserListProps['data'];
2216
- 'bilibili/bangumi': BilibiliBangumiProps['data'];
2217
- 'bilibili/videoInfo': BilibiliVideoInfoProps['data'];
2218
- 'bilibili/qrcodeImg': BilibiliQrcodeImgProps['data'];
2219
- 'bilibili/dynamic/DYNAMIC_TYPE_DRAW': BilibiliDynamicProps['data'];
2220
- 'bilibili/dynamic/DYNAMIC_TYPE_AV': BilibiliVideoDynamicProps['data'];
2221
- 'bilibili/dynamic/DYNAMIC_TYPE_FORWARD': BilibiliForwardDynamicProps['data'];
2222
- 'bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD': BilibiliLiveDynamicProps['data'];
2223
- 'bilibili/dynamic/DYNAMIC_TYPE_ARTICLE': BilibiliArticleDynamicProps['data'];
2224
- 'bilibili/dynamic/DYNAMIC_TYPE_WORD': BilibiliWordDynamicProps['data'];
2225
- 'kuaishou/comment': KuaishouCommentProps['data'];
2226
- 'xiaohongshu/noteInfo': XiaohongshuNoteInfoProps['data'];
2227
- 'xiaohongshu/comment': XiaohongshuCommentProps['data'];
2228
- 'other/help': HelpProps['data'];
2229
- 'other/handlerError': ApiErrorProps['data'];
2230
- 'other/changelog': ChangelogProps['data'];
2231
- 'other/runtime': RuntimeReportProps['data'];
2232
- 'other/version_warning': VersionWarningProps['data'];
2233
- 'other/qrlogin': QrLoginProps['data'];
2234
- 'other/live-photo-tip': LivePhotoTipProps['data'];
2235
- 'statistics/group': GroupStatisticsProps['data'];
2236
- 'statistics/global': GlobalStatisticsProps['data'];
2237
- }
2238
- /**
2239
- * 从路径字符串中提取数据类型的工具类型
2240
- * @template P 路径字符串
2241
- */
2242
- type ExtractDataTypeFromPath<P extends string> = P extends keyof PathToDataTypeMap ? PathToDataTypeMap[P] : Record<string, any>;
2243
- /**
2244
- * 模板类型到数据类型的映射接口
2245
- */
2246
- interface DataTypeMap {
2247
- /** 抖音平台数据类型 */
2248
- douyin: DouyinCommentProps['data'] | DouyinDynamicProps['data'] | DouyinFavoriteListProps['data'] | DouyinLiveProps['data'] | DouyinMusicInfoProps['data'] | DouyinQrcodeImgProps['data'] | DouyinRecommendListProps['data'] | DouyinUserVideoListProps['data'];
2249
- /** B站平台数据类型 */
2250
- bilibili: BilibiliCommentProps['data'] | BilibiliForwardDynamicProps['data'];
2251
- /** 快手平台数据类型 */
2252
- kuaishou: KuaishouCommentProps['data'];
2253
- /** 其他类型数据 */
2254
- other: HelpProps['data'] | LivePhotoTipProps['data'] | RuntimeReportProps['data'];
2255
- }
2256
- /**
2257
- * 渲染请求接口
2258
- * @template K 模板类型键
2259
- */
2260
- interface TypedRenderRequest<K extends keyof DataTypeMap> extends Omit<RenderRequest, 'templateType' | 'data'> {
2261
- /** 模板类型 */
2262
- templateType: K;
2263
- /** 渲染数据 */
2264
- data: DataTypeMap[K];
2265
- }
2266
- //#endregion
2267
- //#region ../template/src/main.d.ts
2268
- /**
2269
- * 插件执行时机
2270
- * - pre: 在渲染前执行
2271
- * - normal: 在渲染时执行
2272
- * - post: 在渲染后执行
2273
- */
2274
- type PluginEnforce = 'pre' | 'normal' | 'post';
2275
- /**
2276
- * 渲染状态接口
2277
- * 用于在插件之间传递和修改渲染状态
2278
- */
2279
- interface RenderState {
2280
- /** 传递给组件的额外属性 */
2281
- props: Record<string, unknown>;
2282
- /** React 组件实例 */
2283
- component?: React$1.ReactElement | null;
2284
- /** 渲染后的 HTML 字符串 */
2285
- html?: string;
2286
- }
2287
- /**
2288
- * 插件上下文接口
2289
- * 提供插件执行时所需的所有上下文信息
2290
- * @template T 渲染数据类型
2291
- */
2292
- interface PluginContext<T = Record<string, unknown>> {
2293
- /** 渲染请求对象 */
2294
- request: RenderRequest<T>;
2295
- /** 输出目录路径 */
2296
- outputDir: string;
2297
- /** 资源路径管理器实例 */
2298
- resourceManager: ResourcePathManager;
2299
- /** 当前渲染状态 */
2300
- state: RenderState;
2301
- }
2302
- /**
2303
- * 模板插件接口
2304
- * 定义插件的生命周期钩子和配置
2305
- * @template T 渲染数据类型
2306
- */
2307
- interface TemplatePlugin<T = Record<string, unknown>> {
2308
- /** 插件名称,用于标识和调试 */
2309
- name: string;
2310
- /** 插件执行时机,默认为 'normal' */
2311
- enforce?: PluginEnforce;
2312
- /** 插件应用条件,返回 true 时插件生效 */
2313
- apply?: (request: RenderRequest<T>) => boolean;
2314
- /** 渲染前钩子,用于准备数据和属性 */
2315
- beforeRender?: (ctx: PluginContext<T>) => Promise<void> | void;
2316
- /** 渲染时钩子,可以包装或替换组件 */
2317
- render?: (ctx: PluginContext<T>) => Promise<void> | void;
2318
- /** 渲染后钩子,可以修改最终的 HTML */
2319
- afterRender?: (ctx: PluginContext<T>) => Promise<void> | void;
2320
- }
2321
- /**
2322
- * 简化的插件类型,下游使用时无需手动指定泛型
2323
- * 自动使用 Record<string, unknown> 作为数据类型
2324
- */
2325
- type Plugin = TemplatePlugin<Record<string, unknown>>;
2326
- /**
2327
- * 插件工厂函数类型
2328
- * 用于创建可配置的插件实例
2329
- * @template T 插件配置类型
2330
- */
2331
- type PluginFactory<T = Record<string, unknown>> = (options?: T) => Plugin;
2332
- /**
2333
- * 资源路径管理器类
2334
- * 负责管理不同环境下的资源路径配置
2335
- */
2336
- declare class ResourcePathManager {
2337
- private packageDir;
2338
- private NODE_ENV;
2339
- private static initialized;
2340
- private isDevelopment;
2341
- constructor();
2342
- /**
2343
- * 获取包目录路径
2344
- * @returns 包目录的绝对路径
2345
- */
2346
- private getPackageDir;
2347
- /**
2348
- * 查找开发环境目录
2349
- * @param cwd 当前工作目录
2350
- * @returns 开发环境目录路径,如果找不到返回 null
2351
- */
2352
- private findDevelopmentDir;
2353
- /**
2354
- * 通过 import.meta.url 获取 npm 包的安装目录
2355
- * @returns npm 包的安装目录路径
2356
- */
2357
- private getPackageDirFromImportMeta;
2358
- /**
2359
- * 从 pnpm 路径中提取插件目录
2360
- * @param pnpmPath pnpm 的符号链接路径
2361
- * @returns 插件目录路径,如果无法提取则返回 null
2362
- */
2363
- private extractPluginDirFromPnpmPath;
2364
- /**
2365
- * 通过扫描当前工作目录查找插件目录
2366
- * @returns 插件目录路径,如果找不到则返回 null
2367
- */
2368
- private findPluginDirByScanning;
2369
- /**
2370
- * 在指定目录中查找包含 karin-plugin-kkk 的插件目录
2371
- * @param pluginsDir 插件目录路径
2372
- * @returns 找到的插件目录路径,如果找不到则返回 null
2373
- */
2374
- private findKarinPluginInDir;
2375
- /**
2376
- * 检测当前是否运行在插件模式
2377
- * @returns 如果是插件模式返回 true,否则返回 false
2378
- */
2379
- private isPluginMode;
2380
- /**
2381
- * 获取静态资源路径配置
2382
- * 统一处理开发和生产环境的资源路径
2383
- * @returns 静态资源路径配置对象
2384
- */
2385
- getResourcePaths(): {
2386
- cssDir: string;
2387
- imageDir: string;
2388
- };
2389
- /**
2390
- * 获取所有可能的资源路径
2391
- * @returns 可能的 CSS 和图片路径列表
2392
- */
2393
- private getPossibleResourcePaths;
2394
- /**
2395
- * 从当前模块路径向上查找 karin-plugin-kkk 包
2396
- * @returns karin-plugin-kkk 包的路径,如果找不到返回 null
2397
- */
2398
- private findKarinPluginKkkPackage;
2399
- }
2400
- /**
2401
- * 渲染器配置选项接口
2402
- * @template K 模板类型键
2403
- */
2404
- interface ReactServerRenderOptions<K extends keyof DataTypeMap> {
2405
- /** 渲染请求对象 */
2406
- request: RenderRequest<DataTypeMap[K]>;
2407
- /** 输出目录路径 */
2408
- outputDir: string;
2409
- /** 插件列表 */
2410
- plugins?: Plugin[];
2411
- }
2412
- /**
2413
- * SSR 预渲染组件为 HTML 的具体实现
2414
- *
2415
- * @template K 模板类型键,用于类型推断
2416
- * @param options 渲染配置选项
2417
- * @returns 渲染结果 Promise
2418
- *
2419
- * # Example
2420
- * ```typescript
2421
- * // 基础使用
2422
- * const result = await reactServerRender({
2423
- * request: {
2424
- * templateType: 'douyin',
2425
- * templateName: 'videoInfo',
2426
- * data: { share_url: 'https://example.com' }
2427
- * },
2428
- * outputDir: './output'
2429
- * })
2430
- *
2431
- * // 使用插件
2432
- * const result = await reactServerRender({
2433
- * request: renderRequest,
2434
- * outputDir: './output',
2435
- * plugins: [customPlugin()]
2436
- * })
2437
- * ```
2438
- */
2439
- declare const reactServerRender: <K extends keyof DataTypeMap>(options: ReactServerRenderOptions<K>) => Promise<RenderResponse>;
1
+ //#region ktr/template/_preview/render.d.ts
2440
2
  type VideoPreviewRenderOptions = {
2441
3
  filename: string;
2442
4
  filePath: string;
@@ -2446,6 +8,10 @@ type VideoPreviewRenderOptions = {
2446
8
  expireAt?: number;
2447
9
  eventsUrl?: string;
2448
10
  };
11
+ /**
12
+ * 渲染临时视频预览页 HTML(/kkk/ssr/video/* 使用)。
13
+ * 逻辑与旧引擎 main.ts 中的实现一致,仅 CSS 来源换成 ktr 构建的 style.css。
14
+ */
2449
15
  declare const renderVideoPreviewPage: (options: VideoPreviewRenderOptions) => string;
2450
16
  //#endregion
2451
- export { BaseComponentProps, DataTypeMap, DynamicRenderPath, ExtractDataTypeFromPath, type Plugin, type PluginContext, type PluginFactory, type ReactServerRenderOptions, RenderRequest, RenderResponse, TypedRenderRequest, reactServerRender as default, reactServerRender, renderVideoPreviewPage };
17
+ export { type VideoPreviewRenderOptions, renderVideoPreviewPage };