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 GetFollowedCommunitiesResponse {
252 communities: Array<CommunityUser>;
255 export interface GetUserDetailsForm {
261 community_id?: number;
265 export interface UserDetailsResponse {
267 follows: Array<CommunityUser>;
268 moderates: Array<CommunityUser>;
269 comments: Array<Comment>;
271 admins: Array<UserView>;
274 export interface GetRepliesForm {
278 unread_only: boolean;
282 export interface GetRepliesResponse {
283 replies: Array<Comment>;
286 export interface GetUserMentionsForm {
290 unread_only: boolean;
294 export interface GetUserMentionsResponse {
295 mentions: Array<Comment>;
298 export interface EditUserMentionForm {
299 user_mention_id: number;
304 export interface UserMentionResponse {
308 export interface BanFromCommunityForm {
309 community_id: number;
317 export interface BanFromCommunityResponse {
322 export interface AddModToCommunityForm {
323 community_id: number;
329 export interface TransferCommunityForm {
330 community_id: number;
335 export interface TransferSiteForm {
340 export interface AddModToCommunityResponse {
341 moderators: Array<CommunityUser>;
344 export interface GetModlogForm {
345 mod_user_id?: number;
346 community_id?: number;
351 export interface GetModlogResponse {
352 removed_posts: Array<ModRemovePost>;
353 locked_posts: Array<ModLockPost>;
354 stickied_posts: Array<ModStickyPost>;
355 removed_comments: Array<ModRemoveComment>;
356 removed_communities: Array<ModRemoveCommunity>;
357 banned_from_community: Array<ModBanFromCommunity>;
358 banned: Array<ModBan>;
359 added_to_community: Array<ModAddCommunity>;
360 added: Array<ModAdd>;
363 export interface ModRemovePost {
370 mod_user_name: string;
372 community_id: number;
373 community_name: string;
376 export interface ModLockPost {
382 mod_user_name: string;
384 community_id: number;
385 community_name: string;
388 export interface ModStickyPost {
394 mod_user_name: string;
396 community_id: number;
397 community_name: string;
400 export interface ModRemoveComment {
407 mod_user_name: string;
408 comment_user_id: number;
409 comment_user_name: string;
410 comment_content: string;
413 community_id: number;
414 community_name: string;
417 export interface ModRemoveCommunity {
420 community_id: number;
425 mod_user_name: string;
426 community_name: string;
429 export interface ModBanFromCommunity {
432 other_user_id: number;
433 community_id: number;
438 mod_user_name: string;
439 other_user_name: string;
440 community_name: string;
443 export interface ModBan {
446 other_user_id: number;
451 mod_user_name: string;
452 other_user_name: string;
455 export interface ModAddCommunity {
458 other_user_id: number;
459 community_id: number;
462 mod_user_name: string;
463 other_user_name: string;
464 community_name: string;
467 export interface ModAdd {
470 other_user_id: number;
473 mod_user_name: string;
474 other_user_name: string;
477 export interface LoginForm {
478 username_or_email: string;
482 export interface RegisterForm {
486 password_verify: string;
491 export interface LoginResponse {
495 export interface UserSettingsForm {
498 default_sort_type: SortType;
499 default_listing_type: ListingType;
503 matrix_user_id?: string;
504 new_password?: string;
505 new_password_verify?: string;
506 old_password?: string;
507 show_avatars: boolean;
508 send_notifications_to_email: boolean;
512 export interface CommunityForm {
515 description?: string;
526 export interface GetCommunityResponse {
527 community: Community;
528 moderators: Array<CommunityUser>;
529 admins: Array<UserView>;
532 export interface CommunityResponse {
533 community: Community;
536 export interface ListCommunitiesForm {
543 export interface ListCommunitiesResponse {
544 communities: Array<Community>;
547 export interface ListCategoriesResponse {
548 categories: Array<Category>;
551 export interface PostForm {
555 community_id: number;
568 export interface PostFormParams {
575 export interface GetPostResponse {
577 comments: Array<Comment>;
578 community: Community;
579 moderators: Array<CommunityUser>;
580 admins: Array<UserView>;
583 export interface SavePostForm {
589 export interface PostResponse {
593 export interface CommentForm {
606 export interface SaveCommentForm {
612 export interface CommentResponse {
616 export interface CommentLikeForm {
623 export interface CommentNode {
625 children?: Array<CommentNode>;
628 export interface GetPostsForm {
633 community_id?: number;
637 export interface GetPostsResponse {
641 export interface CreatePostLikeForm {
647 export interface CreatePostLikeResponse {
651 export interface SiteForm {
653 description?: string;
654 enable_downvotes: boolean;
655 open_registration: boolean;
656 enable_nsfw: boolean;
660 export interface GetSiteResponse {
662 admins: Array<UserView>;
663 banned: Array<UserView>;
667 export interface SiteResponse {
671 export interface BanUserForm {
679 export interface BanUserResponse {
684 export interface AddAdminForm {
690 export interface AddAdminResponse {
691 admins: Array<UserView>;
694 export interface SearchForm {
697 community_id?: number;
704 export interface SearchResponse {
707 comments?: Array<Comment>;
708 communities: Array<Community>;
709 users: Array<UserView>;
712 export interface DeleteAccountForm {
716 export interface PasswordResetForm {
720 // export interface PasswordResetResponse {
723 export interface PasswordChangeForm {
726 password_verify: string;
729 export interface PrivateMessageForm {
731 recipient_id: number;
735 export interface PrivateMessageFormParams {
736 recipient_id: number;
739 export interface EditPrivateMessageForm {
747 export interface GetPrivateMessagesForm {
748 unread_only: boolean;
754 export interface PrivateMessagesResponse {
755 messages: Array<PrivateMessage>;
758 export interface PrivateMessageResponse {
759 message: PrivateMessage;
764 | GetFollowedCommunitiesResponse
765 | ListCommunitiesResponse
767 | CreatePostLikeResponse
769 | GetUserMentionsResponse
770 | ListCategoriesResponse
773 | UserMentionResponse
777 | BanFromCommunityResponse
778 | AddModToCommunityResponse
781 | PrivateMessageResponse
782 | PrivateMessagesResponse;
784 export interface WebSocketResponse {
790 export interface WebSocketJsonResponse {