1 export enum UserOperation {
20 GetFollowedCommunities,
46 export enum CommentSortType {
52 export enum ListingType {
58 export enum SortType {
68 export enum SearchType {
77 export interface User {
83 default_sort_type: SortType;
84 default_listing_type: ListingType;
87 show_avatars: boolean;
90 export interface UserView {
95 matrix_user_id?: string;
98 number_of_posts: number;
100 number_of_comments: number;
101 comment_score: number;
103 show_avatars: boolean;
104 send_notifications_to_email: boolean;
107 export interface CommunityUser {
112 community_id: number;
113 community_name: string;
117 export interface Community {
121 description?: string;
129 creator_name: string;
130 creator_avatar?: string;
131 category_name: string;
132 number_of_subscribers: number;
133 number_of_posts: number;
134 number_of_comments: number;
136 subscribed?: boolean;
139 export interface Post {
145 community_id: number;
152 banned_from_community: boolean;
155 creator_name: string;
156 creator_avatar?: string;
157 community_name: string;
158 community_removed: boolean;
159 community_deleted: boolean;
160 community_nsfw: boolean;
161 number_of_comments: number;
168 subscribed?: boolean;
171 upvoteLoading?: boolean;
172 downvoteLoading?: boolean;
175 export interface Comment {
186 community_id: number;
188 banned_from_community: boolean;
189 creator_name: string;
190 creator_avatar?: string;
197 user_mention_id?: number; // For mention type
198 recipient_id?: number;
199 upvoteLoading?: boolean;
200 downvoteLoading?: boolean;
203 export interface Category {
208 export interface Site {
211 description?: string;
215 creator_name: string;
216 number_of_users: number;
217 number_of_posts: number;
218 number_of_comments: number;
219 number_of_communities: number;
220 enable_downvotes: boolean;
221 open_registration: boolean;
222 enable_nsfw: boolean;
225 export interface PrivateMessage {
228 recipient_id: number;
234 creator_name: string;
235 creator_avatar?: string;
236 recipient_name: string;
237 recipient_avatar?: string;
240 export enum BanType {
245 export interface FollowCommunityForm {
246 community_id: number;
251 export interface GetFollowedCommunitiesForm {
255 export interface GetFollowedCommunitiesResponse {
256 communities: Array<CommunityUser>;
259 export interface GetUserDetailsForm {
265 community_id?: number;
269 export interface UserDetailsResponse {
271 follows: Array<CommunityUser>;
272 moderates: Array<CommunityUser>;
273 comments: Array<Comment>;
275 admins: Array<UserView>;
278 export interface GetRepliesForm {
282 unread_only: boolean;
286 export interface GetRepliesResponse {
287 replies: Array<Comment>;
290 export interface GetUserMentionsForm {
294 unread_only: boolean;
298 export interface GetUserMentionsResponse {
299 mentions: Array<Comment>;
302 export interface EditUserMentionForm {
303 user_mention_id: number;
308 export interface UserMentionResponse {
312 export interface BanFromCommunityForm {
313 community_id: number;
321 export interface BanFromCommunityResponse {
326 export interface AddModToCommunityForm {
327 community_id: number;
333 export interface TransferCommunityForm {
334 community_id: number;
339 export interface TransferSiteForm {
344 export interface AddModToCommunityResponse {
345 moderators: Array<CommunityUser>;
348 export interface GetModlogForm {
349 mod_user_id?: number;
350 community_id?: number;
355 export interface GetModlogResponse {
356 removed_posts: Array<ModRemovePost>;
357 locked_posts: Array<ModLockPost>;
358 stickied_posts: Array<ModStickyPost>;
359 removed_comments: Array<ModRemoveComment>;
360 removed_communities: Array<ModRemoveCommunity>;
361 banned_from_community: Array<ModBanFromCommunity>;
362 banned: Array<ModBan>;
363 added_to_community: Array<ModAddCommunity>;
364 added: Array<ModAdd>;
367 export interface ModRemovePost {
374 mod_user_name: string;
376 community_id: number;
377 community_name: string;
380 export interface ModLockPost {
386 mod_user_name: string;
388 community_id: number;
389 community_name: string;
392 export interface ModStickyPost {
398 mod_user_name: string;
400 community_id: number;
401 community_name: string;
404 export interface ModRemoveComment {
411 mod_user_name: string;
412 comment_user_id: number;
413 comment_user_name: string;
414 comment_content: string;
417 community_id: number;
418 community_name: string;
421 export interface ModRemoveCommunity {
424 community_id: number;
429 mod_user_name: string;
430 community_name: string;
433 export interface ModBanFromCommunity {
436 other_user_id: number;
437 community_id: number;
442 mod_user_name: string;
443 other_user_name: string;
444 community_name: string;
447 export interface ModBan {
450 other_user_id: number;
455 mod_user_name: string;
456 other_user_name: string;
459 export interface ModAddCommunity {
462 other_user_id: number;
463 community_id: number;
466 mod_user_name: string;
467 other_user_name: string;
468 community_name: string;
471 export interface ModAdd {
474 other_user_id: number;
477 mod_user_name: string;
478 other_user_name: string;
481 export interface LoginForm {
482 username_or_email: string;
486 export interface RegisterForm {
490 password_verify: string;
495 export interface LoginResponse {
499 export interface UserSettingsForm {
502 default_sort_type: SortType;
503 default_listing_type: ListingType;
507 matrix_user_id?: string;
508 new_password?: string;
509 new_password_verify?: string;
510 old_password?: string;
511 show_avatars: boolean;
512 send_notifications_to_email: boolean;
516 export interface CommunityForm {
519 description?: string;
530 export interface GetCommunityForm {
536 export interface GetCommunityResponse {
537 community: Community;
538 moderators: Array<CommunityUser>;
539 admins: Array<UserView>;
542 export interface CommunityResponse {
543 community: Community;
546 export interface ListCommunitiesForm {
553 export interface ListCommunitiesResponse {
554 communities: Array<Community>;
557 export interface ListCategoriesResponse {
558 categories: Array<Category>;
561 export interface PostForm {
565 community_id: number;
578 export interface PostFormParams {
585 export interface GetPostForm {
590 export interface GetPostResponse {
592 comments: Array<Comment>;
593 community: Community;
594 moderators: Array<CommunityUser>;
595 admins: Array<UserView>;
598 export interface SavePostForm {
604 export interface PostResponse {
608 export interface CommentForm {
621 export interface SaveCommentForm {
627 export interface CommentResponse {
631 export interface CommentLikeForm {
638 export interface CommentNode {
640 children?: Array<CommentNode>;
643 export interface GetPostsForm {
648 community_id?: number;
652 export interface GetPostsResponse {
656 export interface CreatePostLikeForm {
662 export interface CreatePostLikeResponse {
666 export interface SiteForm {
668 description?: string;
669 enable_downvotes: boolean;
670 open_registration: boolean;
671 enable_nsfw: boolean;
675 export interface GetSiteResponse {
677 admins: Array<UserView>;
678 banned: Array<UserView>;
682 export interface SiteResponse {
686 export interface BanUserForm {
694 export interface BanUserResponse {
699 export interface AddAdminForm {
705 export interface AddAdminResponse {
706 admins: Array<UserView>;
709 export interface SearchForm {
712 community_id?: number;
719 export interface SearchResponse {
722 comments?: Array<Comment>;
723 communities: Array<Community>;
724 users: Array<UserView>;
727 export interface DeleteAccountForm {
731 export interface PasswordResetForm {
735 // export interface PasswordResetResponse {
738 export interface PasswordChangeForm {
741 password_verify: string;
744 export interface PrivateMessageForm {
746 recipient_id: number;
750 export interface PrivateMessageFormParams {
751 recipient_id: number;
754 export interface EditPrivateMessageForm {
762 export interface GetPrivateMessagesForm {
763 unread_only: boolean;
769 export interface PrivateMessagesResponse {
770 messages: Array<PrivateMessage>;
773 export interface PrivateMessageResponse {
774 message: PrivateMessage;
777 export type MessageType =
778 | EditPrivateMessageForm
782 | FollowCommunityForm
783 | ListCommunitiesForm
784 | GetFollowedCommunitiesForm
793 | BanFromCommunityForm
795 | AddModToCommunityForm
796 | TransferCommunityForm
803 | GetUserMentionsForm
804 | EditUserMentionForm
813 | EditPrivateMessageForm
814 | GetPrivateMessagesForm;
818 | GetFollowedCommunitiesResponse
819 | ListCommunitiesResponse
821 | CreatePostLikeResponse
823 | GetUserMentionsResponse
824 | ListCategoriesResponse
827 | UserMentionResponse
831 | BanFromCommunityResponse
832 | AddModToCommunityResponse
835 | PrivateMessageResponse
836 | PrivateMessagesResponse;
838 export interface WebSocketResponse {
843 export interface WebSocketJsonResponse {