diff options
Diffstat (limited to 'src/ts/types/blog.ts')
| -rw-r--r-- | src/ts/types/blog.ts | 48 |
1 files changed, 15 insertions, 33 deletions
diff --git a/src/ts/types/blog.ts b/src/ts/types/blog.ts index 32fa9b8..7325ddf 100644 --- a/src/ts/types/blog.ts +++ b/src/ts/types/blog.ts @@ -1,47 +1,29 @@ -import { - ArticlePreview, - ArticlePreviewResponse, - ArticleSlug, -} from './articles'; -import { PageInfo } from './pagination'; - -export type PostsListEdge = { - cursor: string; - node: ArticlePreviewResponse; -}; - -export type PostsListResponse = { - posts: { - edges: PostsListEdge[]; - pageInfo: PageInfo; - }; -}; +import { PageInfo, Slug } from './app'; +import { ArticlePreview, RawArticlePreview } from './articles'; export type PostsList = { posts: ArticlePreview[]; pageInfo: PageInfo; }; -export type FetchPostsListReturn = ( - first?: number, - after?: string -) => Promise<PostsListResponse>; - -type PostsListProps = { - first?: number; - after?: string; +export type PostsListEdges = { + cursor: string; + node: RawArticlePreview; }; -export type GetPostsListReturn = (props: PostsListProps) => Promise<PostsList>; - -export type BlogPageProps = { - fallback: PostsList; +export type RawPostsList = { + posts: { + edges: PostsListEdges[]; + pageInfo: PageInfo; + }; }; -export type AllPostsSlugResponse = { +export type AllPostsSlug = { posts: { - nodes: ArticleSlug[]; + nodes: Slug[]; }; }; -export type FetchAllPostsSlugReturn = () => Promise<ArticleSlug[]>; +export type BlogPageProps = { + fallback: PostsList; +}; |
