Files
browser-helper/typings/note.d.ts

227 lines
5.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
declare namespace XHS {
/** 笔记用户信息 */
export interface NoteUser {
/** 昵称 */
nick_name: string;
/** 头像URL */
avatar: string;
/** 用户ID */
user_id: string;
/** 昵称与nick_name相同 */
nickname: string;
/** 安全令牌 */
xsec_token: string;
}
/** 笔记交互信息 */
export interface InteractInfo {
/** 评论数 */
comment_count: string;
/** 分享数 */
shared_count: string;
/** 是否已点赞 */
liked: boolean;
/** 点赞数 */
liked_count: string;
/** 是否已收藏 */
collected: boolean;
/** 收藏数 */
collected_count: string;
}
/** 图片信息 */
export interface ImageInfo {
/** 图片场景如WB_DFT默认、WB_PRV预览 */
image_scene: string;
/** 图片URL */
url: string;
}
/** 笔记图片 */
export interface Image {
/** 图片宽度 */
width: number;
/** 图片高度 */
height: number;
/** 图片信息列表不同场景的URL */
info_list: ImageInfo[];
}
/** 笔记封面 */
export interface Cover {
/** 封面高度 */
height: number;
/** 封面宽度 */
width: number;
/** 默认URL */
url_default: string;
/** 预览URL */
url_pre: string;
}
/** 角标信息 */
export interface CornerTagInfo {
/** TODO: 角标类型如publish_time发布时间 */
type: 'publish_time' | string;
/** 角标文本 */
text: string;
}
/** 笔记卡片 */
export interface NoteCard {
/** 显示标题 */
display_title: string;
/** 用户信息 */
user: NoteUser;
/** 交互信息 */
interact_info: InteractInfo;
/** 封面 */
cover: Cover;
/** 图片列表 */
image_list: Image[];
/** 角标信息列表 */
corner_tag_info: CornerTagInfo[];
/** TODO: 笔记类型如normal普通 */
type: 'normal' | 'video';
}
/** 笔记 */
export interface SearchNote {
/** 笔记ID */
id: string;
/** 模型类型如note笔记 */
model_type: 'note' | 'hot_query' | string;
/** 笔记卡片 */
note_card: NoteCard;
/** 安全令牌 */
xsec_token: string;
}
}
declare namespace XHS {
export interface ResultList<T = SearchNote> {
hasMore: boolean;
items: T[];
}
}
declare namespace XHS {
/** 分享信息 */
export interface ShareInfo {
/** 是否不可分享 */
un_share: boolean;
}
/** 标签 */
export interface Tag {
/** 标签ID */
id: string;
/** 标签名称 */
name: string;
/** 标签类型如topic话题 */
type: 'topic' | string;
}
/** 完整的笔记交互信息 */
export interface FullInteractInfo {
/** 分享数 */
share_count: string;
/** 是否已关注 */
followed: boolean;
/** 关系如none无 */
relation: 'none' | 'following' | string;
/** 是否已点赞 */
liked: boolean;
/** 点赞数 */
liked_count: string;
/** 是否已收藏 */
collected: boolean;
/** 收藏数 */
collected_count: string;
/** 评论数 */
comment_count: string;
}
/** 完整的图片信息 */
export interface FullImageInfo {
/** 图片场景如WB_DFT默认、WB_PRV预览 */
image_scene: string;
/** 图片URL */
url: string;
}
/** 完整的笔记图片 */
export interface FullImage {
/** 图片宽度 */
width: number;
/** 图片高度 */
height: number;
/** 图片信息列表不同场景的URL */
info_list: FullImageInfo[];
/** 流信息 */
stream: Record<string, unknown>;
/** 是否Live Photo */
live_photo: boolean;
/** 文件ID */
file_id: string;
/** URL */
url: string;
/** 追踪ID */
trace_id: string;
/** 预览URL */
url_pre: string;
/** 默认URL */
url_default: string;
}
/** 完整的笔记卡片 */
export interface NoteCardDetail {
/** 时间 */
time: number;
/** 分享信息 */
share_info: ShareInfo;
/** 描述 */
desc: string;
/** 用户信息 */
user: NoteUser;
/** 标签列表 */
tag_list: Tag[];
/** 交互信息 */
interact_info: FullInteractInfo;
/** 图片列表 */
image_list: FullImage[];
/** @用户列表 */
at_user_list: unknown[];
/** 最后更新时间 */
last_update_time: number;
/** IP位置 */
ip_location: string;
/** 笔记ID */
note_id: string;
/** 类型如normal普通 */
type: 'normal' | 'video' | string;
/** 标题 */
title: string;
}
/** 笔记详情Feed中的完整笔记 */
export interface NoteDetail {
/** 笔记ID */
id: string;
/** 模型类型如note笔记 */
model_type: 'note' | string;
/** 笔记卡片 */
note_card: NoteCard;
}
/** Feed响应 */
export interface FeedResponse {
/** 游标分数 */
cursor_score: string;
/** 笔记列表 */
items: NoteDetail[];
/** 当前时间 */
current_time: number;
}
}