OurBigBook logoOurBigBook Docs OurBigBook logoOurBigBook.comSite Source code
web/front/types/ArticleType.ts
import { UserType } from 'front/types/UserType'

export interface ArticleList {
  articles: ArticleType[];
}

export interface Article {
  article: ArticleType;
}

/** Just enough to be able to link to the article title. */
export type ArticleLinkType = {
  slug: string;
  titleRenderWithScope: string;
}

/** Add some stuff to link that we need on ancestors listings:
 *  * hasScope: to decide if something need to be shown due to scope on <h1>/<title>
 *  * titleRenderPlaintext: to show it on <title> if needed
 */
export type ArticleAncestorType = ArticleLinkType & {
  hasScope: boolean;
  titleRenderPlaintext: string;
}

export type ArticleType = {
  announcedAt?: number,
  author: UserType,
  body: string;
  createdAt?: string;
  depth: number;
  file: {
    titleSource: string,
    bodySource: string,
  };
  h1Render: string;
  h2Render: string;
  id: number;
  issueCount?: number;
  liked: boolean;
  likedBy?: UserType;
  likedByDate?: string;
  list?: boolean;
  followed?: boolean;
  followerCount?: number;
  image?: string;
  render: string;
  score: number;
  slug: string;
  tagList: string[];
  taggedArticles?: ArticleLinkType[];
  titleRender: string;
  titleRenderPlaintext: string;
  titleRenderWithScope: string;
  titleSource: string;
  titleSourceLine: number;
  topicCount?: number;
  topicId: string;
  updatedAt?: string;
};