gs-x-parser 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/type.d.ts CHANGED
@@ -1,4 +1,7 @@
1
- import { IUserBase as IUserBase$1, IUser as IUser$1, IMediaEntity as IMediaEntity$1, ITweetBase as ITweetBase$1, IUrlEntity as IUrlEntity$1, ITweet as ITweet$1, IOriginalInfo as IOriginalInfo$1, IMediaSizes as IMediaSizes$1, IExtMediaColor as IExtMediaColor$1, IColorPalette as IColorPalette$1, IMediaStats as IMediaStats$1, IBindingValue as IBindingValue$1, ICardPlatform as ICardPlatform$1, IOk as IOk$1, IExtendedEntities as IExtendedEntities$1 } from './index.d.ts';
1
+ import { IReactProps } from 'gs-dom/frs-probe';
2
+
3
+ declare const DomDisplayTypes: readonly ["Tweet", "defaultDisplayType", "FocalTweet", "MediaGrid", "User"];
4
+ type DomDisplayType = typeof DomDisplayTypes[number];
2
5
 
3
6
  /**
4
7
  * 类型常量和联合类型定义
@@ -110,7 +113,7 @@ type UserDisplayType = typeof USER_DISPLAY_TYPES[number];
110
113
  /**
111
114
  * 注入类型常量
112
115
  */
113
- declare const INJECTION_TYPES: readonly ["ForYouInNetwork", "ForYouPromoted", "WhoToFollow", "creators-only-connect-tab", "CommunityToJoin"];
116
+ declare const INJECTION_TYPES: readonly ["ForYouInNetwork", "ForYouPromoted", "WhoToFollow", "creators-only-connect-tab", "CommunityToJoin", "FollowingInNetwork"];
114
117
  /**
115
118
  * 注入类型联合类型
116
119
  */
