Files
Megamenu/lib/services/SPTermStorePickerService.d.ts
Torsten Brendgen 97d2b6b5d2 Update MegaMenu Application Customizer: Version bump to 1.1.0, localization support added, and unnecessary files removed
- Deleted obsolete localization file for English (en-us).
- Updated version number from 1.0.4 to 1.1.0 in manifests.js and manifests.json.
- Added localization support for German (de-de) in a new localization file.
- Removed unnecessary dependencies from manifests.
- Added .gitignore to exclude build artifacts and temporary files.
2026-07-16 22:43:31 +02:00

81 lines
2.8 KiB
TypeScript

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 debug;
private clientServiceUrl;
private suggestionServiceUrl;
/**
* Service constructor
*/
constructor(props: ISPTermStorePickerServiceProps, context: ApplicationCustomizerContext, debug?: boolean);
getTermLabels(termId: string): Promise<string[]>;
/**
* Gets the collection of term stores in the current SharePoint env
*/
getTermStores(): Promise<ITermStore[]>;
/**
* Gets the current term set
*/
getTermSet(): Promise<ITermSet>;
/**
* Retrieve all terms for the given term set
* @param termset
*/
getAllTerms(termset: string, hideDeprecatedTags?: boolean, hideTagsNotAvailableForTagging?: boolean, useSessionStorage?: boolean, cacheMinutes?: number): Promise<ITermSet>;
/**
* Retrieve all terms that starts with the searchText
* @param searchText
*/
searchTermsByName(searchText: string): Promise<IPickerTerm[]>;
searchTermsByTermId(searchText: string, termId: string): Promise<IPickerTerm[]>;
/**
* Retrieve all terms for the given term set and anchorId
*/
getAllTermsByAnchorId(termsetNameOrID: string, anchorId: string, hideDeprecatedTags?: boolean, hideTagsNotAvailableForTagging?: boolean, useSessionStorage?: boolean): Promise<IPickerTerm[]>;
/**
* 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 getCachedTermSet(termId, useSessionStorage?);
private getCachedPickerTerms(termId, useSessionStorage?);
private normalizeCacheMinutes(value);
private ensureSuccessfulResponse(response, operation);
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);
}