1 export enum UserOperation {
20 GetFollowedCommunities,
48 export enum CommentSortType {
55 export enum ListingType {
61 export enum DataType {
66 export enum SortType {
76 export enum SearchType {
85 export interface User {
91 default_sort_type: SortType;
92 default_listing_type: ListingType;
95 show_avatars: boolean;
98 export interface UserView {
103 matrix_user_id?: string;
106 number_of_posts: number;
108 number_of_comments: number;
109 comment_score: number;
111 show_avatars: boolean;
112 send_notifications_to_email: boolean;
115 export interface CommunityUser {
120 community_id: number;
121 community_name: string;
125 export interface Community {
129 description?: string;
137 creator_name: string;
138 creator_avatar?: string;
139 category_name: string;
140 number_of_subscribers: number;
141 number_of_posts: number;
142 number_of_comments: number;
144 subscribed?: boolean;
147 export interface Post {
153 community_id: number;
160 banned_from_community: boolean;
163 creator_name: string;
164 creator_avatar?: string;
165 community_name: string;
166 community_removed: boolean;
167 community_deleted: boolean;
168 community_nsfw: boolean;
169 number_of_comments: number;
176 subscribed?: boolean;
179 upvoteLoading?: boolean;
180 downvoteLoading?: boolean;
181 duplicates?: Array<Post>;
184 export interface Comment {
195 community_id: number;
196 community_name: string;
198 banned_from_community: boolean;
199 creator_name: string;
200 creator_avatar?: string;
209 user_mention_id?: number; // For mention type
210 recipient_id?: number;
211 upvoteLoading?: boolean;
212 downvoteLoading?: boolean;
215 export interface Category {
220 export interface Site {
223 description?: string;
227 creator_name: string;
228 number_of_users: number;
229 number_of_posts: number;
230 number_of_comments: number;
231 number_of_communities: number;
232 enable_downvotes: boolean;
233 open_registration: boolean;
234 enable_nsfw: boolean;
237 export interface PrivateMessage {
240 recipient_id: number;
246 creator_name: string;
247 creator_avatar?: string;
248 recipient_name: string;
249 recipient_avatar?: string;
252 export enum BanType {
257 export interface FollowCommunityForm {
258 community_id: number;
263 export interface GetFollowedCommunitiesForm {
267 export interface GetFollowedCommunitiesResponse {
268 communities: Array<CommunityUser>;
271 export interface GetUserDetailsForm {
277 community_id?: number;
281 export interface UserDetailsResponse {
283 follows: Array<CommunityUser>;
284 moderates: Array<CommunityUser>;
285 comments: Array<Comment>;
287 admins: Array<UserView>;
290 export interface GetRepliesForm {
294 unread_only: boolean;
298 export interface GetRepliesResponse {
299 replies: Array<Comment>;
302 export interface GetUserMentionsForm {
306 unread_only: boolean;
310 export interface GetUserMentionsResponse {
311 mentions: Array<Comment>;
314 export interface EditUserMentionForm {
315 user_mention_id: number;
320 export interface UserMentionResponse {
324 export interface BanFromCommunityForm {
325 community_id: number;
333 export interface BanFromCommunityResponse {
338 export interface AddModToCommunityForm {
339 community_id: number;
345 export interface TransferCommunityForm {
346 community_id: number;
351 export interface TransferSiteForm {
356 export interface AddModToCommunityResponse {
357 moderators: Array<CommunityUser>;
360 export interface GetModlogForm {
361 mod_user_id?: number;
362 community_id?: number;
367 export interface GetModlogResponse {
368 removed_posts: Array<ModRemovePost>;
369 locked_posts: Array<ModLockPost>;
370 stickied_posts: Array<ModStickyPost>;
371 removed_comments: Array<ModRemoveComment>;
372 removed_communities: Array<ModRemoveCommunity>;
373 banned_from_community: Array<ModBanFromCommunity>;
374 banned: Array<ModBan>;
375 added_to_community: Array<ModAddCommunity>;
376 added: Array<ModAdd>;
379 export interface ModRemovePost {
386 mod_user_name: string;
388 community_id: number;
389 community_name: string;
392 export interface ModLockPost {
398 mod_user_name: string;
400 community_id: number;
401 community_name: string;
404 export interface ModStickyPost {
410 mod_user_name: string;
412 community_id: number;
413 community_name: string;
416 export interface ModRemoveComment {
423 mod_user_name: string;
424 comment_user_id: number;
425 comment_user_name: string;
426 comment_content: string;
429 community_id: number;
430 community_name: string;
433 export interface ModRemoveCommunity {
436 community_id: number;
441 mod_user_name: string;
442 community_name: string;
445 export interface ModBanFromCommunity {
448 other_user_id: number;
449 community_id: number;
454 mod_user_name: string;
455 other_user_name: string;
456 community_name: string;
459 export interface ModBan {
462 other_user_id: number;
467 mod_user_name: string;
468 other_user_name: string;
471 export interface ModAddCommunity {
474 other_user_id: number;
475 community_id: number;
478 mod_user_name: string;
479 other_user_name: string;
480 community_name: string;
483 export interface ModAdd {
486 other_user_id: number;
489 mod_user_name: string;
490 other_user_name: string;
493 export interface LoginForm {
494 username_or_email: string;
498 export interface RegisterForm {
502 password_verify: string;
507 export interface LoginResponse {
511 export interface UserSettingsForm {
514 default_sort_type: SortType;
515 default_listing_type: ListingType;
519 matrix_user_id?: string;
520 new_password?: string;
521 new_password_verify?: string;
522 old_password?: string;
523 show_avatars: boolean;
524 send_notifications_to_email: boolean;
528 export interface CommunityForm {
531 description?: string;
542 export interface GetCommunityForm {
548 export interface GetCommunityResponse {
549 community: Community;
550 moderators: Array<CommunityUser>;
551 admins: Array<UserView>;
555 export interface CommunityResponse {
556 community: Community;
559 export interface ListCommunitiesForm {
566 export interface ListCommunitiesResponse {
567 communities: Array<Community>;
570 export interface ListCategoriesResponse {
571 categories: Array<Category>;
574 export interface PostForm {
578 community_id: number;
591 export interface PostFormParams {
598 export interface GetPostForm {
603 export interface GetPostResponse {
605 comments: Array<Comment>;
606 community: Community;
607 moderators: Array<CommunityUser>;
608 admins: Array<UserView>;
612 export interface SavePostForm {
618 export interface PostResponse {
622 export interface CommentForm {
635 export interface SaveCommentForm {
641 export interface CommentResponse {
643 recipient_ids: Array<number>;
646 export interface CommentLikeForm {
653 export interface CommentNode {
655 children?: Array<CommentNode>;
658 export interface GetPostsForm {
663 community_id?: number;
667 export interface GetPostsResponse {
671 export interface GetCommentsForm {
676 community_id?: number;
680 export interface GetCommentsResponse {
681 comments: Array<Comment>;
684 export interface CreatePostLikeForm {
690 export interface SiteForm {
692 description?: string;
693 enable_downvotes: boolean;
694 open_registration: boolean;
695 enable_nsfw: boolean;
699 export interface GetSiteResponse {
701 admins: Array<UserView>;
702 banned: Array<UserView>;
706 export interface SiteResponse {
710 export interface BanUserForm {
718 export interface BanUserResponse {
723 export interface AddAdminForm {
729 export interface AddAdminResponse {
730 admins: Array<UserView>;
733 export interface SearchForm {
736 community_id?: number;
743 export interface SearchResponse {
746 comments?: Array<Comment>;
747 communities: Array<Community>;
748 users: Array<UserView>;
751 export interface DeleteAccountForm {
755 export interface PasswordResetForm {
759 // export interface PasswordResetResponse {
762 export interface PasswordChangeForm {
765 password_verify: string;
768 export interface PrivateMessageForm {
770 recipient_id: number;
774 export interface PrivateMessageFormParams {
775 recipient_id: number;
778 export interface EditPrivateMessageForm {
786 export interface GetPrivateMessagesForm {
787 unread_only: boolean;
793 export interface PrivateMessagesResponse {
794 messages: Array<PrivateMessage>;
797 export interface PrivateMessageResponse {
798 message: PrivateMessage;
801 export interface UserJoinForm {
805 export interface UserJoinResponse {
809 export type MessageType =
810 | EditPrivateMessageForm
814 | FollowCommunityForm
815 | ListCommunitiesForm
816 | GetFollowedCommunitiesForm
825 | BanFromCommunityForm
827 | AddModToCommunityForm
828 | TransferCommunityForm
835 | GetUserMentionsForm
836 | EditUserMentionForm
845 | EditPrivateMessageForm
846 | GetPrivateMessagesForm;
850 | GetFollowedCommunitiesResponse
851 | ListCommunitiesResponse
855 | GetUserMentionsResponse
856 | ListCategoriesResponse
859 | UserMentionResponse
863 | BanFromCommunityResponse
864 | AddModToCommunityResponse
867 | PrivateMessageResponse
868 | PrivateMessagesResponse;
870 export interface WebSocketResponse {
875 export interface WebSocketJsonResponse {