@microsoft/sp-webpart-base
Version:
SharePoint Framework support for building web parts
74 lines • 2.6 kB
TypeScript
import type * as microsoftTeams from '@microsoft/teams-js-v2';
import type { _IComponentPosition } from '@microsoft/sp-component-base';
import type IClientSideWebPartStatusRenderer from './IClientSideWebPartStatusRenderer';
import type IWebPartContextParameters from './IWebPartContextParameters';
import BaseWebPartContext from './BaseWebPartContext';
import type { ISDKs } from './ISDKs';
import type { PageHostLayoutType } from './IWebPartManagerContext';
/**
* Web part context object. This object contains the contextual services available to a web part. e.g.
* a contextual instance to the http client.
*
* @public
*/
export default class WebPartContext extends BaseWebPartContext {
/**
* @internal
*/
readonly _getPositionOnPage?: () => _IComponentPosition | undefined;
private _domElement;
private _statusRenderer;
private _teams;
private readonly _sdks;
private _widthCacheKey;
private readonly _sdksAsync;
private readonly _pageLayoutType;
/** @internal */
constructor(parameters: IWebPartContextParameters);
/**
* Reference to the DOM element that hosts this client-side component.
*/
get domElement(): HTMLElement;
/**
* {@inheritdoc ISDKs}
*/
get sdks(): ISDKs;
/**
* @internal
* {@inheritdoc ISDKs}
*/
_getSdksAsync(): Promise<ISDKs>;
/**
* Web part status renderer.
*/
get statusRenderer(): IClientSideWebPartStatusRenderer;
/**
* Contextual information about the current Microsoft Teams tab. This object will only be defined if
* a component is being hosted in Microsoft Teams.
*
* @remarks
* For more information, please see:
* {@link https://docs.microsoft.com/en-us/javascript/api/@microsoft/teams-js/?view=msteams-client-js-latest}
* @public
* @deprecated - This function has been deprecated
*/
get microsoftTeams(): typeof microsoftTeams | undefined;
/**
* This functions returns a key generated by web parts display mode, layout index, and section factor.
* It will return undefined if sectionFactor or display mode is undefined, else return the cache key.
*/
get widthCacheKey(): string | undefined;
/**
* Type of layout on which the web part is being rendered.
*
* @internal
*/
_getPageLayoutType(): PageHostLayoutType | string | undefined;
/**
* @deprecated - This function has been deprecated
*
* @internal
*/
_setTeams(teams: typeof microsoftTeams): void;
}
//# sourceMappingURL=WebPartContext.d.ts.map