@microsoft/sp-webpart-base
Version:
SharePoint Framework support for building web parts
56 lines • 2.85 kB
TypeScript
/**
* Callback to clear the dom node.
*
* @public
*/
export type ClearDomElementCallback = (domElement: Element) => void;
/**
* Interface to be implemented by a component that should display the loading indicator and
* error messages for a web part.
*
* @public
*/
export default interface IClientSideWebPartStatusRenderer {
/**
* Display a loading spinner.
* @param domElement - the web part container div.
* @param loadingMessage - the message to be displayed when the loading spinner id displayed.
* @param timeout - timeout to render the loading indicator. Default is 1500ms.
* @param clearDomElementCallback - Callback to clear the dom node before rendering the indicator. Standard DOM API will be used after the callback.
*/
displayLoadingIndicator(domElement: Element, loadingMessage: string, timeout?: number, clearDomElementCallback?: ClearDomElementCallback): void;
/**
* Clear the loading indicator.
* @param domElement - the web part container div.
*/
clearLoadingIndicator(domElement: Element): void;
/**
* Render the provided error message in the webpart container div.
* @param domElement - the web part container div.
* @param error - the error message.
* @param clearDomElementCallback - Callback to clear the dom node before rendering the error element. Standard DOM API will be used after the callback.
*/
renderError(domElement: HTMLElement, error: Error | string, clearDomElementCallback?: ClearDomElementCallback): void;
/**
* Clear the webpart error message.
* @param domElement - the web part container div.
*/
clearError(domElement: HTMLElement): void;
/**
* Display a loading indicator.
*
* @param domElement - the web part container div.
* @param loadingMessage - the message to be displayed when the loading indicator id displayed.
* @param performanceLogEventName - event identifier used in written telemetry data for first party web
* parts, e.g., 'WebPart.NewsWebPart.8dd9dec2-c6b3-4d4a-819e-2a5431e901f2'.
* @param reservedHeight - reserved height
* @param isInternal - flag to indicate if web part is internal or external.
* @param timeout - (optional) timeout to render the loading indicator. Default is 1500ms.
* @param clearDomElementCallback - (optional) callback to clear the dom element.
* @param useShimmer - (optional) flag to indicate if shimmer should be used.
*
* @internal
*/
_displayLoadingIndicator(domElement: HTMLElement, loadingMessage: string, performanceLogEventName: string, reservedHeight: number | undefined, isInternal?: boolean, timeout?: number, clearDomElementCallback?: ClearDomElementCallback, useShimmer?: boolean): void;
}
//# sourceMappingURL=IClientSideWebPartStatusRenderer.d.ts.map