import { ITermStore, ITermSet } from './ISPTermStorePickerService'; import { ISPTermStorePickerServiceProps } from './ISPTermStorePickerServiceProps'; import { IPickerTerm } from './IPickerTerm'; import { ApplicationCustomizerContext } from '@microsoft/sp-application-base'; /** * Service implementation to manage term stores in SharePoint */ export default class SPTermStorePickerService { private props; private context; private clientServiceUrl; private suggestionServiceUrl; /** * Service constructor */ constructor(props: ISPTermStorePickerServiceProps, context: ApplicationCustomizerContext); getTermLabels(termId: string): Promise; /** * Gets the collection of term stores in the current SharePoint env */ getTermStores(): Promise; /** * Gets the current term set */ getTermSet(): Promise; /** * Retrieve all terms for the given term set * @param termset */ getAllTerms(termset: string, hideDeprecatedTags?: boolean, hideTagsNotAvailableForTagging?: boolean, useSessionStorage?: boolean): Promise; /** * Retrieve all terms that starts with the searchText * @param searchText */ searchTermsByName(searchText: string): Promise; searchTermsByTermId(searchText: string, termId: string): Promise; /** * Retrieve all terms for the given term set and anchorId */ getAllTermsByAnchorId(termsetNameOrID: string, anchorId: string, hideDeprecatedTags?: boolean, hideTagsNotAvailableForTagging?: boolean, useSessionStorage?: boolean): Promise; /** * Clean the Guid from the Web Service response * @param guid */ cleanGuid(guid: string): string; /** * Get the term set ID by its name * @param termstore * @param termset */ private getTermSetId(termstore, termsetName); private getTermsById(termId, useSessionStorage?); private searchTermsBySearchText(terms, searchText); /** * Searches terms for the given term set * @param searchText * @param termsetId */ private searchTermsByTermSet(searchText); private isGuid(strGuid); /** * Sorting terms based on their path and depth * * @param terms */ private sortTerms(terms); /** * Sort the terms by their path * * @param a term 2 * @param b term 2 */ private sortTermByPath(a, b); private convertTermToPickerTerm(term); private convertSuggestTermToPickerTerm(term); }