// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import {CustomEmoji} from './emojis'; import {FileInfo} from './files'; import {Reaction} from './reactions'; import { $ID, RelationOneToOne, RelationOneToMany, IDMappedObjects, Dictionary, } from './utilities'; export type PostType = 'system_add_remove' | 'system_add_to_channel' | 'system_add_to_team' | 'system_channel_deleted' | 'system_channel_restored' | 'system_displayname_change' | 'system_convert_channel' | 'system_ephemeral' | 'system_header_change' | 'system_join_channel' | 'system_join_leave' | 'system_leave_channel' | 'system_purpose_change' | 'system_remove_from_channel'; export type PostEmbedType = 'image' | 'message_attachment' | 'opengraph'; export type PostEmbed = { type: PostEmbedType; url: string; data: Record; }; export type PostImage = { height: number; width: number; }; export type PostMetadata = { embeds: Array; emojis: Array; files: Array; images: Dictionary; reactions: Array; }; export type Post = { id: string; create_at: number; update_at: number; edit_at: number; delete_at: number; is_pinned: boolean; user_id: string; channel_id: string; root_id: string; parent_id: string; original_id: string; message: string; type: PostType; props: Record; hashtags: string; pending_post_id: string; reply_count: number; file_ids?: any[]; metadata: PostMetadata; failed?: boolean; user_activity_posts?: Array; state?: 'DELETED'; }; export type PostList = { order: $ID[]; posts: Map; next_post_id: string; prev_post_id: string; }; export type PostSearchResults = PostList & { matches: RelationOneToOne; }; export type PostWithFormatData = Post & { isFirstReply: boolean; isLastReply: boolean; previousPostIsComment: boolean; commentedOnPost?: Post; consecutivePostByUser: boolean; replyCount: number; isCommentMention: boolean; highlight: boolean; }; export type PostOrderBlock = { order: Array; recent?: boolean; oldest?: boolean; }; export type MessageHistory = { messages: Array; index: { post: number; comment: number; }; }; export type PostsState = { posts: IDMappedObjects; postsReplies: {[x in $ID]: number}; postsInChannel: Dictionary>; postsInThread: RelationOneToMany; reactions: RelationOneToOne>; openGraph: RelationOneToOne; pendingPostIds: Array; selectedPostId: string; currentFocusedPostId: string; messagesHistory: MessageHistory; expandedURLs: Dictionary; }; export type OpenGraphMetadata = any;