@@ -187,6 +190,14 @@ declare const VIDEO_CONTENT_TYPES: readonly ["application/x-mpegURL", "video/mp4
187
190
  * 视频内容类型联合类型
188
191
  */
189
192
  type VideoContentType = typeof VIDEO_CONTENT_TYPES[number];
193
+ /**
194
+ * 视频质量类型常量
195
+ */
196
+ declare const VIDEO_QUALITIES: readonly ["high", "medium", "low"];
197
+ /**
198
+ * 视频质量类型联合类型
199
+ */
200
+ type VideoQuality = typeof VIDEO_QUALITIES[number];
190
201
  /**
191
202
  * 消息收件箱时间线索引常量
192
203
  */
@@ -342,6 +353,87 @@ declare enum IdPrefixes {
342
353
  Trends = "trends-"
343
354
  }
344
355
 
356
+ /**
357
+ * 用户基础类型,包含所有用户相关类型共有的字段
358
+ */
359
+ interface IUserBase {
360
+ /** 用户名 */
361
+ name?: string;
362
+ /** 用户屏幕名称 */
363
+ screen_name?: string;
364
+ /** 位置 */
365
+ location?: string | null;
366
+ /** 个人简介 */
367
+ description?: string | null;
368
+ /** 个人网站 */
369
+ url?: string | null;
370
+ /** 实体 */
371
+ entities?: IUserEntities;
372
+ /** 粉丝数 */
373
+ followers_count?: number;
374
+ /** 关注数 */
375
+ friends_count?: number;
376
+ /** 列表数 */
377
+ listed_count?: number;
378
+ /** 创建时间 */
379
+ created_at?: string;
380
+ /** 收藏数 */
381
+ favourites_count?: number;
382
+ /** 推文数 */
383
+ statuses_count?: number;
384
+ /** 是否为翻译者 */
385
+ is_translator?: boolean;
386
+ /** 翻译者类型 */
387
+ translator_type?: string;
388
+ /** 头像URL */
389
+ profile_image_url_https?: string;
390
+ /** 是否默认个人资料 */
391
+ default_profile?: boolean;
392
+ /** 是否默认头像 */
393
+ default_profile_image?: boolean;
394
+ /** 是否可以直接消息 */
395
+ can_dm?: boolean | null;
396
+ /** 是否可以媒体标签 */
397
+ can_media_tag?: boolean;
398
+ /** 是否关注 */
399
+ following?: boolean | null;
400
+ /** 是否想要转发 */
401
+ want_retweets?: boolean;
402
+ /** 被限制的国家 */
403
+ withheld_in_countries?: string[];
404
+ /** 是否验证 */
405
+ verified?: boolean;
406
+ }
407
+ /**
408
+ * 用户实体接口
409
+ */
410
+ interface IUserEntities {
411
+ /** 描述实体 */
412
+ description?: IUserEntityUrls;
413
+ /** URL实体 */
414
+ url?: IUserEntityUrls;
415
+ }
416
+ /**
417
+ * 用户实体URL接口
418
+ */
419
+ interface IUserEntityUrls {
420
+ /** URL实体数组 */
421
+ urls?: IUrlEntity[];
422
+ }
423
+ /**
424
+ * URL实体接口
425
+ */
426
+ interface IUrlEntity {
427
+ /** 显示URL */
428
+ display_url?: string;
429
+ /** 展开URL */
430
+ expanded_url?: string;
431
+ /** URL */
432
+ url?: string;
433
+ /** 索引 */
434
+ indices?: number[];
435
+ }
436
+
345
437
  /**
346
438
  * 用户类型定义
347
439
  */
@@ -358,29 +450,103 @@ interface IUser {
358
450
  rest_id: string;
359
451
  /** 附属高亮标签 */
360
452
  affiliates_highlighted_label?: IAffiliatesHighlightedLabel;
453
+ /** 头像 */
454
+ avatar?: IAvatar;
455
+ /** 核心数据 */
456
+ core?: IUserCore;
457
+ /** 私信权限 */
458
+ dm_permissions?: IDmPermissions;
361
459
  /** 是否有毕业访问权限 */
362
460
  has_graduated_access?: boolean;
363
461
  /** 是否蓝V验证 */
364
462
  is_blue_verified?: boolean;
463
+ /** 位置 */
464
+ location?: ILocation | string;
465
+ /** 媒体权限 */
466
+ media_permissions?: IMediaPermissions;
467
+ /** 模仿评论粉丝标签 */
468
+ parody_commentary_fan_label?: string;
469
+ /** 隐私设置 */
470
+ privacy?: IPrivacy;
365
471
  /** 头像形状 */
366
472
  profile_image_shape?: string;
473
+ /** 个人简介 */
474
+ profile_bio?: IProfileBio;
475
+ /** 个人简介语言 */
476
+ profile_description_language?: string;
477
+ /** 关系视角 */
478
+ relationship_perspectives?: IRelationshipPerspectives;
367
479
  /** 遗留用户数据 */
368
480
  legacy?: IUserLegacy;
369
481
  /** 专业信息 */
370
482
  professional?: IUserProfessional;
371
483
  /** 是否有超级关注资格 */
372
484
  super_follow_eligible?: boolean;
485
+ /** 是否被超级关注 */
486
+ super_followed_by?: boolean;
487
+ /** 是否超级关注 */
488
+ super_following?: boolean;
373
489
  /** 小费设置 */
374
490
  tipjar_settings?: ITipjarSettings;
491
+ /** 验证信息 */
492
+ verification?: IVerification;
493
+ /** 直接在用户对象上的字段(用于通知数据) */
494
+ name?: string;
495
+ screen_name?: string;
496
+ profile_image_url_https?: string;
497
+ verified?: boolean;
498
+ followers_count?: number;
499
+ friends_count?: number;
500
+ statuses_count?: number;
501
+ description?: string;
502
+ url?: string;
503
+ verified_type?: VerifiedType;
504
+ created_at?: string;
505
+ profile_banner_url?: string;
506
+ protected?: boolean;
507
+ lang?: string;
508
+ contributors_enabled?: boolean;
509
+ is_translator?: boolean;
510
+ is_translation_enabled?: boolean;
511
+ profile_background_color?: string;
512
+ profile_background_image_url?: string;
513
+ profile_background_image_url_https?: string;
514
+ profile_background_tile?: boolean;
515
+ profile_link_color?: string;
516
+ profile_sidebar_border_color?: string;
517
+ profile_sidebar_fill_color?: string;
518
+ profile_text_color?: string;
519
+ profile_use_background_image?: boolean;
520
+ default_profile?: boolean;
521
+ default_profile_image?: boolean;
522
+ following?: boolean;
523
+ follow_request_sent?: boolean;
524
+ notifications?: boolean;
525
+ blocking?: boolean;
526
+ blocked_by?: boolean;
527
+ want_retweets?: boolean;
528
+ profile_interstitial_type?: string;
529
+ translator_type?: string;
530
+ withheld_in_countries?: string[];
531
+ followed_by?: boolean;
532
+ ext_is_blue_verified?: boolean;
533
+ ext_highlighted_label?: any;
534
+ entities?: any;
375
535
  }
376
536
  interface ITipjarSettings {
377
537
  /** 是否启用 */
378
538
  is_enabled?: boolean;
539
+ /** 比特币地址 */
540
+ bitcoin_handle?: string;
541
+ /** 以太坊地址 */
542
+ ethereum_handle?: string;
543
+ /** Patreon 句柄 */
544
+ patreon_handle?: string;
379
545
  }
380
546
  /**
381
547
  * 遗留用户数据接口
382
548
  */
383
- interface IUserLegacy extends IUserBase$1 {
549
+ interface IUserLegacy extends IUserBase {
384
550
  /** 快速粉丝数 */
385
551
  fast_followers_count?: number;
386
552
  /** 是否有自定义时间线 */
@@ -466,142 +632,527 @@ interface IBadge {
466
632
  /** URL */
467
633
  url?: string;
468
634
  }
469
-
470
635
  /**
471
- * 用户基础类型,包含所有用户相关类型共有的字段
636
+ * 头像接口
472
637
  */
473
- interface IUserBase {
474
- /** 用户名 */
475
- name?: string;
476
- /** 用户屏幕名称 */
477
- screen_name?: string;
478
- /** 位置 */
479
- location?: string | null;
480
- /** 个人简介 */
481
- description?: string | null;
482
- /** 个人网站 */
483
- url?: string | null;
484
- /** 实体 */
485
- entities?: IUserEntities;
486
- /** 粉丝数 */
487
- followers_count?: number;
488
- /** 关注数 */
489
- friends_count?: number;
490
- /** 列表数 */
491
- listed_count?: number;
492
- /** 创建时间 */
493
- created_at?: string;
494
- /** 收藏数 */
495
- favourites_count?: number;
496
- /** 推文数 */
497
- statuses_count?: number;
498
- /** 是否为翻译者 */
499
- is_translator?: boolean;
500
- /** 翻译者类型 */
501
- translator_type?: string;
502
- /** 头像URL */
503
- profile_image_url_https?: string;
504
- /** 是否默认个人资料 */
505
- default_profile?: boolean;
506
- /** 是否默认头像 */
507
- default_profile_image?: boolean;
508
- /** 是否可以直接消息 */
509
- can_dm?: boolean | null;
510
- /** 是否可以媒体标签 */
511
- can_media_tag?: boolean;
512
- /** 是否关注 */
513
- following?: boolean | null;
514
- /** 是否想要转发 */
515
- want_retweets?: boolean;
516
- /** 被限制的国家 */
517
- withheld_in_countries?: string[];
518
- /** 是否验证 */
519
- verified?: boolean;
638
+ interface IAvatar {
639
+ /** 图像URL */
640
+ image_url?: string;
520
641
  }
521
642
  /**
522
- * 用户实体接口
643
+ * 用户核心数据接口
523
644
  */
524
- interface IUserEntities {
525
- /** 描述实体 */
526
- description?: IUserEntityUrls;
527
- /** URL实体 */
528
- url?: IUserEntityUrls;
645
+ interface IUserCore {
646
+ /** 创建时间 */
647
+ created_at?: string;
648
+ /** 名称 */
649
+ name?: string;
650
+ /** 屏幕名称 */
651
+ screen_name?: string;
529
652
  }
530
653
  /**
531
- * 用户实体URL接口
654
+ * 私信权限接口
532
655
  */
533
- interface IUserEntityUrls {
534
- /** URL实体数组 */
535
- urls?: IUrlEntity[];
656
+ interface IDmPermissions {
657
+ /** 是否可以发送私信 */
658
+ can_dm?: boolean;
536
659
  }
537
660
  /**
538
- * URL实体接口
661
+ * 位置接口
539
662
  */
540
- interface IUrlEntity {
541
- /** 显示URL */
542
- display_url?: string;
543
- /** 展开URL */
544
- expanded_url?: string;
545
- /** URL */
546
- url?: string;
547
- /** 索引 */
548
- indices?: number[];
663
+ interface ILocation {
664
+ /** 位置 */
665
+ location?: string;
549
666
  }
550
-
551
667
  /**
552
- * 推文类型定义
668
+ * 媒体权限接口
553
669
  */
554
-
670
+ interface IMediaPermissions {
671
+ /** 是否可以媒体标签 */
672
+ can_media_tag?: boolean;
673
+ }
555
674
  /**
556
- * 推文接口
675
+ * 隐私设置接口
557
676
  */
558
- interface ITweet {
559
- /** 类型名称 */
560
- __typename: string;
561
- /** 推文REST ID */
562
- rest_id: string;
563
- /** 是否有birdwatch注释 */
564
- has_birdwatch_notes?: boolean;
565
- /** 核心数据 */
566
- core?: ITweetCore;
567
- /** 取消提及数据 */
568
- unmention_data?: Record<string, unknown>;
569
- /** 编辑控制 */
570
- edit_control?: IEditControl;
571
- /** 之前的计数 */
572
- previous_counts?: IPreviousCounts;
573
- /** 是否可翻译 */
574
- is_translatable?: boolean;
575
- /** 视图 */
576
- views?: ITweetViews;
577
- /** 来源 */
578
- source?: string;
579
- /** 卡片 */
580
- card?: ICard;
581
- /** 遗留推文数据 */
582
- legacy?: ITweetLegacy;
583
- /** 快速推广资格 */
584
- quick_promote_eligibility?: IQuickPromoteEligibility;
585
- /** 引用状态结果 */
586
- quoted_status_result?: IQuotedStatusResult;
587
- /** 转发状态结果 */
588
- retweeted_status_result?: IRetweetedStatusResult;
589
- /** 超级关注回复用户结果 */
590
- superFollowsReplyUserResult?: ISuperFollowsReplyUserResult;
677
+ interface IPrivacy {
678
+ /** 是否受保护 */
679
+ protected?: boolean;
591
680
  }
592
681
  /**
593
- * 推文核心数据接口
682
+ * 个人简介接口
594
683
  */
595
- interface ITweetCore {
596
- /** 用户结果 */
597
- user_results?: IUserResults;
684
+ interface IProfileBio {
685
+ /** 描述 */
686
+ description?: string;
598
687
  }
599
688
  /**
600
- * 用户结果接口
689
+ * 关系视角接口
601
690
  */
602
- interface IUserResults {
603
- /** 结果 */
604
- result?: IUser$1;
691
+ interface IRelationshipPerspectives {
692
+ /** 是否被阻塞 */
693
+ blocked_by?: boolean;
694
+ /** 是否阻塞 */
695
+ blocking?: boolean;
696
+ /** 是否被关注 */
697
+ followed_by?: boolean;
698
+ /** 是否关注 */
699
+ following?: boolean;
700
+ /** 是否静音 */
701
+ muting?: boolean;
702
+ }
703
+ /**
704
+ * 验证信息接口
705
+ */
706
+ interface IVerification {
707
+ /** 是否验证 */
708
+ verified?: boolean;
709
+ }
710
+
711
+ /**
712
+ * 媒体相关类型定义
713
+ */
714
+
715
+ /**
716
+ * 媒体实体接口
717
+ */
718
+ interface IMediaEntity {
719
+ /** 显示URL */
720
+ display_url?: string;
721
+ /** 展开URL */
722
+ expanded_url?: string;
723
+ /** ID字符串 */
724
+ id_str?: string;
725
+ /** 索引 */
726
+ indices?: number[];
727
+ /** 媒体键 */
728
+ media_key?: string;
729
+ /** 媒体URL */
730
+ media_url_https?: string;
731
+ /** 类型 */
732
+ type?: string;
733
+ /** URL */
734
+ url?: string;
735
+ /** 额外媒体信息 */
736
+ additional_media_info?: IAdditionalMediaInfo;
737
+ /** 扩展媒体可用性 */
738
+ ext_media_availability?: IExtMediaAvailability;
739
+ /** 尺寸 */
740
+ sizes?: IMediaSizes;
741
+ /** 原始信息 */
742
+ original_info?: IOriginalInfo;
743
+ /** 允许下载状态 */
744
+ allow_download_status?: IAllowDownloadStatus;
745
+ /** 视频信息 */
746
+ video_info?: IVideoInfo;
747
+ /** 媒体结果 */
748
+ media_results?: IMediaResults;
749
+ /** 特性 */
750
+ features?: IMediaFeatures;
751
+ /** 扩展媒体颜色 */
752
+ ext_media_color?: IExtMediaColor;
753
+ /** 扩展替代文本 */
754
+ ext_alt_text?: string | null;
755
+ /** 扩展 */
756
+ ext?: IExtMedia;
757
+ }
758
+ /**
759
+ * 额外媒体信息接口
760
+ */
761
+ interface IAdditionalMediaInfo {
762
+ /** 是否可变现 */
763
+ monetizable?: boolean;
764
+ }
765
+ /**
766
+ * 扩展媒体可用性接口
767
+ */
768
+ interface IExtMediaAvailability {
769
+ /** 状态 */
770
+ status?: string;
771
+ }
772
+ /**
773
+ * 媒体尺寸接口
774
+ */
775
+ interface IMediaSizes {
776
+ /** 大尺寸 */
777
+ large?: IMediaSize;
778
+ /** 中等尺寸 */
779
+ medium?: IMediaSize;
780
+ /** 小尺寸 */
781
+ small?: IMediaSize;
782
+ /** 缩略图 */
783
+ thumb?: IMediaSize;
784
+ }
785
+ /**
786
+ * 媒体尺寸接口
787
+ */
788
+ interface IMediaSize {
789
+ /** 高度 */
790
+ h?: number;
791
+ /** 宽度 */
792
+ w?: number;
793
+ /** 调整大小方式 */
794
+ resize?: string;
795
+ }
796
+ /**
797
+ * 原始信息接口
798
+ */
799
+ interface IOriginalInfo {
800
+ /** 高度 */
801
+ height?: number;
802
+ /** 宽度 */
803
+ width?: number;
804
+ /** 焦点矩形 */
805
+ focus_rects?: IFocusRect[];
806
+ }
807
+ /**
808
+ * 焦点矩形接口
809
+ */
810
+ interface IFocusRect {
811
+ /** X坐标 */
812
+ x?: number;
813
+ /** Y坐标 */
814
+ y?: number;
815
+ /** 宽度 */
816
+ w?: number;
817
+ /** 高度 */
818
+ h?: number;
819
+ }
820
+ /**
821
+ * 允许下载状态接口
822
+ */
823
+ interface IAllowDownloadStatus {
824
+ /** 是否允许下载 */
825
+ allow_download?: boolean;
826
+ }
827
+ /**
828
+ * 视频信息接口
829
+ */
830
+ interface IVideoInfo {
831
+ /** 宽高比 */
832
+ aspect_ratio?: number[];
833
+ /** 时长(毫秒) */
834
+ duration_millis?: number;
835
+ /** 视频变体 */
836
+ variants?: IVideoVariant[];
837
+ }
838
+ /**
839
+ * 视频变体接口
840
+ */
841
+ interface IVideoVariant {
842
+ /** 比特率 */
843
+ bitrate?: number;
844
+ /** 内容类型 */
845
+ content_type?: string;
846
+ /** URL */
847
+ url?: string;
848
+ }
849
+ /**
850
+ * 媒体结果接口
851
+ */
852
+ interface IMediaResults {
853
+ /** 结果 */
854
+ result?: IMediaResult;
855
+ }
856
+ /**
857
+ * 媒体结果接口
858
+ */
859
+ interface IMediaResult {
860
+ /** 媒体键 */
861
+ media_key?: string;
862
+ }
863
+ /**
864
+ * 媒体特性接口
865
+ */
866
+ interface IMediaFeatures {
867
+ /** 大尺寸 */
868
+ large?: IMediaFeature;
869
+ /** 中等尺寸 */
870
+ medium?: IMediaFeature;
871
+ /** 小尺寸 */
872
+ small?: IMediaFeature;
873
+ /** 原始尺寸 */
874
+ orig?: IMediaFeature;
875
+ }
876
+ /**
877
+ * 面部接口
878
+ */
879
+ interface IFace {
880
+ /** 高度 */
881
+ h?: number;
882
+ /** 宽度 */
883
+ w?: number;
884
+ /** X坐标 */
885
+ x?: number;
886
+ /** Y坐标 */
887
+ y?: number;
888
+ }
889
+ /**
890
+ * 媒体特性接口
891
+ */
892
+ interface IMediaFeature {
893
+ /** 面部 */
894
+ faces?: IFace[];
895
+ }
896
+ /**
897
+ * 扩展媒体颜色接口
898
+ */
899
+ interface IExtMediaColor {
900
+ /** 调色板 */
901
+ palette?: IColorPalette[];
902
+ }
903
+ /**
904
+ * 扩展媒体接口
905
+ */
906
+ interface IExtMedia {
907
+ /** 媒体统计 */
908
+ mediaStats?: IMediaStats;
909
+ }
910
+ /**
911
+ * 媒体统计接口
912
+ */
913
+ interface IMediaStats {
914
+ /** 统计数据 */
915
+ r?: any;
916
+ /** 生存时间 */
917
+ ttl?: number;
918
+ }
919
+
920
+ /**
921
+ * 推文基础类型,包含所有推文相关类型共有的字段
922
+ */
923
+
924
+ /**
925
+ * 推文基础接口
926
+ */
927
+ interface ITweetBase {
928
+ /** 创建时间 */
929
+ created_at?: string;
930
+ /** ID字符串 */
931
+ id_str?: string;
932
+ /** 完整文本 */
933
+ full_text?: string;
934
+ /** 是否截断 */
935
+ truncated?: boolean;
936
+ /** 显示文本范围 */
937
+ display_text_range?: number[];
938
+ /** 实体 */
939
+ entities?: ITweetEntities;
940
+ /** 来源 */
941
+ source?: string;
942
+ /** 回复的状态ID字符串 */
943
+ in_reply_to_status_id_str?: string | null;
944
+ /** 回复的用户ID字符串 */
945
+ in_reply_to_user_id_str?: string | null;
946
+ /** 回复的屏幕名称 */
947
+ in_reply_to_screen_name?: string | null;
948
+ /** 地理信息 */
949
+ geo?: any | null;
950
+ /** 坐标 */
951
+ coordinates?: any | null;
952
+ /** 地点 */
953
+ place?: any | null;
954
+ /** 贡献者 */
955
+ contributors?: any | null;
956
+ /** 是否为引用状态 */
957
+ is_quote_status?: boolean;
958
+ /** 引用状态ID字符串 */
959
+ quoted_status_id_str?: string | null;
960
+ /** 转发状态ID字符串 */
961
+ retweeted_status_id_str?: string | null;
962
+ /** 转发数 */
963
+ retweet_count?: number;
964
+ /** 点赞数 */
965
+ favorite_count?: number;
966
+ /** 回复数 */
967
+ reply_count?: number;
968
+ /** 引用数 */
969
+ quote_count?: number;
970
+ /** 对话ID字符串 */
971
+ conversation_id_str?: string;
972
+ /** 是否已收藏 */
973
+ favorited?: boolean;
974
+ /** 是否已转发 */
975
+ retweeted?: boolean;
976
+ /** 是否敏感内容 */
977
+ possibly_sensitive?: boolean;
978
+ /** 语言 */
979
+ lang?: string;
980
+ }
981
+ /**
982
+ * 推文实体接口
983
+ */
984
+ interface ITweetEntities {
985
+ /** 话题标签实体数组 */
986
+ hashtags?: IHashtagEntity[];
987
+ /** 媒体实体数组 */
988
+ media?: IMediaEntity[];
989
+ /** 符号实体数组 */
990
+ symbols?: any[];
991
+ /** 时间戳实体数组 */
992
+ timestamps?: any[];
993
+ /** URL实体数组 */
994
+ urls?: IUrlEntity[];
995
+ /** 用户提及实体数组 */
996
+ user_mentions?: IUserMentionEntity[];
997
+ }
998
+ /**
999
+ * 话题标签实体接口
1000
+ */
1001
+ interface IHashtagEntity {
1002
+ /** 索引 */
1003
+ indices?: number[];
1004
+ /** 文本 */
1005
+ text?: string;
1006
+ }
1007
+ /**
1008
+ * 用户提及实体接口
1009
+ */
1010
+ interface IUserMentionEntity {
1011
+ /** ID字符串 */
1012
+ id_str?: string;
1013
+ /** 名称 */
1014
+ name?: string;
1015
+ /** 屏幕名称 */
1016
+ screen_name?: string;
1017
+ /** 索引 */
1018
+ indices?: number[];
1019
+ }
1020
+
1021
+ /**
1022
+ * 推文类型定义
1023
+ */
1024
+
1025
+ /**
1026
+ * 推文接口
1027
+ */
1028
+ interface ITweet {
1029
+ /** 类型名称 */
1030
+ __typename: string;
1031
+ /** 推文REST ID */
1032
+ rest_id: string;
1033
+ /** 是否有birdwatch注释 */
1034
+ has_birdwatch_notes?: boolean;
1035
+ /** 核心数据 */
1036
+ core?: ITweetCore;
1037
+ /** 取消提及数据 */
1038
+ unmention_data?: Record<string, unknown>;
1039
+ /** 编辑控制 */
1040
+ edit_control?: IEditControl;
1041
+ /** Grok分析按钮 */
1042
+ grok_analysis_button?: boolean;
1043
+ /** Grok注释 */
1044
+ grok_annotations?: Record<string, unknown>;
1045
+ /** Grok翻译帖子可用性 */
1046
+ grok_translated_post_with_availability?: IGrokTranslatedPostWithAvailability;
1047
+ /** 之前的计数 */
1048
+ previous_counts?: IPreviousCounts;
1049
+ /** 是否可翻译 */
1050
+ is_translatable?: boolean;
1051
+ /** 视图 */
1052
+ views?: ITweetViews;
1053
+ /** 来源 */
1054
+ source?: string;
1055
+ /** 卡片 */
1056
+ card?: ICard;
1057
+ /** 遗留推文数据 */
1058
+ legacy?: ITweetLegacy;
1059
+ /** 快速推广资格 */
1060
+ quick_promote_eligibility?: IQuickPromoteEligibility;
1061
+ /** 引用状态结果 */
1062
+ quoted_status_result?: IQuotedStatusResult;
1063
+ /** 转发状态结果 */
1064
+ retweeted_status_result?: IRetweetedStatusResult;
1065
+ /** 超级关注回复用户结果 */
1066
+ superFollowsReplyUserResult?: ISuperFollowsReplyUserResult;
1067
+ /** 可见性结果 */
1068
+ visibility_results?: IVisibilityResults;
1069
+ /** 客户端事件信息 */
1070
+ clientEventInfo?: IClientEventInfo;
1071
+ /** 直接在推文对象上的字段(用于通知数据) */
1072
+ full_text?: string;
1073
+ created_at?: string;
1074
+ user_id_str?: string;
1075
+ retweet_count?: number;
1076
+ favorite_count?: number;
1077
+ reply_count?: number;
1078
+ quote_count?: number;
1079
+ lang?: string;
1080
+ conversation_id_str?: string;
1081
+ conversation_id?: string;
1082
+ possibly_sensitive?: boolean;
1083
+ retweeted_status_id_str?: string;
1084
+ quoted_status_id_str?: string;
1085
+ entities?: any;
1086
+ extended_entities?: any;
1087
+ entryId?: string;
1088
+ }
1089
+ /**
1090
+ * 客户端事件信息接口
1091
+ */
1092
+ interface IClientEventInfo {
1093
+ /** 组件 */
1094
+ component?: string;
1095
+ /** 详情 */
1096
+ details?: IClientEventDetails;
1097
+ /** 元素 */
1098
+ element?: string;
1099
+ }
1100
+ /**
1101
+ * 客户端事件详情接口
1102
+ */
1103
+ interface IClientEventDetails {
1104
+ /** 会话详情 */
1105
+ conversationDetails?: IConversationDetails;
1106
+ /** 时间线详情 */
1107
+ timelinesDetails?: ITimelinesDetails;
1108
+ }
1109
+ /**
1110
+ * 会话详情接口
1111
+ */
1112
+ interface IConversationDetails {
1113
+ /** 会话部分 */
1114
+ conversationSection?: string;
1115
+ }
1116
+ /**
1117
+ * 时间线详情接口
1118
+ */
1119
+ interface ITimelinesDetails {
1120
+ /** 控制器数据 */
1121
+ controllerData?: string;
1122
+ /** 注入类型 */
1123
+ injectionType?: string;
1124
+ }
1125
+ /**
1126
+ * 可见性结果接口
1127
+ */
1128
+ interface IVisibilityResults {
1129
+ /** 推文质量 */
1130
+ tweet_visibility_annotations?: ITweetVisibilityAnnotation[];
1131
+ }
1132
+ /**
1133
+ * 推文可见性注释接口
1134
+ */
1135
+ interface ITweetVisibilityAnnotation {
1136
+ /** 类型 */
1137
+ type?: string;
1138
+ /** 理由 */
1139
+ reason?: string;
1140
+ /** 推文质量 */
1141
+ tweet_quality?: string;
1142
+ }
1143
+ /**
1144
+ * 推文核心数据接口
1145
+ */
1146
+ interface ITweetCore {
1147
+ /** 用户结果 */
1148
+ user_results?: IUserResults;
1149
+ }
1150
+ /**
1151
+ * 用户结果接口
1152
+ */
1153
+ interface IUserResults {
1154
+ /** 结果 */
1155
+ result?: IUser;
605
1156
  }
606
1157
  /**
607
1158
  * 编辑控制接口
@@ -660,7 +1211,7 @@ interface ITweetViews {
660
1211
  /**
661
1212
  * 遗留推文数据接口
662
1213
  */
663
- interface ITweetLegacy extends ITweetBase$1 {
1214
+ interface ITweetLegacy extends ITweetBase {
664
1215
  /** 书签数 */
665
1216
  bookmark_count?: number;
666
1217
  /** 是否已书签 */
@@ -679,7 +1230,7 @@ interface ITweetLegacy extends ITweetBase$1 {
679
1230
  */
680
1231
  interface IExtendedEntities {
681
1232
  /** 媒体实体数组 */
682
- media?: IMediaEntity$1[];
1233
+ media?: IMediaEntity[];
683
1234
  }
684
1235
  /**
685
1236
  * 快速推广资格接口
@@ -700,7 +1251,7 @@ interface IQuotedStatusResult {
700
1251
  */
701
1252
  interface ISuperFollowsReplyUserResult {
702
1253
  /** 结果 */
703
- result?: IUser$1;
1254
+ result?: IUser;
704
1255
  }
705
1256
  /**
706
1257
  * 转发状态结果接口
@@ -782,6 +1333,8 @@ interface IImageValue {
782
1333
  width?: number;
783
1334
  /** URL */
784
1335
  url?: string;
1336
+ /** 替代文本 */
1337
+ alt?: string;
785
1338
  }
786
1339
  /**
787
1340
  * 图像颜色值接口
@@ -847,7 +1400,7 @@ interface IDevice {
847
1400
  */
848
1401
  interface IUserRefResult {
849
1402
  /** 结果 */
850
- result?: IUser$1;
1403
+ result?: IUser;
851
1404
  }
852
1405
  /**
853
1406
  * 用户值接口
@@ -858,106 +1411,152 @@ interface IUserValue {
858
1411
  /** 路径 */
859
1412
  path?: string[];
860
1413
  }
861
-
862
1414
  /**
863
- * 推文基础类型,包含所有推文相关类型共有的字段
1415
+ * Grok翻译帖子可用性接口
864
1416
  */
1417
+ interface IGrokTranslatedPostWithAvailability {
1418
+ /** 是否可用 */
1419
+ is_available?: boolean;
1420
+ }
865
1421
 
866
- /**
867
- * 推文基础接口
868
- */
869
- interface ITweetBase {
870
- /** 创建时间 */
871
- created_at?: string;
872
- /** ID字符串 */
873
- id_str?: string;
874
- /** 完整文本 */
875
- full_text?: string;
876
- /** 是否截断 */
877
- truncated?: boolean;
878
- /** 显示文本范围 */
879
- display_text_range?: number[];
880
- /** 实体 */
881
- entities?: ITweetEntities;
882
- /** 来源 */
883
- source?: string;
884
- /** 回复的状态ID字符串 */
885
- in_reply_to_status_id_str?: string | null;
886
- /** 回复的用户ID字符串 */
887
- in_reply_to_user_id_str?: string | null;
888
- /** 回复的屏幕名称 */
889
- in_reply_to_screen_name?: string | null;
890
- /** 地理信息 */
891
- geo?: any | null;
892
- /** 坐标 */
893
- coordinates?: any | null;
894
- /** 地点 */
895
- place?: any | null;
896
- /** 贡献者 */
897
- contributors?: any | null;
898
- /** 是否为引用状态 */
899
- is_quote_status?: boolean;
900
- /** 引用状态ID字符串 */
901
- quoted_status_id_str?: string | null;
902
- /** 转发状态ID字符串 */
903
- retweeted_status_id_str?: string | null;
904
- /** 转发数 */
905
- retweet_count?: number;
906
- /** 点赞数 */
907
- favorite_count?: number;
908
- /** 回复数 */
909
- reply_count?: number;
910
- /** 引用数 */
911
- quote_count?: number;
912
- /** 对话ID字符串 */
913
- conversation_id_str?: string;
914
- /** 是否已收藏 */
915
- favorited?: boolean;
916
- /** 是否已转发 */
917
- retweeted?: boolean;
918
- /** 是否敏感内容 */
919
- possibly_sensitive?: boolean;
920
- /** 语言 */
921
- lang?: string;
1422
+ interface IContent {
1423
+ id?: string;
1424
+ prerollMetadata?: any;
1425
+ promotedMetadata?: any;
1426
+ displayType?: DomDisplayType;
1427
+ tweetContext?: any;
1428
+ socialContext?: any;
1429
+ innerTombstoneInfo?: any;
1430
+ forwardPivot?: any;
1431
+ hasModeratedReplies?: any;
1432
+ ruxContext?: any;
1433
+ conversation_annotation?: any;
1434
+ retweetedStatusId?: any;
1435
+ replyBadge?: any;
1436
+ highlights?: any;
1437
+ grok_translated_post?: any;
1438
+ count?: number;
1439
+ lastRevealedTimestamp?: number | null;
1440
+ tweet?: ITweet;
922
1441
  }
923
- /**
924
- * 推文实体接口
925
- */
926
- interface ITweetEntities {
927
- /** 话题标签实体数组 */
928
- hashtags?: IHashtagEntity[];
929
- /** 媒体实体数组 */
930
- media?: IMediaEntity$1[];
931
- /** 符号实体数组 */
932
- symbols?: any[];
933
- /** 时间戳实体数组 */
934
- timestamps?: any[];
935
- /** URL实体数组 */
936
- urls?: IUrlEntity$1[];
937
- /** 用户提及实体数组 */
938
- user_mentions?: IUserMentionEntity[];
1442
+
1443
+ interface IModuleMetadata {
1444
+ conversationMetadata?: any;
1445
+ gridCarouselMetadata?: any;
1446
+ verticalMetadata?: any;
939
1447
  }
940
- /**
941
- * 话题标签实体接口
942
- */
943
- interface IHashtagEntity {
944
- /** 索引 */
945
- indices?: number[];
946
- /** 文本 */
947
- text?: string;
1448
+
1449
+ interface IItemMetadata {
1450
+ clientEventInfo?: IClientEventInfo;
1451
+ feedbackInfo?: any;
1452
+ reactiveTriggers?: any;
1453
+ moduleMetadata?: IModuleMetadata;
948
1454
  }
949
- /**
950
- * 用户提及实体接口
951
- */
952
- interface IUserMentionEntity {
953
- /** ID字符串 */
954
- id_str?: string;
955
- /** 名称 */
956
- name?: string;
957
- /** 屏幕名称 */
958
- screen_name?: string;
959
- /** 索引 */
960
- indices?: number[];
1455
+
1456
+ interface IDomEntry {
1457
+ type?: string;
1458
+ entryId?: string;
1459
+ sortIndex?: string;
1460
+ itemMetadata?: IItemMetadata;
1461
+ dispensable?: any;
1462
+ treeDisplay?: any;
1463
+ pill_group?: any;
1464
+ content?: any | IContent;
1465
+ shouldCountTowardsAdSpacing?: boolean | any;
1466
+ position?: number;
1467
+ }
1468
+
1469
+ interface IItemData {
1470
+ type?: string;
1471
+ entryId?: string;
1472
+ content?: any;
1473
+ itemMetadata?: any;
1474
+ shouldCountTowardsAdSpacing?: any;
1475
+ sortIndex?: string;
1476
+ position?: number;
1477
+ }
1478
+
1479
+ interface IItem {
1480
+ id?: string;
1481
+ _renderer?: Function;
1482
+ canBeAnchor?: boolean;
1483
+ data?: IItemData;
1484
+ sortIndex?: string;
1485
+ }
1486
+
1487
+ interface IModule {
1488
+ applyFeedbackAction?: Function;
1489
+ applyNewTweetsBarInstructions?: Function;
1490
+ applyReactionInstructions?: Function;
1491
+ clearActiveCover?: Function;
1492
+ clearAllEntries?: Function;
1493
+ clearDroppedAds?: Function;
1494
+ deleteTimeline?: Function;
1495
+ fetchBottom?: Function;
1496
+ fetchCursor?: Function;
1497
+ fetchGraphQLDarkRead?: Function;
1498
+ fetchInitial?: Function;
1499
+ fetchInitialOrTop?: Function;
1500
+ fetchTop?: Function;
1501
+ getCreationOptions?: Function;
1502
+ impressEntry?: Function;
1503
+ injectEntry?: Function;
1504
+ injectTimelineModuleEntry?: Function;
1505
+ markAllAsRead?: Function;
1506
+ markTopEntrySeen?: Function;
1507
+ perfKey?: string;
1508
+ pinEntry?: Function;
1509
+ processCallback?: Function;
1510
+ removeAlert?: Function;
1511
+ removeEntry?: Function;
1512
+ removeTweets?: Function;
1513
+ restoreInjections?: Function;
1514
+ restoreTimeline?: Function;
1515
+ scopeId?: any;
1516
+ selectActiveCover?: Function;
1517
+ selectAlert?: Function;
1518
+ selectBottomFetchStatus?: Function;
1519
+ selectCanRefresh?: Function;
1520
+ selectCursorFetchStatus?: Function;
1521
+ selectCursorFetchStatusByValue?: Function;
1522
+ selectDismissedEntries?: Function;
1523
+ selectDroppedAds?: Function;
1524
+ selectEntries?: Function;
1525
+ selectFeedbackActions?: Function;
1526
+ selectHasHoistedAnEntry?: Function;
1527
+ selectInitialFetchStatus?: Function;
1528
+ selectIsEmptyTimeline?: Function;
1529
+ selectIsUnread?: Function;
1530
+ selectMetadata?: Function;
1531
+ selectNewTweetsBar?: Function;
1532
+ selectPageConfiguration?: Function;
1533
+ selectPinnedEntry?: Function;
1534
+ selectPollingIntervalMs?: Function;
1535
+ selectTimeline?: Function;
1536
+ selectTopFetchStatus?: Function;
1537
+ selectTopUnreadCount?: Function;
1538
+ selectUnavailableReason?: Function;
1539
+ selectUnreadEntries?: Function;
1540
+ selectUnreadEntriesCount?: Function;
1541
+ timelineId?: string;
1542
+ timelineType?: any;
1543
+ undoFeedbackAction?: Function;
1544
+ unpinCurrentlyPinnedEntry?: Function;
1545
+ updateDismissCause?: Function;
1546
+ updateEntry?: Function;
1547
+ }
1548
+
1549
+ interface IReactXCellDivProps extends IReactProps<IDomEntry, IItem, IReactXCellDivProps> {
1550
+ displayType?: DomDisplayType;
1551
+ module?: IModule;
1552
+ setAPI?: Function;
1553
+ children?: any;
1554
+ }
1555
+
1556
+ interface IGetTweetVideoIdResult {
1557
+ videoId?: string;
1558
+ tweetId?: string;
1559
+ index?: number;
961
1560
  }
962
1561
 
963
1562
  interface ITimeline {
@@ -966,6 +1565,7 @@ interface ITimeline {
966
1565
  interface ITimelineInstruction {
967
1566
  type?: string;
968
1567
  entries?: ITimelineEntry[];
1568
+ entry?: ITimelineEntry;
969
1569
  }
970
1570
  interface ITimelineEntry {
971
1571
  entryId?: string;
@@ -978,7 +1578,7 @@ interface ITimelineContent {
978
1578
  itemContent?: ITimelineItemContent;
979
1579
  items?: ITimelineModuleItem[];
980
1580
  displayType?: DisplayType;
981
- clientEventInfo?: IClientEventInfo;
1581
+ clientEventInfo?: ITimelineClientEventInfo;
982
1582
  feedbackInfo?: IFeedbackInfo;
983
1583
  metadata?: IMetadata;
984
1584
  }
@@ -995,9 +1595,17 @@ interface ITimelineItemContent {
995
1595
  tweet_results?: ITweetResults;
996
1596
  tweetDisplayType?: TweetDisplayType;
997
1597
  hasModeratedReplies?: boolean;
998
- clientEventInfo?: IClientEventInfo;
1598
+ clientEventInfo?: ITimelineClientEventInfo;
999
1599
  content?: ITimelineMessageContent;
1000
1600
  impressionCallbacks?: IEndpointCallback[];
1601
+ display_type?: string;
1602
+ text?: string;
1603
+ socialContext?: ISocialContext;
1604
+ }
1605
+ interface ISocialContext {
1606
+ contextType?: string;
1607
+ text?: string;
1608
+ type?: string;
1001
1609
  }
1002
1610
  interface ITimelineMessageContent {
1003
1611
  contentType?: string;
@@ -1015,7 +1623,7 @@ interface IAction {
1015
1623
  url?: string;
1016
1624
  dismissOnClick?: boolean;
1017
1625
  onClickCallbacks?: IEndpointCallback[];
1018
- clientEventInfo?: IClientEventInfo;
1626
+ clientEventInfo?: ITimelineClientEventInfo;
1019
1627
  }
1020
1628
  interface IEndpointCallback {
1021
1629
  endpoint?: string;
@@ -1028,27 +1636,30 @@ interface IFeedbackInfo {
1028
1636
  feedbackKeys?: string[];
1029
1637
  }
1030
1638
  interface ITweetResults {
1031
- result?: ITweet$1;
1639
+ result?: ITweet;
1032
1640
  }
1033
1641
  interface ITimelineModuleItem {
1034
1642
  entryId?: string;
1035
1643
  item?: ITimelineModuleItemContent;
1644
+ dispensable?: boolean;
1036
1645
  }
1037
1646
  interface ITimelineModuleItemContent {
1038
1647
  itemContent?: ITimelineItemContent;
1039
- clientEventInfo?: IClientEventInfo;
1648
+ clientEventInfo?: ITimelineClientEventInfo;
1040
1649
  }
1041
- interface IClientEventInfo {
1042
- details?: IClientEventDetails;
1650
+ interface ITimelineClientEventInfo {
1651
+ component?: string;
1652
+ details?: ITimelineClientEventDetails;
1653
+ element?: string;
1043
1654
  }
1044
- interface IClientEventDetails {
1045
- conversationDetails?: IConversationDetails;
1046
- timelinesDetails?: ITimelinesDetails;
1655
+ interface ITimelineClientEventDetails {
1656
+ conversationDetails?: ITimelineConversationDetails;
1657
+ timelinesDetails?: ITimelineTimelinesDetails;
1047
1658
  }
1048
- interface IConversationDetails {
1659
+ interface ITimelineConversationDetails {
1049
1660
  conversationSection?: string;
1050
1661
  }
1051
- interface ITimelinesDetails {
1662
+ interface ITimelineTimelinesDetails {
1052
1663
  controllerData?: string;
1053
1664
  injectionType?: InjectionType;
1054
1665
  }
@@ -1084,7 +1695,7 @@ interface IMessageEntities {
1084
1695
  hashtags?: any[];
1085
1696
  symbols?: any[];
1086
1697
  user_mentions?: any[];
1087
- urls?: IUrlEntity$1[];
1698
+ urls?: IUrlEntity[];
1088
1699
  }
1089
1700
  interface IAttachment {
1090
1701
  photo?: IPhoto;
@@ -1099,17 +1710,17 @@ interface IPhoto {
1099
1710
  display_url?: string;
1100
1711
  expanded_url?: string;
1101
1712
  type?: string;
1102
- original_info?: IOriginalInfo$1;
1103
- sizes?: IMediaSizes$1;
1713
+ original_info?: IOriginalInfo;
1714
+ sizes?: IMediaSizes;
1104
1715
  features?: Record<string, unknown>;
1105
- ext_media_color?: IExtMediaColor$1;
1716
+ ext_media_color?: IExtMediaColor;
1106
1717
  ext_alt_text?: string | null;
1107
1718
  ext?: IExt;
1108
1719
  audio_only?: boolean;
1109
1720
  }
1110
1721
  interface IExt {
1111
1722
  mediaColor?: IMediaColor;
1112
- mediaStats?: IMediaStats$1;
1723
+ mediaStats?: IMediaStats;
1113
1724
  altText?: IAltText;
1114
1725
  }
1115
1726
  interface IMediaColor {
@@ -1117,13 +1728,13 @@ interface IMediaColor {
1117
1728
  ttl?: number;
1118
1729
  }
1119
1730
  interface IOk {
1120
- palette?: IColorPalette$1[];
1731
+ palette?: IColorPalette[];
1121
1732
  }
1122
1733
  interface IAltText {
1123
1734
  r?: string;
1124
1735
  ttl?: number;
1125
1736
  }
1126
- interface IMessageUser extends IUserBase$1 {
1737
+ interface IMessageUser extends IUserBase {
1127
1738
  id?: number;
1128
1739
  id_str?: string;
1129
1740
  protected?: boolean;
@@ -1153,7 +1764,7 @@ interface IMessageUser extends IUserBase$1 {
1153
1764
  followed_by?: boolean;
1154
1765
  }
1155
1766
  interface IUrlEntities {
1156
- urls?: IUrlEntity$1[];
1767
+ urls?: IUrlEntity[];
1157
1768
  }
1158
1769
  interface IConversation {
1159
1770
  conversation_id?: string;
@@ -1234,7 +1845,7 @@ interface ICommunityTweetPinActionResult {
1234
1845
  __isCommunityTweetPinActionResult?: string;
1235
1846
  }
1236
1847
  interface IUserResult {
1237
- result?: IUser$1;
1848
+ result?: IUser;
1238
1849
  id?: string;
1239
1850
  }
1240
1851
  interface ICommunityInvitesResult {
@@ -1261,7 +1872,7 @@ interface IApiImage {
1261
1872
  salient_rect?: ISalientRect;
1262
1873
  }
1263
1874
  interface IColorInfo {
1264
- palette?: IColorPalette$1[];
1875
+ palette?: IColorPalette[];
1265
1876
  }
1266
1877
  interface ISalientRect {
1267
1878
  left?: number;
@@ -1287,7 +1898,7 @@ interface IGlobalObjects {
1287
1898
  users?: Record<string, IUserObject>;
1288
1899
  tweets?: Record<string, ITweetObject>;
1289
1900
  }
1290
- interface IUserObject extends IUserBase$1 {
1901
+ interface IUserObject extends IUserBase {
1291
1902
  id?: number;
1292
1903
  id_str?: string;
1293
1904
  protected?: boolean;
@@ -1317,7 +1928,7 @@ interface IUserObject extends IUserBase$1 {
1317
1928
  ext_is_blue_verified?: boolean;
1318
1929
  ext_highlighted_label?: Record<string, unknown>;
1319
1930
  }
1320
- interface ITweetObject extends ITweetBase$1 {
1931
+ interface ITweetObject extends ITweetBase {
1321
1932
  id?: number;
1322
1933
  in_reply_to_status_id?: number | null;
1323
1934
  in_reply_to_user_id?: number | null;
@@ -1328,7 +1939,7 @@ interface ITweetObject extends ITweetBase$1 {
1328
1939
  conversation_muted?: boolean;
1329
1940
  card?: ITweetCard;
1330
1941
  ext?: INotificationExt;
1331
- extended_entities?: IExtendedEntities$1;
1942
+ extended_entities?: IExtendedEntities;
1332
1943
  }
1333
1944
  interface IHashtag {
1334
1945
  text?: string;
@@ -1342,7 +1953,7 @@ interface IUserMention {
1342
1953
  indices?: number[];
1343
1954
  }
1344
1955
  interface INotificationMediaStats {
1345
- r?: IOk$1;
1956
+ r?: IOk;
1346
1957
  ttl?: number;
1347
1958
  }
1348
1959
  interface IViewCount {
@@ -1352,210 +1963,14 @@ interface ITweetCard {
1352
1963
  name?: string;
1353
1964
  url?: string;
1354
1965
  card_type_url?: string;
1355
- binding_values?: Record<string, IBindingValue$1>;
1356
- card_platform?: ICardPlatform$1;
1966
+ binding_values?: Record<string, IBindingValue>;
1967
+ card_platform?: ICardPlatform;
1357
1968
  }
1358
1969
  interface INotificationExt {
1359
1970
  superFollowMetadata?: ISuperFollowMetadata;
1360
1971
  }
1361
1972
  interface ISuperFollowMetadata {
1362
- r?: IOk$1;
1363
- ttl?: number;
1364
- }
1365
-
1366
- /**
1367
- * 媒体相关类型定义
1368
- */
1369
-
1370
- /**
1371
- * 媒体实体接口
1372
- */
1373
- interface IMediaEntity {
1374
- /** 显示URL */
1375
- display_url?: string;
1376
- /** 展开URL */
1377
- expanded_url?: string;
1378
- /** ID字符串 */
1379
- id_str?: string;
1380
- /** 索引 */
1381
- indices?: number[];
1382
- /** 媒体键 */
1383
- media_key?: string;
1384
- /** 媒体URL */
1385
- media_url_https?: string;
1386
- /** 类型 */
1387
- type?: string;
1388
- /** URL */
1389
- url?: string;
1390
- /** 额外媒体信息 */
1391
- additional_media_info?: IAdditionalMediaInfo;
1392
- /** 扩展媒体可用性 */
1393
- ext_media_availability?: IExtMediaAvailability;
1394
- /** 尺寸 */
1395
- sizes?: IMediaSizes;
1396
- /** 原始信息 */
1397
- original_info?: IOriginalInfo;
1398
- /** 允许下载状态 */
1399
- allow_download_status?: IAllowDownloadStatus;
1400
- /** 视频信息 */
1401
- video_info?: IVideoInfo;
1402
- /** 媒体结果 */
1403
- media_results?: IMediaResults;
1404
- /** 特性 */
1405
- features?: IMediaFeatures;
1406
- /** 扩展媒体颜色 */
1407
- ext_media_color?: IExtMediaColor;
1408
- /** 扩展替代文本 */
1409
- ext_alt_text?: string | null;
1410
- /** 扩展 */
1411
- ext?: IExtMedia;
1412
- }
1413
- /**
1414
- * 额外媒体信息接口
1415
- */
1416
- interface IAdditionalMediaInfo {
1417
- /** 是否可变现 */
1418
- monetizable?: boolean;
1419
- }
1420
- /**
1421
- * 扩展媒体可用性接口
1422
- */
1423
- interface IExtMediaAvailability {
1424
- /** 状态 */
1425
- status?: string;
1426
- }
1427
- /**
1428
- * 媒体尺寸接口
1429
- */
1430
- interface IMediaSizes {
1431
- /** 大尺寸 */
1432
- large?: IMediaSize;
1433
- /** 中等尺寸 */
1434
- medium?: IMediaSize;
1435
- /** 小尺寸 */
1436
- small?: IMediaSize;
1437
- /** 缩略图 */
1438
- thumb?: IMediaSize;
1439
- }
1440
- /**
1441
- * 媒体尺寸接口
1442
- */
1443
- interface IMediaSize {
1444
- /** 高度 */
1445
- h?: number;
1446
- /** 宽度 */
1447
- w?: number;
1448
- /** 调整大小方式 */
1449
- resize?: string;
1450
- }
1451
- /**
1452
- * 原始信息接口
1453
- */
1454
- interface IOriginalInfo {
1455
- /** 高度 */
1456
- height?: number;
1457
- /** 宽度 */
1458
- width?: number;
1459
- /** 焦点矩形 */
1460
- focus_rects?: IFocusRect[];
1461
- }
1462
- /**
1463
- * 焦点矩形接口
1464
- */
1465
- interface IFocusRect {
1466
- /** X坐标 */
1467
- x?: number;
1468
- /** Y坐标 */
1469
- y?: number;
1470
- /** 宽度 */
1471
- w?: number;
1472
- /** 高度 */
1473
- h?: number;
1474
- }
1475
- /**
1476
- * 允许下载状态接口
1477
- */
1478
- interface IAllowDownloadStatus {
1479
- /** 是否允许下载 */
1480
- allow_download?: boolean;
1481
- }
1482
- /**
1483
- * 视频信息接口
1484
- */
1485
- interface IVideoInfo {
1486
- /** 宽高比 */
1487
- aspect_ratio?: number[];
1488
- /** 时长(毫秒) */
1489
- duration_millis?: number;
1490
- /** 视频变体 */
1491
- variants?: IVideoVariant[];
1492
- }
1493
- /**
1494
- * 视频变体接口
1495
- */
1496
- interface IVideoVariant {
1497
- /** 比特率 */
1498
- bitrate?: number;
1499
- /** 内容类型 */
1500
- content_type?: string;
1501
- /** URL */
1502
- url?: string;
1503
- }
1504
- /**
1505
- * 媒体结果接口
1506
- */
1507
- interface IMediaResults {
1508
- /** 结果 */
1509
- result?: IMediaResult;
1510
- }
1511
- /**
1512
- * 媒体结果接口
1513
- */
1514
- interface IMediaResult {
1515
- /** 媒体键 */
1516
- media_key?: string;
1517
- }
1518
- /**
1519
- * 媒体特性接口
1520
- */
1521
- interface IMediaFeatures {
1522
- /** 大尺寸 */
1523
- large?: IMediaFeature;
1524
- /** 中等尺寸 */
1525
- medium?: IMediaFeature;
1526
- /** 小尺寸 */
1527
- small?: IMediaFeature;
1528
- /** 原始尺寸 */
1529
- orig?: IMediaFeature;
1530
- }
1531
- /**
1532
- * 媒体特性接口
1533
- */
1534
- interface IMediaFeature {
1535
- /** 面部 */
1536
- faces?: any[];
1537
- }
1538
- /**
1539
- * 扩展媒体颜色接口
1540
- */
1541
- interface IExtMediaColor {
1542
- /** 调色板 */
1543
- palette?: IColorPalette$1[];
1544
- }
1545
- /**
1546
- * 扩展媒体接口
1547
- */
1548
- interface IExtMedia {
1549
- /** 媒体统计 */
1550
- mediaStats?: IMediaStats;
1551
- }
1552
- /**
1553
- * 媒体统计接口
1554
- */
1555
- interface IMediaStats {
1556
- /** 统计数据 */
1557
- r?: any;
1558
- /** 生存时间 */
1973
+ r?: IOk;
1559
1974
  ttl?: number;
1560
1975
  }
1561
1976
 
@@ -1574,6 +1989,8 @@ interface ISimpleUser {
1574
1989
  profile_image_url_https: string;
1575
1990
  /** 是否验证 */
1576
1991
  verified?: boolean;
1992
+ /** 是否蓝V验证 */
1993
+ blue_verified?: boolean;
1577
1994
  /** 粉丝数 */
1578
1995
  followers_count?: number;
1579
1996
  /** 关注数 */
@@ -1638,16 +2055,28 @@ interface ISimplePhoto extends ISimpleMedia {
1638
2055
  */
1639
2056
  interface ISimpleVideo extends ISimpleMedia {
1640
2057
  /** 媒体类型 */
1641
- type: Exclude<MediaType, 'photo'>;
1642
- /** 视频信息 */
1643
- video_info?: {
1644
- /** 宽高比 */
1645
- aspect_ratio?: number[];
1646
- /** 时长(毫秒) */
1647
- duration_millis?: number;
1648
- /** 视频变体 */
1649
- variants?: ISimpleVideoVariant[];
1650
- };
2058
+ type: 'video';
2059
+ /** 宽高比 */
2060
+ aspect_ratio?: number[];
2061
+ /** 时长(毫秒) */
2062
+ duration_millis?: number;
2063
+ /** MP4 视频数组 */
2064
+ mp4?: ISimpleMP4Video[];
2065
+ /** HLS 视频 URL */
2066
+ hls?: string;
2067
+ }
2068
+ /**
2069
+ * 简单动态图片媒体类型
2070
+ */
2071
+ interface ISimpleGif extends ISimpleMedia {
2072
+ /** 媒体类型 */
2073
+ type: 'animated_gif';
2074
+ /** 宽高比 */
2075
+ aspect_ratio?: number[];
2076
+ /** 时长(毫秒) */
2077
+ duration_millis?: number;
2078
+ /** MP4 视频 URL */
2079
+ mp4?: string;
1651
2080
  }
1652
2081
  /**
1653
2082
  * 媒体尺寸
@@ -1661,15 +2090,15 @@ interface ISimpleMediaSize {
1661
2090
  resize: string;
1662
2091
  }
1663
2092
  /**
1664
- * 视频变体
2093
+ * MP4 视频
1665
2094
  */
1666
- interface ISimpleVideoVariant {
2095
+ interface ISimpleMP4Video {
1667
2096
  /** 比特率 */
1668
2097
  bitrate?: number;
1669
- /** 内容类型 */
1670
- content_type: string;
1671
2098
  /** 视频URL */
1672
2099
  url: string;
2100
+ /** 质量 */
2101
+ quality?: VideoQuality;
1673
2102
  }
1674
2103
  /**
1675
2104
  * 简单URL类型
@@ -1694,10 +2123,8 @@ interface ISimpleTweet {
1694
2123
  full_text: string;
1695
2124
  /** 创建时间 */
1696
2125
  created_at: string;
1697
- /** 用户ID */
1698
- user_id: string;
1699
- /** 用户屏幕名称 */
1700
- user_screen_name: string;
2126
+ /** 用户信息 */
2127
+ user: ISimpleUser;
1701
2128
  /** 转发数 */
1702
2129
  retweet_count?: number;
1703
2130
  /** 点赞数 */
@@ -1722,8 +2149,12 @@ interface ISimpleTweet {
1722
2149
  photos?: ISimplePhoto[];
1723
2150
  /** 视频媒体数组 */
1724
2151
  videos?: ISimpleVideo[];
2152
+ /** 动态图片媒体数组 */
2153
+ gifs?: ISimpleGif[];
1725
2154
  /** URL数组 */
1726
2155
  urls?: ISimpleUrl[];
2156
+ /** 推文质量 */
2157
+ quality?: TweetQuality;
1727
2158
  }
1728
2159
 
1729
2160
  /**
@@ -1731,21 +2162,29 @@ interface ISimpleTweet {
1731
2162
  */
1732
2163
 
1733
2164
  /**
1734
- * Result的基类,支持泛型
1735
- * @template UserType - 用户类型,必须是ISimpleUser或IUser
2165
+ * Result的基类
1736
2166
  * @template TweetType - 推文类型,必须是ISimpleTweet或ITweet
2167
+ * @template UserType - 用户类型,必须是IUser或ISimpleUser
1737
2168
  */
1738
- interface IResultBase<UserType extends ISimpleUser | IUser, TweetType extends ISimpleTweet | ITweet> {
1739
- /** 用户数组 */
1740
- users?: UserType[];
2169
+ interface IResultBase<TweetType extends ISimpleTweet | ITweet, UserType extends IUser | ISimpleUser> {
1741
2170
  /** 推文数组 */
1742
2171
  tweets?: TweetType[];
1743
2172
  /** 包含图片的推文数组 */
1744
2173
  photos?: TweetType[];
1745
2174
  /** 包含视频的推文数组 */
1746
2175
  videos?: TweetType[];
2176
+ /** 包含动态图片的推文数组 */
2177
+ gifs?: TweetType[];
1747
2178
  /** 包含URL的推文数组 */
1748
2179
  urls?: TweetType[];
2180
+ /** 广告推文数组 */
2181
+ ads?: TweetType[];
2182
+ /** 探索更多内容数组 */
2183
+ exploreMore?: TweetType[];
2184
+ /** 推荐推文数组 */
2185
+ recommendations?: TweetType[];
2186
+ /** 用户数组 */
2187
+ users?: UserType[];
1749
2188
  /** 下一页游标 */
1750
2189
  next_cursor?: string;
1751
2190
  /** 下一页游标字符串 */
@@ -1768,13 +2207,43 @@ interface IResultBase<UserType extends ISimpleUser | IUser, TweetType extends IS
1768
2207
  /**
1769
2208
  * 基于简单类型的Result
1770
2209
  */
1771
- interface ISimpleResult extends IResultBase<ISimpleUser, ISimpleTweet> {
2210
+ interface ISimpleResult extends IResultBase<ISimpleTweet, ISimpleUser> {
1772
2211
  }
1773
2212
  /**
1774
2213
  * 基于原始类型的Result
1775
2214
  */
1776
- interface IOriginalResult extends IResultBase<IUser, ITweet> {
2215
+ interface IOriginalResult extends IResultBase<ITweet, IUser> {
2216
+ }
2217
+
2218
+ interface IListenTweetOption {
2219
+ enableVideoDetected?: boolean;
2220
+ enableTweetDetected?: boolean;
2221
+ enableUserDetected?: boolean;
2222
+ enableVideoRendered?: boolean;
2223
+ }
2224
+
2225
+ declare const enum ListenTweetEvents {
2226
+ /**
2227
+ * 发现视频
2228
+ */
2229
+ VideoDetected = "__listen-tweet-video-detected",
2230
+ /**
2231
+ * 发现推文
2232
+ */
2233
+ TweetDetected = "__listen-tweet-tweet-detected",
2234
+ /**
2235
+ * 发现用户
2236
+ */
2237
+ UserDetected = "__listen-tweet-user-detected",
2238
+ /**
2239
+ * 推文渲染
2240
+ */
2241
+ TweetRendered = "__listen-tweet-tweet-rendered",
2242
+ /**
2243
+ * 视频渲染
2244
+ */
2245
+ VideoRendered = "__listen-tweet-video-rendered"
1777
2246
  }
1778
2247
 
1779
- export { COMMUNITY_TYPENAMES, COMPONENT_VALUES, CONTENT_TYPES, CURSOR_TYPES, DISPLAY_TYPES, ELEMENT_TYPES, ELIGIBILITY_TYPES, INJECTION_TYPES, INSTRUCTION_TYPES, ITEM_TYPES, IdPrefixes, LEGACY_CARD_BINDING_KEY_TYPES, LEGACY_CARD_BINDING_VALUE_TYPES, MEDIA_TYPES, MESSAGE_INBOX_TIMELINE_INDEXES, NOTIFICATION_KEYS, TIMELINE_ENTRY_TYPES, TIMELINE_INSTRUCTION_TYPES, TIMELINE_ITEM_TYPENAMES, TIMELINE_ITEM_TYPES, TIMELINE_TYPENAMES, TRANSPARENT_GUIDE_DETAIL_TYPES, TWEET_DISPLAY_TYPES, TWEET_QUALITIES, TWEET_TYPENAMES, URL_TYPES, USER_DISPLAY_TYPES, USER_LABEL_TYPES, USER_TYPENAMES, VERIFIED_TYPES, VIDEO_CONTENT_TYPES, VIEW_STATES };
1780
- export type { CommunityTypename, ComponentValue, ContentType, CursorType, DisplayType, ElementType, EligibilityType, IAction, IAdditionalMediaInfo, IAffiliatesHighlightedLabel, IAllowDownloadStatus, IAltText, IApiImage, IAttachment, IAudience, IBadge, IBindingValue, IBindingValueContent, IButtonAction, ICard, ICardLegacy, ICardPlatform, IClientEventDetails, IClientEventInfo, IColorInfo, IColorPalette, IColorRGB, ICommunity, ICommunityActions, ICommunityDeleteActionResult, ICommunityInvitesResult, ICommunityJoinActionResult, ICommunityJoinRequestsResult, ICommunityLeaveActionResult, ICommunityMedia, ICommunityResult, ICommunityRule, ICommunityTweetPinActionResult, ICommunityUserDefaultModerationState, IConversation, IConversationDetails, IConversationMetadata, IConversationTimeline, IDevice, IEditControl, IEditControlInitial, IEndpointCallback, IEntry, IExt, IExtMedia, IExtMediaAvailability, IExtMediaColor, IExtendedEntities, IFeedbackInfo, IFocusRect, IGlobalObjects, IHashtag, IHashtagEntity, IImageColorValue, IImageValue, ILabel, IMediaColor, IMediaEntity, IMediaFeature, IMediaFeatures, IMediaResult, IMediaResults, IMediaSize, IMediaSizes, IMediaStats, IMessage, IMessageData, IMessageEntities, IMessageUser, IMetadata, INotificationExt, INotificationMediaStats, INotificationResponse, IOk, IOriginalInfo, IOriginalResult, IParticipant, IPhoto, IPlatform, IPreviousCounts, IQuickPromoteEligibility, IQuotedStatusPermalink, IQuotedStatusResult, IResultBase, IRetweetedStatusResult, IRichText, ISalientRect, ISimpleMedia, ISimpleMediaSize, ISimplePhoto, ISimpleResult, ISimpleTweet, ISimpleUrl, ISimpleUser, ISimpleVideo, ISimpleVideoVariant, ISuperFollowMetadata, ISuperFollowsReplyUserResult, ITimeline, ITimelineContent, ITimelineEntry, ITimelineInstruction, ITimelineItemContent, ITimelineMessageContent, ITimelineModuleItem, ITimelineModuleItemContent, ITimelinesDetails, ITipjarSettings, ITweet, ITweetBase, ITweetCard, ITweetCore, ITweetEntities, ITweetLegacy, ITweetObject, ITweetResults, ITweetViews, IUrl, IUrlEntities, IUrlEntity, IUser, IUserBase, IUserCategory, IUserEntities, IUserEntityUrls, IUserLegacy, IUserMention, IUserMentionEntity, IUserObject, IUserProfessional, IUserRefResult, IUserResult, IUserResults, IUserValue, IVideoInfo, IVideoVariant, IViewCount, IViewerRelationship, InjectionType, InstructionType, ItemType, LegacyCardBindingKeyType, LegacyCardBindingValueType, MediaType, MessageInboxTimelineIndex, NotificationKey, TimelineEntryType, TimelineInstructionType, TimelineItemType, TimelineItemTypename, TimelineTypename, TransparentGuideDetailType, TweetDisplayType, TweetQuality, TweetTypename, UrlType, UserDisplayType, UserLabelType, UserTypename, VerifiedType, VideoContentType, ViewState };
2248
+ export { COMMUNITY_TYPENAMES, COMPONENT_VALUES, CONTENT_TYPES, CURSOR_TYPES, DISPLAY_TYPES, DomDisplayTypes, ELEMENT_TYPES, ELIGIBILITY_TYPES, INJECTION_TYPES, INSTRUCTION_TYPES, ITEM_TYPES, IdPrefixes, LEGACY_CARD_BINDING_KEY_TYPES, LEGACY_CARD_BINDING_VALUE_TYPES, ListenTweetEvents, MEDIA_TYPES, MESSAGE_INBOX_TIMELINE_INDEXES, NOTIFICATION_KEYS, TIMELINE_ENTRY_TYPES, TIMELINE_INSTRUCTION_TYPES, TIMELINE_ITEM_TYPENAMES, TIMELINE_ITEM_TYPES, TIMELINE_TYPENAMES, TRANSPARENT_GUIDE_DETAIL_TYPES, TWEET_DISPLAY_TYPES, TWEET_QUALITIES, TWEET_TYPENAMES, URL_TYPES, USER_DISPLAY_TYPES, USER_LABEL_TYPES, USER_TYPENAMES, VERIFIED_TYPES, VIDEO_CONTENT_TYPES, VIDEO_QUALITIES, VIEW_STATES };
2249
+ export type { CommunityTypename, ComponentValue, ContentType, CursorType, DisplayType, DomDisplayType, ElementType, EligibilityType, IAction, IAdditionalMediaInfo, IAffiliatesHighlightedLabel, IAllowDownloadStatus, IAltText, IApiImage, IAttachment, IAudience, IAvatar, IBadge, IBindingValue, IBindingValueContent, IButtonAction, ICard, ICardLegacy, ICardPlatform, IClientEventDetails, IClientEventInfo, IColorInfo, IColorPalette, IColorRGB, ICommunity, ICommunityActions, ICommunityDeleteActionResult, ICommunityInvitesResult, ICommunityJoinActionResult, ICommunityJoinRequestsResult, ICommunityLeaveActionResult, ICommunityMedia, ICommunityResult, ICommunityRule, ICommunityTweetPinActionResult, ICommunityUserDefaultModerationState, IContent, IConversation, IConversationDetails, IConversationMetadata, IConversationTimeline, IDevice, IDmPermissions, IDomEntry, IEditControl, IEditControlInitial, IEndpointCallback, IEntry, IExt, IExtMedia, IExtMediaAvailability, IExtMediaColor, IExtendedEntities, IFace, IFeedbackInfo, IFocusRect, IGetTweetVideoIdResult, IGlobalObjects, IGrokTranslatedPostWithAvailability, IHashtag, IHashtagEntity, IImageColorValue, IImageValue, IItem, IItemData, IItemMetadata, ILabel, IListenTweetOption, ILocation, IMediaColor, IMediaEntity, IMediaFeature, IMediaFeatures, IMediaPermissions, IMediaResult, IMediaResults, IMediaSize, IMediaSizes, IMediaStats, IMessage, IMessageData, IMessageEntities, IMessageUser, IMetadata, IModule, IModuleMetadata, INotificationExt, INotificationMediaStats, INotificationResponse, IOk, IOriginalInfo, IOriginalResult, IParticipant, IPhoto, IPlatform, IPreviousCounts, IPrivacy, IProfileBio, IQuickPromoteEligibility, IQuotedStatusPermalink, IQuotedStatusResult, IReactXCellDivProps, IRelationshipPerspectives, IResultBase, IRetweetedStatusResult, IRichText, ISalientRect, ISimpleGif, ISimpleMP4Video, ISimpleMedia, ISimpleMediaSize, ISimplePhoto, ISimpleResult, ISimpleTweet, ISimpleUrl, ISimpleUser, ISimpleVideo, ISocialContext, ISuperFollowMetadata, ISuperFollowsReplyUserResult, ITimeline, ITimelineClientEventDetails, ITimelineClientEventInfo, ITimelineContent, ITimelineConversationDetails, ITimelineEntry, ITimelineInstruction, ITimelineItemContent, ITimelineMessageContent, ITimelineModuleItem, ITimelineModuleItemContent, ITimelineTimelinesDetails, ITimelinesDetails, ITipjarSettings, ITweet, ITweetBase, ITweetCard, ITweetCore, ITweetEntities, ITweetLegacy, ITweetObject, ITweetResults, ITweetViews, ITweetVisibilityAnnotation, IUrl, IUrlEntities, IUrlEntity, IUser, IUserBase, IUserCategory, IUserCore, IUserEntities, IUserEntityUrls, IUserLegacy, IUserMention, IUserMentionEntity, IUserObject, IUserProfessional, IUserRefResult, IUserResult, IUserResults, IUserValue, IVerification, IVideoInfo, IVideoVariant, IViewCount, IViewerRelationship, IVisibilityResults, InjectionType, InstructionType, ItemType, LegacyCardBindingKeyType, LegacyCardBindingValueType, MediaType, MessageInboxTimelineIndex, NotificationKey, TimelineEntryType, TimelineInstructionType, TimelineItemType, TimelineItemTypename, TimelineTypename, TransparentGuideDetailType, TweetDisplayType, TweetQuality, TweetTypename, UrlType, UserDisplayType, UserLabelType, UserTypename, VerifiedType, VideoContentType, VideoQuality, ViewState };