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;
213 export interface Category {
218 export interface Site {
221 description?: string;
225 creator_name: string;
226 number_of_users: number;
227 number_of_posts: number;
228 number_of_comments: number;
229 number_of_communities: number;
230 enable_downvotes: boolean;
231 open_registration: boolean;
232 enable_nsfw: boolean;
235 export interface PrivateMessage {
238 recipient_id: number;
244 creator_name: string;
245 creator_avatar?: string;
246 recipient_name: string;
247 recipient_avatar?: string;
250 export enum BanType {
255 export interface FollowCommunityForm {
256 community_id: number;
261 export interface GetFollowedCommunitiesForm {
265 export interface GetFollowedCommunitiesResponse {
266 communities: Array<CommunityUser>;
269 export interface GetUserDetailsForm {
275 community_id?: number;
279 export interface UserDetailsResponse {
281 follows: Array<CommunityUser>;
282 moderates: Array<CommunityUser>;
283 comments: Array<Comment>;
285 admins: Array<UserView>;
288 export interface GetRepliesForm {
292 unread_only: boolean;
296 export interface GetRepliesResponse {
297 replies: Array<Comment>;
300 export interface GetUserMentionsForm {
304 unread_only: boolean;
308 export interface GetUserMentionsResponse {
309 mentions: Array<Comment>;
312 export interface EditUserMentionForm {
313 user_mention_id: number;
318 export interface UserMentionResponse {
322 export interface BanFromCommunityForm {
323 community_id: number;
331 export interface BanFromCommunityResponse {
336 export interface AddModToCommunityForm {
337 community_id: number;
343 export interface TransferCommunityForm {
344 community_id: number;
349 export interface TransferSiteForm {
354 export interface AddModToCommunityResponse {
355 moderators: Array<CommunityUser>;
358 export interface GetModlogForm {
359 mod_user_id?: number;
360 community_id?: number;
365 export interface GetModlogResponse {
366 removed_posts: Array<ModRemovePost>;
367 locked_posts: Array<ModLockPost>;
368 stickied_posts: Array<ModStickyPost>;
369 removed_comments: Array<ModRemoveComment>;
370 removed_communities: Array<ModRemoveCommunity>;
371 banned_from_community: Array<ModBanFromCommunity>;
372 banned: Array<ModBan>;
373 added_to_community: Array<ModAddCommunity>;
374 added: Array<ModAdd>;
377 export interface ModRemovePost {
384 mod_user_name: string;
386 community_id: number;
387 community_name: string;
390 export interface ModLockPost {
396 mod_user_name: string;
398 community_id: number;
399 community_name: string;
402 export interface ModStickyPost {
408 mod_user_name: string;
410 community_id: number;
411 community_name: string;
414 export interface ModRemoveComment {
421 mod_user_name: string;
422 comment_user_id: number;
423 comment_user_name: string;
424 comment_content: string;
427 community_id: number;
428 community_name: string;
431 export interface ModRemoveCommunity {
434 community_id: number;
439 mod_user_name: string;
440 community_name: string;
443 export interface ModBanFromCommunity {
446 other_user_id: number;
447 community_id: number;
452 mod_user_name: string;
453 other_user_name: string;
454 community_name: string;
457 export interface ModBan {
460 other_user_id: number;
465 mod_user_name: string;
466 other_user_name: string;
469 export interface ModAddCommunity {
472 other_user_id: number;
473 community_id: number;
476 mod_user_name: string;
477 other_user_name: string;
478 community_name: string;
481 export interface ModAdd {
484 other_user_id: number;
487 mod_user_name: string;
488 other_user_name: string;
491 export interface LoginForm {
492 username_or_email: string;
496 export interface RegisterForm {
500 password_verify: string;
505 export interface LoginResponse {
509 export interface UserSettingsForm {
512 default_sort_type: SortType;
513 default_listing_type: ListingType;
517 matrix_user_id?: string;
518 new_password?: string;
519 new_password_verify?: string;
520 old_password?: string;
521 show_avatars: boolean;
522 send_notifications_to_email: boolean;
526 export interface CommunityForm {
529 description?: string;
540 export interface GetCommunityForm {
546 export interface GetCommunityResponse {
547 community: Community;
548 moderators: Array<CommunityUser>;
549 admins: Array<UserView>;
553 export interface CommunityResponse {
554 community: Community;
557 export interface ListCommunitiesForm {
564 export interface ListCommunitiesResponse {
565 communities: Array<Community>;
568 export interface ListCategoriesResponse {
569 categories: Array<Category>;
572 export interface PostForm {
576 community_id: number;
589 export interface PostFormParams {
596 export interface GetPostForm {
601 export interface GetPostResponse {
603 comments: Array<Comment>;
604 community: Community;
605 moderators: Array<CommunityUser>;
606 admins: Array<UserView>;
610 export interface SavePostForm {
616 export interface PostResponse {
620 export interface CommentForm {
633 export interface SaveCommentForm {
639 export interface CommentResponse {
641 recipient_ids: Array<number>;
644 export interface CommentLikeForm {
651 export interface CommentNode {
653 children?: Array<CommentNode>;
656 export interface GetPostsForm {
661 community_id?: number;
665 export interface GetPostsResponse {
669 export interface GetCommentsForm {
674 community_id?: number;
678 export interface GetCommentsResponse {
679 comments: Array<Comment>;
682 export interface CreatePostLikeForm {
688 export interface SiteForm {
690 description?: string;
691 enable_downvotes: boolean;
692 open_registration: boolean;
693 enable_nsfw: boolean;
697 export interface GetSiteResponse {
699 admins: Array<UserView>;
700 banned: Array<UserView>;
704 export interface SiteResponse {
708 export interface BanUserForm {
716 export interface BanUserResponse {
721 export interface AddAdminForm {
727 export interface AddAdminResponse {
728 admins: Array<UserView>;
731 export interface SearchForm {
734 community_id?: number;
741 export interface SearchResponse {
744 comments?: Array<Comment>;
745 communities: Array<Community>;
746 users: Array<UserView>;
749 export interface DeleteAccountForm {
753 export interface PasswordResetForm {
757 // export interface PasswordResetResponse {
760 export interface PasswordChangeForm {
763 password_verify: string;
766 export interface PrivateMessageForm {
768 recipient_id: number;
772 export interface PrivateMessageFormParams {
773 recipient_id: number;
776 export interface EditPrivateMessageForm {
784 export interface GetPrivateMessagesForm {
785 unread_only: boolean;
791 export interface PrivateMessagesResponse {
792 messages: Array<PrivateMessage>;
795 export interface PrivateMessageResponse {
796 message: PrivateMessage;
799 export interface UserJoinForm {
803 export interface UserJoinResponse {
807 export type MessageType =
808 | EditPrivateMessageForm
812 | FollowCommunityForm
813 | ListCommunitiesForm
814 | GetFollowedCommunitiesForm
823 | BanFromCommunityForm
825 | AddModToCommunityForm
826 | TransferCommunityForm
833 | GetUserMentionsForm
834 | EditUserMentionForm
843 | EditPrivateMessageForm
844 | GetPrivateMessagesForm;
848 | GetFollowedCommunitiesResponse
849 | ListCommunitiesResponse
853 | GetUserMentionsResponse
854 | ListCategoriesResponse
857 | UserMentionResponse
861 | BanFromCommunityResponse
862 | AddModToCommunityResponse
865 | PrivateMessageResponse
866 | PrivateMessagesResponse;
868 export interface WebSocketResponse {
873 export interface WebSocketJsonResponse {
880 export interface FramelyData {
887 provider_name?: string;
888 thumbnail_url?: string;
889 thumbnail_width?: number;
890 thumbnail_height?: number;
891 description?: string;