mui-spfx-controls
Version:
SPFx component library built with MUI
39 lines • 2.05 kB
TypeScript
import { WebPartContext } from '@microsoft/sp-webpart-base';
import { PrincipalSource, PrincipalType } from '@pnp/sp';
import { IPeoplePickerEntity } from '../components/PeoplePicker/IPeoplePickerProps';
/**
* Service class for interacting with SharePoint People Picker.
*/
declare class PeopleService {
private readonly sp;
/**
* Initializes the PeopleService instance.
* @param {WebPartContext} context - The SharePoint WebPart context.
*/
constructor(context: WebPartContext);
/**
* Restricts unvalidated email addresses from appearing in search results.
* @param {IBasePeoplePickerEntity} user - The user entity to validate.
* @returns {boolean} Returns true if the user is validated, otherwise false.
*/
private restrictUnInvalidated;
/**
* Searches for users in SharePoint based on a query string.
* @param {WebPartContext} context - The SharePoint WebPart context.
* @param {string} query - The search query string.
* @param {number} [maximumSuggestions=25] - The maximum number of suggestions to return.
* @param {PrincipalSource} [principalSource=PrincipalSource.All] - The source from which to retrieve users.
* @param {PrincipalType} [principalType=PrincipalType.All] - The type of principals (users, groups, etc.) to include in the search.
* @returns {Promise<IPeoplePickerEntity[]>} A list of matched people entities.
*/
searchUser(context: WebPartContext, query: string, maximumSuggestions?: number, principalSource?: PrincipalSource, principalType?: PrincipalType): Promise<IPeoplePickerEntity[]>;
/**
* Resolves a single user based on a query string.
* @param {WebPartContext} context - The SharePoint WebPart context.
* @param {string} query - The user query string.
* @returns {Promise<IPeoplePickerEntity>} The resolved user entity.
*/
resolveUser(context: WebPartContext, query: string): Promise<IPeoplePickerEntity>;
}
export { PeopleService };
//# sourceMappingURL=PeopleService.d.ts.map