mattermost-redux
Version:
Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client
67 lines (66 loc) • 5.85 kB
TypeScript
import type { Channel } from '@mattermost/types/channels';
import type { OpenGraphMetadata, Post, PostAcknowledgement, PostOrderBlock } from '@mattermost/types/posts';
import type { Reaction } from '@mattermost/types/reactions';
import type { GlobalState } from '@mattermost/types/store';
import type { Team } from '@mattermost/types/teams';
import type { UserProfile } from '@mattermost/types/users';
import type { RelationOneToOne, RelationOneToMany } from '@mattermost/types/utilities';
export declare function getAllPosts(state: GlobalState): import("@mattermost/types/utilities").IDMappedObjects<Post>;
export type UserActivityPost = Post & {
system_post_ids: string[];
user_activity_posts: Post[];
};
export declare function getPost(state: GlobalState, postId: Post['id']): Post;
export declare function isPostFlagged(state: GlobalState, postId: Post['id']): boolean;
export declare function getPostRepliesCount(state: GlobalState, postId: Post['id']): number;
export declare function getPostsInThread(state: GlobalState): RelationOneToMany<Post, Post>;
export declare function getPostsInThreadOrdered(state: GlobalState, rootId: string): string[];
export declare function getReactionsForPosts(state: GlobalState): RelationOneToOne<Post, {
[x: string]: Reaction;
}>;
export declare function makeGetReactionsForPost(): (state: GlobalState, postId: Post['id']) => {
[x: string]: Reaction;
} | undefined;
export declare function getHasReactions(state: GlobalState, postId: Post['id']): boolean;
export declare function getOpenGraphMetadata(state: GlobalState): RelationOneToOne<Post, Record<string, OpenGraphMetadata>>;
export declare function getOpenGraphMetadataForUrl(state: GlobalState, postId: string, url: string): OpenGraphMetadata | undefined;
export declare function getPostIdsInCurrentChannel(state: GlobalState): Array<Post['id']> | undefined | null;
export declare function makeGetPostIdsForThread(): (state: GlobalState, postId: Post['id']) => Array<Post['id']>;
export declare function makeGetPostsChunkAroundPost(): (state: GlobalState, postId: Post['id'], channelId: Channel['id']) => PostOrderBlock | null | undefined;
export declare function getLatestInteractablePostId(state: GlobalState, channelId: string, rootId?: string): string;
export declare function getLatestPostToEdit(state: GlobalState, channelId: string, rootId?: string): string;
export declare const getLatestReplyablePostId: (state: GlobalState) => Post['id'];
export declare const getPostsInCurrentChannel: (state: GlobalState) => Post[] | undefined | null;
export declare function makeGetPostsForThread(): (state: GlobalState, rootId: string) => Post[];
export declare function makeGetProfilesForThread(): (state: GlobalState, rootId: string) => UserProfile[];
export declare function makeGetCommentCountForPost(): (state: GlobalState, post: Post) => number;
export declare const getSearchResults: (state: GlobalState) => Post[];
export declare function getSearchMatches(state: GlobalState): {
[x: string]: string[];
};
export declare function makeGetMessageInHistoryItem(type: 'post' | 'comment'): (state: GlobalState) => string;
export declare function makeGetPostsForIds(): (state: GlobalState, postIds: Array<Post['id']>) => Post[];
export declare const getMostRecentPostIdInChannel: (state: GlobalState, channelId: Channel['id']) => Post['id'] | undefined | null;
export declare function getRecentPostsChunkInChannel(state: GlobalState, channelId: Channel['id']): PostOrderBlock | null | undefined;
export declare function getOldestPostsChunkInChannel(state: GlobalState, channelId: Channel['id']): PostOrderBlock | null | undefined;
export declare function getOldestPostTimeInChannel(state: GlobalState, channelId: Channel['id']): number;
export declare function getPostIdsInChannel(state: GlobalState, channelId: Channel['id']): Array<Post['id']> | undefined | null;
export declare function getPostsChunkInChannelAroundTime(state: GlobalState, channelId: Channel['id'], timeStamp: number): PostOrderBlock | undefined | null;
export declare function getUnreadPostsChunk(state: GlobalState, channelId: Channel['id'], timeStamp: number): PostOrderBlock | undefined | null;
export declare const isPostsChunkIncludingUnreadsPosts: (state: GlobalState, chunk: PostOrderBlock, timeStamp: number) => boolean;
export declare const isPostIdSending: (state: GlobalState, postId: Post["id"]) => boolean;
export declare const makeIsPostCommentMention: () => ((state: GlobalState, postId: Post["id"]) => boolean);
export declare function getLimitedViews(state: GlobalState): GlobalState['entities']['posts']['limitedViews'];
export declare function isPostPriorityEnabled(state: GlobalState): boolean;
export declare function isPostAcknowledgementsEnabled(state: GlobalState): boolean;
export declare function getAllowPersistentNotifications(state: GlobalState): boolean;
export declare function getPersistentNotificationMaxRecipients(state: GlobalState): string | undefined;
export declare function getPersistentNotificationIntervalMinutes(state: GlobalState): string | undefined;
export declare function getAllowPersistentNotificationsForGuests(state: GlobalState): boolean;
export declare function getPostAcknowledgements(state: GlobalState, postId: Post['id']): Record<UserProfile['id'], PostAcknowledgement['acknowledged_at']>;
export declare const isPersistentNotificationsEnabled: import("mattermost-redux/selectors/create_selector").OutputSelector<GlobalState, boolean, (res1: UserProfile, res2: boolean, res3: boolean) => boolean>;
export declare function makeGetPostAcknowledgementsWithProfiles(): (state: GlobalState, postId: Post['id']) => Array<{
user: UserProfile;
acknowledgedAt: PostAcknowledgement['acknowledged_at'];
}>;
export declare function getTeamIdFromPost(state: GlobalState, post: Post): Team['id'] | undefined;