mattermost-redux
Version:
Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client
65 lines (64 loc) • 3.54 kB
TypeScript
import type { Post } from '@mattermost/types/posts';
import type { UserThread, UserThreadList } from '@mattermost/types/threads';
import type { DispatchFunc, GetStateFunc, ActionFunc, ActionFuncAsync } from 'mattermost-redux/types/actions';
type ExtendedPost = Post & {
system_post_ids?: string[];
};
export declare function fetchThreads(userId: string, teamId: string, { before, after, perPage, unread, totalsOnly, threadsOnly, extended, since }?: {
before?: string | undefined;
after?: string | undefined;
perPage?: number | undefined;
unread?: boolean | undefined;
totalsOnly?: boolean | undefined;
threadsOnly?: boolean | undefined;
extended?: boolean | undefined;
since?: number | undefined;
}): ActionFuncAsync<UserThreadList>;
export declare function getThreadsForCurrentTeam({ before, after, unread }?: {
before?: string | undefined;
after?: string | undefined;
unread?: boolean | undefined;
}): ActionFuncAsync<UserThreadList>;
export declare function getThreadCounts(userId: string, teamId: string): ActionFuncAsync;
export declare function getCountsAndThreadsSince(userId: string, teamId: string, since?: number): ActionFuncAsync;
export declare function handleThreadArrived(dispatch: DispatchFunc, getState: GetStateFunc, threadData: UserThread, teamId: string, previousUnreadReplies?: number, previousUnreadMentions?: number): {
is_following: boolean;
id: string;
reply_count: number;
last_reply_at: number;
last_viewed_at: number;
participants: Array<{
id: import("@mattermost/types/users").UserProfile["id"];
} | import("@mattermost/types/users").UserProfile>;
unread_replies: number;
unread_mentions: number;
is_urgent?: boolean;
type?: import("@mattermost/types/threads").UserThreadType;
post: {
channel_id: import("@mattermost/types/channels").Channel["id"];
user_id: import("@mattermost/types/users").UserProfile["id"];
};
};
export declare function getThread(userId: string, teamId: string, threadId: string, extended?: boolean): ActionFuncAsync;
export declare function handleAllMarkedRead(teamId: string): {
type: "ALL_TEAM_THREADS_READ";
data: {
team_id: string;
};
};
export declare function markAllThreadsInTeamRead(userId: string, teamId: string): ActionFuncAsync;
export declare function markThreadAsUnread(userId: string, teamId: string, threadId: string, postId: string): ActionFuncAsync;
export declare function markLastPostInThreadAsUnread(userId: string, teamId: string, threadId: string): ActionFuncAsync;
export declare function updateThreadRead(userId: string, teamId: string, threadId: string, timestamp: number): ActionFuncAsync;
export declare function handleReadChanged(threadId: string, teamId: string, channelId: string, { lastViewedAt, prevUnreadMentions, newUnreadMentions, prevUnreadReplies, newUnreadReplies, }: {
lastViewedAt: number;
prevUnreadMentions: number;
newUnreadMentions: number;
prevUnreadReplies: number;
newUnreadReplies: number;
}): ActionFunc;
export declare function handleFollowChanged(dispatch: DispatchFunc, threadId: string, teamId: string, following: boolean): void;
export declare function setThreadFollow(userId: string, teamId: string, threadId: string, newState: boolean): ActionFuncAsync;
export declare function handleAllThreadsInChannelMarkedRead(channelId: string, lastViewedAt: number): ActionFunc<boolean>;
export declare function decrementThreadCounts(post: ExtendedPost): ActionFunc;
export {};