// TODO @hw：这个要融合到 draftApi 里么？类似其他模块的。
interface NewsItem {
  title: string;
  thumbMediaId: string;
  author: string;
  digest: string;
  showCoverPic: number;
  content: string;
  contentSourceUrl: string;
  needOpenComment: number;
  onlyFansCanComment: number;
  thumbUrl: string;
  picUrl?: string; // 用于预览封面
}

interface NewsItemList {
  newsItem: NewsItem[];
}

interface Article {
  mediaId: string;
  content: NewsItemList;
  updateTime: number;
}

function createEmptyNewsItem(): NewsItem {
  return {
    title: '',
    thumbMediaId: '',
    author: '',
    digest: '',
    showCoverPic: 0,
    content: '',
    contentSourceUrl: '',
    needOpenComment: 0,
    onlyFansCanComment: 0,
    thumbUrl: '',
  };
}

export type { Article, NewsItem, NewsItemList };
export { createEmptyNewsItem };
