@sitecore/sc-contenthub-blok
Version:
A UI library for [Sitecore Content Hub](https://doc.sitecore.com/ch/).
22 lines (21 loc) • 973 B
TypeScript
export declare class IconDownloadManager {
constructor();
private static readonly MAX_CONCURRENT_ICON_LOAD;
private static readonly WAIT_TIME;
private readonly loadingIcons;
private readonly domPurify;
private readonly iconHtmlContentCache;
private readonly svgPathByNameCache;
private readonly domParser;
private getSvgPathString;
private getSanitizedIcon;
private wait;
/**
* Loads svg path while making sure that total number of concurrent downloads never exceed MAX_CONCURRENT_ICON_LOAD.
* @param iconName - Name of the icon
* @param baseUrl - if provided, the icons will be fetched from that server
* @param fetchCreator - A function that returns a preconfigured fetch function
*/
getSvgPathCachedAsync(iconName: string, baseUrl: string, fetchCreator: (url: string) => Promise<Response>): Promise<string>;
getReferencedSvgIconAsync(iconName: string, baseUrl: string): Promise<string>;
}