mattermost-redux
Version:
Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client
26 lines (25 loc) • 2.05 kB
TypeScript
import { ChannelMembership } from "../types/channels";
import { TeamMembership } from "../types/teams";
import { UserProfile } from "../types/users";
import { IDMappedObjects, $ID } from "../types/utilities";
export declare function getFullName(user: UserProfile): string;
export declare function displayUsername(user: UserProfile, teammateNameDisplay: string, useFallbackUsername?: boolean): string;
export declare function spaceSeparatedStringIncludes(spaceSeparated: string, item: string): boolean;
export declare function isAdmin(roles: string): boolean;
export declare function isGuest(roles: string): boolean;
export declare function isTeamAdmin(roles: string): boolean;
export declare function isSystemAdmin(roles: string): boolean;
export declare function includesAnAdminRole(roles: string): boolean;
export declare function isChannelAdmin(roles: string): boolean;
export declare function hasUserAccessTokenRole(roles: string): boolean;
export declare function hasPostAllRole(roles: string): boolean;
export declare function hasPostAllPublicRole(roles: string): boolean;
export declare function profileListToMap(profileList: UserProfile[]): IDMappedObjects<UserProfile>;
export declare function removeUserFromList(userId: $ID<UserProfile>, list: UserProfile[]): UserProfile[];
export declare function getSuggestionsSplitBy(term: string, splitStr: string): string[];
export declare function getSuggestionsSplitByMultiple(term: string, splitStrs: string[]): string[];
export declare function nameSuggestionsForUser(user: UserProfile): string[];
export declare function filterProfilesStartingWithTerm(users: UserProfile[], term: string): UserProfile[];
export declare function filterProfilesMatchingWithTerm(users: UserProfile[], term: string): UserProfile[];
export declare function sortByUsername(a: UserProfile, b: UserProfile): number;
export declare function applyRolesFilters(user: UserProfile, filterRoles: string[], excludeRoles: string[], membership: TeamMembership | ChannelMembership | undefined): boolean;