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;
99 export interface UserView {
104 matrix_user_id?: string;
107 number_of_posts: number;
109 number_of_comments: number;
110 comment_score: number;
112 show_avatars: boolean;
113 send_notifications_to_email: boolean;
116 export interface CommunityUser {
121 community_id: number;
122 community_name: string;
126 export interface Community {
130 description?: string;
138 creator_name: string;
139 creator_avatar?: string;
140 category_name: string;
141 number_of_subscribers: number;
142 number_of_posts: number;
143 number_of_comments: number;
145 subscribed?: boolean;
148 export interface Post {
154 community_id: number;
161 banned_from_community: boolean;
164 creator_name: string;
165 creator_avatar?: string;
166 community_name: string;
167 community_removed: boolean;
168 community_deleted: boolean;
169 community_nsfw: boolean;
170 number_of_comments: number;
175 newest_activity_time: string;
178 subscribed?: 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;
214 export interface Category {
219 export interface Site {
222 description?: string;
226 creator_name: string;
227 number_of_users: number;
228 number_of_posts: number;
229 number_of_comments: number;
230 number_of_communities: number;
231 enable_downvotes: boolean;
232 open_registration: boolean;
233 enable_nsfw: boolean;
236 export interface PrivateMessage {
239 recipient_id: number;
245 creator_name: string;
246 creator_avatar?: string;
247 recipient_name: string;
248 recipient_avatar?: string;
251 export enum BanType {
256 export interface FollowCommunityForm {
257 community_id: number;
262 export interface GetFollowedCommunitiesForm {
266 export interface GetFollowedCommunitiesResponse {
267 communities: Array<CommunityUser>;
270 export interface GetUserDetailsForm {
276 community_id?: number;
280 export interface UserDetailsResponse {
282 follows: Array<CommunityUser>;
283 moderates: Array<CommunityUser>;
284 comments: Array<Comment>;
286 admins: Array<UserView>;
289 export interface GetRepliesForm {
293 unread_only: boolean;
297 export interface GetRepliesResponse {
298 replies: Array<Comment>;
301 export interface GetUserMentionsForm {
305 unread_only: boolean;
309 export interface GetUserMentionsResponse {
310 mentions: Array<Comment>;
313 export interface EditUserMentionForm {
314 user_mention_id: number;
319 export interface UserMentionResponse {
323 export interface BanFromCommunityForm {
324 community_id: number;
332 export interface BanFromCommunityResponse {
337 export interface AddModToCommunityForm {
338 community_id: number;
344 export interface TransferCommunityForm {
345 community_id: number;
350 export interface TransferSiteForm {
355 export interface AddModToCommunityResponse {
356 moderators: Array<CommunityUser>;
359 export interface GetModlogForm {
360 mod_user_id?: number;
361 community_id?: number;
366 export interface GetModlogResponse {
367 removed_posts: Array<ModRemovePost>;
368 locked_posts: Array<ModLockPost>;
369 stickied_posts: Array<ModStickyPost>;
370 removed_comments: Array<ModRemoveComment>;
371 removed_communities: Array<ModRemoveCommunity>;
372 banned_from_community: Array<ModBanFromCommunity>;
373 banned: Array<ModBan>;
374 added_to_community: Array<ModAddCommunity>;
375 added: Array<ModAdd>;
378 export interface ModRemovePost {
385 mod_user_name: string;
387 community_id: number;
388 community_name: string;
391 export interface ModLockPost {
397 mod_user_name: string;
399 community_id: number;
400 community_name: string;
403 export interface ModStickyPost {
409 mod_user_name: string;
411 community_id: number;
412 community_name: string;
415 export interface ModRemoveComment {
422 mod_user_name: string;
423 comment_user_id: number;
424 comment_user_name: string;
425 comment_content: string;
428 community_id: number;
429 community_name: string;
432 export interface ModRemoveCommunity {
435 community_id: number;
440 mod_user_name: string;
441 community_name: string;
444 export interface ModBanFromCommunity {
447 other_user_id: number;
448 community_id: number;
453 mod_user_name: string;
454 other_user_name: string;
455 community_name: string;
458 export interface ModBan {
461 other_user_id: number;
466 mod_user_name: string;
467 other_user_name: string;
470 export interface ModAddCommunity {
473 other_user_id: number;
474 community_id: number;
477 mod_user_name: string;
478 other_user_name: string;
479 community_name: string;
482 export interface ModAdd {
485 other_user_id: number;
488 mod_user_name: string;
489 other_user_name: string;
492 export interface LoginForm {
493 username_or_email: string;
497 export interface RegisterForm {
501 password_verify: string;
506 export interface LoginResponse {
510 export interface UserSettingsForm {
513 default_sort_type: SortType;
514 default_listing_type: ListingType;
518 matrix_user_id?: string;
519 new_password?: string;
520 new_password_verify?: string;
521 old_password?: string;
522 show_avatars: boolean;
523 send_notifications_to_email: boolean;
527 export interface CommunityForm {
530 description?: string;
541 export interface GetCommunityForm {
547 export interface GetCommunityResponse {
548 community: Community;
549 moderators: Array<CommunityUser>;
550 admins: Array<UserView>;
554 export interface CommunityResponse {
555 community: Community;
558 export interface ListCommunitiesForm {
565 export interface ListCommunitiesResponse {
566 communities: Array<Community>;
569 export interface ListCategoriesResponse {
570 categories: Array<Category>;
573 export interface PostForm {
577 community_id: number;
590 export interface PostFormParams {
597 export interface GetPostForm {
602 export interface GetPostResponse {
604 comments: Array<Comment>;
605 community: Community;
606 moderators: Array<CommunityUser>;
607 admins: Array<UserView>;
611 export interface SavePostForm {
617 export interface PostResponse {
621 export interface CommentForm {
634 export interface SaveCommentForm {
640 export interface CommentResponse {
642 recipient_ids: Array<number>;
645 export interface CommentLikeForm {
652 export interface CommentNode {
654 children?: Array<CommentNode>;
657 export interface GetPostsForm {
662 community_id?: number;
666 export interface GetPostsResponse {
670 export interface GetCommentsForm {
675 community_id?: number;
679 export interface GetCommentsResponse {
680 comments: Array<Comment>;
683 export interface CreatePostLikeForm {
689 export interface SiteForm {
691 description?: string;
692 enable_downvotes: boolean;
693 open_registration: boolean;
694 enable_nsfw: boolean;
698 export interface GetSiteResponse {
700 admins: Array<UserView>;
701 banned: Array<UserView>;
705 export interface SiteResponse {
709 export interface BanUserForm {
717 export interface BanUserResponse {
722 export interface AddAdminForm {
728 export interface AddAdminResponse {
729 admins: Array<UserView>;
732 export interface SearchForm {
735 community_id?: number;
742 export interface SearchResponse {
745 comments?: Array<Comment>;
746 communities: Array<Community>;
747 users: Array<UserView>;
750 export interface DeleteAccountForm {
754 export interface PasswordResetForm {
758 // export interface PasswordResetResponse {
761 export interface PasswordChangeForm {
764 password_verify: string;
767 export interface PrivateMessageForm {
769 recipient_id: number;
773 export interface PrivateMessageFormParams {
774 recipient_id: number;
777 export interface EditPrivateMessageForm {
785 export interface GetPrivateMessagesForm {
786 unread_only: boolean;
792 export interface PrivateMessagesResponse {
793 messages: Array<PrivateMessage>;
796 export interface PrivateMessageResponse {
797 message: PrivateMessage;
800 export interface UserJoinForm {
804 export interface UserJoinResponse {
808 export type MessageType =
809 | EditPrivateMessageForm
813 | FollowCommunityForm
814 | ListCommunitiesForm
815 | GetFollowedCommunitiesForm
824 | BanFromCommunityForm
826 | AddModToCommunityForm
827 | TransferCommunityForm
834 | GetUserMentionsForm
835 | EditUserMentionForm
844 | EditPrivateMessageForm
845 | GetPrivateMessagesForm;
849 | GetFollowedCommunitiesResponse
850 | ListCommunitiesResponse
854 | GetUserMentionsResponse
855 | ListCategoriesResponse
858 | UserMentionResponse
862 | BanFromCommunityResponse
863 | AddModToCommunityResponse
866 | PrivateMessageResponse
867 | PrivateMessagesResponse;
869 export interface WebSocketResponse {
874 export interface WebSocketJsonResponse {
881 export interface FramelyData {
888 provider_name?: string;
889 thumbnail_url?: string;
890 thumbnail_width?: number;
891 thumbnail_height?: number;
892 description?: string;