@microsoft/sp-webpart-base
Version:
SharePoint Framework support for building web parts
64 lines • 2.21 kB
TypeScript
import { BaseComponentContext } from '@microsoft/sp-component-base';
import { type SPEvent, type SPEventArgs } from '@microsoft/sp-core-library';
import type { IClientSideWebPartManifestInstance } from '@microsoft/sp-module-interfaces';
import type { IPropertyPaneAccessor } from './context/IPropertyPaneAccessor';
import type IBaseWebPartContextParameters from './IBaseWebPartContextParameters';
import type IWebPartHost from '../components/host/IWebPartHost';
import type { WebPartFormFactor } from './WebPartFormFactor';
/**
* Web part context object. This object contains the contextual services available to a web part. e.g.
* a contextual instance to the http client.
*
* This base is to be extended by UI-specific WebPart's base.
*
* @public
*/
export default class BaseWebPartContext extends BaseComponentContext {
/**
* {@inheritDoc @microsoft/sp-component-base#BaseComponentContext.manifest}
*/
readonly manifest: IClientSideWebPartManifestInstance<any>;
private _webPartTag;
private _requestPropertyPaneAction;
private _isPropertyPaneRenderedByWebPart;
private _isPropertyPaneOpen;
private _isContentPanelOpen;
private _host;
private _propertyPaneAccessor;
private _privateDataUpdatedEvent;
private _formFactor;
/** @internal */
constructor(parameters: IBaseWebPartContextParameters);
/**
* Web part tag to be used for logging and telemetry.
*/
get webPartTag(): string;
/**
* Accessor for common web part property pane operations.
*/
get propertyPane(): IPropertyPaneAccessor;
/**
* Form factor of the web part.
*
* @remarks
* Web parts may behave differently based on its form factor.
* E.g. a web part rendering as full size may want to set up different margins that when rendering in a canvas.
*
* @beta
*/
get formFactor(): WebPartFormFactor;
/**
* Web part host.
*
* @internal
*/
get host(): IWebPartHost;
/**
* Web part properties updated event.
*
* @eventproperty
* @internal
*/
get _dataUpdatedEvent(): SPEvent<SPEventArgs>;
}
//# sourceMappingURL=BaseWebPartContext.d.ts.map