mattermost-redux
Version:
Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client
79 lines (78 loc) • 6.9 kB
TypeScript
import { getCurrentUser, getCurrentUserId, getUsers } from "./common";
import { Channel, ChannelMembership } from "../../types/channels";
import { Reaction } from "../../types/reactions";
import { GlobalState } from "../../types/store";
import { Team, TeamMembership } from "../../types/teams";
import { Group } from "../../types/groups";
import { UserProfile } from "../../types/users";
import { $Email, $ID, $Username, EmailMappedObjects, IDMappedObjects, RelationOneToMany, RelationOneToOne, UsernameMappedObjects } from "../../types/utilities";
export { getCurrentUser, getCurrentUserId, getUsers };
declare type Filters = {
role?: string;
inactive?: boolean;
active?: boolean;
roles?: string[];
exclude_roles?: string[];
channel_roles?: string[];
team_roles?: string[];
};
export declare function getUserIdsInChannels(state: GlobalState): RelationOneToMany<Channel, UserProfile>;
export declare function getUserIdsNotInChannels(state: GlobalState): RelationOneToMany<Channel, UserProfile>;
export declare function getUserIdsInTeams(state: GlobalState): RelationOneToMany<Team, UserProfile>;
export declare function getUserIdsNotInTeams(state: GlobalState): RelationOneToMany<Team, UserProfile>;
export declare function getUserIdsWithoutTeam(state: GlobalState): Set<$ID<UserProfile>>;
export declare function getUserIdsInGroups(state: GlobalState): RelationOneToMany<Group, UserProfile>;
export declare function getUserStatuses(state: GlobalState): RelationOneToOne<UserProfile, string>;
export declare function getUserSessions(state: GlobalState): any[];
export declare function getUserAudits(state: GlobalState): any[];
export declare function getUser(state: GlobalState, id: $ID<UserProfile>): UserProfile;
export declare const getUsersByUsername: (a: GlobalState) => UsernameMappedObjects<UserProfile>;
export declare function getUserByUsername(state: GlobalState, username: $Username<UserProfile>): UserProfile;
export declare const getUsersByEmail: (a: GlobalState) => EmailMappedObjects<UserProfile>;
export declare function getUserByEmail(state: GlobalState, email: $Email<UserProfile>): UserProfile;
export declare const isCurrentUserSystemAdmin: (state: GlobalState) => boolean;
export declare const currentUserHasAnAdminRole: (state: GlobalState) => boolean;
export declare const getCurrentUserRoles: (a: GlobalState) => UserProfile['roles'];
export declare type UserMentionKey = {
key: string;
caseSensitive?: boolean;
};
export declare const getCurrentUserMentionKeys: (state: GlobalState) => UserMentionKey[];
export declare const getProfileSetInCurrentChannel: (state: GlobalState) => Array<$ID<UserProfile>>;
export declare const getProfileSetNotInCurrentChannel: (state: GlobalState) => Array<$ID<UserProfile>>;
export declare const getProfileSetInCurrentTeam: (state: GlobalState) => Array<$ID<UserProfile>>;
export declare const getProfileSetNotInCurrentTeam: (state: GlobalState) => Array<$ID<UserProfile>>;
export declare const getProfiles: (state: GlobalState, filters: Filters) => UserProfile[];
export declare function filterProfiles(profiles: IDMappedObjects<UserProfile>, filters?: Filters, memberships?: RelationOneToOne<UserProfile, TeamMembership> | RelationOneToOne<UserProfile, ChannelMembership>): IDMappedObjects<UserProfile>;
export declare function getIsManualStatusForUserId(state: GlobalState, userId: $ID<UserProfile>): boolean;
export declare const getProfilesInCurrentChannel: (state: GlobalState) => UserProfile[];
export declare const getProfilesNotInCurrentChannel: (state: GlobalState) => UserProfile[];
export declare const getProfilesInCurrentTeam: (state: GlobalState) => UserProfile[];
export declare const getProfilesInTeam: (state: GlobalState, teamId: $ID<Team>, filters?: Filters) => UserProfile[];
export declare const getProfilesNotInTeam: (state: GlobalState, teamId: $ID<Team>, filters?: Filters) => UserProfile[];
export declare const getProfilesNotInCurrentTeam: (state: GlobalState) => UserProfile[];
export declare const getProfilesWithoutTeam: (state: GlobalState, filters?: Filters) => UserProfile[];
export declare function getStatusForUserId(state: GlobalState, userId: $ID<UserProfile>): string;
export declare function getTotalUsersStats(state: GlobalState): any;
export declare function getFilteredUsersStats(state: GlobalState): any;
export declare function makeSearchProfilesStartingWithTerm(): (state: GlobalState, term: string, skipCurrent?: boolean, filters?: Filters) => UserProfile[];
export declare function makeSearchProfilesMatchingWithTerm(): (state: GlobalState, term: string, skipCurrent?: boolean, filters?: Filters) => UserProfile[];
export declare function makeSearchProfilesInChannel(): (state: GlobalState, channelId: $ID<Channel>, term: string, skipCurrent?: boolean, filters?: Filters | undefined) => UserProfile[];
export declare function searchProfilesInCurrentChannel(state: GlobalState, term: string, skipCurrent?: boolean): UserProfile[];
export declare function searchProfilesNotInCurrentChannel(state: GlobalState, term: string, skipCurrent?: boolean): UserProfile[];
export declare function searchProfilesInCurrentTeam(state: GlobalState, term: string, skipCurrent?: boolean): UserProfile[];
export declare function searchProfilesInTeam(state: GlobalState, teamId: $ID<Team>, term: string, skipCurrent?: boolean, filters?: Filters): UserProfile[];
export declare function searchProfilesNotInCurrentTeam(state: GlobalState, term: string, skipCurrent?: boolean): UserProfile[];
export declare function searchProfilesWithoutTeam(state: GlobalState, term: string, skipCurrent?: boolean, filters?: Filters): UserProfile[];
export declare const shouldShowTermsOfService: (state: GlobalState) => boolean;
export declare const getUsersInVisibleDMs: (state: GlobalState) => UserProfile[];
export declare function makeGetProfilesForReactions(): (state: GlobalState, reactions: Reaction[]) => UserProfile[];
export declare function makeGetProfilesInChannel(): (state: GlobalState, channelId: $ID<Channel>, filters?: Filters) => UserProfile[];
export declare function makeGetProfilesNotInChannel(): (state: GlobalState, channelId: $ID<Channel>, filters?: Filters) => UserProfile[];
export declare function makeGetProfilesByIdsAndUsernames(): (state: GlobalState, props: {
allUserIds: Array<$ID<UserProfile>>;
allUsernames: Array<$Username<UserProfile>>;
}) => UserProfile[];
export declare function makeGetDisplayName(): (state: GlobalState, userId: $ID<UserProfile>, useFallbackUsername: boolean) => string;
export declare const getProfilesInGroup: (state: GlobalState, groupId: $ID<Group>, filters?: Filters) => UserProfile[];
export declare function searchProfilesInGroup(state: GlobalState, groupId: $ID<Group>, term: string, skipCurrent?: boolean, filters?: Filters): UserProfile[];