@microsoft/sp-webpart-base
Version:
SharePoint Framework support for building web parts
66 lines • 2.5 kB
TypeScript
import type { IClientSideWebPartManifestInstance } from '@microsoft/sp-module-interfaces';
import type { _IComponentContextParameters } from '@microsoft/sp-component-base';
import type { SPEvent, SPEventArgs } from '@microsoft/sp-core-library';
import type { _PropertyPaneAction as PropertyPaneAction } from '@microsoft/sp-property-pane';
import type IWebPartHost from '../components/host/IWebPartHost';
import type { WebPartFormFactor } from './WebPartFormFactor';
/**
* Constructor parameters for BaseWebPartContext.
* This base interface represents the parameters for the UI-agnostic BaseWebPart.
*
* @internal
*/
export default interface IBaseWebPartContextParameters extends _IComponentContextParameters {
/**
* Manifest for the client-side web part.
*/
readonly manifest: IClientSideWebPartManifestInstance<any>;
/**
* Web part instance id. This is a globally unique value.
*/
readonly instanceId: string;
/**
* Web part tag to be used for logging and telemetry.
*/
readonly webPartTag: string;
/**
* Is the property pane rendered by a web part and not by Canvas or any other source.
*/
readonly isPropertyPaneRenderedByWebPart: () => boolean;
/**
* Indicates whether the PropertyPane is open or not.
* Also true if Property Pane is rendered by Content Panel.
*
* @param instanceId - optional param to check isopen based on the supported consumer (content panel or property pane).
*/
readonly isPropertyPaneOpen: (instanceId?: string) => boolean;
/**
* Indicates whether the ContentPanel is open or not.
* Returns true if the Content Panel is open, regardless if the Content Panel is rendering the property pane.
*/
readonly isContentPanelOpen: () => boolean;
/**
* Form factor of the web part.
*/
readonly formFactor: WebPartFormFactor;
/**
* Web part host.
* @internal
*/
readonly host: IWebPartHost;
/**
* Web part data updated event.
*
* @eventproperty
* @internal
*/
readonly _dataUpdatedEvent: SPEvent<SPEventArgs>;
/**
* Request property pane to perform the given action.
*
* @privateRemarks
* This is not currently exposed via IWebPartContext.
*/
readonly requestPropertyPaneAction: (id: string, propertyPaneAction?: PropertyPaneAction, renderedByWebPart?: boolean, context?: any) => void;
}
//# sourceMappingURL=IBaseWebPartContextParameters.d.ts.map