@microsoft/sp-webpart-base
Version:
SharePoint Framework support for building web parts
94 lines • 3.27 kB
TypeScript
/**
*
* When a web part is serialized, some pieces of the serialized data is controlled by the web part code and
* some other pieces are controlled by the framework. This file contains the interface that represents the part of
* the serialized data that is controlled by the web part code.
*/
import type { Version } from '@microsoft/sp-core-library';
import type { ISerializedServerProcessedData } from '@microsoft/sp-component-base';
/**
* This structure represents the part of the serialized state of a web part which is controlled by the web part.
* It is extended by IWebPartData which contains additional data added by the framework to the serialized data.
*
* @public
*/
export interface ISerializedWebPartData {
/**
* Web part data version.
*
* @remarks
* Note that data version is different from the version field in the manifest.
* The manifest version is used to control the versioning of the web part code, while data version is used to
* control the versioning of the serialized data of the web part. Refer to dataVersion field of your web part
* for more information.
*
* Supported values: MAJOR.MINOR
*
* Example: `"1.0"`
*/
dataVersion: Version;
/**
* Web part specific properties. The individual web part owns the definition of these properties.
*
* @remarks
* Used by the web part to manage its internal metadata and config data. The framework code never
* touches these properties.
*
* Supported values: any JSON stringifiable object hierarchy.
*
* Example: `{ 'value': 'text value' }`
*/
properties?: any;
/**
* The collections of data that can be processed by server side services like search index and link fixup.
*/
serverProcessedContent?: ISerializedServerProcessedData;
/**
* Does this webpart currently have a Dynamic Data Source hookup, as a provider or consumer? Used to disable lazy-loading on page load.
* @internal
*/
containsDynamicDataSource?: boolean;
/**
* Paths for the dynamic data. This is used to reconstruct the dynamic data objects when deserializing the web part.
*
* @remarks
* The key is the path within the web part properties, and the value is the dynamic data internal id.
*
* Example:
* ```
* {
* 'pageContextUser':
* 'PageContext:user',
* 'anotherWebPartProperty':
* 'WebPart.c3be45f2-7cd9-4e92-9c6c-a01d24dc04cf.3d6307e4-c8e1-4b2d-bef9-f1689c6eb7ea:aProperty'
* }
* ```
*
* @beta
*/
dynamicDataPaths?: {
[path: string]: string;
};
/**
* Static values for the dynamic data. This is used to reconstruct the dynamic data objects when
* deserializing the web part.
*
* @remarks
* The key is the path within the web part properties, and the value is the dynamic data static value.
*
* Example:
* ```
* {
* 'aStringProperty': 'thisIsAString',
* 'aBooleanProperty': true
* }
* ```
*
* @beta
*/
dynamicDataValues?: {
[path: string]: any;
};
}
export default ISerializedWebPartData;
//# sourceMappingURL=ISerializedWebPartData.d.ts.map