1 export enum UserOperation {
20 GetFollowedCommunities,
47 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 GetFollowedCommunitiesResponse {
253 communities: Array<CommunityUser>;
256 export interface GetUserDetailsForm {
262 community_id?: number;
266 export interface UserDetailsResponse {
268 follows: Array<CommunityUser>;
269 moderates: Array<CommunityUser>;
270 comments: Array<Comment>;
272 admins: Array<UserView>;
275 export interface GetRepliesForm {
279 unread_only: boolean;
283 export interface GetRepliesResponse {
284 replies: Array<Comment>;
287 export interface GetUserMentionsForm {
291 unread_only: boolean;
295 export interface GetUserMentionsResponse {
296 mentions: Array<Comment>;
299 export interface EditUserMentionForm {
300 user_mention_id: number;
305 export interface UserMentionResponse {
309 export interface BanFromCommunityForm {
310 community_id: number;
318 export interface BanFromCommunityResponse {
323 export interface AddModToCommunityForm {
324 community_id: number;
330 export interface TransferCommunityForm {
331 community_id: number;
336 export interface TransferSiteForm {
341 export interface AddModToCommunityResponse {
342 moderators: Array<CommunityUser>;
345 export interface GetModlogForm {
346 mod_user_id?: number;
347 community_id?: number;
352 export interface GetModlogResponse {
353 removed_posts: Array<ModRemovePost>;
354 locked_posts: Array<ModLockPost>;
355 stickied_posts: Array<ModStickyPost>;
356 removed_comments: Array<ModRemoveComment>;
357 removed_communities: Array<ModRemoveCommunity>;
358 banned_from_community: Array<ModBanFromCommunity>;
359 banned: Array<ModBan>;
360 added_to_community: Array<ModAddCommunity>;
361 added: Array<ModAdd>;
364 export interface ModRemovePost {
371 mod_user_name: string;
373 community_id: number;
374 community_name: string;
377 export interface ModLockPost {
383 mod_user_name: string;
385 community_id: number;
386 community_name: string;
389 export interface ModStickyPost {
395 mod_user_name: string;
397 community_id: number;
398 community_name: string;
401 export interface ModRemoveComment {
408 mod_user_name: string;
409 comment_user_id: number;
410 comment_user_name: string;
411 comment_content: string;
414 community_id: number;
415 community_name: string;
418 export interface ModRemoveCommunity {
421 community_id: number;
426 mod_user_name: string;
427 community_name: string;
430 export interface ModBanFromCommunity {
433 other_user_id: number;
434 community_id: number;
439 mod_user_name: string;
440 other_user_name: string;
441 community_name: string;
444 export interface ModBan {
447 other_user_id: number;
452 mod_user_name: string;
453 other_user_name: string;
456 export interface ModAddCommunity {
459 other_user_id: number;
460 community_id: number;
463 mod_user_name: string;
464 other_user_name: string;
465 community_name: string;
468 export interface ModAdd {
471 other_user_id: number;
474 mod_user_name: string;
475 other_user_name: string;
478 export interface LoginForm {
479 username_or_email: string;
483 export interface RegisterForm {
487 password_verify: string;
492 export interface LoginResponse {
496 export interface UserSettingsForm {
499 default_sort_type: SortType;
500 default_listing_type: ListingType;
504 matrix_user_id?: string;
505 new_password?: string;
506 new_password_verify?: string;
507 old_password?: string;
508 show_avatars: boolean;
509 send_notifications_to_email: boolean;
513 export interface CommunityForm {
516 description?: string;
527 export interface GetCommunityResponse {
528 community: Community;
529 moderators: Array<CommunityUser>;
530 admins: Array<UserView>;
533 export interface CommunityResponse {
534 community: Community;
537 export interface ListCommunitiesForm {
544 export interface ListCommunitiesResponse {
545 communities: Array<Community>;
548 export interface ListCategoriesResponse {
549 categories: Array<Category>;
552 export interface PostForm {
556 community_id: number;
569 export interface PostFormParams {
576 export interface GetPostResponse {
578 comments: Array<Comment>;
579 community: Community;
580 moderators: Array<CommunityUser>;
581 admins: Array<UserView>;
584 export interface SavePostForm {
590 export interface PostResponse {
594 export interface CommentForm {
607 export interface SaveCommentForm {
613 export interface CommentResponse {
617 export interface CommentLikeForm {
624 export interface CommentNode {
626 children?: Array<CommentNode>;
629 export interface GetPostsForm {
634 community_id?: number;
638 export interface GetPostsResponse {
642 export interface CreatePostLikeForm {
648 export interface CreatePostLikeResponse {
652 export interface SiteForm {
654 description?: string;
655 enable_downvotes: boolean;
656 open_registration: boolean;
657 enable_nsfw: boolean;
661 export interface GetSiteResponse {
663 admins: Array<UserView>;
664 banned: Array<UserView>;
668 export interface SiteResponse {
672 export interface BanUserForm {
680 export interface BanUserResponse {
685 export interface AddAdminForm {
691 export interface AddAdminResponse {
692 admins: Array<UserView>;
695 export interface SearchForm {
698 community_id?: number;
705 export interface SearchResponse {
708 comments?: Array<Comment>;
709 communities: Array<Community>;
710 users: Array<UserView>;
713 export interface DeleteAccountForm {
717 export interface PasswordResetForm {
721 // export interface PasswordResetResponse {
724 export interface PasswordChangeForm {
727 password_verify: string;
730 export interface PrivateMessageForm {
732 recipient_id: number;
736 export interface PrivateMessageFormParams {
737 recipient_id: number;
740 export interface EditPrivateMessageForm {
748 export interface GetPrivateMessagesForm {
749 unread_only: boolean;
755 export interface PrivateMessagesResponse {
756 messages: Array<PrivateMessage>;
759 export interface PrivateMessageResponse {
760 message: PrivateMessage;
765 | GetFollowedCommunitiesResponse
766 | ListCommunitiesResponse
768 | CreatePostLikeResponse
770 | GetUserMentionsResponse
771 | ListCategoriesResponse
774 | UserMentionResponse
778 | BanFromCommunityResponse
779 | AddModToCommunityResponse
782 | PrivateMessageResponse
783 | PrivateMessagesResponse;
785 export interface WebSocketResponse {
790 export interface WebSocketJsonResponse {