UNPKG

@kwiz/common

Version:

KWIZ common utilities and helpers for M365 platform

72 lines (71 loc) 2.21 kB
import { PrincipalType } from "../../types/sharepoint.types"; export interface iPeoplePickerUserItem { /** LoginName or Id of the principal in the site. */ id: string; /** LoginName of the principal. */ loginName: string; imageUrl: string; imageInitials: string; text: string; secondaryText: string; tertiaryText: string; optionalText: string; } /** * Service implementation to search people in SharePoint */ export declare class SPPeopleSearchService { private context; private cachedLocalUsers; /** * Service constructor */ constructor(context: { siteUrl: any; }); /** * Generate the user photo link using SharePoint user photo endpoint. * * @param value */ generateUserPhotoLink(value: string, size?: "S" | "M"): string; /** * Generate sum of principal types * * PrincipalType controls the type of entities that are returned in the results. * Choices are All - 15, Distribution List - 2 , Security Groups - 4, SharePoint Groups - 8, User - 1. * These values can be combined (example: 13 is security + SP groups + users) * * @param principalTypes */ getSumOfPrincipalTypes(principalTypes: PrincipalType[]): number; /** * Retrieve the specified group * * @param groupName * @param siteUrl */ getGroupId(groupName: string, siteUrl?: string): Promise<number | null>; /** * Search person by its email or login name */ searchPersonByEmailOrLogin(email: string, principalTypes: PrincipalType[], siteUrl?: string, groupId?: number, ensureUser?: boolean): Promise<iPeoplePickerUserItem>; /** * Search All Users from the SharePoint People database */ searchPeople(query: string, maximumSuggestions: number, principalTypes: PrincipalType[], siteUrl?: string, groupId?: number, ensureUser?: boolean): Promise<iPeoplePickerUserItem[]>; /** * Tenant search */ private searchTenant; /** * Retrieves the local user ID * * @param userId */ private ensureUser; /** * Generates Initials from a full name */ private getFullNameInitials; }