diff options
Diffstat (limited to 'src/ts/types/blog.ts')
| -rw-r--r-- | src/ts/types/blog.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ts/types/blog.ts b/src/ts/types/blog.ts new file mode 100644 index 0000000..345deed --- /dev/null +++ b/src/ts/types/blog.ts @@ -0,0 +1,33 @@ +import { ArticlePreview, ArticlePreviewResponse } from './articles'; +import { PageInfo } from './pagination'; + +export type PostsListEdge = { + cursor: string; + node: ArticlePreviewResponse; +}; + +export type PostsListResponse = { + posts: { + edges: PostsListEdge[]; + pageInfo: PageInfo; + }; +}; + +export type PostsList = { + posts: ArticlePreview[]; + pageInfo: PageInfo; +}; + +export type fetchPostsListReturn = ( + first?: number, + after?: string +) => Promise<PostsListResponse>; + +export type getPostsListReturn = ( + first?: number, + after?: string +) => Promise<PostsList>; + +export type BlogPageProps = { + data: PostsList; +}; |
