diff options
author | Dessalines <tyhou13@gmx.com> | 2020-01-27 21:04:30 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-01-27 21:04:30 -0500 |
commit | 2e84441e6635b42065ef646238a6c95aea207548 (patch) | |
tree | 53b7db65bb5567e13d9c24a6364cde49224af6a4 /ui/src/interfaces.ts | |
parent | 8cfd5f9266a0a93dc47ec2ab6060ee0435276aba (diff) |
Strictly typing websocket forms.
Diffstat (limited to 'ui/src/interfaces.ts')
-rw-r--r-- | ui/src/interfaces.ts | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/ui/src/interfaces.ts b/ui/src/interfaces.ts index cd3961b5..b0594e8d 100644 --- a/ui/src/interfaces.ts +++ b/ui/src/interfaces.ts @@ -248,6 +248,10 @@ export interface FollowCommunityForm { auth?: string; } +export interface GetFollowedCommunitiesForm { + auth: string; +} + export interface GetFollowedCommunitiesResponse { communities: Array<CommunityUser>; } @@ -523,6 +527,12 @@ export interface CommunityForm { auth?: string; } +export interface GetCommunityForm { + id?: number; + name?: string; + auth?: string; +} + export interface GetCommunityResponse { community: Community; moderators: Array<CommunityUser>; @@ -572,6 +582,11 @@ export interface PostFormParams { community?: string; } +export interface GetPostForm { + id: number; + auth?: string; +} + export interface GetPostResponse { post: Post; comments: Array<Comment>; @@ -759,6 +774,45 @@ export interface PrivateMessageResponse { message: PrivateMessage; } +export type MessageType = + | EditPrivateMessageForm + | LoginForm + | RegisterForm + | CommunityForm + | FollowCommunityForm + | ListCommunitiesForm + | GetFollowedCommunitiesForm + | PostForm + | GetPostForm + | GetPostsForm + | GetCommunityForm + | CommentForm + | CommentLikeForm + | SaveCommentForm + | CreatePostLikeForm + | BanFromCommunityForm + | AddAdminForm + | AddModToCommunityForm + | TransferCommunityForm + | TransferSiteForm + | SaveCommentForm + | BanUserForm + | AddAdminForm + | GetUserDetailsForm + | GetRepliesForm + | GetUserMentionsForm + | EditUserMentionForm + | GetModlogForm + | SiteForm + | SearchForm + | UserSettingsForm + | DeleteAccountForm + | PasswordResetForm + | PasswordChangeForm + | PrivateMessageForm + | EditPrivateMessageForm + | GetPrivateMessagesForm; + type ResponseType = | SiteResponse | GetFollowedCommunitiesResponse |