Files
knowai/types/post/base.ts
tobegold574 382e3aff21 feat(reset): 以构造器模式重构
- 加了大文件传输自定义分片协议

BREAKING CHANGES: 0.1.0(latest)
2025-11-30 20:27:53 +08:00

27 lines
837 B
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.

import type { UserProfile } from '../user';
import type { BaseEntity, BaseStats } from '../common';
export type PostType = 'question' | 'article';
// 不搞fallback统一用原子组件作为fallback
export type PostContent =
| { type: 'text'; value: string }
| { type: 'image'; src: string }
| { type: 'video'; src: string};
export interface PostComment extends BaseEntity {
author: UserProfile; // 作者信息
content: string; // 评论内容(暂时只支持文字评论)
parentId?: string; // 父评论ID用于嵌套评论
}
// 帖子接口
export interface Post extends BaseEntity, BaseStats{
title: string; // 标题
// 没有标签数组
content: PostContent[]; // 内容(文字、图片等)
type: PostType; // 帖子类型:提问或文章
author: UserProfile; // 作者信息
}