mattermost-redux
Version:
Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client
133 lines (132 loc) • 10.4 kB
TypeScript
import type { AnyAction } from 'redux';
import type { AccessControlAttributes } from '@mattermost/types/access_control';
import type { Channel, ChannelNotifyProps, ChannelMembership, ChannelModerationPatch, ChannelsWithTotalCount, ChannelSearchOpts, ServerChannel, ChannelStats, ChannelWithTeamData } from '@mattermost/types/channels';
import type { OptsSignalExt } from '@mattermost/types/client4';
import type { GetStateFunc, ActionFunc, ActionFuncAsync } from 'mattermost-redux/types/actions';
export declare function selectChannel(channelId: string): {
type: "SELECT_CHANNEL";
data: string;
};
export declare function createChannel(channel: Channel, userId: string): ActionFuncAsync<Channel>;
export declare function createDirectChannel(userId: string, otherUserId: string): ActionFuncAsync<Channel>;
export declare function markGroupChannelOpen(channelId: string): ActionFuncAsync;
export declare function createGroupChannel(userIds: string[]): ActionFuncAsync<Channel>;
export declare function patchChannel(channelId: string, patch: Partial<Channel>): ActionFuncAsync<Channel>;
export declare function setMyChannelAutotranslation(channelId: string, enabled: boolean): ActionFuncAsync<boolean>;
export declare function updateChannelPrivacy(channelId: string, privacy: string): ActionFuncAsync<Channel>;
export declare function convertGroupMessageToPrivateChannel(channelID: string, teamID: string, displayName: string, name: string): ActionFuncAsync<Channel>;
export declare function updateChannelNotifyProps(userId: string, channelId: string, props: Partial<ChannelNotifyProps>): ActionFuncAsync;
export declare function getChannelByNameAndTeamName(teamName: string, channelName: string, includeDeleted?: boolean): ActionFuncAsync<Channel>;
export declare function getChannel(channelId: string, asContentReviewer?: boolean): ActionFuncAsync<Channel>;
export declare function getChannelAndMyMember(channelId: string): ActionFuncAsync<{
channel: Channel;
member: ChannelMembership;
}>;
export declare function getChannelTimezones(channelId: string): ActionFuncAsync<string[]>;
export declare function fetchChannelsAndMembers(teamId: string): ActionFuncAsync<{
channels: ServerChannel[];
channelMembers: ChannelMembership[];
}>;
export declare function fetchAllMyChannelMembers(): ActionFuncAsync;
export declare function fetchAllMyTeamsChannels(): ActionFuncAsync;
export declare function getChannelMembers(channelId: string, page?: number, perPage?: number): ActionFuncAsync<ChannelMembership[]>;
export declare function leaveChannel(channelId: string): ActionFuncAsync;
export declare function joinChannel(userId: string, teamId: string, channelId: string, channelName?: string): ActionFuncAsync<{
channel: Channel;
member: ChannelMembership;
} | null>;
export declare function deleteChannel(channelId: string): ActionFuncAsync;
export declare function unarchiveChannel(channelId: string): ActionFuncAsync;
export declare function updateApproximateViewTime(channelId: string): ActionFuncAsync;
export declare function unsetActiveChannelOnServer(): ActionFuncAsync;
export declare function readMultipleChannels(channelIds: string[]): ActionFuncAsync;
export declare function getChannels(teamId: string, page?: number, perPage?: number): ActionFuncAsync<Channel[]>;
export declare function getArchivedChannels(teamId: string, page?: number, perPage?: number): ActionFuncAsync<Channel[]>;
export declare function getAllChannelsWithCount(page?: number, perPage?: number, notAssociatedToGroup?: string, excludeDefaultChannels?: boolean, includeDeleted?: boolean, excludePolicyConstrained?: boolean, accessControlPolicyEnforced?: boolean, excludeAccessControlPolicyEnforced?: boolean): ActionFuncAsync<ChannelsWithTotalCount>;
export declare function getAllChannels(page?: number, perPage?: number, notAssociatedToGroup?: string, excludeDefaultChannels?: boolean, excludePolicyConstrained?: boolean, excludeAccessControlPolicyEnforced?: boolean, accessControlPolicyEnforced?: boolean): ActionFuncAsync<ChannelWithTeamData[]>;
export declare function autocompleteChannels(teamId: string, term: string): ActionFuncAsync<Channel[]>;
export declare function autocompleteChannelsForSearch(teamId: string, term: string): ActionFuncAsync<Channel[]>;
export declare function searchChannels(teamId: string, term: string): ActionFuncAsync<Channel[]>;
export declare function searchAllChannels(term: string, opts: {
page: number;
per_page: number;
} & ChannelSearchOpts & OptsSignalExt): ActionFuncAsync<ChannelsWithTotalCount>;
export declare function searchAllChannels(term: string, opts: Omit<ChannelSearchOpts, 'page' | 'per_page'> & OptsSignalExt | undefined): ActionFuncAsync<ChannelWithTeamData[]>;
export declare function searchGroupChannels(term: string): ActionFuncAsync<Channel[], import("@mattermost/types/store").GlobalState, AnyAction>;
export declare function getChannelStats(channelId: string, includeFileCount?: boolean): ActionFuncAsync<ChannelStats>;
export declare function getChannelsMemberCount(channelIds: string[]): ActionFuncAsync<Record<string, number>>;
export declare function addChannelMember(channelId: string, userId: string, postRootId?: string): ActionFuncAsync<ChannelMembership>;
export declare function addChannelMembers(channelId: string, userIds: string[], postRootId?: string): ActionFuncAsync;
export declare function removeChannelMember(channelId: string, userId: string): ActionFuncAsync;
export declare function markChannelAsRead(channelId: string, skipUpdateViewTime?: boolean): ActionFunc;
export declare function markMultipleChannelsAsRead(channelTimes: Record<string, number>): ActionFunc;
export declare function markChannelAsViewedOnServer(channelId: string): ActionFuncAsync;
export declare function actionsToMarkChannelAsRead(getState: GetStateFunc, channelId: string, viewedAt?: number): AnyAction[];
export declare function actionsToMarkChannelAsUnread(getState: GetStateFunc, teamId: string, channelId: string, mentions: string, fetchedChannelMember?: boolean, isRoot?: boolean, priority?: string): AnyAction[];
export declare function getChannelMembersByIds(channelId: string, userIds: string[]): ActionFuncAsync<ChannelMembership[], import("@mattermost/types/store").GlobalState, AnyAction>;
export declare function getChannelMember(channelId: string, userId: string): ActionFuncAsync<ChannelMembership, import("@mattermost/types/store").GlobalState, AnyAction>;
export declare function getMyChannelMember(channelId: string): ActionFuncAsync<ChannelMembership, import("@mattermost/types/store").GlobalState, AnyAction>;
export declare function loadMyChannelMemberAndRole(channelId: string): ActionFuncAsync;
export declare function favoriteChannel(channelId: string): ActionFuncAsync;
export declare function unfavoriteChannel(channelId: string): ActionFuncAsync;
export declare function updateChannelScheme(channelId: string, schemeId: string): ActionFuncAsync<{
channelId: string;
schemeId: string;
}, import("@mattermost/types/store").GlobalState, AnyAction>;
export declare function updateChannelMemberSchemeRoles(channelId: string, userId: string, isSchemeUser: boolean, isSchemeAdmin: boolean): ActionFuncAsync<{
channelId: string;
userId: string;
isSchemeUser: boolean;
isSchemeAdmin: boolean;
}, import("@mattermost/types/store").GlobalState, AnyAction>;
export declare function membersMinusGroupMembers(channelID: string, groupIDs: string[], page?: number, perPage?: number): ActionFuncAsync<import("@mattermost/types/groups").UsersWithGroupsAndCount, import("@mattermost/types/store").GlobalState, AnyAction>;
export declare function getChannelModerations(channelId: string): ActionFuncAsync<{
channelId: string;
moderations: import("@mattermost/types/channels").ChannelModeration[];
}, import("@mattermost/types/store").GlobalState, AnyAction>;
export declare function patchChannelModerations(channelId: string, patch: ChannelModerationPatch[]): ActionFuncAsync<{
channelId: string;
moderations: import("@mattermost/types/channels").ChannelModeration[];
}, import("@mattermost/types/store").GlobalState, AnyAction>;
export declare function getChannelMemberCountsByGroup(channelId: string): ActionFuncAsync<{
channelId: string;
memberCounts: import("@mattermost/types/channels").ChannelMemberCountsByGroup;
}, import("@mattermost/types/store").GlobalState, AnyAction>;
export declare function fetchMissingChannels(channelIDs: string[], asContentReviewer?: boolean): ActionFuncAsync<Array<Channel['id']>>;
export declare function fetchIsRestrictedDM(channelId: string): ActionFuncAsync<{
channelId: string;
isRestricted: boolean;
}, import("@mattermost/types/store").GlobalState, AnyAction>;
export declare function getChannelAccessControlAttributes(channelId: string): ActionFuncAsync<AccessControlAttributes>;
declare const _default: {
selectChannel: typeof selectChannel;
createChannel: typeof createChannel;
createDirectChannel: typeof createDirectChannel;
patchChannel: typeof patchChannel;
updateChannelNotifyProps: typeof updateChannelNotifyProps;
getChannel: typeof getChannel;
fetchChannelsAndMembers: typeof fetchChannelsAndMembers;
getChannelTimezones: typeof getChannelTimezones;
getChannelMembersByIds: typeof getChannelMembersByIds;
leaveChannel: typeof leaveChannel;
joinChannel: typeof joinChannel;
deleteChannel: typeof deleteChannel;
unarchiveChannel: typeof unarchiveChannel;
getChannels: typeof getChannels;
autocompleteChannels: typeof autocompleteChannels;
autocompleteChannelsForSearch: typeof autocompleteChannelsForSearch;
searchChannels: typeof searchChannels;
searchGroupChannels: typeof searchGroupChannels;
getChannelStats: typeof getChannelStats;
addChannelMember: typeof addChannelMember;
addChannelMembers: typeof addChannelMembers;
removeChannelMember: typeof removeChannelMember;
markChannelAsRead: typeof markChannelAsRead;
favoriteChannel: typeof favoriteChannel;
unfavoriteChannel: typeof unfavoriteChannel;
membersMinusGroupMembers: typeof membersMinusGroupMembers;
getChannelModerations: typeof getChannelModerations;
getChannelMemberCountsByGroup: typeof getChannelMemberCountsByGroup;
getChannelAccessControlAttributes: typeof getChannelAccessControlAttributes;
};
export default _default;