fishpi 0.1.24 → 0.1.26

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,4072 @@
1
+ import ReconnectingWebSocket, { Options } from "reconnecting-websocket";
2
+
3
+ //#region src/types/article.d.ts
4
+ /**
5
+ * 发帖信息
6
+ */
7
+ declare class ArticlePost implements IArticlePost {
8
+ /**
9
+ * 帖子标题
10
+ */
11
+ title: string;
12
+ /**
13
+ * 帖子内容
14
+ */
15
+ content: string;
16
+ /**
17
+ * 帖子标签
18
+ */
19
+ tags: string;
20
+ /**
21
+ * 是否允许评论
22
+ */
23
+ commentable: boolean;
24
+ /**
25
+ * 是否通知帖子关注者
26
+ */
27
+ isNotifyFollowers: boolean;
28
+ /**
29
+ * 帖子类型
30
+ */
31
+ type: ArticleType;
32
+ /**
33
+ * 是否在列表展示
34
+ */
35
+ isShowInList: boolean;
36
+ /**
37
+ * 打赏内容
38
+ */
39
+ rewardContent?: string;
40
+ /**
41
+ * 打赏积分
42
+ */
43
+ rewardPoint?: number;
44
+ /**
45
+ * 是否匿名
46
+ */
47
+ isAnonymous?: boolean;
48
+ /**
49
+ * 提问悬赏积分
50
+ */
51
+ offerPoint?: number;
52
+ static from(article: IArticlePost): ArticlePost & IArticlePost;
53
+ toJson(): {
54
+ articleTitle: string;
55
+ articleContent: string;
56
+ articleTags: string;
57
+ articleCommentable: boolean;
58
+ articleNotifyFollowers: boolean;
59
+ articleType: ArticleType;
60
+ articleShowInList: number;
61
+ articleRewardContent: string | undefined;
62
+ articleRewardPoint: number | undefined;
63
+ articleAnonymous: boolean | undefined;
64
+ articleQnAOfferPoint: number | undefined;
65
+ };
66
+ }
67
+ declare class CommentPost implements ICommentPost {
68
+ /**
69
+ * 文章 Id
70
+ */
71
+ articleId: string;
72
+ /**
73
+ * 是否匿名评论
74
+ */
75
+ isAnonymous: boolean;
76
+ /**
77
+ * 评论是否公共可见
78
+ */
79
+ isVisible: boolean;
80
+ /**
81
+ * 评论内容
82
+ */
83
+ content: string;
84
+ /**
85
+ * 回复评论 Id
86
+ */
87
+ originalId?: string;
88
+ static from(comment: ICommentPost): CommentPost & ICommentPost;
89
+ toJson(): {
90
+ articleId: string;
91
+ commentAnonymous: number;
92
+ commentVisible: number;
93
+ commentContent: string;
94
+ commentOriginalCommentId: string | undefined;
95
+ };
96
+ }
97
+ /**
98
+ * 帖子类型
99
+ */
100
+ declare enum ArticleType {
101
+ Normal = 0,
102
+ Private = 1,
103
+ Broadcast = 2,
104
+ Thought = 3,
105
+ Question = 5
106
+ }
107
+ /**
108
+ * 公开状态
109
+ */
110
+ declare enum PublicStatus {
111
+ Public = 0,
112
+ Private = 1
113
+ }
114
+ /**
115
+ * 投票状态,点赞与否
116
+ */
117
+ declare enum VoteStatus {
118
+ /**
119
+ * 未投票
120
+ */
121
+ normal = -1,
122
+ /**
123
+ * 点赞
124
+ */
125
+ up = 0,
126
+ /**
127
+ * 点踩
128
+ */
129
+ down = 1
130
+ }
131
+ /**
132
+ * 是否状态
133
+ */
134
+ declare enum YesNoStatus {
135
+ Yes = 0,
136
+ No = 1
137
+ }
138
+ /**
139
+ * 文章状态
140
+ */
141
+ declare enum ArticleStatus {
142
+ /**
143
+ * 正常
144
+ */
145
+ Normal = 0,
146
+ /**
147
+ * 封禁
148
+ */
149
+ Ban = 1,
150
+ /**
151
+ * 锁定
152
+ */
153
+ Lock = 2
154
+ }
155
+ /**
156
+ * 帖子列表查询类型
157
+ */
158
+ declare enum ArticleListType {
159
+ /**
160
+ * 最近
161
+ */
162
+ Recent = "",
163
+ /**
164
+ * 热门
165
+ */
166
+ Hot = "/hot",
167
+ /**
168
+ * 点赞
169
+ */
170
+ Good = "/good",
171
+ /**
172
+ * 最近回复
173
+ */
174
+ Reply = "/reply",
175
+ /**
176
+ * 优选,需包含标签
177
+ */
178
+ Perfect = "/perfact"
179
+ }
180
+ /**
181
+ * 点赞类型
182
+ */
183
+ declare enum VoteType {
184
+ /**
185
+ * 点赞
186
+ */
187
+ Voted = 0,
188
+ /**
189
+ * 取消点赞
190
+ */
191
+ Unvote = -1
192
+ }
193
+ /**
194
+ * 发帖信息
195
+ */
196
+ interface IArticlePost {
197
+ /**
198
+ * 帖子标题
199
+ */
200
+ title: string;
201
+ /**
202
+ * 帖子内容
203
+ */
204
+ content: string;
205
+ /**
206
+ * 帖子标签
207
+ */
208
+ tags: string;
209
+ /**
210
+ * 帖子类型
211
+ */
212
+ type?: ArticleType;
213
+ /**
214
+ * 是否允许评论
215
+ */
216
+ commentable?: boolean;
217
+ /**
218
+ * 是否帖子关注者
219
+ */
220
+ isNotifyFollowers?: boolean;
221
+ /**
222
+ * 是否在列表展示
223
+ */
224
+ isShowInList?: boolean;
225
+ /**
226
+ * 打赏内容
227
+ */
228
+ rewardContent?: string;
229
+ /**
230
+ * 打赏积分
231
+ */
232
+ rewardPoint?: number;
233
+ /**
234
+ * 是否匿名
235
+ */
236
+ isAnonymous?: boolean;
237
+ /**
238
+ * 提问悬赏积分
239
+ */
240
+ offerPoint?: number;
241
+ }
242
+ /**
243
+ * 文章标签
244
+ */
245
+ declare class ArticleTag {
246
+ /**
247
+ * 标签 id
248
+ */
249
+ oId: string;
250
+ /**
251
+ * 标签名
252
+ */
253
+ title: string;
254
+ /**
255
+ * 标签描述
256
+ */
257
+ description: string;
258
+ /**
259
+ * icon 地址
260
+ */
261
+ iconPath: string;
262
+ /**
263
+ * 标签地址
264
+ */
265
+ URI: string;
266
+ /**
267
+ * 标签自定义 CSS
268
+ */
269
+ CSS: string;
270
+ /**
271
+ * 反对数
272
+ */
273
+ badCnt: number;
274
+ /**
275
+ * 标签回帖计数
276
+ */
277
+ commentCount: number;
278
+ /**
279
+ * 关注数
280
+ */
281
+ followerCount: number;
282
+ /**
283
+ * 点赞数
284
+ */
285
+ goodCnt: number;
286
+ /**
287
+ * 引用计数
288
+ */
289
+ referenceCount: number;
290
+ /**
291
+ * 标签相关链接计数
292
+ */
293
+ linkCount: number;
294
+ /**
295
+ * 标签 SEO 描述
296
+ */
297
+ seoDesc: string;
298
+ /**
299
+ * 标签关键字
300
+ */
301
+ seoKeywords: string;
302
+ /**
303
+ * 标签 SEO 标题
304
+ */
305
+ seoTitle: string;
306
+ /**
307
+ * 标签广告内容
308
+ */
309
+ ad: string;
310
+ /**
311
+ * 是否展示广告
312
+ */
313
+ isShowSideAd: boolean;
314
+ /**
315
+ * 标签状态
316
+ */
317
+ status: 0 | 1;
318
+ static from(tag: Record<string, any>): ArticleTag;
319
+ }
320
+ /**
321
+ * 文章作者信息
322
+ */
323
+ declare class Author {
324
+ /**
325
+ * 用户是否在线
326
+ */
327
+ online: boolean;
328
+ /**
329
+ * 用户在线时长
330
+ */
331
+ onlineMinute: number;
332
+ /**
333
+ * 用户标签
334
+ */
335
+ tags: string;
336
+ /**
337
+ * 用户时区
338
+ */
339
+ timezone: string;
340
+ /**
341
+ * 用户个人主页
342
+ */
343
+ URL: string;
344
+ /**
345
+ * 最近发帖时间
346
+ */
347
+ latestArticleTime: number;
348
+ /**
349
+ * 昵称
350
+ */
351
+ nickname: string;
352
+ /**
353
+ * 应用角色
354
+ */
355
+ appRole: number;
356
+ /**
357
+ * 用户状态
358
+ */
359
+ status: number;
360
+ /**
361
+ * 用户省份
362
+ */
363
+ province: string;
364
+ /**
365
+ * 用户当前连续签到计数
366
+ */
367
+ currentCheckinStreak: number;
368
+ /**
369
+ * 用户编号
370
+ */
371
+ userNo: number;
372
+ /**
373
+ * 用户头像
374
+ */
375
+ avatarURL: string;
376
+ /**
377
+ * 用户语言
378
+ */
379
+ language: string;
380
+ /**
381
+ * 用户消费积分
382
+ */
383
+ usedPoint: number;
384
+ /**
385
+ * 用户积分
386
+ */
387
+ points: number;
388
+ /**
389
+ * 用户回帖数量
390
+ */
391
+ commentCount: number;
392
+ /**
393
+ * 用户个性签名
394
+ */
395
+ intro: string;
396
+ /**
397
+ * 用户 Id
398
+ */
399
+ oId: string;
400
+ /**
401
+ * 用户名
402
+ */
403
+ userName: string;
404
+ /**
405
+ * 文章数
406
+ */
407
+ articleCount: number;
408
+ /**
409
+ * 用户角色
410
+ */
411
+ role: string;
412
+ /**
413
+ * 徽章
414
+ */
415
+ sysMetal?: IMetal[];
416
+ /**
417
+ * MBTI 性格类型
418
+ */
419
+ mbti: string;
420
+ static from(user: Record<string, any>): Author;
421
+ }
422
+ /**
423
+ * 文章详情
424
+ */
425
+ declare class ArticleDetail {
426
+ /**
427
+ * 是否在列表展示
428
+ */
429
+ isShowInList: boolean;
430
+ /**
431
+ * 发布者Id
432
+ */
433
+ authorId: string;
434
+ /**
435
+ * 反对数
436
+ */
437
+ badCnt: number;
438
+ /**
439
+ * 文章最后修改时间
440
+ */
441
+ latestCmtTime: string;
442
+ /**
443
+ * 赞同数
444
+ */
445
+ goodCnt: number;
446
+ /**
447
+ * 悬赏积分
448
+ */
449
+ offerPoint: number;
450
+ /**
451
+ * 文章首图缩略图
452
+ */
453
+ thumbnailURL: string;
454
+ /**
455
+ * 置顶序号
456
+ */
457
+ stickRemains: number;
458
+ /**
459
+ * 发布时间简写
460
+ */
461
+ timeAgo: string;
462
+ /**
463
+ * 文章更新时间
464
+ */
465
+ updateTime: string;
466
+ /**
467
+ * 作者用户名
468
+ */
469
+ authorName: string;
470
+ /**
471
+ * 文章类型
472
+ */
473
+ type: ArticleType;
474
+ /**
475
+ * 是否悬赏
476
+ */
477
+ isOffered: boolean;
478
+ /**
479
+ * 文章创建时间字符串
480
+ */
481
+ createTime: string;
482
+ /**
483
+ * 文章浏览数
484
+ */
485
+ viewCount: number;
486
+ /**
487
+ * 作者头像缩略图
488
+ */
489
+ authorThumbnail20: string;
490
+ /**
491
+ * 关注数
492
+ */
493
+ watchCnt: number;
494
+ /**
495
+ * 文章预览内容
496
+ */
497
+ previewContent: string;
498
+ /**
499
+ * 文章标题
500
+ */
501
+ titleEmoj: string;
502
+ /**
503
+ * 文章标题
504
+ */
505
+ titleEmojUnicode: string;
506
+ /**
507
+ * 文章标题
508
+ */
509
+ title: string;
510
+ /**
511
+ * 作者头像缩略图
512
+ */
513
+ authorThumbnail48: string;
514
+ /**
515
+ * 收藏数
516
+ */
517
+ collectCnt: number;
518
+ /**
519
+ * 文章最后评论者
520
+ */
521
+ latestCmter: string;
522
+ /**
523
+ * 文章标签
524
+ */
525
+ tagsContent: string;
526
+ /**
527
+ * 文章 id
528
+ */
529
+ oId: string;
530
+ /**
531
+ * 最后评论时间简写
532
+ */
533
+ cmtTimeAgo: string;
534
+ /**
535
+ * 是否置顶
536
+ */
537
+ stick: number;
538
+ /**
539
+ * 文章标签信息
540
+ */
541
+ tags: ArticleTag[];
542
+ /**
543
+ * 是否匿名
544
+ */
545
+ isAnonymous: boolean;
546
+ /**
547
+ * 文章感谢数
548
+ */
549
+ thankCnt: number;
550
+ /**
551
+ * 文章状态
552
+ */
553
+ status: ArticleStatus;
554
+ /**
555
+ * 文章点击数
556
+ */
557
+ heat: number;
558
+ /**
559
+ * 文章是否优选
560
+ */
561
+ isPerfect: boolean;
562
+ /**
563
+ * 作者头像缩略图
564
+ */
565
+ authorThumbnail210: string;
566
+ /**
567
+ * 文章固定链接
568
+ */
569
+ permalink: string;
570
+ /**
571
+ * 作者用户信息
572
+ */
573
+ author: Author;
574
+ /**
575
+ * 文章感谢数
576
+ */
577
+ thankedCnt?: number;
578
+ /**
579
+ * 文章匿名浏览量
580
+ */
581
+ anonymousView?: number;
582
+ /**
583
+ * 文章浏览量简写
584
+ */
585
+ viewCntDisplay?: string;
586
+ /**
587
+ * 文章是否启用评论
588
+ */
589
+ commentable?: boolean;
590
+ /**
591
+ * 是否已打赏
592
+ */
593
+ isRewarded?: boolean;
594
+ /**
595
+ * 打赏人数
596
+ */
597
+ rewardedCnt?: number;
598
+ /**
599
+ * 文章打赏积分
600
+ */
601
+ rewardPoint?: number;
602
+ /**
603
+ * 是否已收藏
604
+ */
605
+ isFollowing?: boolean;
606
+ /**
607
+ * 是否已关注
608
+ */
609
+ isWatching?: boolean;
610
+ /**
611
+ * 是否是我的文章
612
+ */
613
+ isMyArticle?: boolean;
614
+ /**
615
+ * 是否已感谢
616
+ */
617
+ isThanked?: boolean;
618
+ /**
619
+ * 文章音频地址
620
+ */
621
+ audioURL?: string;
622
+ /**
623
+ * 文章目录 HTML
624
+ */
625
+ tableOfContents?: string;
626
+ /**
627
+ * 文章内容 HTML
628
+ */
629
+ content?: string;
630
+ /**
631
+ * 文章内容 Markdown
632
+ */
633
+ originalContent?: string;
634
+ /**
635
+ * 文章首图
636
+ */
637
+ img1URL?: string;
638
+ /**
639
+ * 文章点赞状态
640
+ */
641
+ vote?: VoteStatus;
642
+ /**
643
+ * 作者签名
644
+ */
645
+ authorIntro?: string;
646
+ /**
647
+ * 发布城市
648
+ */
649
+ city?: string;
650
+ /**
651
+ * 作者首页地址
652
+ */
653
+ authorURL?: string;
654
+ /**
655
+ * 打赏内容
656
+ */
657
+ rewardContent?: string;
658
+ /**
659
+ * 评论分页信息
660
+ */
661
+ pagination?: Pagination;
662
+ /**
663
+ * 评论是否可见
664
+ */
665
+ discussionViewable: boolean;
666
+ /**
667
+ * 文章修改次数
668
+ */
669
+ revisionCount: number;
670
+ /**
671
+ * 文章的评论
672
+ */
673
+ comments?: Array<ArticleComment>;
674
+ /**
675
+ * 文章最佳评论
676
+ */
677
+ niceComments?: Array<ArticleComment>;
678
+ static from(post: Record<string, any>): ArticleDetail;
679
+ }
680
+ /**
681
+ * 文章评论
682
+ */
683
+ declare class ArticleComment {
684
+ /**
685
+ * 是否优评
686
+ */
687
+ isNice: boolean;
688
+ /**
689
+ * 评论创建时间字符串
690
+ */
691
+ createTime: string;
692
+ /**
693
+ * 评论作者 id
694
+ */
695
+ authorId: string;
696
+ /**
697
+ * 评论分数
698
+ */
699
+ score: number;
700
+ /**
701
+ * 评论作者头像
702
+ */
703
+ authorURL: string;
704
+ /**
705
+ * 评论状态
706
+ */
707
+ vote: VoteStatus;
708
+ /**
709
+ * 评论引用数
710
+ */
711
+ revisionCount: number;
712
+ /**
713
+ * 评论经过时间
714
+ */
715
+ timeAgo: string;
716
+ /**
717
+ * 回复评论 id
718
+ */
719
+ originalId: string;
720
+ /**
721
+ * 徽章
722
+ */
723
+ sysMetal: IMetal[];
724
+ /**
725
+ * 点赞数
726
+ */
727
+ goodCnt: number;
728
+ /**
729
+ * 评论是否可见
730
+ */
731
+ visible: YesNoStatus;
732
+ /**
733
+ * 文章 id
734
+ */
735
+ articleId: string;
736
+ /**
737
+ * 评论感谢数
738
+ */
739
+ rewardedCnt: number;
740
+ /**
741
+ * 评论地址
742
+ */
743
+ sharpURL: string;
744
+ /**
745
+ * 是否匿名
746
+ */
747
+ isAnonymous: boolean;
748
+ /**
749
+ * 评论回复数
750
+ */
751
+ replyCnt: number;
752
+ /**
753
+ * 评论 id
754
+ */
755
+ oId: string;
756
+ /**
757
+ * 评论内容
758
+ */
759
+ content: string;
760
+ /**
761
+ * 评论状态
762
+ */
763
+ status: ArticleStatus;
764
+ /**
765
+ * 评论作者
766
+ */
767
+ commenter: Author;
768
+ /**
769
+ * 评论作者用户名
770
+ */
771
+ authorName: string;
772
+ /**
773
+ * 评论感谢数
774
+ */
775
+ thankCnt: number;
776
+ /**
777
+ * 评论点踩数
778
+ */
779
+ badCnt: number;
780
+ /**
781
+ * 是否已感谢
782
+ */
783
+ rewarded: boolean;
784
+ /**
785
+ * 评论作者头像
786
+ */
787
+ authorThumbnailURL: string;
788
+ /**
789
+ * 评论音频地址
790
+ */
791
+ audioURL: string;
792
+ /**
793
+ * 评论是否采纳,1 表示采纳
794
+ */
795
+ isOffered: boolean;
796
+ static from(cmt: Record<string, any>): ArticleComment;
797
+ }
798
+ /**
799
+ * 文章列表
800
+ */
801
+ declare class ArticleList {
802
+ /**
803
+ * 文章列表
804
+ */
805
+ articles: ArticleDetail[];
806
+ /**
807
+ * 分页信息
808
+ */
809
+ pagination: Pagination;
810
+ /**
811
+ * 标签信息,仅查询标签下文章列表有效
812
+ */
813
+ tag?: ArticleTag;
814
+ static from(list: Record<string, any>): ArticleList;
815
+ }
816
+ interface ICommentPost {
817
+ /**
818
+ * 文章 Id
819
+ */
820
+ articleId: string;
821
+ /**
822
+ * 是否匿名评论
823
+ */
824
+ isAnonymous?: boolean;
825
+ /**
826
+ * 评论是否楼主可见
827
+ */
828
+ isVisible?: boolean;
829
+ /**
830
+ * 评论内容
831
+ */
832
+ content: string;
833
+ /**
834
+ * 回复评论 Id
835
+ */
836
+ originalId?: string;
837
+ }
838
+ interface IArticleHeat {
839
+ articleId: string;
840
+ heat: number;
841
+ }
842
+ //#endregion
843
+ //#region src/types/breezemoon.d.ts
844
+ /**
845
+ * 清风明月内容
846
+ */
847
+ declare class BreezemoonContent {
848
+ /**
849
+ * 发布者用户名
850
+ */
851
+ authorName: string;
852
+ /**
853
+ * 最后更新时间
854
+ */
855
+ updatedAt: string;
856
+ /**
857
+ * 清风明月ID
858
+ */
859
+ oId: string;
860
+ /**
861
+ * 创建时间
862
+ */
863
+ createAt: string;
864
+ /**
865
+ * 发布者头像URL
866
+ */
867
+ authorThumbnail: string;
868
+ /**
869
+ * 发布时间
870
+ */
871
+ timeAgo: string;
872
+ /**
873
+ * 正文
874
+ */
875
+ content: string;
876
+ /**
877
+ * 发布城市(可能为空,请注意做判断)
878
+ */
879
+ city: string;
880
+ static from(src: Record<string, any>): BreezemoonContent;
881
+ }
882
+ declare class BreezemoonList {
883
+ /**
884
+ * 分页信息
885
+ */
886
+ pagination: Pagination;
887
+ /**
888
+ * 清风明月列表
889
+ */
890
+ breezemoons: BreezemoonContent[];
891
+ static from(src: Record<string, any>): BreezemoonList;
892
+ }
893
+ //#endregion
894
+ //#region src/types/chat.d.ts
895
+ /**
896
+ * 私聊内容
897
+ */
898
+ interface IChatData {
899
+ /**
900
+ * 接收者 Id
901
+ */
902
+ toId: string;
903
+ /**
904
+ * 预览内容
905
+ */
906
+ preview: string;
907
+ /**
908
+ * 消息用户 Session
909
+ */
910
+ user_session: string;
911
+ /**
912
+ * 发送者头像
913
+ */
914
+ senderAvatar: string;
915
+ /**
916
+ * 消息 Markdown
917
+ */
918
+ markdown: string;
919
+ /**
920
+ * 接收者头像
921
+ */
922
+ receiverAvatar: string;
923
+ /**
924
+ * 消息 Id
925
+ */
926
+ oId: string;
927
+ /**
928
+ * 发送时间
929
+ */
930
+ time: string;
931
+ /**
932
+ * 来源 Id
933
+ */
934
+ fromId: string;
935
+ /**
936
+ * 发送者用户名
937
+ */
938
+ senderUserName: string;
939
+ /**
940
+ * 消息内容 HTML
941
+ */
942
+ content: string;
943
+ /**
944
+ * 接收者用户名
945
+ */
946
+ receiverUserName: string;
947
+ }
948
+ /**
949
+ * 私聊撤回消息
950
+ */
951
+ interface IChatRevoke {
952
+ /**
953
+ * 消息 Id
954
+ */
955
+ data: string;
956
+ type: 'revoke';
957
+ }
958
+ interface IChatQuery {
959
+ /**
960
+ * 页码
961
+ */
962
+ page?: number;
963
+ /**
964
+ * 每页个数
965
+ */
966
+ size?: number;
967
+ /**
968
+ * 是否自动已读消息
969
+ */
970
+ autoRead?: boolean;
971
+ }
972
+ interface IChatNotice {
973
+ /**
974
+ * 命令
975
+ */
976
+ command: string;
977
+ /**
978
+ * 发送用户 ID
979
+ */
980
+ userId: string;
981
+ /**
982
+ * 预览内容
983
+ */
984
+ preview?: string;
985
+ /**
986
+ * 发送者头像
987
+ */
988
+ senderAvatar?: string;
989
+ /**
990
+ * 发送者用户名
991
+ */
992
+ senderUserName?: string;
993
+ }
994
+ //#endregion
995
+ //#region src/types/chatroom.d.ts
996
+ declare enum ClientType {
997
+ /**
998
+ * 网页端
999
+ */
1000
+ Web = "Web",
1001
+ /**
1002
+ * PC 端
1003
+ */
1004
+ PC = "PC",
1005
+ /**
1006
+ * 移动端聊天室
1007
+ */
1008
+ Mobile = "Mobile",
1009
+ /**
1010
+ * Windows 客户端
1011
+ */
1012
+ Windows = "Windows",
1013
+ /**
1014
+ * macOS 客户端
1015
+ */
1016
+ macOS = "macOS",
1017
+ /**
1018
+ * Linux 客户端
1019
+ */
1020
+ Linux = "Linux",
1021
+ /**
1022
+ * iOS 客户端
1023
+ */
1024
+ iOS = "iOS",
1025
+ /**
1026
+ * Android 客户端
1027
+ */
1028
+ Android = "Android",
1029
+ /**
1030
+ * IDEA 插件
1031
+ */
1032
+ IDEA = "IDEA",
1033
+ /**
1034
+ * Chrome 插件
1035
+ */
1036
+ Chrome = "Chrome",
1037
+ /**
1038
+ * Edge 插件
1039
+ */
1040
+ Edge = "Edge",
1041
+ /**
1042
+ * VSCode 插件
1043
+ */
1044
+ VSCode = "VSCode",
1045
+ /**
1046
+ * Python 客户端
1047
+ */
1048
+ Python = "Python",
1049
+ /**
1050
+ * Golang 客户端
1051
+ */
1052
+ Golang = "Golang",
1053
+ /**
1054
+ * Rust 客户端
1055
+ */
1056
+ Rust = "Rust",
1057
+ /**
1058
+ * Harmony App
1059
+ */
1060
+ Harmony = "Harmony",
1061
+ /**
1062
+ * CLI 工具
1063
+ */
1064
+ CLI = "CLI",
1065
+ /**
1066
+ * 鸽机器人
1067
+ */
1068
+ Bird = "Bird",
1069
+ /**
1070
+ * 小冰机器人
1071
+ */
1072
+ IceNet = "IceNet",
1073
+ /**
1074
+ * 凌机器人
1075
+ */
1076
+ ElvesOnline = "ElvesOnline",
1077
+ /**
1078
+ * 其他插件
1079
+ */
1080
+ Other = "Other"
1081
+ }
1082
+ /**
1083
+ * 聊天室消息来源
1084
+ */
1085
+ declare class ChatRoomSource implements IChatRoomSource {
1086
+ /**
1087
+ * 消息来源
1088
+ */
1089
+ client: ClientType | string;
1090
+ /**
1091
+ * 消息来源版本
1092
+ */
1093
+ version: string;
1094
+ }
1095
+ /**
1096
+ * 历史消息类型
1097
+ */
1098
+ declare enum ChatContentType {
1099
+ /**
1100
+ * 原始 Markdown
1101
+ */
1102
+ Markdown = "md",
1103
+ /**
1104
+ * 渲染 HTML
1105
+ */
1106
+ HTML = "html"
1107
+ }
1108
+ /**
1109
+ * chatroom get 接口获取 oId 的相关消息类型
1110
+ */
1111
+ declare enum ChatMessageType {
1112
+ /**
1113
+ * 前后消息
1114
+ */
1115
+ Context = 0,
1116
+ /**
1117
+ * 前面的消息
1118
+ */
1119
+ Before = 1,
1120
+ /**
1121
+ * 后面的消息
1122
+ */
1123
+ After = 2
1124
+ }
1125
+ /**
1126
+ * 聊天室消息类型
1127
+ */
1128
+ declare enum ChatRoomMessageType {
1129
+ /**
1130
+ * 在线用户
1131
+ */
1132
+ online = "online",
1133
+ /**
1134
+ * 话题修改
1135
+ */
1136
+ discussChanged = "discussChanged",
1137
+ /**
1138
+ * 消息撤回
1139
+ */
1140
+ revoke = "revoke",
1141
+ /**
1142
+ * 消息
1143
+ */
1144
+ msg = "msg",
1145
+ /**
1146
+ * 红包
1147
+ */
1148
+ redPacket = "redPacket",
1149
+ /**
1150
+ * 红包状态
1151
+ */
1152
+ redPacketStatus = "redPacketStatus",
1153
+ /**
1154
+ * 弹幕
1155
+ */
1156
+ barrager = "barrager",
1157
+ /**
1158
+ * 自定义消息
1159
+ */
1160
+ custom = "customMessage"
1161
+ }
1162
+ /**
1163
+ * 聊天室消息来源
1164
+ */
1165
+ interface IChatRoomSource {
1166
+ /**
1167
+ * 消息来源
1168
+ */
1169
+ client: ClientType | string;
1170
+ /**
1171
+ * 消息来源版本
1172
+ */
1173
+ version: string;
1174
+ }
1175
+ /**
1176
+ * 聊天室消息
1177
+ */
1178
+ interface IChatRoomMessage {
1179
+ /**
1180
+ * 消息 Id
1181
+ */
1182
+ oId: string;
1183
+ /**
1184
+ * 消息类型
1185
+ */
1186
+ type: string;
1187
+ /**
1188
+ * 发送者用户名
1189
+ */
1190
+ userName: string;
1191
+ /**
1192
+ * 用户昵称
1193
+ */
1194
+ userNickname: string;
1195
+ /**
1196
+ * 用户头像
1197
+ */
1198
+ userAvatarURL: string;
1199
+ /**
1200
+ * 用户徽章
1201
+ */
1202
+ sysMetal: IMetal[];
1203
+ /**
1204
+ * 消息来源
1205
+ */
1206
+ client: string;
1207
+ /**
1208
+ * 消息来源解析
1209
+ */
1210
+ via: IChatRoomSource;
1211
+ /**
1212
+ * 消息内容
1213
+ */
1214
+ content: string | IRedPacketMessage | IMusicMessage | IWeatherMessage;
1215
+ /**
1216
+ * Markdown 内容
1217
+ */
1218
+ md: string;
1219
+ /**
1220
+ * 发送时间
1221
+ */
1222
+ time: string;
1223
+ }
1224
+ type CustomMsg = string;
1225
+ /**
1226
+ * 弹幕消息
1227
+ */
1228
+ interface IBarragerMsg {
1229
+ /**
1230
+ * 用户名
1231
+ */
1232
+ userName: string;
1233
+ /**
1234
+ * 用户昵称
1235
+ */
1236
+ userNickname: string;
1237
+ /**
1238
+ * 弹幕内容
1239
+ */
1240
+ barragerContent: string;
1241
+ /**
1242
+ * 弹幕颜色
1243
+ */
1244
+ barragerColor: string;
1245
+ /**
1246
+ * 用户头像地址
1247
+ */
1248
+ userAvatarURL: string;
1249
+ /**
1250
+ * 用户头像地址 20x20
1251
+ */
1252
+ userAvatarURL20: string;
1253
+ /**
1254
+ * 用户头像地址 48x48
1255
+ */
1256
+ userAvatarURL48: string;
1257
+ /**
1258
+ * 用户头像地址 210x210
1259
+ */
1260
+ userAvatarURL210: string;
1261
+ }
1262
+ /**
1263
+ * 在线用户信息
1264
+ */
1265
+ interface IOnlineInfo {
1266
+ /**
1267
+ * 用户首页
1268
+ */
1269
+ homePage: string;
1270
+ /**
1271
+ * 用户头像
1272
+ */
1273
+ userAvatarURL: string;
1274
+ /**
1275
+ * 用户名
1276
+ */
1277
+ userName: string;
1278
+ }
1279
+ /**
1280
+ * 主题修改消息,主题内容
1281
+ */
1282
+ type DiscussMsg = string;
1283
+ /**
1284
+ * 撤回消息,被撤回消息的 oId
1285
+ */
1286
+ type RevokeMsg = string;
1287
+ /**
1288
+ * 聊天消息
1289
+ */
1290
+ interface IChatRoomMsg<T = string> {
1291
+ /**
1292
+ * 消息类型
1293
+ */
1294
+ type: string;
1295
+ /**
1296
+ * 消息 oId
1297
+ */
1298
+ oId: string;
1299
+ /**
1300
+ * 消息发送时间
1301
+ */
1302
+ time: string;
1303
+ /**
1304
+ * 用户 Id
1305
+ */
1306
+ userOId: string;
1307
+ /**
1308
+ * 发送者用户名
1309
+ */
1310
+ userName: string;
1311
+ /**
1312
+ * 发送者昵称
1313
+ */
1314
+ userNickname: string;
1315
+ /**
1316
+ * 发送者头像
1317
+ */
1318
+ userAvatarURL: string;
1319
+ /**
1320
+ * 消息内容
1321
+ */
1322
+ content: T;
1323
+ /**
1324
+ * 消息内容 Markdown
1325
+ */
1326
+ md: string;
1327
+ /**
1328
+ * 消息来源
1329
+ */
1330
+ client: string;
1331
+ /**
1332
+ * 消息来源解析
1333
+ */
1334
+ via: IChatRoomSource;
1335
+ }
1336
+ type WeatherCode = 'CLEAR_DAY' | 'CLEAR_NIGHT' | 'CLOUDY' | 'DUST' | 'FOG' | 'HEAVY_HAZE' | 'HEAVY_RAIN' | 'HEAVY_SNOW' | 'LIGHT_HAZE' | 'LIGHT_RAIN' | 'LIGHT_SNOW' | 'MODERATE_HAZE' | 'MODERATE_RAIN' | 'MODERATE_SNOW' | 'PARTLY_CLOUDY_DAY' | 'PARTLY_CLOUDY_NIGHT' | 'SAND' | 'STORM_RAIN' | 'STORM_SNOW' | 'WIND';
1337
+ /**
1338
+ * 聊天天气消息详情
1339
+ */
1340
+ interface IWeatherData {
1341
+ /**
1342
+ * 日期
1343
+ */
1344
+ date: string;
1345
+ /**
1346
+ * 天气代码
1347
+ */
1348
+ code: WeatherCode;
1349
+ /**
1350
+ * 最小气温
1351
+ */
1352
+ min: number;
1353
+ /**
1354
+ * 最大气温
1355
+ */
1356
+ max: number;
1357
+ }
1358
+ /**
1359
+ * 聊天天气消息
1360
+ */
1361
+ interface IWeatherMessage {
1362
+ /**
1363
+ * 城市
1364
+ */
1365
+ city: string;
1366
+ /**
1367
+ * 描述
1368
+ */
1369
+ description: string;
1370
+ /**
1371
+ * 最近几天天气数据
1372
+ */
1373
+ data: IWeatherData[];
1374
+ }
1375
+ /**
1376
+ * 聊天音乐消息
1377
+ */
1378
+ interface IMusicMessage {
1379
+ type: 'music';
1380
+ /**
1381
+ * 音乐源
1382
+ */
1383
+ source: string;
1384
+ /**
1385
+ * 封面地址
1386
+ */
1387
+ coverURL: string;
1388
+ /**
1389
+ * 歌曲名称
1390
+ */
1391
+ title: string;
1392
+ /**
1393
+ * 来源
1394
+ */
1395
+ from: string;
1396
+ }
1397
+ /**
1398
+ * 聊天室节点信息
1399
+ */
1400
+ interface IChatRoomNode {
1401
+ /**
1402
+ * 节点地址
1403
+ */
1404
+ node: string;
1405
+ /**
1406
+ * 名称
1407
+ */
1408
+ name: string;
1409
+ /**
1410
+ * 在线人数
1411
+ */
1412
+ online?: number;
1413
+ }
1414
+ /**
1415
+ * 聊天室节点详情
1416
+ */
1417
+ interface IChatRoomNodeInfo {
1418
+ /**
1419
+ * 推荐节点
1420
+ */
1421
+ recommend: IChatRoomNode;
1422
+ /**
1423
+ * 所有节点
1424
+ */
1425
+ avaliable: IChatRoomNode[];
1426
+ }
1427
+ //#endregion
1428
+ //#region src/types/redpacket.d.ts
1429
+ /**
1430
+ * 猜拳类型
1431
+ */
1432
+ declare enum GestureType {
1433
+ /**
1434
+ * 石头
1435
+ */
1436
+ Rock = 0,
1437
+ /**
1438
+ * 剪刀
1439
+ */
1440
+ Scissors = 1,
1441
+ /**
1442
+ * 布
1443
+ */
1444
+ Paper = 2
1445
+ }
1446
+ /**
1447
+ * 红包类型
1448
+ */
1449
+ declare enum RedPacketType {
1450
+ /**
1451
+ * 拼手气
1452
+ */
1453
+ Random = "random",
1454
+ /**
1455
+ * 平分
1456
+ */
1457
+ Average = "average",
1458
+ /**
1459
+ * 专属
1460
+ */
1461
+ Specify = "specify",
1462
+ /**
1463
+ * 心跳
1464
+ */
1465
+ Heartbeat = "heartbeat",
1466
+ /**
1467
+ * 猜拳
1468
+ */
1469
+ RockPaperScissors = "rockPaperScissors"
1470
+ }
1471
+ /**
1472
+ * 红包数据
1473
+ */
1474
+ declare class Redpacket implements IRedpacket {
1475
+ /**
1476
+ * 红包类型
1477
+ */
1478
+ type: RedPacketType;
1479
+ /**
1480
+ * 红包积分
1481
+ */
1482
+ money: number;
1483
+ /**
1484
+ * 红包个数
1485
+ */
1486
+ count: number;
1487
+ /**
1488
+ * 祝福语
1489
+ */
1490
+ msg: string;
1491
+ /**
1492
+ * 接收者,专属红包有效
1493
+ */
1494
+ recivers?: Array<string>;
1495
+ /**
1496
+ * 出拳,猜拳红包有效
1497
+ */
1498
+ gesture?: GestureType;
1499
+ }
1500
+ /**
1501
+ * 红包数据
1502
+ */
1503
+ interface IRedpacket {
1504
+ /**
1505
+ * 红包类型
1506
+ */
1507
+ type: RedPacketType;
1508
+ /**
1509
+ * 红包积分
1510
+ */
1511
+ money: number;
1512
+ /**
1513
+ * 红包个数
1514
+ */
1515
+ count: number;
1516
+ /**
1517
+ * 祝福语
1518
+ */
1519
+ msg: string;
1520
+ /**
1521
+ * 接收者,专属红包有效
1522
+ */
1523
+ recivers?: Array<string>;
1524
+ /**
1525
+ * 出拳,猜拳红包有效
1526
+ */
1527
+ gesture?: GestureType;
1528
+ }
1529
+ /**
1530
+ * 红包领取者信息
1531
+ */
1532
+ interface IRedPacketGot {
1533
+ /**
1534
+ * 用户 id
1535
+ */
1536
+ userId: string;
1537
+ /**
1538
+ * 用户名
1539
+ */
1540
+ userName: string;
1541
+ /**
1542
+ * 用户头像
1543
+ */
1544
+ avatar: string;
1545
+ /**
1546
+ * 领取到的积分
1547
+ */
1548
+ userMoney: number;
1549
+ /**
1550
+ * 领取积分时间
1551
+ */
1552
+ time: string;
1553
+ }
1554
+ /**
1555
+ * 红包历史信息
1556
+ */
1557
+ interface IRedPacketMessage {
1558
+ /**
1559
+ * 消息类型,固定为 redPacket
1560
+ */
1561
+ msgType: string;
1562
+ /**
1563
+ * 红包数
1564
+ */
1565
+ count: number;
1566
+ /**
1567
+ * 领取数
1568
+ */
1569
+ got: number;
1570
+ /**
1571
+ * 内含积分
1572
+ */
1573
+ money: number;
1574
+ /**
1575
+ * 祝福语
1576
+ */
1577
+ msg: string;
1578
+ /**
1579
+ * 发送者 id
1580
+ */
1581
+ senderId: string;
1582
+ /**
1583
+ * 红包类型
1584
+ */
1585
+ type: RedPacketType;
1586
+ /**
1587
+ * 接收者,专属红包有效
1588
+ */
1589
+ recivers: string[];
1590
+ /**
1591
+ * 已领取者列表
1592
+ */
1593
+ who: IRedPacketGot[];
1594
+ }
1595
+ /**
1596
+ * 红包基本信息
1597
+ */
1598
+ interface IRedPacketBase {
1599
+ /**
1600
+ * 数量
1601
+ */
1602
+ count: number;
1603
+ /**
1604
+ * 猜拳类型
1605
+ */
1606
+ gesture?: GestureType;
1607
+ /**
1608
+ * 领取数
1609
+ */
1610
+ got: number;
1611
+ /**
1612
+ * 祝福语
1613
+ */
1614
+ msg: string;
1615
+ /**
1616
+ * 发送者用户名
1617
+ */
1618
+ userName: string;
1619
+ /**
1620
+ * 用户头像
1621
+ */
1622
+ userAvatarURL: string;
1623
+ }
1624
+ /**
1625
+ * 红包信息
1626
+ */
1627
+ interface IRedPacketInfo {
1628
+ /**
1629
+ * 红包基本信息
1630
+ */
1631
+ info: IRedPacketBase;
1632
+ /**
1633
+ * 接收者,专属红包有效
1634
+ */
1635
+ recivers: string[];
1636
+ /**
1637
+ * 已领取者列表
1638
+ */
1639
+ who: IRedPacketGot[];
1640
+ }
1641
+ /**
1642
+ * 红包状态信息
1643
+ */
1644
+ interface IRedPacketStatusMsg {
1645
+ /**
1646
+ * 对应红包消息 oId
1647
+ */
1648
+ oId: string;
1649
+ /**
1650
+ * 红包个数
1651
+ */
1652
+ count: number;
1653
+ /**
1654
+ * 已领取数量
1655
+ */
1656
+ got: number;
1657
+ /**
1658
+ * 发送者信息
1659
+ */
1660
+ whoGive: any;
1661
+ /**
1662
+ * 领取者信息
1663
+ */
1664
+ whoGot: any[];
1665
+ }
1666
+ //#endregion
1667
+ //#region src/types/user.d.ts
1668
+ interface IUserLite {
1669
+ oId: string;
1670
+ userAvatarURL: string;
1671
+ userNickname: string;
1672
+ userName: string;
1673
+ }
1674
+ /**
1675
+ * 用户信息
1676
+ */
1677
+ declare class UserInfo {
1678
+ /**
1679
+ * 用户 id
1680
+ */
1681
+ oId: string;
1682
+ /**
1683
+ * 用户编号
1684
+ */
1685
+ userNo: string;
1686
+ /**
1687
+ * 用户名
1688
+ */
1689
+ userName: string;
1690
+ /**
1691
+ * 昵称
1692
+ */
1693
+ userNickname: string;
1694
+ /**
1695
+ * 首页地址
1696
+ */
1697
+ URL: string;
1698
+ /**
1699
+ * 所在城市
1700
+ */
1701
+ city: string;
1702
+ /**
1703
+ * 签名
1704
+ */
1705
+ intro: string;
1706
+ /**
1707
+ * 是否在线
1708
+ */
1709
+ online: boolean;
1710
+ /**
1711
+ * 用户积分
1712
+ */
1713
+ points: number;
1714
+ /**
1715
+ * 用户组
1716
+ */
1717
+ role: string;
1718
+ /**
1719
+ * 角色
1720
+ */
1721
+ appRole: UserAppRole;
1722
+ /**
1723
+ * 用户头像地址
1724
+ */
1725
+ avatar: string;
1726
+ /**
1727
+ * 用户卡片背景
1728
+ */
1729
+ cardBg: string;
1730
+ /**
1731
+ * 用户关注数
1732
+ */
1733
+ following: number;
1734
+ /**
1735
+ * 用户被关注数
1736
+ */
1737
+ follower: number;
1738
+ /**
1739
+ * 在线时长,单位分钟
1740
+ */
1741
+ onlineMinute: number;
1742
+ /**
1743
+ * 是否已经关注,未登录则为 `hide`
1744
+ */
1745
+ canFollow: 'hide' | 'no' | 'yes';
1746
+ /**
1747
+ * 用户所有勋章列表,包含未佩戴
1748
+ */
1749
+ ownedMetal: Metal[];
1750
+ /**
1751
+ * 用户勋章列表
1752
+ */
1753
+ sysMetal: Metal[];
1754
+ /**
1755
+ * MBTI 性格类型
1756
+ */
1757
+ mbti: string;
1758
+ get name(): string;
1759
+ static from(user: Record<string, any>): UserInfo;
1760
+ }
1761
+ /**
1762
+ * 徽章属性
1763
+ */
1764
+ declare class MetalAttr {
1765
+ /**
1766
+ * 徽标图地址
1767
+ */
1768
+ url: string;
1769
+ /**
1770
+ * 背景色
1771
+ */
1772
+ backcolor: string;
1773
+ /**
1774
+ * 文字颜色
1775
+ */
1776
+ fontcolor: string;
1777
+ /**
1778
+ * 版本号
1779
+ */
1780
+ ver: number;
1781
+ /**
1782
+ * 缩放比例
1783
+ */
1784
+ scale: number;
1785
+ toString(): string;
1786
+ }
1787
+ /**
1788
+ * 徽章基本信息
1789
+ */
1790
+ declare class MetalBase {
1791
+ /**
1792
+ * 徽章属性
1793
+ */
1794
+ attr: MetalAttr | string;
1795
+ /**
1796
+ * 徽章名
1797
+ */
1798
+ name: string;
1799
+ /**
1800
+ * 徽章描述
1801
+ */
1802
+ description: string;
1803
+ /**
1804
+ * 徽章数据
1805
+ */
1806
+ data: string;
1807
+ constructor(metal?: MetalBase);
1808
+ toUrl(includeText?: boolean): string;
1809
+ }
1810
+ /**
1811
+ * 徽章信息
1812
+ */
1813
+ declare class Metal extends MetalBase {
1814
+ /**
1815
+ * 完整徽章地址(含文字)
1816
+ */
1817
+ url?: string;
1818
+ /**
1819
+ * 徽章地址(不含文字)
1820
+ */
1821
+ icon?: string;
1822
+ /**
1823
+ * 是否佩戴
1824
+ */
1825
+ enable: boolean;
1826
+ }
1827
+ declare class AtUser {
1828
+ /**
1829
+ * 用户名
1830
+ */
1831
+ userName: string;
1832
+ /**
1833
+ * 用户头像
1834
+ */
1835
+ userAvatarURL: string;
1836
+ /**
1837
+ * 全小写用户名
1838
+ */
1839
+ userNameLowerCase: string;
1840
+ }
1841
+ /**
1842
+ * 徽章属性
1843
+ */
1844
+ interface IMetalAttr {
1845
+ /**
1846
+ * 徽标图地址
1847
+ */
1848
+ url: string;
1849
+ /**
1850
+ * 背景色
1851
+ */
1852
+ backcolor: string;
1853
+ /**
1854
+ * 文字颜色
1855
+ */
1856
+ fontcolor: string;
1857
+ }
1858
+ /**
1859
+ * 徽章基本信息
1860
+ */
1861
+ interface IMetalBase {
1862
+ /**
1863
+ * 徽章属性
1864
+ */
1865
+ attr: IMetalAttr | string;
1866
+ /**
1867
+ * 徽章名
1868
+ */
1869
+ name: string;
1870
+ /**
1871
+ * 徽章描述
1872
+ */
1873
+ description: string;
1874
+ /**
1875
+ * 徽章数据
1876
+ */
1877
+ data: string;
1878
+ }
1879
+ /**
1880
+ * 徽章信息
1881
+ */
1882
+ interface IMetal extends IMetalBase {
1883
+ /**
1884
+ * 完整徽章地址(含文字)
1885
+ */
1886
+ url?: string;
1887
+ /**
1888
+ * 徽章地址(不含文字)
1889
+ */
1890
+ icon?: string;
1891
+ /**
1892
+ * 是否佩戴
1893
+ */
1894
+ enable: boolean;
1895
+ }
1896
+ interface IAtUser {
1897
+ /**
1898
+ * 用户名
1899
+ */
1900
+ userName: string;
1901
+ /**
1902
+ * 用户头像
1903
+ */
1904
+ userAvatarURL: string;
1905
+ /**
1906
+ * 全小写用户名
1907
+ */
1908
+ userNameLowerCase: string;
1909
+ }
1910
+ /**
1911
+ * 更新用户信息参数
1912
+ */
1913
+ interface UserUpdateParams {
1914
+ /**
1915
+ * 昵称
1916
+ */
1917
+ userNickname?: string;
1918
+ /**
1919
+ * 用户标签,多个标签用逗号分隔
1920
+ */
1921
+ userTags?: string;
1922
+ /**
1923
+ * 个人主页 URL
1924
+ */
1925
+ userURL?: string;
1926
+ /**
1927
+ * 个人简介
1928
+ */
1929
+ userIntro?: string;
1930
+ /**
1931
+ * MBTI 性格类型(例如:ENFP)
1932
+ */
1933
+ mbti?: string;
1934
+ }
1935
+ //#endregion
1936
+ //#region src/types/finger.d.ts
1937
+ /**
1938
+ * 摸鱼大闯关信息
1939
+ */
1940
+ declare class MoFishGame implements IMoFishGame {
1941
+ userName: string;
1942
+ stage: string;
1943
+ time: number;
1944
+ }
1945
+ /**
1946
+ * 用户背包物品类型
1947
+ */
1948
+ declare enum UserBagType {
1949
+ checkin1day = 0,
1950
+ checkin2days = 1,
1951
+ patchCheckinCard = 2,
1952
+ metalTicket = 3
1953
+ }
1954
+ /**
1955
+ * 摸鱼大闯关信息
1956
+ */
1957
+ interface IMoFishGame {
1958
+ userName: string;
1959
+ stage: string;
1960
+ time: number;
1961
+ }
1962
+ /**
1963
+ * 用户 IP 信息
1964
+ */
1965
+ interface IUserIP {
1966
+ latestLoginIP: string;
1967
+ userId: string;
1968
+ }
1969
+ /**
1970
+ * 用户背包信息
1971
+ */
1972
+ interface IUserBag {
1973
+ /**
1974
+ * 免签卡
1975
+ */
1976
+ checkin1day: number;
1977
+ /**
1978
+ * 两日免签卡
1979
+ */
1980
+ checkin2days: number;
1981
+ /**
1982
+ * 补签卡
1983
+ */
1984
+ patchCheckinCard: number;
1985
+ /**
1986
+ * 摸鱼派一周年纪念勋章领取券
1987
+ */
1988
+ metalTicket: number;
1989
+ /**
1990
+ * 改名卡
1991
+ */
1992
+ nameCard: number;
1993
+ /**
1994
+ * 免签天数
1995
+ */
1996
+ sysCheckinRemain: number;
1997
+ }
1998
+ //#endregion
1999
+ //#region src/types/notice.d.ts
2000
+ /**
2001
+ * 通知类型
2002
+ */
2003
+ declare enum NoticeType {
2004
+ /**
2005
+ * 积分
2006
+ */
2007
+ Point = "point",
2008
+ /**
2009
+ * 评论
2010
+ */
2011
+ Comment = "commented",
2012
+ /**
2013
+ * 回复
2014
+ */
2015
+ Reply = "reply",
2016
+ /**
2017
+ * 提及我的
2018
+ */
2019
+ At = "at",
2020
+ /**
2021
+ * 我关注的
2022
+ */
2023
+ Following = "following",
2024
+ /**
2025
+ * 同城
2026
+ */
2027
+ Broadcast = "broadcast",
2028
+ /**
2029
+ * 系统
2030
+ */
2031
+ System = "sys-announce"
2032
+ }
2033
+ /**
2034
+ * 通知列表
2035
+ */
2036
+ type NoticeList = Array<INoticePoint | INoticeComment | INoticeReply | INoticeAt | INoticeArticle | INoticeSystem>;
2037
+ /**
2038
+ * 通知数
2039
+ */
2040
+ interface INoticeCount {
2041
+ /**
2042
+ * 用户是否启用 Web 通知
2043
+ */
2044
+ userNotifyStatus: boolean;
2045
+ /**
2046
+ * 未读通知数
2047
+ */
2048
+ unreadNotificationCnt: number;
2049
+ /**
2050
+ * 未读回复通知数
2051
+ */
2052
+ unreadReplyNotificationCnt: number;
2053
+ /**
2054
+ * 未读积分通知数
2055
+ */
2056
+ unreadPointNotificationCnt: number;
2057
+ /**
2058
+ * 未读 @ 通知数
2059
+ */
2060
+ unreadAtNotificationCnt: number;
2061
+ /**
2062
+ * 未读同城通知数
2063
+ */
2064
+ unreadBroadcastNotificationCnt: number;
2065
+ /**
2066
+ * 未读系统通知数
2067
+ */
2068
+ unreadSysAnnounceNotificationCnt: number;
2069
+ /**
2070
+ * 未读关注者通知数
2071
+ */
2072
+ unreadNewFollowerNotificationCnt: number;
2073
+ /**
2074
+ * 未读关注通知数
2075
+ */
2076
+ unreadFollowingNotificationCnt: number;
2077
+ /**
2078
+ * 未读评论通知数
2079
+ */
2080
+ unreadCommentedNotificationCnt: number;
2081
+ }
2082
+ /**
2083
+ * 积分通知
2084
+ */
2085
+ interface INoticePoint {
2086
+ /**
2087
+ * 通知 id
2088
+ */
2089
+ oId: string;
2090
+ /**
2091
+ * 数据 id
2092
+ */
2093
+ dataId: string;
2094
+ /**
2095
+ * 用户 id
2096
+ */
2097
+ userId: string;
2098
+ /**
2099
+ * 数据类型
2100
+ */
2101
+ dataType: DataType;
2102
+ /**
2103
+ * 通知描述
2104
+ */
2105
+ description: string;
2106
+ /**
2107
+ * 是否已读
2108
+ */
2109
+ hasRead: boolean;
2110
+ /**
2111
+ * 创建日期
2112
+ */
2113
+ createTime: string;
2114
+ }
2115
+ /**
2116
+ * 评论通知
2117
+ */
2118
+ interface INoticeComment {
2119
+ /**
2120
+ * 通知 id
2121
+ */
2122
+ oId: string;
2123
+ /**
2124
+ * 文章标题
2125
+ */
2126
+ commentArticleTitle: string;
2127
+ /**
2128
+ * 文章作者
2129
+ */
2130
+ commentAuthorName: string;
2131
+ /**
2132
+ * 作者头像
2133
+ */
2134
+ commentAuthorThumbnailURL: string;
2135
+ /**
2136
+ * 文章类型
2137
+ */
2138
+ commentArticleType: number;
2139
+ /**
2140
+ * 是否精选
2141
+ */
2142
+ commentArticlePerfect: number;
2143
+ /**
2144
+ * 评论内容
2145
+ */
2146
+ commentContent: string;
2147
+ /**
2148
+ * 评论地址
2149
+ */
2150
+ commentSharpURL: string;
2151
+ /**
2152
+ * 是否已读
2153
+ */
2154
+ hasRead: boolean;
2155
+ /**
2156
+ * 评论时间
2157
+ */
2158
+ commentCreateTime: string;
2159
+ }
2160
+ /**
2161
+ * 回帖通知
2162
+ */
2163
+ interface INoticeReply extends INoticeComment {
2164
+ /**
2165
+ * 文章 id
2166
+ */
2167
+ articleId: string;
2168
+ /**
2169
+ * 数据类型
2170
+ */
2171
+ dataType: DataType;
2172
+ }
2173
+ /**
2174
+ * 提到我通知
2175
+ */
2176
+ interface INoticeAt {
2177
+ /**
2178
+ * 通知 id
2179
+ */
2180
+ oId: string;
2181
+ /**
2182
+ * 数据 id
2183
+ */
2184
+ dataId: string;
2185
+ /**
2186
+ * 数据类型
2187
+ */
2188
+ dataType: DataType;
2189
+ /**
2190
+ * 用户名
2191
+ */
2192
+ userName: string;
2193
+ /**
2194
+ * 用户头像
2195
+ */
2196
+ thumbnailURL: string;
2197
+ /**
2198
+ * 通知内容
2199
+ */
2200
+ description: string;
2201
+ /**
2202
+ * 是否已读
2203
+ */
2204
+ hasRead: boolean;
2205
+ /**
2206
+ * 创建时间
2207
+ */
2208
+ createTime: string;
2209
+ }
2210
+ /**
2211
+ * 我关注的通知
2212
+ */
2213
+ interface INoticeArticle {
2214
+ /**
2215
+ * 通知 Id
2216
+ */
2217
+ oId: string;
2218
+ /**
2219
+ * 文章地址
2220
+ */
2221
+ url: string;
2222
+ /**
2223
+ * 数据类型
2224
+ */
2225
+ dataType: DataType;
2226
+ /**
2227
+ * 文章标题
2228
+ */
2229
+ articleTitle: string;
2230
+ /**
2231
+ * 作者
2232
+ */
2233
+ authorName: string;
2234
+ /**
2235
+ * 通知内容
2236
+ */
2237
+ content: string;
2238
+ /**
2239
+ * 是否评论
2240
+ */
2241
+ isComment: boolean;
2242
+ /**
2243
+ * 作者头像
2244
+ */
2245
+ thumbnailURL: string;
2246
+ /**
2247
+ * 文章评论数
2248
+ */
2249
+ articleCommentCount: number;
2250
+ /**
2251
+ * 是否精选
2252
+ */
2253
+ articlePerfect: number;
2254
+ /**
2255
+ * 文章标签列表
2256
+ */
2257
+ articleTagObjs: ArticleTag[];
2258
+ /**
2259
+ * 文章标签
2260
+ */
2261
+ articleTags: string;
2262
+ /**
2263
+ * 文章类型
2264
+ */
2265
+ articleType: number;
2266
+ /**
2267
+ * 是否已读
2268
+ */
2269
+ hasRead: boolean;
2270
+ /**
2271
+ * 通知创建时间
2272
+ */
2273
+ createTime: string;
2274
+ }
2275
+ /**
2276
+ * 系统通知数据
2277
+ */
2278
+ interface INoticeSystem {
2279
+ /**
2280
+ * 消息的 oId
2281
+ */
2282
+ oId: string;
2283
+ /**
2284
+ * 用户 Id
2285
+ */
2286
+ userId: string;
2287
+ /**
2288
+ * 数据 Id
2289
+ */
2290
+ dataId: string;
2291
+ /**
2292
+ * 数据类型
2293
+ */
2294
+ dataType: DataType;
2295
+ /**
2296
+ * 消息描述
2297
+ */
2298
+ description: string;
2299
+ /**
2300
+ * 是否已读
2301
+ */
2302
+ hasRead: boolean;
2303
+ /**
2304
+ * 创建日期
2305
+ */
2306
+ createTime: string;
2307
+ }
2308
+ declare enum NoticeCommandType {
2309
+ /** 刷新通知 */
2310
+ RefreshNotification = "refreshNotification",
2311
+ /**
2312
+ * 聊天未读数刷新
2313
+ */
2314
+ ChatUnreadCountRefresh = "chatUnreadCountRefresh",
2315
+ /**
2316
+ * 新的闲聊消息
2317
+ */
2318
+ NewIdleChatMessage = "newIdleChatMessage",
2319
+ /**
2320
+ * 系统广播警告
2321
+ */
2322
+ WarnBroadcast = "warnBroadcast",
2323
+ /**
2324
+ * 清风明月更新
2325
+ */
2326
+ bzUpdate = "bzUpdate"
2327
+ }
2328
+ /**
2329
+ * 通知消息
2330
+ */
2331
+ interface INoticeCommand {
2332
+ /**
2333
+ * 通知类型
2334
+ */
2335
+ command: NoticeCommandType;
2336
+ }
2337
+ /**
2338
+ * 未读消息数
2339
+ */
2340
+ interface INoticeUnReadCount extends INoticeCommand {
2341
+ /**
2342
+ * 未读数
2343
+ */
2344
+ count: number;
2345
+ }
2346
+ /**
2347
+ * 私聊通知
2348
+ */
2349
+ interface INoticeIdleChat extends INoticeCommand {
2350
+ senderUserName: string;
2351
+ senderAvatar: string;
2352
+ preview: string;
2353
+ }
2354
+ /**
2355
+ * 系统广播
2356
+ */
2357
+ interface INoticeWarnBroadcast extends INoticeCommand {
2358
+ warnBroadcastText: string;
2359
+ who: string;
2360
+ }
2361
+ /**
2362
+ * 清风明月更新
2363
+ */
2364
+ interface INoticeBreezemoon extends INoticeCommand {
2365
+ /**
2366
+ * 发布者用户名
2367
+ */
2368
+ breezemoonAuthorName: string;
2369
+ /**
2370
+ * 发布者头像
2371
+ */
2372
+ breezemoonAuthorThumbnailURL48: string;
2373
+ /**
2374
+ * 内容
2375
+ */
2376
+ breezemoonContent: string;
2377
+ /**
2378
+ * 清风明月ID
2379
+ */
2380
+ oId: string;
2381
+ }
2382
+ //#endregion
2383
+ //#region src/types/index.d.ts
2384
+ /**
2385
+ * 数据类型
2386
+ */
2387
+ declare enum DataType {
2388
+ /**
2389
+ * 文章
2390
+ */
2391
+ article = 0,
2392
+ /**
2393
+ * 评论
2394
+ */
2395
+ comment = 1,
2396
+ /**
2397
+ * @
2398
+ */
2399
+ at = 2,
2400
+ /**
2401
+ * 被评论
2402
+ */
2403
+ commented = 3,
2404
+ /**
2405
+ * 关注者
2406
+ */
2407
+ followingUser = 4,
2408
+ /**
2409
+ * 积分 - 充值
2410
+ */
2411
+ pointCharge = 5,
2412
+ /**
2413
+ * 积分 - 转账
2414
+ */
2415
+ pointTransfer = 6,
2416
+ /**
2417
+ * 积分 - 文章打赏
2418
+ */
2419
+ pointArticleReward = 7,
2420
+ /**
2421
+ * 积分 - 评论感谢
2422
+ */
2423
+ pointCommentThank = 8,
2424
+ /**
2425
+ * 同城广播
2426
+ */
2427
+ broadcast = 9,
2428
+ /**
2429
+ * 积分 - 交易
2430
+ */
2431
+ pointExchange = 10,
2432
+ /**
2433
+ * 积分 - 滥用扣除
2434
+ */
2435
+ abusePointDeduct = 11,
2436
+ /**
2437
+ * 积分 - 文章被感谢
2438
+ */
2439
+ pointArticleThank = 12,
2440
+ /**
2441
+ * 回复
2442
+ */
2443
+ reply = 13,
2444
+ /**
2445
+ * 使用邀请码
2446
+ */
2447
+ invitecodeUsed = 14,
2448
+ /**
2449
+ * 系统公告 - 文章
2450
+ */
2451
+ sysAnnounceArticle = 15,
2452
+ /**
2453
+ * 系统公告 - 新用户
2454
+ */
2455
+ sysAnnounceNewUser = 16,
2456
+ /**
2457
+ * 新的关注者
2458
+ */
2459
+ newFollower = 17,
2460
+ /**
2461
+ * 邀请链接
2462
+ */
2463
+ invitationLinkUsed = 18,
2464
+ /**
2465
+ * 系统通知 - 角色变化
2466
+ */
2467
+ sysAnnounceRoleChanged = 19,
2468
+ /**
2469
+ * 关注的文章更新
2470
+ */
2471
+ followingArticleUpdate = 20,
2472
+ /**
2473
+ * 关注的文章评论
2474
+ */
2475
+ followingArticleComment = 21,
2476
+ /**
2477
+ * 积分 - 文章优选
2478
+ */
2479
+ pointPerfectArticle = 22,
2480
+ /**
2481
+ * 文章新的被关注者
2482
+ */
2483
+ articleNewFollower = 23,
2484
+ /**
2485
+ * 文章新的关注者
2486
+ */
2487
+ articleNewWatcher = 24,
2488
+ /**
2489
+ * 评论点赞
2490
+ */
2491
+ commentVoteUp = 25,
2492
+ /**
2493
+ * 评论点踩
2494
+ */
2495
+ commentVoteDown = 26,
2496
+ /**
2497
+ * 文章被点赞
2498
+ */
2499
+ articleVoteUp = 27,
2500
+ /**
2501
+ * 文章被点踩
2502
+ */
2503
+ articleVoteDown = 28,
2504
+ /**
2505
+ * 积分 - 评论被接受
2506
+ */
2507
+ pointCommentAccept = 33,
2508
+ /**
2509
+ * 积分 - 举报处理
2510
+ */
2511
+ pointReportHandled = 36,
2512
+ /**
2513
+ * 聊天室 @
2514
+ */
2515
+ chatRoomAt = 38,
2516
+ /**
2517
+ * 专属红包提醒
2518
+ */
2519
+ redPacket = 39
2520
+ }
2521
+ /**
2522
+ * 用户角色类型
2523
+ */
2524
+ declare enum UserAppRole {
2525
+ /**
2526
+ * 黑客
2527
+ */
2528
+ Hack = 0,
2529
+ /**
2530
+ * 画家
2531
+ */
2532
+ Artist = 1
2533
+ }
2534
+ /**
2535
+ * 举报数据类型
2536
+ */
2537
+ declare enum ReportDataType {
2538
+ /**
2539
+ * 文章
2540
+ */
2541
+ article = 0,
2542
+ /**
2543
+ * 评论
2544
+ */
2545
+ comment = 1,
2546
+ /**
2547
+ * 用户
2548
+ */
2549
+ user = 2,
2550
+ /**
2551
+ * 聊天消息
2552
+ */
2553
+ chatroom = 3
2554
+ }
2555
+ /**
2556
+ * 举报类型
2557
+ */
2558
+ declare enum ReportType {
2559
+ /**
2560
+ * 垃圾广告
2561
+ */
2562
+ advertise = 0,
2563
+ /**
2564
+ * 色情
2565
+ */
2566
+ porn = 1,
2567
+ /**
2568
+ * 违规
2569
+ */
2570
+ violate = 2,
2571
+ /**
2572
+ * 侵权
2573
+ */
2574
+ infringement = 3,
2575
+ /**
2576
+ * 人身攻击
2577
+ */
2578
+ attacks = 4,
2579
+ /**
2580
+ * 冒充他人账号
2581
+ */
2582
+ impersonate = 5,
2583
+ /**
2584
+ * 垃圾广告账号
2585
+ */
2586
+ advertisingAccount = 6,
2587
+ /**
2588
+ * 违规泄露个人信息
2589
+ */
2590
+ leakPrivacy = 7,
2591
+ /**
2592
+ * 其它
2593
+ */
2594
+ other = 8
2595
+ }
2596
+ /**
2597
+ * 登录信息
2598
+ */
2599
+ declare class Account implements IAccount {
2600
+ /**
2601
+ * 用户名
2602
+ */
2603
+ username: string;
2604
+ /**
2605
+ * 密码
2606
+ */
2607
+ passwd: string;
2608
+ /**
2609
+ * 二次验证码,非必填
2610
+ */
2611
+ mfaCode?: string;
2612
+ }
2613
+ /**
2614
+ * 注册信息
2615
+ */
2616
+ declare class PreRegisterInfo implements IPreRegisterInfo {
2617
+ /**
2618
+ * 用户名
2619
+ */
2620
+ username: string;
2621
+ /**
2622
+ * 手机号
2623
+ */
2624
+ phone: string;
2625
+ /**
2626
+ * 邀请码
2627
+ */
2628
+ invitecode?: string;
2629
+ /**
2630
+ * 验证码
2631
+ */
2632
+ captcha: string;
2633
+ }
2634
+ /**
2635
+ * 注册信息
2636
+ */
2637
+ declare class RegisterInfo implements IRegisterInfo {
2638
+ /**
2639
+ * 用户角色
2640
+ */
2641
+ role: string;
2642
+ /**
2643
+ * 用户密码
2644
+ */
2645
+ passwd: string;
2646
+ /**
2647
+ * 用户 Id
2648
+ */
2649
+ userId: string;
2650
+ /**
2651
+ * 邀请人用户名
2652
+ */
2653
+ r?: string;
2654
+ }
2655
+ /**
2656
+ * 举报接口数据
2657
+ */
2658
+ declare class Report implements IReport {
2659
+ /**
2660
+ * 举报对象的 oId
2661
+ */
2662
+ reportDataId: string;
2663
+ /**
2664
+ * 举报数据的类型
2665
+ */
2666
+ reportDataType: ReportDataType;
2667
+ /**
2668
+ * 举报的类型
2669
+ */
2670
+ reportType: ReportType;
2671
+ /**
2672
+ * 举报的理由
2673
+ */
2674
+ reportMemo: string;
2675
+ }
2676
+ /**
2677
+ * 登录信息
2678
+ */
2679
+ interface IAccount {
2680
+ /**
2681
+ * 用户名
2682
+ */
2683
+ username: string;
2684
+ /**
2685
+ * 密码
2686
+ */
2687
+ passwd: string;
2688
+ /**
2689
+ * 二次验证码,非必填
2690
+ */
2691
+ mfaCode?: string;
2692
+ }
2693
+ /**
2694
+ * 注册信息
2695
+ */
2696
+ interface IPreRegisterInfo {
2697
+ /**
2698
+ * 用户名
2699
+ */
2700
+ username: string;
2701
+ /**
2702
+ * 手机号
2703
+ */
2704
+ phone: string;
2705
+ /**
2706
+ * 邀请码
2707
+ */
2708
+ invitecode?: string;
2709
+ /**
2710
+ * 验证码
2711
+ */
2712
+ captcha: string;
2713
+ }
2714
+ /**
2715
+ * 注册信息
2716
+ */
2717
+ interface IRegisterInfo {
2718
+ /**
2719
+ * 用户角色
2720
+ */
2721
+ role: string;
2722
+ /**
2723
+ * 用户密码
2724
+ */
2725
+ passwd: string;
2726
+ /**
2727
+ * 用户 Id
2728
+ */
2729
+ userId: string;
2730
+ /**
2731
+ * 邀请人用户名
2732
+ */
2733
+ r?: string;
2734
+ }
2735
+ /**
2736
+ * 上传文件响应
2737
+ */
2738
+ interface IUploadInfo {
2739
+ /**
2740
+ * 上传失败文件
2741
+ */
2742
+ errFiles: string[];
2743
+ /**
2744
+ * 上传成功文件
2745
+ */
2746
+ succMap: {
2747
+ /**
2748
+ * Key 是文件名,value 为地址
2749
+ */
2750
+ [key: string]: string;
2751
+ };
2752
+ }
2753
+ /**
2754
+ * VIP 信息
2755
+ */
2756
+ interface IUserVIP {
2757
+ /**
2758
+ * VIP Id
2759
+ */
2760
+ oId: string;
2761
+ /**
2762
+ * VIP 状态
2763
+ */
2764
+ state: number;
2765
+ /**
2766
+ * 用户 Id
2767
+ */
2768
+ userId: string;
2769
+ /**
2770
+ * 是否 VIP
2771
+ */
2772
+ jointVip: boolean;
2773
+ /**
2774
+ * 颜色
2775
+ */
2776
+ color: string;
2777
+ /**
2778
+ * 是否有下划线
2779
+ */
2780
+ underline: boolean;
2781
+ /**
2782
+ * 是否有金属质感
2783
+ */
2784
+ metal: boolean;
2785
+ /**
2786
+ * 是否自动签到
2787
+ */
2788
+ autoCheckin: number;
2789
+ /**
2790
+ * 是否加粗
2791
+ */
2792
+ bold: boolean;
2793
+ /**
2794
+ * 等级代码
2795
+ */
2796
+ lvCode: string;
2797
+ /**
2798
+ * 过期时间
2799
+ */
2800
+ expiresAt: number;
2801
+ /**
2802
+ * 创建时间
2803
+ */
2804
+ createdAt: number;
2805
+ /**
2806
+ * 更新时间
2807
+ */
2808
+ updatedAt: number;
2809
+ }
2810
+ declare class UserVIP implements IUserVIP {
2811
+ /**
2812
+ * VIP Id
2813
+ */
2814
+ oId: string;
2815
+ /**
2816
+ * VIP 状态
2817
+ */
2818
+ state: number;
2819
+ /**
2820
+ * 用户 Id
2821
+ */
2822
+ userId: string;
2823
+ /**
2824
+ * 是否 VIP
2825
+ */
2826
+ jointVip: boolean;
2827
+ /**
2828
+ * 颜色
2829
+ */
2830
+ color: string;
2831
+ /**
2832
+ * 是否有下划线
2833
+ */
2834
+ underline: boolean;
2835
+ /**
2836
+ * 是否有金属质感
2837
+ */
2838
+ metal: boolean;
2839
+ /**
2840
+ * 是否自动签到
2841
+ */
2842
+ autoCheckin: number;
2843
+ /**
2844
+ * 是否加粗
2845
+ */
2846
+ bold: boolean;
2847
+ /**
2848
+ * 等级代码
2849
+ */
2850
+ lvCode: string;
2851
+ /**
2852
+ * 过期时间
2853
+ */
2854
+ expiresAt: number;
2855
+ /**
2856
+ * 创建时间
2857
+ */
2858
+ createdAt: number;
2859
+ /**
2860
+ * 更新时间
2861
+ */
2862
+ updatedAt: number;
2863
+ get isVip(): boolean;
2864
+ get vipName(): string;
2865
+ get expireDate(): Date;
2866
+ get createDate(): Date;
2867
+ get updateDate(): Date;
2868
+ static from(data: any): UserVIP;
2869
+ }
2870
+ /**
2871
+ * 举报接口数据
2872
+ */
2873
+ interface IReport {
2874
+ /**
2875
+ * 举报对象的 oId
2876
+ */
2877
+ reportDataId: string;
2878
+ /**
2879
+ * 举报数据的类型
2880
+ */
2881
+ reportDataType: ReportDataType;
2882
+ /**
2883
+ * 举报的类型
2884
+ */
2885
+ reportType: ReportType;
2886
+ /**
2887
+ * 举报的理由
2888
+ */
2889
+ reportMemo: string;
2890
+ }
2891
+ /**
2892
+ * 禁言用户信息
2893
+ */
2894
+ interface IMuteItem {
2895
+ /**
2896
+ * 解除禁言时间戳
2897
+ */
2898
+ time: number;
2899
+ /**
2900
+ * 用户头像
2901
+ */
2902
+ userAvatarURL: string;
2903
+ /**
2904
+ * 用户名
2905
+ */
2906
+ userName: string;
2907
+ /**
2908
+ * 用户昵称
2909
+ */
2910
+ userNickname: string;
2911
+ }
2912
+ interface ILog {
2913
+ /**
2914
+ * 操作时间
2915
+ */
2916
+ key1: string;
2917
+ /**
2918
+ * IP
2919
+ */
2920
+ key2: string;
2921
+ /**
2922
+ * 内容
2923
+ */
2924
+ data: string;
2925
+ /**
2926
+ * 是否公开
2927
+ */
2928
+ public: boolean;
2929
+ /**
2930
+ * 操作类型
2931
+ */
2932
+ key3: string;
2933
+ /**
2934
+ * 唯一标识
2935
+ */
2936
+ oId: string;
2937
+ /**
2938
+ * 类型
2939
+ */
2940
+ type: string;
2941
+ }
2942
+ declare class Pagination {
2943
+ /**
2944
+ * 分页数
2945
+ */
2946
+ pageCount: number;
2947
+ /**
2948
+ * 建议分页页码
2949
+ */
2950
+ pageNums: number[];
2951
+ static from(data: any): Pagination;
2952
+ }
2953
+ //#endregion
2954
+ //#region src/ws.d.ts
2955
+ interface IWebSocketEvent {
2956
+ /**
2957
+ * Websocket 打开
2958
+ */
2959
+ open: (event: Event) => void;
2960
+ /**
2961
+ * Websocket 关闭
2962
+ */
2963
+ close: (event: CloseEvent) => void;
2964
+ /**
2965
+ * Websocket 错误
2966
+ */
2967
+ error: (error: ErrorEvent) => void;
2968
+ }
2969
+ declare class WsEventBase<T> {
2970
+ emitter: {
2971
+ listeners: Map<string, Function[]>;
2972
+ on(event: string, listener: Function): /*elided*/any;
2973
+ off(event: string, listener: Function): /*elided*/any;
2974
+ once(event: string, listener: Function): /*elided*/any;
2975
+ emit(event: string, ...args: any[]): /*elided*/any;
2976
+ removeAllListeners(event?: string): /*elided*/any;
2977
+ };
2978
+ ws: ReconnectingWebSocket | null;
2979
+ rwsOptions: Options;
2980
+ constructor();
2981
+ /**
2982
+ * 重连通知频道
2983
+ * @returns Websocket 连接对象
2984
+ */
2985
+ reconnect(): Promise<unknown>;
2986
+ /**
2987
+ * 连接 WebSocket 频道
2988
+ * @returns Websocket 连接对象
2989
+ */
2990
+ connect(reload?: boolean): Promise<ReconnectingWebSocket>;
2991
+ /**
2992
+ * WebSocket 监听
2993
+ * @param event WebSocket 事件
2994
+ * @param listener 监听器
2995
+ */
2996
+ on<K extends keyof T>(event: K, listener: T[K]): {
2997
+ listeners: Map<string, Function[]>;
2998
+ on(event: string, listener: Function): /*elided*/any;
2999
+ off(event: string, listener: Function): /*elided*/any;
3000
+ once(event: string, listener: Function): /*elided*/any;
3001
+ emit(event: string, ...args: any[]): /*elided*/any;
3002
+ removeAllListeners(event?: string): /*elided*/any;
3003
+ };
3004
+ /**
3005
+ * 移除 WebSocket 监听
3006
+ * @param event WebSocket 事件
3007
+ * @param listener 监听器
3008
+ */
3009
+ off<K extends keyof T>(event?: K, listener?: T[K]): {
3010
+ listeners: Map<string, Function[]>;
3011
+ on(event: string, listener: Function): /*elided*/any;
3012
+ off(event: string, listener: Function): /*elided*/any;
3013
+ once(event: string, listener: Function): /*elided*/any;
3014
+ emit(event: string, ...args: any[]): /*elided*/any;
3015
+ removeAllListeners(event?: string): /*elided*/any;
3016
+ };
3017
+ /**
3018
+ * WebSocket 单次监听
3019
+ * @param event WebSocket 事件
3020
+ * @param listener 监听器
3021
+ */
3022
+ once<K extends keyof T>(event: K, listener: T[K]): {
3023
+ listeners: Map<string, Function[]>;
3024
+ on(event: string, listener: Function): /*elided*/any;
3025
+ off(event: string, listener: Function): /*elided*/any;
3026
+ once(event: string, listener: Function): /*elided*/any;
3027
+ emit(event: string, ...args: any[]): /*elided*/any;
3028
+ removeAllListeners(event?: string): /*elided*/any;
3029
+ };
3030
+ /**
3031
+ * 清除 WebSocket 监听
3032
+ */
3033
+ clearListener(event?: keyof T): void;
3034
+ /**
3035
+ * 移除 WebSocket 消息监听函数
3036
+ * @param event WebSocket 事件
3037
+ * @param listener 监听器
3038
+ */
3039
+ removeListener<K extends keyof T>(event: K, listener: T[K]): {
3040
+ listeners: Map<string, Function[]>;
3041
+ on(event: string, listener: Function): /*elided*/any;
3042
+ off(event: string, listener: Function): /*elided*/any;
3043
+ once(event: string, listener: Function): /*elided*/any;
3044
+ emit(event: string, ...args: any[]): /*elided*/any;
3045
+ removeAllListeners(event?: string): /*elided*/any;
3046
+ };
3047
+ /**
3048
+ * 添加 WebSocket 消息监听函数
3049
+ * @param event WebSocket 事件
3050
+ * @param listener 监听器
3051
+ */
3052
+ addListener<K extends keyof T>(event: K, listener: T[K]): {
3053
+ listeners: Map<string, Function[]>;
3054
+ on(event: string, listener: Function): /*elided*/any;
3055
+ off(event: string, listener: Function): /*elided*/any;
3056
+ once(event: string, listener: Function): /*elided*/any;
3057
+ emit(event: string, ...args: any[]): /*elided*/any;
3058
+ removeAllListeners(event?: string): /*elided*/any;
3059
+ };
3060
+ }
3061
+ //#endregion
3062
+ //#region src/chatroom.d.ts
3063
+ interface IChatRoomEvents extends IWebSocketEvent {
3064
+ /**
3065
+ * 在线用户变更
3066
+ * @param onlines 在线用户
3067
+ */
3068
+ online: (onlines: IOnlineInfo[]) => void;
3069
+ /**
3070
+ * 话题变更
3071
+ * @param discuss 话题
3072
+ */
3073
+ discuss: (discuss: DiscussMsg) => void;
3074
+ /**
3075
+ * 撤回消息
3076
+ * @param oId 被撤回消息 oId
3077
+ */
3078
+ revoke: (oId: RevokeMsg) => void;
3079
+ /**
3080
+ * 弹幕消息
3081
+ * @param barrage 弹幕消息内容
3082
+ */
3083
+ barrager: (barrage: IBarragerMsg) => void;
3084
+ /**
3085
+ * 聊天消息
3086
+ * @param msg 聊天消息内容
3087
+ */
3088
+ msg: (msg: IChatRoomMsg) => void;
3089
+ /**
3090
+ * 红包消息
3091
+ * @param redpacket 红包内容
3092
+ */
3093
+ redPacket: (redpacket: IChatRoomMsg<IRedpacket>) => void;
3094
+ /**
3095
+ * 音乐消息
3096
+ * @param music 音乐消息内容
3097
+ */
3098
+ music: (music: IChatRoomMsg<IMusicMessage>) => void;
3099
+ /**
3100
+ * 天气消息
3101
+ * @param weather 天气消息内容
3102
+ */
3103
+ weather: (weather: IChatRoomMsg<IWeatherMessage>) => void;
3104
+ /**
3105
+ * 红包领取
3106
+ * @param status 红包领取状态
3107
+ */
3108
+ redPacketStatus: (status: IRedPacketStatusMsg) => void;
3109
+ /**
3110
+ * 进出通知
3111
+ * @param msg 进出通知内容
3112
+ */
3113
+ custom: (msg: CustomMsg) => void;
3114
+ /**
3115
+ * 发送所有消息
3116
+ * @param type 消息类型
3117
+ * @param data 消息内容
3118
+ */
3119
+ all: (type: string, data: any) => void;
3120
+ }
3121
+ declare class ChatRoom extends WsEventBase<IChatRoomEvents> {
3122
+ private apiKey;
3123
+ private _discusse;
3124
+ private _onlines;
3125
+ private wsTimer;
3126
+ private client;
3127
+ private version;
3128
+ constructor(token?: string);
3129
+ /**
3130
+ * 当前在线人数列表,需要先调用 addListener 添加聊天室消息监听
3131
+ */
3132
+ get onlines(): IOnlineInfo[];
3133
+ /**
3134
+ * 当前聊天室话题,需要先调用 addListener 添加聊天室消息监听
3135
+ */
3136
+ get discusse(): string;
3137
+ /**
3138
+ * 設置当前聊天室话题
3139
+ */
3140
+ set discusse(val: string);
3141
+ /**
3142
+ * 重新设置请求 Token
3143
+ * @param apiKey 接口 API Key
3144
+ */
3145
+ setToken(apiKey: string): void;
3146
+ /**
3147
+ * 设置当前来源类型
3148
+ * @param client 来源类型
3149
+ * @param version 版本号
3150
+ */
3151
+ setVia(client: ClientType | string, version: string): void;
3152
+ /**
3153
+ * 查询聊天室历史消息
3154
+ * @param page 消息页码
3155
+ * @param type 消息内容类型,HTML 或 Raw,默认 HTML
3156
+ */
3157
+ history(page?: number, type?: ChatContentType): Promise<IChatRoomMessage[]>;
3158
+ /**
3159
+ * 获取指定消息附近的聊天室消息
3160
+ * @param oId 消息 Id
3161
+ * @param mode 获取模式,context 上下文模式,after 之后模式
3162
+ * @param size 获取消息数量,默认 25,最大 100
3163
+ * @param type 获取消息类型,默认 HTML
3164
+ */
3165
+ get({
3166
+ oId,
3167
+ mode,
3168
+ size,
3169
+ type
3170
+ }: {
3171
+ oId: string;
3172
+ mode?: ChatMessageType;
3173
+ size?: number;
3174
+ type?: ChatContentType;
3175
+ }): Promise<IChatRoomMessage[]>;
3176
+ /**
3177
+ * 撤回消息,普通成员 24 小时内可撤回一条自己的消息,纪律委员/OP/管理员角色可以撤回任意人消息
3178
+ * @param oId 消息 Id
3179
+ */
3180
+ revoke(oId: string): Promise<void>;
3181
+ /**
3182
+ * 发送一条消息
3183
+ * @param msg 消息内容,支持 Markdown
3184
+ */
3185
+ send(msg: string, clientType?: ClientType | string, version?: string): Promise<void>;
3186
+ /**
3187
+ * 发送一条弹幕
3188
+ * @param msg 消息内容,支持 Markdown
3189
+ * @param color 弹幕颜色
3190
+ */
3191
+ barrage(msg: string, color?: string): Promise<void>;
3192
+ /**
3193
+ * 获取弹幕发送价格
3194
+ * @returns 返回价格`cost`与单位`unit`
3195
+ */
3196
+ barragePay(): Promise<{
3197
+ cost: number;
3198
+ unit: string;
3199
+ }>;
3200
+ /**
3201
+ * 获取禁言中成员列表(思过崖)
3202
+ */
3203
+ mutes(): Promise<IMuteItem[]>;
3204
+ /**
3205
+ * 获取消息原文(比如 Markdown)
3206
+ * @param oId 消息 Id
3207
+ */
3208
+ raw(oId: string): Promise<string>;
3209
+ /**
3210
+ * 红包接口对象
3211
+ */
3212
+ redpacket: RedPacket;
3213
+ /**
3214
+ * 获取聊天室节点
3215
+ * @returns 返回节点地址
3216
+ */
3217
+ getNode(): Promise<IChatRoomNodeInfo>;
3218
+ /**
3219
+ * 连接聊天室
3220
+ * @param url 聊天室节点地址
3221
+ * @param timeout 超时时间,单位为秒,默认为 10
3222
+ * @returns 返回 Open Event
3223
+ */
3224
+ connect(reload?: boolean): Promise<ReconnectingWebSocket>;
3225
+ connect(url?: string, timeout?: number): Promise<ReconnectingWebSocket>;
3226
+ }
3227
+ declare class RedPacket {
3228
+ private chatroom;
3229
+ private apiKey;
3230
+ constructor(chatroom: ChatRoom, apiKey: string);
3231
+ setToken(apiKey: string): void;
3232
+ /**
3233
+ * 打开一个红包
3234
+ * @param oId 红包消息 Id
3235
+ * @param gesture 猜拳类型
3236
+ */
3237
+ open(oId: string, gesture?: GestureType): Promise<IRedPacketInfo>;
3238
+ /**
3239
+ * 发送一个红包
3240
+ * @param redpacket 红包对象
3241
+ */
3242
+ send(redpacket: Redpacket): Promise<void>;
3243
+ }
3244
+ //#endregion
3245
+ //#region src/notice.d.ts
3246
+ interface INoticeEvents extends IWebSocketEvent {
3247
+ /**
3248
+ * 清风明月更新
3249
+ * @param data 清风明月
3250
+ */
3251
+ bzUpdate: (data: INoticeBreezemoon) => void;
3252
+ /**
3253
+ * 未读消息数通知
3254
+ * @param data 未读消息数
3255
+ */
3256
+ refreshNotification: (data: INoticeUnReadCount) => void;
3257
+ /**
3258
+ * 聊天未读消息数通知
3259
+ * @param data 聊天未读消息数
3260
+ */
3261
+ chatUnreadCountRefresh: (data: INoticeUnReadCount) => void;
3262
+ /**
3263
+ * 新私聊消息通知
3264
+ * @param data 新私聊消息
3265
+ */
3266
+ newIdleChatMessage: (data: INoticeIdleChat) => void;
3267
+ /**
3268
+ * 警告广播消息通知
3269
+ * @param data 警告广播消息
3270
+ */
3271
+ warnBroadcast: (data: INoticeWarnBroadcast) => void;
3272
+ }
3273
+ declare class Notice extends WsEventBase<INoticeEvents> {
3274
+ private apiKey;
3275
+ constructor(token?: string);
3276
+ /**
3277
+ * 重新设置请求 Token
3278
+ * @param apiKey 接口 API Key
3279
+ */
3280
+ setToken(token: string): void;
3281
+ /**
3282
+ * 获取未读消息数
3283
+ */
3284
+ count(): Promise<INoticeCount>;
3285
+ /**
3286
+ * 获取消息列表
3287
+ * @param type 消息类型
3288
+ */
3289
+ list(type: NoticeType): Promise<NoticeList>;
3290
+ /**
3291
+ * 已读指定类型消息
3292
+ * @param type 消息类型
3293
+ */
3294
+ makeRead(type: NoticeType): Promise<void>;
3295
+ /**
3296
+ * 已读所有消息
3297
+ */
3298
+ readAll(): Promise<void>;
3299
+ /**
3300
+ * 重连通知频道
3301
+ * @returns Websocket 连接对象
3302
+ */
3303
+ reconnect(): Promise<unknown>;
3304
+ /**
3305
+ * 连接用户私聊频道
3306
+ * @returns Websocket 连接对象
3307
+ */
3308
+ connect(reload?: boolean): Promise<ReconnectingWebSocket>;
3309
+ }
3310
+ //#endregion
3311
+ //#region src/emoji.d.ts
3312
+ declare class Emoji {
3313
+ private apiKey;
3314
+ private emojis;
3315
+ constructor(token?: string);
3316
+ /**
3317
+ * 重新设置请求 Token
3318
+ * @param apiKey 接口 API Key
3319
+ */
3320
+ setToken(token: string): void;
3321
+ get default(): {
3322
+ doge: string;
3323
+ trollface: string;
3324
+ huaji: string;
3325
+ octocat: string;
3326
+ wulian: string;
3327
+ smile: string;
3328
+ laughing: string;
3329
+ blush: string;
3330
+ smiley: string;
3331
+ relaxed: string;
3332
+ smirk: string;
3333
+ heart_eyes: string;
3334
+ kissing_heart: string;
3335
+ kissing_closed_eyes: string;
3336
+ flushed: string;
3337
+ relieved: string;
3338
+ satisfied: string;
3339
+ grin: string;
3340
+ wink: string;
3341
+ stuck_out_tongue_winking_eye: string;
3342
+ stuck_out_tongue_closed_eyes: string;
3343
+ grinning: string;
3344
+ kissing: string;
3345
+ kissing_smiling_eyes: string;
3346
+ stuck_out_tongue: string;
3347
+ sleeping: string;
3348
+ worried: string;
3349
+ frowning: string;
3350
+ anguished: string;
3351
+ open_mouth: string;
3352
+ grimacing: string;
3353
+ confused: string;
3354
+ hushed: string;
3355
+ expressionless: string;
3356
+ unamused: string;
3357
+ sweat_smile: string;
3358
+ sweat: string;
3359
+ disappointed_relieved: string;
3360
+ weary: string;
3361
+ pensive: string;
3362
+ disappointed: string;
3363
+ confounded: string;
3364
+ fearful: string;
3365
+ cold_sweat: string;
3366
+ persevere: string;
3367
+ cry: string;
3368
+ sob: string;
3369
+ joy: string;
3370
+ astonished: string;
3371
+ scream: string;
3372
+ tired_face: string;
3373
+ angry: string;
3374
+ rage: string;
3375
+ triumph: string;
3376
+ sleepy: string;
3377
+ yum: string;
3378
+ mask: string;
3379
+ sunglasses: string;
3380
+ dizzy_face: string;
3381
+ imp: string;
3382
+ smiling_imp: string;
3383
+ neutral_face: string;
3384
+ no_mouth: string;
3385
+ innocent: string;
3386
+ alien: string;
3387
+ yellow_heart: string;
3388
+ blue_heart: string;
3389
+ purple_heart: string;
3390
+ heart: string;
3391
+ green_heart: string;
3392
+ broken_heart: string;
3393
+ heartbeat: string;
3394
+ heartpulse: string;
3395
+ two_hearts: string;
3396
+ revolving_hearts: string;
3397
+ cupid: string;
3398
+ sparkling_heart: string;
3399
+ sparkles: string;
3400
+ star: string;
3401
+ star2: string;
3402
+ dizzy: string;
3403
+ boom: string;
3404
+ collision: string;
3405
+ anger: string;
3406
+ exclamation: string;
3407
+ question: string;
3408
+ grey_exclamation: string;
3409
+ grey_question: string;
3410
+ zzz: string;
3411
+ dash: string;
3412
+ sweat_drops: string;
3413
+ notes: string;
3414
+ musical_note: string;
3415
+ fire: string;
3416
+ poop: string;
3417
+ '+1': string;
3418
+ thumbsup: string;
3419
+ '-1': string;
3420
+ thumbsdown: string;
3421
+ ok_hand: string;
3422
+ punch: string;
3423
+ facepunch: string;
3424
+ fist: string;
3425
+ v: string;
3426
+ wave: string;
3427
+ hand: string;
3428
+ raised_hand: string;
3429
+ open_hands: string;
3430
+ point_up: string;
3431
+ point_down: string;
3432
+ point_left: string;
3433
+ point_right: string;
3434
+ raised_hands: string;
3435
+ pray: string;
3436
+ point_up_2: string;
3437
+ clap: string;
3438
+ muscle: string;
3439
+ couple: string;
3440
+ family: string;
3441
+ two_men_holding_hands: string;
3442
+ two_women_holding_hands: string;
3443
+ dancer: string;
3444
+ dancers: string;
3445
+ ok_woman: string;
3446
+ no_good: string;
3447
+ information_desk_person: string;
3448
+ raising_hand: string;
3449
+ bride_with_veil: string;
3450
+ person_with_pouting_face: string;
3451
+ person_frowning: string;
3452
+ bow: string;
3453
+ couplekiss: string;
3454
+ couple_with_heart: string;
3455
+ massage: string;
3456
+ haircut: string;
3457
+ nail_care: string;
3458
+ boy: string;
3459
+ girl: string;
3460
+ woman: string;
3461
+ man: string;
3462
+ baby: string;
3463
+ older_woman: string;
3464
+ older_man: string;
3465
+ person_with_blond_hair: string;
3466
+ man_with_gua_pi_mao: string;
3467
+ man_with_turban: string;
3468
+ construction_worker: string;
3469
+ cop: string;
3470
+ angel: string;
3471
+ princess: string;
3472
+ smiley_cat: string;
3473
+ smile_cat: string;
3474
+ heart_eyes_cat: string;
3475
+ kissing_cat: string;
3476
+ smirk_cat: string;
3477
+ scream_cat: string;
3478
+ crying_cat_face: string;
3479
+ joy_cat: string;
3480
+ pouting_cat: string;
3481
+ japanese_ogre: string;
3482
+ japanese_goblin: string;
3483
+ see_no_evil: string;
3484
+ hear_no_evil: string;
3485
+ speak_no_evil: string;
3486
+ guardsman: string;
3487
+ skull: string;
3488
+ feet: string;
3489
+ lips: string;
3490
+ kiss: string;
3491
+ droplet: string;
3492
+ ear: string;
3493
+ eyes: string;
3494
+ nose: string;
3495
+ tongue: string;
3496
+ love_letter: string;
3497
+ bust_in_silhouette: string;
3498
+ busts_in_silhouette: string;
3499
+ speech_balloon: string;
3500
+ thought_balloon: string;
3501
+ };
3502
+ get(): Promise<string[]>;
3503
+ /**
3504
+ * 设置表情包列表
3505
+ * @param data 所有表情包图像列表
3506
+ */
3507
+ set(data: string[]): Promise<any>;
3508
+ append(url: string): Promise<string[]>;
3509
+ remove(url: string): Promise<string[]>;
3510
+ exists(url: string): Promise<Boolean>;
3511
+ }
3512
+ //#endregion
3513
+ //#region src/user.d.ts
3514
+ declare class User {
3515
+ private apiKey;
3516
+ constructor(token?: string);
3517
+ /**
3518
+ * 重新设置请求 Token
3519
+ * @param apiKey 接口 API Key
3520
+ */
3521
+ setToken(token: string): void;
3522
+ /**
3523
+ * 返回登录账户信息,需要先登录或设置有效的 api key
3524
+ * @returns 用户信息
3525
+ */
3526
+ info(): Promise<UserInfo>;
3527
+ /**
3528
+ * 查询登录用户常用表情
3529
+ * @returns 常用表情列表
3530
+ */
3531
+ emotions(): Promise<Array<string>>;
3532
+ /**
3533
+ * 查询登录用户当前活跃度,请求频率请控制在 30 ~ 60 秒一次
3534
+ * @returns 活跃度
3535
+ */
3536
+ liveness(): Promise<number>;
3537
+ /**
3538
+ * 检查登录用户是否已经签到
3539
+ * @returns 是否已经签到
3540
+ */
3541
+ isCheckIn(): Promise<boolean>;
3542
+ /**
3543
+ * 检查登录用户是否已经领取昨日活跃奖励
3544
+ * @returns 是否已经领取昨日活跃奖励
3545
+ */
3546
+ isCollectedLiveness(): Promise<boolean>;
3547
+ /**
3548
+ * 领取昨日活跃度奖励
3549
+ * @returns sum 领取的奖励积分
3550
+ */
3551
+ rewardLiveness(): Promise<number>;
3552
+ /**
3553
+ * 转账
3554
+ * @param userName 转账目标用户名
3555
+ * @param amount 转账金额
3556
+ * @param memo 转账备注
3557
+ * @returns code 0 为成功,失败则有 msg
3558
+ */
3559
+ transfer(userName: string, amount: number, memo: string): Promise<void>;
3560
+ /**
3561
+ * 关注用户
3562
+ * @param followingId 用户id
3563
+ */
3564
+ follow(followingId: string): Promise<void>;
3565
+ /**
3566
+ * 取消关注用户
3567
+ * @param followingId 用户id
3568
+ */
3569
+ unfollow(followingId: string): Promise<void>;
3570
+ /**
3571
+ * 修改用户头像
3572
+ * @param userAvatarURL 用户头像地址
3573
+ */
3574
+ updateUserAvatar(userAvatarURL: string): Promise<void>;
3575
+ /**
3576
+ * 修改用户信息
3577
+ * @param data 用户信息参数
3578
+ */
3579
+ updateUserInfo(data: UserUpdateParams): Promise<void>;
3580
+ }
3581
+ //#endregion
3582
+ //#region src/article.d.ts
3583
+ interface IArticleEvents extends IWebSocketEvent {
3584
+ heat: (msg: IArticleHeat) => void;
3585
+ comment: (msg: ArticleComment) => void;
3586
+ }
3587
+ declare class Article {
3588
+ private apiKey;
3589
+ private channels;
3590
+ constructor(token?: string);
3591
+ /**
3592
+ * 重新设置请求 Token
3593
+ * @param apiKey 接口 API Key
3594
+ */
3595
+ setToken(token: string): void;
3596
+ /**
3597
+ * 发布文章
3598
+ * @param data 文章信息
3599
+ * @returns 发布成功返回文章Id (articleId)
3600
+ */
3601
+ post(data: IArticlePost): Promise<string>;
3602
+ /**
3603
+ * 更新文章
3604
+ * @param id 文章 Id
3605
+ * @param data 文章信息
3606
+ * @returns 更新成功返回文章Id (articleId)
3607
+ */
3608
+ update(id: string, data: IArticlePost): Promise<string>;
3609
+ /**
3610
+ * 查询文章列表
3611
+ * @param type 查询类型
3612
+ * @param tag 指定查询标签,可选
3613
+ * @returns 文章列表
3614
+ */
3615
+ list({
3616
+ type,
3617
+ page,
3618
+ size,
3619
+ tag
3620
+ }: {
3621
+ type: ArticleListType;
3622
+ page?: number;
3623
+ size?: number;
3624
+ tag?: string;
3625
+ }): Promise<ArticleList>;
3626
+ /**
3627
+ * 查询用户文章列表
3628
+ * @param userName 用户名
3629
+ * @param page 页码
3630
+ * @returns 文章列表
3631
+ */
3632
+ userArticles({
3633
+ userName,
3634
+ page,
3635
+ size
3636
+ }: {
3637
+ userName: string;
3638
+ page?: number;
3639
+ size?: number;
3640
+ }): Promise<ArticleList>;
3641
+ /**
3642
+ * 获取文章详情
3643
+ * @param id 文章id
3644
+ * @returns 文章详情
3645
+ */
3646
+ detail(id: string, p?: number): Promise<ArticleDetail>;
3647
+ /**
3648
+ * 点赞/取消点赞文章
3649
+ * @param id 文章id
3650
+ * @param type 点赞类型
3651
+ * @returns 文章点赞状态
3652
+ */
3653
+ vote(id: string, type: 'up' | 'down'): Promise<VoteType>;
3654
+ /**
3655
+ * 感谢文章
3656
+ * @param id 文章id
3657
+ */
3658
+ thank(id: string): Promise<void>;
3659
+ /**
3660
+ * 收藏文章
3661
+ * @param followingId 文章id
3662
+ */
3663
+ follow(followingId: string): Promise<void>;
3664
+ /**
3665
+ * 取消收藏文章
3666
+ * @param followingId 文章id
3667
+ */
3668
+ unfollow(followingId: string): Promise<void>;
3669
+ /**
3670
+ * 关注文章
3671
+ * @param followingId 文章id
3672
+ */
3673
+ watch(followingId: string): Promise<void>;
3674
+ /**
3675
+ * 取消关注文章
3676
+ * @param followingId 文章id
3677
+ */
3678
+ unwatch(followingId: string): Promise<void>;
3679
+ /**
3680
+ * 打赏文章
3681
+ * @param id 文章id
3682
+ */
3683
+ reward(id: string): Promise<void>;
3684
+ /**
3685
+ * 获取文章在线人数
3686
+ * @param id 文章id
3687
+ */
3688
+ heat(id: string): Promise<number>;
3689
+ /**
3690
+ * 获取帖子的Markdown原文
3691
+ * @param articleId 文章Id
3692
+ */
3693
+ md(articleId: string): Promise<string>;
3694
+ channel(id: string, type: ArticleType): ArticleChannel;
3695
+ }
3696
+ declare class ArticleChannel extends WsEventBase<IArticleEvents> {
3697
+ private apiKey;
3698
+ private id;
3699
+ private type;
3700
+ constructor(token: string, id: string, type: ArticleType);
3701
+ /**
3702
+ * 添加文章监听器
3703
+ * @param id 文章id
3704
+ * @param type 文章类型
3705
+ * @param callback 监听回调
3706
+ */
3707
+ connect(reload?: boolean): Promise<ReconnectingWebSocket>;
3708
+ }
3709
+ //#endregion
3710
+ //#region src/comment.d.ts
3711
+ declare class Comment {
3712
+ private apiKey;
3713
+ constructor(token?: string);
3714
+ /**
3715
+ * 重新设置请求 Token
3716
+ * @param apiKey 接口 API Key
3717
+ */
3718
+ setToken(token: string): void;
3719
+ /**
3720
+ * 发布评论
3721
+ * @param data 评论信息
3722
+ */
3723
+ send(data: ICommentPost): Promise<void>;
3724
+ /**
3725
+ * 更新评论
3726
+ * @param id 评论 Id
3727
+ * @param data 评论信息
3728
+ */
3729
+ update(id: string, data: ICommentPost): Promise<string>;
3730
+ /**
3731
+ * 评论点赞
3732
+ * @param id 评论 Id
3733
+ * @param type 点赞类型
3734
+ */
3735
+ vote(id: string, type: 'up' | 'down'): Promise<VoteType>;
3736
+ /**
3737
+ * 评论感谢
3738
+ * @param id 评论 Id
3739
+ */
3740
+ thank(id: string): Promise<void>;
3741
+ /**
3742
+ * 删除评论
3743
+ * @param id 评论 Id
3744
+ */
3745
+ remove(id: string): Promise<string>;
3746
+ }
3747
+ //#endregion
3748
+ //#region src/chat.d.ts
3749
+ interface IChatEvents extends IWebSocketEvent {
3750
+ /**
3751
+ * 私聊消息
3752
+ * @param msg 私聊消息内容
3753
+ */
3754
+ data: (msg: IChatData) => void;
3755
+ /**
3756
+ * 撤回消息
3757
+ * @param oId 消息 ID
3758
+ */
3759
+ revoke: (oId: string) => void;
3760
+ }
3761
+ declare class ChatChannel extends WsEventBase<IChatEvents> {
3762
+ private apiKey;
3763
+ private user;
3764
+ constructor(user: string, apiKey: string);
3765
+ /**
3766
+ * 重新设置请求 Token
3767
+ * @param apiKey 接口 API Key
3768
+ */
3769
+ setToken(apiKey: string): void;
3770
+ /**
3771
+ * 连接用户私聊频道
3772
+ * @returns Websocket 连接对象
3773
+ */
3774
+ connect(reload?: boolean): Promise<ReconnectingWebSocket>;
3775
+ send(msg: string): Promise<void>;
3776
+ close(): void;
3777
+ /**
3778
+ * 获取用户私聊历史消息
3779
+ * @param param 消息参数
3780
+ * @returns 私聊消息列表
3781
+ */
3782
+ get({
3783
+ page,
3784
+ size,
3785
+ autoRead
3786
+ }: IChatQuery): Promise<IChatData[]>;
3787
+ /**
3788
+ * 标记用户消息已读
3789
+ * @param user 用户名
3790
+ * @returns 执行结果
3791
+ */
3792
+ markRead(): Promise<void>;
3793
+ }
3794
+ declare class Chat {
3795
+ private apiKey;
3796
+ private chats;
3797
+ constructor(token?: string);
3798
+ /**
3799
+ * 获取私聊频道
3800
+ * @param user 私聊用户名
3801
+ * @returns 私聊频道
3802
+ */
3803
+ channel(user: string): ChatChannel;
3804
+ /**
3805
+ * 关闭私聊频道
3806
+ * @param user 私聊用户名
3807
+ */
3808
+ close(user?: string): void;
3809
+ /**
3810
+ * 重新设置请求 Token
3811
+ * @param apiKey 接口 API Key
3812
+ */
3813
+ setToken(apiKey: string): void;
3814
+ /**
3815
+ * 获取有私聊用户列表以及第一条消息
3816
+ * @returns 私聊消息列表
3817
+ */
3818
+ list(): Promise<IChatData[]>;
3819
+ /**
3820
+ * 获取未读消息
3821
+ * @returns 未读消息列表
3822
+ */
3823
+ unread(): Promise<IChatData>;
3824
+ /**
3825
+ * 撤回私聊消息
3826
+ * @param msgId 消息 ID
3827
+ */
3828
+ revoke(msgId: string): Promise<number>;
3829
+ }
3830
+ //#endregion
3831
+ //#region src/breezemoon.d.ts
3832
+ declare class Breezemoon {
3833
+ private apiKey;
3834
+ constructor(token?: string);
3835
+ /**
3836
+ * 重新设置请求 Token
3837
+ * @param apiKey 接口 API Key
3838
+ */
3839
+ setToken(token: string): void;
3840
+ /**
3841
+ * 获取清风明月列表
3842
+ * @param page 消息页码
3843
+ * @param size 每页个数
3844
+ */
3845
+ list(page?: number, size?: number): Promise<BreezemoonContent[]>;
3846
+ /**
3847
+ * 获取用户清风明月列表
3848
+ * @param user 用户名
3849
+ * @param page 消息页码
3850
+ * @param size 每页个数
3851
+ */
3852
+ listByUser(user: string, page?: number, size?: number): Promise<BreezemoonList>;
3853
+ /**
3854
+ * 发送清风明月
3855
+ * @param content 内容
3856
+ */
3857
+ send(content: string): Promise<void>;
3858
+ }
3859
+ //#endregion
3860
+ //#region src/finger.d.ts
3861
+ declare class Finger {
3862
+ private goldFingerKey;
3863
+ constructor(key: string);
3864
+ /**
3865
+ * 设置金手指
3866
+ * @param key 金手指密钥
3867
+ */
3868
+ setFinger(key: string): void;
3869
+ /**
3870
+ * 上传摸鱼大闯关关卡数据
3871
+ * @param userName: 用户在摸鱼派的用户名
3872
+ * @param stage: 关卡数
3873
+ * @param time: 通过此关时间(毫秒级时间戳)
3874
+ */
3875
+ addMofishScore({
3876
+ userName,
3877
+ stage,
3878
+ time
3879
+ }: {
3880
+ userName: string;
3881
+ stage: string;
3882
+ time: number;
3883
+ }): Promise<void>;
3884
+ /**
3885
+ * 查询用户最近登录的IP地址
3886
+ * @param userName: 用户在摸鱼派的用户名
3887
+ */
3888
+ queryLatestLoginIP(userName: string): Promise<IUserIP>;
3889
+ /**
3890
+ * 添加勋章
3891
+ * @param userName: 用户在摸鱼派的用户名
3892
+ * @param metal: 勋章信息
3893
+ */
3894
+ addMetal(userName: string, metal: MetalBase): Promise<void>;
3895
+ /**
3896
+ * 删除勋章
3897
+ * @param userName: 用户在摸鱼派的用户名
3898
+ * @param name: 勋章名称
3899
+ */
3900
+ deleteMetal(userName: string, name: string): Promise<void>;
3901
+ /**
3902
+ * 删除勋章By userId
3903
+ * @param userId: 用户在摸鱼派的用户ID
3904
+ * @param name: 勋章名称
3905
+ */
3906
+ deleteMetalByUserId(userId: string, name: string): Promise<void>;
3907
+ /**
3908
+ * 查询用户背包
3909
+ * @param userName: 用户在摸鱼派的用户名
3910
+ */
3911
+ queryUserBag(userName: string): Promise<IUserBag>;
3912
+ /**
3913
+ * 调整用户背包
3914
+ * @param userName: 用户在摸鱼派的用户名
3915
+ * @param item: 物品名称
3916
+ * @param sum: 物品数量
3917
+ */
3918
+ editUserBag(userName: string, item: string, sum: number): Promise<void>;
3919
+ /**
3920
+ * 调整用户积分
3921
+ * @param userName: 用户在摸鱼派的用户名
3922
+ * @param point: 积分数量
3923
+ * @param memo: 备注
3924
+ */
3925
+ editUserPoints(userName: string, point: number, memo: string): Promise<void>;
3926
+ /**
3927
+ * 查询用户当前活跃度
3928
+ * @param userName: 用户在摸鱼派的用户名
3929
+ */
3930
+ getLiveness(userName: string): Promise<number>;
3931
+ /**
3932
+ * 查询用户昨日活跃度奖励
3933
+ * @param userName: 用户在摸鱼派的用户名
3934
+ */
3935
+ getYesterDayLivenessReward(userName: string): Promise<number>;
3936
+ }
3937
+ //#endregion
3938
+ //#region src/index.d.ts
3939
+ declare class FishPi {
3940
+ /**
3941
+ * 请求 API 的 API Key
3942
+ */
3943
+ private apiKey;
3944
+ /**
3945
+ * 聊天室接口对象
3946
+ */
3947
+ readonly chatroom: ChatRoom;
3948
+ /**
3949
+ * 通知接口对象
3950
+ */
3951
+ readonly notice: Notice;
3952
+ /**
3953
+ * 表情包接口对象
3954
+ */
3955
+ readonly emoji: Emoji;
3956
+ /**
3957
+ * 用户接口对象
3958
+ */
3959
+ readonly account: User;
3960
+ /**
3961
+ * 文章接口对象
3962
+ */
3963
+ readonly article: Article;
3964
+ /**
3965
+ * 评论接口对象
3966
+ */
3967
+ readonly comment: Comment;
3968
+ /**
3969
+ * 清风明月对象
3970
+ */
3971
+ readonly breezemoon: Breezemoon;
3972
+ /**
3973
+ * 私聊接口对象
3974
+ */
3975
+ readonly chat: Chat;
3976
+ /**
3977
+ * 构造一个 API 请求对象
3978
+ * @param token 接口 API Key,没有可以传空
3979
+ */
3980
+ constructor(token?: string);
3981
+ setToken(apiKey: string): Promise<void>;
3982
+ setDomain(domain: string): Promise<void>;
3983
+ /**
3984
+ * 登录账号返回 API Key
3985
+ * @param data 用户账密
3986
+ */
3987
+ login(data: Account): Promise<string>;
3988
+ /**
3989
+ * 预注册账号
3990
+ * @param data 用户信息
3991
+ * @returns
3992
+ */
3993
+ preRegister(data: PreRegisterInfo): Promise<void>;
3994
+ /**
3995
+ * 验证手机验证码
3996
+ * @param code 验证码
3997
+ * @returns
3998
+ */
3999
+ verify(code: string): Promise<number>;
4000
+ /**
4001
+ * 注册账号
4002
+ */
4003
+ register(data: RegisterInfo): Promise<void>;
4004
+ /**
4005
+ * 查询指定用户信息
4006
+ * @param username 用户名
4007
+ */
4008
+ user(username: string): Promise<UserInfo | undefined>;
4009
+ /**
4010
+ * 查询指定用户积分
4011
+ * @param username 用户名
4012
+ * @returns 用户积分
4013
+ */
4014
+ userPoints(username: string): Promise<number>;
4015
+ /**
4016
+ * 查询指定用户 oId 的用户信息
4017
+ */
4018
+ userByoId(oId: string): Promise<IUserLite | undefined>;
4019
+ /**
4020
+ * 用户名联想,通常用于 @ 列表
4021
+ * @param username 用户名
4022
+ */
4023
+ names(name: string): Promise<IAtUser[]>;
4024
+ /**
4025
+ * 获取最近注册的20个用户
4026
+ */
4027
+ recentRegister(): Promise<{
4028
+ userNickname: string;
4029
+ userName: string;
4030
+ }[]>;
4031
+ /**
4032
+ * 获取用户 VIP 信息
4033
+ * @param userId 用户 oId
4034
+ */
4035
+ vipInfo(userId: string): Promise<UserVIP>;
4036
+ /**
4037
+ * 举报
4038
+ * @param data 举报信息
4039
+ */
4040
+ report(data: IReport): Promise<void>;
4041
+ /**
4042
+ * 获取操作日志
4043
+ * @param page 页码
4044
+ * @param pageSize 每页数量
4045
+ */
4046
+ log({
4047
+ page,
4048
+ pageSize
4049
+ }: {
4050
+ page?: number | undefined;
4051
+ pageSize?: number | undefined;
4052
+ }): Promise<ILog[]>;
4053
+ /**
4054
+ * 上传文件
4055
+ * @param files 要上传的文件,如果是在 Node 使用,则传入文件路径数组,若是在浏览器使用,则传入文件对象数组。
4056
+ */
4057
+ upload(files: Array<File | string>): Promise<IUploadInfo>;
4058
+ /**
4059
+ * 生成登录认证地址
4060
+ * @param redirect 登录成功后跳转的地址
4061
+ */
4062
+ generateAuthURL(redirect: string): string;
4063
+ /**
4064
+ * 校验登录回调
4065
+ * @param query 验证返回的地址 QueryString 参数
4066
+ * @returns 验证成功则返回用户简略信息,否则返回 undefined
4067
+ */
4068
+ authVerify(query: Record<string, string>): Promise<IUserLite | undefined>;
4069
+ }
4070
+ declare function FingerTo(key: string): Finger;
4071
+ //#endregion
4072
+ export { Account, Article, ArticleChannel, ArticleComment, ArticleDetail, ArticleList, ArticleListType, ArticlePost, ArticleStatus, ArticleTag, ArticleType, AtUser, Author, Breezemoon, BreezemoonContent, BreezemoonList, Chat, ChatContentType, ChatMessageType, ChatRoom, ChatRoomMessageType, ChatRoomSource, ClientType, Comment, CommentPost, CustomMsg, DataType, DiscussMsg, Emoji, Finger, FingerTo, FishPi, FishPi as default, GestureType, IAccount, IArticleHeat, IArticlePost, IAtUser, IBarragerMsg, IChatData, IChatNotice, IChatQuery, IChatRevoke, IChatRoomMessage, IChatRoomMsg, IChatRoomNode, IChatRoomNodeInfo, IChatRoomSource, ICommentPost, ILog, IMetal, IMetalAttr, IMetalBase, IMoFishGame, IMusicMessage, IMuteItem, INoticeArticle, INoticeAt, INoticeBreezemoon, INoticeCommand, INoticeComment, INoticeCount, INoticeIdleChat, INoticePoint, INoticeReply, INoticeSystem, INoticeUnReadCount, INoticeWarnBroadcast, IOnlineInfo, IPreRegisterInfo, IRedPacketBase, IRedPacketGot, IRedPacketInfo, IRedPacketMessage, IRedPacketStatusMsg, IRedpacket, IRegisterInfo, IReport, IUploadInfo, IUserBag, IUserIP, IUserLite, IUserVIP, IWeatherData, IWeatherMessage, Metal, MetalAttr, MetalBase, MoFishGame, Notice, NoticeCommandType, NoticeList, NoticeType, Pagination, PreRegisterInfo, PublicStatus, RedPacketType, Redpacket, RegisterInfo, Report, ReportDataType, ReportType, RevokeMsg, User, UserAppRole, UserBagType, UserInfo, UserUpdateParams, UserVIP, VoteStatus, VoteType, YesNoStatus };