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;
175 duplicates?: Array<Post>;
178 export interface Comment {
189 community_id: number;
191 banned_from_community: boolean;
192 creator_name: string;
193 creator_avatar?: string;
200 user_mention_id?: number; // For mention type
201 recipient_id?: number;
202 upvoteLoading?: boolean;
203 downvoteLoading?: boolean;
206 export interface Category {
211 export interface Site {
214 description?: string;
218 creator_name: string;
219 number_of_users: number;
220 number_of_posts: number;
221 number_of_comments: number;
222 number_of_communities: number;
223 enable_downvotes: boolean;
224 open_registration: boolean;
225 enable_nsfw: boolean;
228 export interface PrivateMessage {
231 recipient_id: number;
237 creator_name: string;
238 creator_avatar?: string;
239 recipient_name: string;
240 recipient_avatar?: string;
243 export enum BanType {
248 export interface FollowCommunityForm {
249 community_id: number;
254 export interface GetFollowedCommunitiesForm {
258 export interface GetFollowedCommunitiesResponse {
259 communities: Array<CommunityUser>;
262 export interface GetUserDetailsForm {
268 community_id?: number;
272 export interface UserDetailsResponse {
274 follows: Array<CommunityUser>;
275 moderates: Array<CommunityUser>;
276 comments: Array<Comment>;
278 admins: Array<UserView>;
281 export interface GetRepliesForm {
285 unread_only: boolean;
289 export interface GetRepliesResponse {
290 replies: Array<Comment>;
293 export interface GetUserMentionsForm {
297 unread_only: boolean;
301 export interface GetUserMentionsResponse {
302 mentions: Array<Comment>;
305 export interface EditUserMentionForm {
306 user_mention_id: number;
311 export interface UserMentionResponse {
315 export interface BanFromCommunityForm {
316 community_id: number;
324 export interface BanFromCommunityResponse {
329 export interface AddModToCommunityForm {
330 community_id: number;
336 export interface TransferCommunityForm {
337 community_id: number;
342 export interface TransferSiteForm {
347 export interface AddModToCommunityResponse {
348 moderators: Array<CommunityUser>;
351 export interface GetModlogForm {
352 mod_user_id?: number;
353 community_id?: number;
358 export interface GetModlogResponse {
359 removed_posts: Array<ModRemovePost>;
360 locked_posts: Array<ModLockPost>;
361 stickied_posts: Array<ModStickyPost>;
362 removed_comments: Array<ModRemoveComment>;
363 removed_communities: Array<ModRemoveCommunity>;
364 banned_from_community: Array<ModBanFromCommunity>;
365 banned: Array<ModBan>;
366 added_to_community: Array<ModAddCommunity>;
367 added: Array<ModAdd>;
370 export interface ModRemovePost {
377 mod_user_name: string;
379 community_id: number;
380 community_name: string;
383 export interface ModLockPost {
389 mod_user_name: string;
391 community_id: number;
392 community_name: string;
395 export interface ModStickyPost {
401 mod_user_name: string;
403 community_id: number;
404 community_name: string;
407 export interface ModRemoveComment {
414 mod_user_name: string;
415 comment_user_id: number;
416 comment_user_name: string;
417 comment_content: string;
420 community_id: number;
421 community_name: string;
424 export interface ModRemoveCommunity {
427 community_id: number;
432 mod_user_name: string;
433 community_name: string;
436 export interface ModBanFromCommunity {
439 other_user_id: number;
440 community_id: number;
445 mod_user_name: string;
446 other_user_name: string;
447 community_name: string;
450 export interface ModBan {
453 other_user_id: number;
458 mod_user_name: string;
459 other_user_name: string;
462 export interface ModAddCommunity {
465 other_user_id: number;
466 community_id: number;
469 mod_user_name: string;
470 other_user_name: string;
471 community_name: string;
474 export interface ModAdd {
477 other_user_id: number;
480 mod_user_name: string;
481 other_user_name: string;
484 export interface LoginForm {
485 username_or_email: string;
489 export interface RegisterForm {
493 password_verify: string;
498 export interface LoginResponse {
502 export interface UserSettingsForm {
505 default_sort_type: SortType;
506 default_listing_type: ListingType;
510 matrix_user_id?: string;
511 new_password?: string;
512 new_password_verify?: string;
513 old_password?: string;
514 show_avatars: boolean;
515 send_notifications_to_email: boolean;
519 export interface CommunityForm {
522 description?: string;
533 export interface GetCommunityForm {
539 export interface GetCommunityResponse {
540 community: Community;
541 moderators: Array<CommunityUser>;
542 admins: Array<UserView>;
546 export interface CommunityResponse {
547 community: Community;
550 export interface ListCommunitiesForm {
557 export interface ListCommunitiesResponse {
558 communities: Array<Community>;
561 export interface ListCategoriesResponse {
562 categories: Array<Category>;
565 export interface PostForm {
569 community_id: number;
582 export interface PostFormParams {
589 export interface GetPostForm {
594 export interface GetPostResponse {
596 comments: Array<Comment>;
597 community: Community;
598 moderators: Array<CommunityUser>;
599 admins: Array<UserView>;
603 export interface SavePostForm {
609 export interface PostResponse {
613 export interface CommentForm {
626 export interface SaveCommentForm {
632 export interface CommentResponse {
634 recipient_ids: Array<number>;
637 export interface CommentLikeForm {
644 export interface CommentNode {
646 children?: Array<CommentNode>;
649 export interface GetPostsForm {
654 community_id?: number;
658 export interface GetPostsResponse {
662 export interface CreatePostLikeForm {
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 interface UserJoinForm {
783 export interface UserJoinResponse {
787 export type MessageType =
788 | EditPrivateMessageForm
792 | FollowCommunityForm
793 | ListCommunitiesForm
794 | GetFollowedCommunitiesForm
803 | BanFromCommunityForm
805 | AddModToCommunityForm
806 | TransferCommunityForm
813 | GetUserMentionsForm
814 | EditUserMentionForm
823 | EditPrivateMessageForm
824 | GetPrivateMessagesForm;
828 | GetFollowedCommunitiesResponse
829 | ListCommunitiesResponse
833 | GetUserMentionsResponse
834 | ListCategoriesResponse
837 | UserMentionResponse
841 | BanFromCommunityResponse
842 | AddModToCommunityResponse
845 | PrivateMessageResponse
846 | PrivateMessagesResponse;
848 export interface WebSocketResponse {
853 export interface WebSocketJsonResponse {