UNPKG

mattermost-redux

Version:

Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client

48 lines (47 loc) 3.13 kB
import type { OpenGraphMetadata, Post, PostsState, PostOrderBlock, MessageHistory } from '@mattermost/types/posts'; import type { Reaction } from '@mattermost/types/reactions'; import type { UserProfile } from '@mattermost/types/users'; import type { RelationOneToOne, IDMappedObjects, RelationOneToMany } from '@mattermost/types/utilities'; import type { MMReduxAction } from 'mattermost-redux/action_types'; export declare function removeUnneededMetadata(post: Post): Post; export declare function nextPostsReplies(state: { [x in Post["id"]]: number; } | undefined, action: MMReduxAction): { [x: string]: number; }; export declare function handlePosts(state: IDMappedObjects<Post> | undefined, action: MMReduxAction): any; export declare function handlePendingPosts(state: string[] | undefined, action: MMReduxAction): string[]; export declare function postsInChannel(state: Record<string, PostOrderBlock[]> | undefined, action: MMReduxAction, prevPosts: IDMappedObjects<Post>, nextPosts: Record<string, Post>): Record<string, PostOrderBlock[]>; export declare function removeNonRecentEmptyPostBlocks(blocks: PostOrderBlock[]): PostOrderBlock[]; export declare function mergePostBlocks(blocks: PostOrderBlock[], posts: Record<string, Post>): PostOrderBlock[]; export declare function mergePostOrder(left: string[], right: string[], posts: Record<string, Post>): string[]; export declare function postsInThread(state: RelationOneToMany<Post, Post> | undefined, action: MMReduxAction, prevPosts: Record<string, Post>): RelationOneToMany<Post, Post>; export declare function postEditHistory(state: Post[] | undefined, action: MMReduxAction): any; export declare function reactions(state: RelationOneToOne<Post, Record<string, Reaction>> | undefined, action: MMReduxAction): RelationOneToOne<Post, Record<string, Reaction>>; export declare function acknowledgements(state: RelationOneToOne<Post, Record<UserProfile["id"], number>> | undefined, action: MMReduxAction): any; export declare function openGraph(state: RelationOneToOne<Post, Record<string, OpenGraphMetadata>> | undefined, action: MMReduxAction): any; export declare const zeroStateLimitedViews: { threads: {}; channels: {}; }; export declare function limitedViews(state: PostsState["limitedViews"] | undefined, action: MMReduxAction): PostsState['limitedViews']; export default function reducer(state: Partial<PostsState> | undefined, action: MMReduxAction): Partial<PostsState> | { posts: any; postsReplies: { [x: string]: number; }; pendingPostIds: string[]; postsInChannel: Record<string, PostOrderBlock[]>; postsInThread: RelationOneToMany<Post, Post>; postEditHistory: any; currentFocusedPostId: any; reactions: RelationOneToOne<Post, Record<string, Reaction>>; openGraph: any; messagesHistory: Partial<MessageHistory> | { messages: string[] | undefined; index: Record<string, number>; }; acknowledgements: any; limitedViews: { channels: Record<import("@mattermost/types/channels").Channel["id"], number>; threads: Record<Post["root_id"], number>; }; };