diff options
author | Dessalines <tyhou13@gmx.com> | 2019-04-07 22:19:02 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-04-07 22:19:02 -0700 |
commit | 49bf16e7d451388d894f93a994f3bf18571f9594 (patch) | |
tree | 1802bf775a0dd97503670c38ceb13d9aa78d95b6 /ui/src/interfaces.ts | |
parent | a61516439406b7884e19d9ae8a1875c728bbe628 (diff) |
Adding user details / overview page.
- Fixes #19
Diffstat (limited to 'ui/src/interfaces.ts')
-rw-r--r-- | ui/src/interfaces.ts | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/ui/src/interfaces.ts b/ui/src/interfaces.ts index 6d314c62..66088647 100644 --- a/ui/src/interfaces.ts +++ b/ui/src/interfaces.ts @@ -1,5 +1,5 @@ export enum UserOperation { - Login, Register, CreateCommunity, CreatePost, ListCommunities, ListCategories, GetPost, GetCommunity, CreateComment, EditComment, CreateCommentLike, GetPosts, CreatePostLike, EditPost, EditCommunity, FollowCommunity, GetFollowedCommunities + Login, Register, CreateCommunity, CreatePost, ListCommunities, ListCategories, GetPost, GetCommunity, CreateComment, EditComment, CreateCommentLike, GetPosts, CreatePostLike, EditPost, EditCommunity, FollowCommunity, GetFollowedCommunities, GetUserDetails } export interface User { @@ -8,6 +8,17 @@ export interface User { username: string; } +export interface UserView { + id: number; + name: string; + fedi_name: string; + published: string; + number_of_posts: number; + post_score: number; + number_of_comments: number; + comment_score: number; +} + export interface CommunityUser { id: number; user_id: number; @@ -144,6 +155,11 @@ export interface CommentLikeForm { auth?: string; } +export interface CommentNode { + comment: Comment; + children?: Array<CommentNode>; +} + export interface GetPostsForm { type_: string; sort: string; @@ -184,6 +200,27 @@ export interface GetFollowedCommunitiesResponse { communities: Array<CommunityUser>; } +export interface GetUserDetailsForm { + user_id: number; + sort: string; // TODO figure this one out + limit: number; + community_id?: number; + auth?: string; +} + + + +export interface UserDetailsResponse { + op: string; + user: UserView; + follows: Array<CommunityUser>; + moderates: Array<CommunityUser>; + comments: Array<Comment>; + posts: Array<Post>; + saved?: Array<Post>; +} + + export interface LoginForm { username_or_email: string; password: string; @@ -210,7 +247,7 @@ export enum ListingType { All, Subscribed, Community } -export enum ListingSortType { +export enum SortType { Hot, New, TopDay, TopWeek, TopMonth, TopYear, TopAll } |