UNPKG

mattermost-redux

Version:

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

37 lines (36 loc) 3.52 kB
import type { Channel, ChannelMembership, ChannelNotifyProps, ChannelMessageCount } from '@mattermost/types/channels'; import type { Post } from '@mattermost/types/posts'; import type { GlobalState } from '@mattermost/types/store'; import type { UsersState, UserProfile, UserNotifyProps } from '@mattermost/types/users'; import type { IDMappedObjects, RelationOneToManyUnique, RelationOneToOne } from '@mattermost/types/utilities'; export declare function completeDirectChannelInfo(usersState: UsersState, teammateNameDisplay: string, channel: Channel): Channel; export declare function splitRoles(roles: string): Set<string>; export declare function newCompleteDirectChannelInfo(currentUserId: string, profiles: IDMappedObjects<UserProfile>, profilesInChannel: RelationOneToManyUnique<Channel, UserProfile>, teammateStatus: string, teammateNameDisplay: string, channel: Channel): Channel; export declare function completeDirectChannelDisplayName(currentUserId: string, profiles: IDMappedObjects<UserProfile>, userIdsInChannel: Set<string>, teammateNameDisplay: string, channel: Channel): Channel; export declare function cleanUpUrlable(input: string): string; export declare function getChannelByName(channels: IDMappedObjects<Channel>, name: string): Channel | undefined; export declare function getDirectChannelName(id: string, otherId: string): string; export declare function getUserIdFromChannelName(userId: string, channelName: string): string; export declare function isDirectChannel(channel: Channel): boolean; export declare function isGroupChannel(channel: Channel): boolean; export declare function getChannelsIdForTeam(state: GlobalState, teamId: string): string[]; export declare function getGroupDisplayNameFromUserIds(userIds: Set<string>, profiles: IDMappedObjects<UserProfile>, currentUserId: string, teammateNameDisplay: string, omitCurrentUser?: boolean): string; export declare function isDefault(channel?: Channel): boolean; export declare function completeDirectGroupInfo(usersState: UsersState, teammateNameDisplay: string, channel: Channel, omitCurrentUser?: boolean): Channel; export declare function isOpenChannel(channel: Channel): boolean; export declare function isPrivateChannel(channel: Channel): boolean; export declare function sortChannelsByTypeListAndDisplayName(locale: string, typeList: string[], a: Channel, b: Channel): number; export declare function sortChannelsByTypeAndDisplayName(locale: string, a: Channel, b: Channel): number; export declare function sortChannelsByDisplayName(locale: string, a: Channel, b: Channel): number; export declare function sortChannelsByDisplayNameAndMuted(locale: string, members: RelationOneToOne<Channel, ChannelMembership>, a: Channel, b: Channel): number; export declare function sortChannelsByRecency(lastPosts: RelationOneToOne<Channel, Post>, a: Channel, b: Channel): number; export declare function isChannelMuted(member?: ChannelMembership): boolean; export declare function areChannelMentionsIgnored(channelMemberNotifyProps: ChannelNotifyProps, currentUserNotifyProps: UserNotifyProps): boolean; export declare function filterChannelsMatchingTerm(channels: Channel[], term: string): Channel[]; export declare function channelListToMap(channelList: Channel[]): IDMappedObjects<Channel>; export declare function calculateUnreadCount(messageCount: ChannelMessageCount | undefined, member: ChannelMembership | undefined, crtEnabled: boolean): { showUnread: boolean; mentions: number; messages: number; hasUrgent: boolean; };