This commit is contained in:
2025-12-25 15:29:55 +08:00
parent c35299bf8c
commit 66e6370013
7 changed files with 397 additions and 29 deletions

106
typings/note.ts Normal file
View File

@@ -0,0 +1,106 @@
export 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 Note {
/** 笔记ID */
id: string;
/** 模型类型如note笔记 */
model_type: string;
/** 笔记卡片 */
note_card: NoteCard;
/** 安全令牌 */
xsec_token: string;
}
}
export namespace XHS {
export interface ResultList<T = NoteCard> {
hasMore: boolean;
items: T[];
}
}