Files
browser-helper/typings/note.d.ts
2025-12-26 18:13:15 +08:00

106 lines
2.3 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[];
}
}