1 export enum UserOperation {
20 GetFollowedCommunities,
47 export enum CommentSortType {
54 export enum ListingType {
60 export enum SortType {
70 export enum SearchType {
79 export interface User {
85 default_sort_type: SortType;
86 default_listing_type: ListingType;
89 show_avatars: boolean;
92 export interface UserView {
97 matrix_user_id?: string;
100 number_of_posts: number;
102 number_of_comments: number;
103 comment_score: number;
105 show_avatars: boolean;
106 send_notifications_to_email: boolean;
109 export interface CommunityUser {
114 community_id: number;
115 community_name: string;
119 export interface Community {
123 description?: string;
131 creator_name: string;
132 creator_avatar?: string;
133 category_name: string;
134 number_of_subscribers: number;
135 number_of_posts: number;
136 number_of_comments: number;
138 subscribed?: boolean;
141 export interface Post {
147 community_id: number;
154 banned_from_community: boolean;
157 creator_name: string;
158 creator_avatar?: string;
159 community_name: string;
160 community_removed: boolean;
161 community_deleted: boolean;
162 community_nsfw: boolean;
163 number_of_comments: number;
170 subscribed?: boolean;
173 upvoteLoading?: boolean;
174 downvoteLoading?: boolean;
177 export interface Comment {
188 community_id: number;
190 banned_from_community: boolean;
191 creator_name: string;
192 creator_avatar?: string;
199 user_mention_id?: number; // For mention type
200 recipient_id?: number;
201 upvoteLoading?: boolean;
202 downvoteLoading?: boolean;
205 export interface Category {
210 export interface Site {
213 description?: string;
217 creator_name: string;
218 number_of_users: number;
219 number_of_posts: number;
220 number_of_comments: number;
221 number_of_communities: number;
222 enable_downvotes: boolean;
223 open_registration: boolean;
224 enable_nsfw: boolean;
227 export interface PrivateMessage {
230 recipient_id: number;
236 creator_name: string;
237 creator_avatar?: string;
238 recipient_name: string;
239 recipient_avatar?: string;
242 export enum BanType {
247 export interface FollowCommunityForm {
248 community_id: number;
253 export interface GetFollowedCommunitiesForm {
257 export interface GetFollowedCommunitiesResponse {
258 communities: Array<CommunityUser>;
261 export interface GetUserDetailsForm {
267 community_id?: number;
271 export interface UserDetailsResponse {
273 follows: Array<CommunityUser>;
274 moderates: Array<CommunityUser>;
275 comments: Array<Comment>;
277 admins: Array<UserView>;
280 export interface GetRepliesForm {
284 unread_only: boolean;
288 export interface GetRepliesResponse {
289 replies: Array<Comment>;
292 export interface GetUserMentionsForm {
296 unread_only: boolean;
300 export interface GetUserMentionsResponse {
301 mentions: Array<Comment>;
304 export interface EditUserMentionForm {
305 user_mention_id: number;
310 export interface UserMentionResponse {
314 export interface BanFromCommunityForm {
315 community_id: number;
323 export interface BanFromCommunityResponse {
328 export interface AddModToCommunityForm {
329 community_id: number;
335 export interface TransferCommunityForm {
336 community_id: number;
341 export interface TransferSiteForm {
346 export interface AddModToCommunityResponse {
347 moderators: Array<CommunityUser>;
350 export interface GetModlogForm {
351 mod_user_id?: number;
352 community_id?: number;
357 export interface GetModlogResponse {
358 removed_posts: Array<ModRemovePost>;
359 locked_posts: Array<ModLockPost>;
360 stickied_posts: Array<ModStickyPost>;
361 removed_comments: Array<ModRemoveComment>;
362 removed_communities: Array<ModRemoveCommunity>;
363 banned_from_community: Array<ModBanFromCommunity>;
364 banned: Array<ModBan>;
365 added_to_community: Array<ModAddCommunity>;
366 added: Array<ModAdd>;
369 export interface ModRemovePost {
376 mod_user_name: string;
378 community_id: number;
379 community_name: string;
382 export interface ModLockPost {
388 mod_user_name: string;
390 community_id: number;
391 community_name: string;
394 export interface ModStickyPost {
400 mod_user_name: string;
402 community_id: number;
403 community_name: string;
406 export interface ModRemoveComment {
413 mod_user_name: string;
414 comment_user_id: number;
415 comment_user_name: string;
416 comment_content: string;
419 community_id: number;
420 community_name: string;
423 export interface ModRemoveCommunity {
426 community_id: number;
431 mod_user_name: string;
432 community_name: string;
435 export interface ModBanFromCommunity {
438 other_user_id: number;
439 community_id: number;
444 mod_user_name: string;
445 other_user_name: string;
446 community_name: string;
449 export interface ModBan {
452 other_user_id: number;
457 mod_user_name: string;
458 other_user_name: string;
461 export interface ModAddCommunity {
464 other_user_id: number;
465 community_id: number;
468 mod_user_name: string;
469 other_user_name: string;
470 community_name: string;
473 export interface ModAdd {
476 other_user_id: number;
479 mod_user_name: string;
480 other_user_name: string;
483 export interface LoginForm {
484 username_or_email: string;
488 export interface RegisterForm {
492 password_verify: string;
497 export interface LoginResponse {
501 export interface UserSettingsForm {
504 default_sort_type: SortType;
505 default_listing_type: ListingType;
509 matrix_user_id?: string;
510 new_password?: string;
511 new_password_verify?: string;
512 old_password?: string;
513 show_avatars: boolean;
514 send_notifications_to_email: boolean;
518 export interface CommunityForm {
521 description?: string;
532 export interface GetCommunityForm {
538 export interface GetCommunityResponse {
539 community: Community;
540 moderators: Array<CommunityUser>;
541 admins: Array<UserView>;
544 export interface CommunityResponse {
545 community: Community;
548 export interface ListCommunitiesForm {
555 export interface ListCommunitiesResponse {
556 communities: Array<Community>;
559 export interface ListCategoriesResponse {
560 categories: Array<Category>;
563 export interface PostForm {
567 community_id: number;
580 export interface PostFormParams {
587 export interface GetPostForm {
592 export interface GetPostResponse {
594 comments: Array<Comment>;
595 community: Community;
596 moderators: Array<CommunityUser>;
597 admins: Array<UserView>;
600 export interface SavePostForm {
606 export interface PostResponse {
610 export interface CommentForm {
623 export interface SaveCommentForm {
629 export interface CommentResponse {
633 export interface CommentLikeForm {
640 export interface CommentNode {
642 children?: Array<CommentNode>;
645 export interface GetPostsForm {
650 community_id?: number;
654 export interface GetPostsResponse {
658 export interface CreatePostLikeForm {
664 export interface CreatePostLikeResponse {
668 export interface SiteForm {
670 description?: string;
671 enable_downvotes: boolean;
672 open_registration: boolean;
673 enable_nsfw: boolean;
677 export interface GetSiteResponse {
679 admins: Array<UserView>;
680 banned: Array<UserView>;
684 export interface SiteResponse {
688 export interface BanUserForm {
696 export interface BanUserResponse {
701 export interface AddAdminForm {
707 export interface AddAdminResponse {
708 admins: Array<UserView>;
711 export interface SearchForm {
714 community_id?: number;
721 export interface SearchResponse {
724 comments?: Array<Comment>;
725 communities: Array<Community>;
726 users: Array<UserView>;
729 export interface DeleteAccountForm {
733 export interface PasswordResetForm {
737 // export interface PasswordResetResponse {
740 export interface PasswordChangeForm {
743 password_verify: string;
746 export interface PrivateMessageForm {
748 recipient_id: number;
752 export interface PrivateMessageFormParams {
753 recipient_id: number;
756 export interface EditPrivateMessageForm {
764 export interface GetPrivateMessagesForm {
765 unread_only: boolean;
771 export interface PrivateMessagesResponse {
772 messages: Array<PrivateMessage>;
775 export interface PrivateMessageResponse {
776 message: PrivateMessage;
779 export type MessageType =
780 | EditPrivateMessageForm
784 | FollowCommunityForm
785 | ListCommunitiesForm
786 | GetFollowedCommunitiesForm
795 | BanFromCommunityForm
797 | AddModToCommunityForm
798 | TransferCommunityForm
805 | GetUserMentionsForm
806 | EditUserMentionForm
815 | EditPrivateMessageForm
816 | GetPrivateMessagesForm;
820 | GetFollowedCommunitiesResponse
821 | ListCommunitiesResponse
823 | CreatePostLikeResponse
825 | GetUserMentionsResponse
826 | ListCategoriesResponse
829 | UserMentionResponse
833 | BanFromCommunityResponse
834 | AddModToCommunityResponse
837 | PrivateMessageResponse
838 | PrivateMessagesResponse;
840 export interface WebSocketResponse {
845 export interface WebSocketJsonResponse {