diff options
Diffstat (limited to 'src/ts/types/articles.ts')
| -rw-r--r-- | src/ts/types/articles.ts | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/src/ts/types/articles.ts b/src/ts/types/articles.ts index 5d5fbc5..664e237 100644 --- a/src/ts/types/articles.ts +++ b/src/ts/types/articles.ts @@ -1,4 +1,6 @@ +import { Comment, CommentsResponse } from './comments'; import { Cover, CoverResponse } from './cover'; +import { SEO } from './seo'; import { SubjectPreview, ThematicPreview } from './taxonomies'; export type ArticleDates = { @@ -11,7 +13,7 @@ export type ArticlePreviewResponse = { postsInSubject: SubjectPreview[] | null; postsInThematics: ThematicPreview[] | null; }; - commentCount: number; + commentCount: number | null; contentParts: { beforeMore: string; }; @@ -25,7 +27,7 @@ export type ArticlePreviewResponse = { }; export type ArticlePreview = { - commentCount: number; + commentCount: number | null; content: string; databaseId: number; date: ArticleDates; @@ -36,3 +38,33 @@ export type ArticlePreview = { thematics: ThematicPreview[] | []; title: string; }; + +export type ArticleResponse = ArticlePreviewResponse & { + comments: CommentsResponse; + contentParts: { + afterMore: string; + }; + seo: SEO; +}; + +export type Article = ArticlePreview & { + comments: Comment[]; + intro: string; + seo: SEO; +}; + +export type PostByResponse = { + postBy: ArticleResponse; +}; + +export type FetchPostByReturn = (slug: string) => Promise<PostByResponse>; + +export type GetPostByReturn = (slug: string) => Promise<Article>; + +export type ArticleProps = { + post: Article; +}; + +export type ArticleSlug = { + slug: string; +}; |
