1 export enum UserOperation {
20 GetFollowedCommunities,
46 export enum CommentSortType {
53 export enum ListingType {
59 export enum SortType {
69 export enum SearchType {
78 export interface User {
84 default_sort_type: SortType;
85 default_listing_type: ListingType;
88 show_avatars: boolean;
91 export interface UserView {
96 matrix_user_id?: string;
99 number_of_posts: number;
101 number_of_comments: number;
102 comment_score: number;
104 show_avatars: boolean;
105 send_notifications_to_email: boolean;
108 export interface CommunityUser {
113 community_id: number;
114 community_name: string;
118 export interface Community {
122 description?: string;
130 creator_name: string;
131 creator_avatar?: string;
132 category_name: string;
133 number_of_subscribers: number;
134 number_of_posts: number;
135 number_of_comments: number;
137 subscribed?: boolean;
140 export interface Post {
146 community_id: number;
153 banned_from_community: boolean;
156 creator_name: string;
157 creator_avatar?: string;
158 community_name: string;
159 community_removed: boolean;
160 community_deleted: boolean;
161 community_nsfw: boolean;
162 number_of_comments: number;
169 subscribed?: boolean;
172 upvoteLoading?: boolean;
173 downvoteLoading?: boolean;
176 export interface Comment {
187 community_id: number;
189 banned_from_community: boolean;
190 creator_name: string;
191 creator_avatar?: string;
198 user_mention_id?: number; // For mention type
199 recipient_id?: number;
200 upvoteLoading?: boolean;
201 downvoteLoading?: boolean;
204 export interface Category {
209 export interface Site {
212 description?: string;
216 creator_name: string;
217 number_of_users: number;
218 number_of_posts: number;
219 number_of_comments: number;
220 number_of_communities: number;
221 enable_downvotes: boolean;
222 open_registration: boolean;
223 enable_nsfw: boolean;
226 export interface PrivateMessage {
229 recipient_id: number;
235 creator_name: string;
236 creator_avatar?: string;
237 recipient_name: string;
238 recipient_avatar?: string;
241 export enum BanType {
246 export interface FollowCommunityForm {
247 community_id: number;
252 export interface GetFollowedCommunitiesForm {
256 export interface GetFollowedCommunitiesResponse {
257 communities: Array<CommunityUser>;
260 export interface GetUserDetailsForm {
266 community_id?: number;
270 export interface UserDetailsResponse {
272 follows: Array<CommunityUser>;
273 moderates: Array<CommunityUser>;
274 comments: Array<Comment>;
276 admins: Array<UserView>;
279 export interface GetRepliesForm {
283 unread_only: boolean;
287 export interface GetRepliesResponse {
288 replies: Array<Comment>;
291 export interface GetUserMentionsForm {
295 unread_only: boolean;
299 export interface GetUserMentionsResponse {
300 mentions: Array<Comment>;
303 export interface EditUserMentionForm {
304 user_mention_id: number;
309 export interface UserMentionResponse {
313 export interface BanFromCommunityForm {
314 community_id: number;
322 export interface BanFromCommunityResponse {
327 export interface AddModToCommunityForm {
328 community_id: number;
334 export interface TransferCommunityForm {
335 community_id: number;
340 export interface TransferSiteForm {
345 export interface AddModToCommunityResponse {
346 moderators: Array<CommunityUser>;
349 export interface GetModlogForm {
350 mod_user_id?: number;
351 community_id?: number;
356 export interface GetModlogResponse {
357 removed_posts: Array<ModRemovePost>;
358 locked_posts: Array<ModLockPost>;
359 stickied_posts: Array<ModStickyPost>;
360 removed_comments: Array<ModRemoveComment>;
361 removed_communities: Array<ModRemoveCommunity>;
362 banned_from_community: Array<ModBanFromCommunity>;
363 banned: Array<ModBan>;
364 added_to_community: Array<ModAddCommunity>;
365 added: Array<ModAdd>;
368 export interface ModRemovePost {
375 mod_user_name: string;
377 community_id: number;
378 community_name: string;
381 export interface ModLockPost {
387 mod_user_name: string;
389 community_id: number;
390 community_name: string;
393 export interface ModStickyPost {
399 mod_user_name: string;
401 community_id: number;
402 community_name: string;
405 export interface ModRemoveComment {
412 mod_user_name: string;
413 comment_user_id: number;
414 comment_user_name: string;
415 comment_content: string;
418 community_id: number;
419 community_name: string;
422 export interface ModRemoveCommunity {
425 community_id: number;
430 mod_user_name: string;
431 community_name: string;
434 export interface ModBanFromCommunity {
437 other_user_id: number;
438 community_id: number;
443 mod_user_name: string;
444 other_user_name: string;
445 community_name: string;
448 export interface ModBan {
451 other_user_id: number;
456 mod_user_name: string;
457 other_user_name: string;
460 export interface ModAddCommunity {
463 other_user_id: number;
464 community_id: number;
467 mod_user_name: string;
468 other_user_name: string;
469 community_name: string;
472 export interface ModAdd {
475 other_user_id: number;
478 mod_user_name: string;
479 other_user_name: string;
482 export interface LoginForm {
483 username_or_email: string;
487 export interface RegisterForm {
491 password_verify: string;
496 export interface LoginResponse {
500 export interface UserSettingsForm {
503 default_sort_type: SortType;
504 default_listing_type: ListingType;
508 matrix_user_id?: string;
509 new_password?: string;
510 new_password_verify?: string;
511 old_password?: string;
512 show_avatars: boolean;
513 send_notifications_to_email: boolean;
517 export interface CommunityForm {
520 description?: string;
531 export interface GetCommunityForm {
537 export interface GetCommunityResponse {
538 community: Community;
539 moderators: Array<CommunityUser>;
540 admins: Array<UserView>;
543 export interface CommunityResponse {
544 community: Community;
547 export interface ListCommunitiesForm {
554 export interface ListCommunitiesResponse {
555 communities: Array<Community>;
558 export interface ListCategoriesResponse {
559 categories: Array<Category>;
562 export interface PostForm {
566 community_id: number;
579 export interface PostFormParams {
586 export interface GetPostForm {
591 export interface GetPostResponse {
593 comments: Array<Comment>;
594 community: Community;
595 moderators: Array<CommunityUser>;
596 admins: Array<UserView>;
599 export interface SavePostForm {
605 export interface PostResponse {
609 export interface CommentForm {
622 export interface SaveCommentForm {
628 export interface CommentResponse {
632 export interface CommentLikeForm {
639 export interface CommentNode {
641 children?: Array<CommentNode>;
644 export interface GetPostsForm {
649 community_id?: number;
653 export interface GetPostsResponse {
657 export interface CreatePostLikeForm {
663 export interface CreatePostLikeResponse {
667 export interface SiteForm {
669 description?: string;
670 enable_downvotes: boolean;
671 open_registration: boolean;
672 enable_nsfw: boolean;
676 export interface GetSiteResponse {
678 admins: Array<UserView>;
679 banned: Array<UserView>;
683 export interface SiteResponse {
687 export interface BanUserForm {
695 export interface BanUserResponse {
700 export interface AddAdminForm {
706 export interface AddAdminResponse {
707 admins: Array<UserView>;
710 export interface SearchForm {
713 community_id?: number;
720 export interface SearchResponse {
723 comments?: Array<Comment>;
724 communities: Array<Community>;
725 users: Array<UserView>;
728 export interface DeleteAccountForm {
732 export interface PasswordResetForm {
736 // export interface PasswordResetResponse {
739 export interface PasswordChangeForm {
742 password_verify: string;
745 export interface PrivateMessageForm {
747 recipient_id: number;
751 export interface PrivateMessageFormParams {
752 recipient_id: number;
755 export interface EditPrivateMessageForm {
763 export interface GetPrivateMessagesForm {
764 unread_only: boolean;
770 export interface PrivateMessagesResponse {
771 messages: Array<PrivateMessage>;
774 export interface PrivateMessageResponse {
775 message: PrivateMessage;
778 export type MessageType =
779 | EditPrivateMessageForm
783 | FollowCommunityForm
784 | ListCommunitiesForm
785 | GetFollowedCommunitiesForm
794 | BanFromCommunityForm
796 | AddModToCommunityForm
797 | TransferCommunityForm
804 | GetUserMentionsForm
805 | EditUserMentionForm
814 | EditPrivateMessageForm
815 | GetPrivateMessagesForm;
819 | GetFollowedCommunitiesResponse
820 | ListCommunitiesResponse
822 | CreatePostLikeResponse
824 | GetUserMentionsResponse
825 | ListCategoriesResponse
828 | UserMentionResponse
832 | BanFromCommunityResponse
833 | AddModToCommunityResponse
836 | PrivateMessageResponse
837 | PrivateMessagesResponse;
839 export interface WebSocketResponse {
844 export interface WebSocketJsonResponse {