IWebPartData interface

This structure represents the serialized state of a web part.

Remarks

When the serialize() API is called on a web part, the output should be this structure. The structure of the 'properties' field is owned by the web part and is specific to the web part. Each web part can decide the set of properties it wants to serialize.

Properties

dataVersion

Web part data version

description

Web part description

dynamicDataPaths

Paths for the dynamic data.

dynamicDataValues

Static values for the dynamic data.This is used to reconstruct the dynamic data objects when deserializing the web part.

id

Universally unique web part Type id.

instanceId

Universally unique instance id of the web part. A web part can have multiple instances on a page. This id is expected to be universally unique across time and page boundaries.

properties

Web part specific properties. The individual web part owns the definition of these properties.

serverProcessedContent

The collections of data that can be processed by server side services like search index and link fixup

title

Web part title

Property Details

dataVersion

Web part data version

dataVersion: string;

Property Value

string

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"

description

Web part description

description?: string;

Property Value

string

Remarks

Used to display the description of the web part.

Supported values: string with the description.

Example: "Text"

dynamicDataPaths

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Paths for the dynamic data.

dynamicDataPaths?: {
        [path: string]: string;
    };

Property Value

{ [path: string]: string; }

Remarks

This is used to reconstruct the dynamic data objects when deserializing the web part. 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'
}

dynamicDataValues

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Static values for the dynamic data.This is used to reconstruct the dynamic data objects when deserializing the web part.

dynamicDataValues?: {
        [path: string]: any;
    };

Property Value

{ [path: string]: any; }

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
}

id

Universally unique web part Type id.

id: string;

Property Value

string

Remarks

Example: "dbef608d-3ad5-4f8f-b139-d916f2f0a294"

instanceId

Universally unique instance id of the web part. A web part can have multiple instances on a page. This id is expected to be universally unique across time and page boundaries.

instanceId: string;

Property Value

string

Remarks

supported values: a unique string. Could be GUID or other uniquely identifiable formats.

example: ["dbef608d-3ad5-4f8f-b139-d916f2f0a294"]

properties

Web part specific properties. The individual web part owns the definition of these properties.

properties?: any;

Property Value

any

Remarks

Used by the web part to manage its internal metadata and config data. The framework code never touches these properties.

Supported values: any object hierarchy that can be serialized using JSON.stringify().

Example: { 'value': 'text value' }

serverProcessedContent

The collections of data that can be processed by server side services like search index and link fixup

serverProcessedContent?: ISerializedServerProcessedData;

Property Value

title

Web part title

title: string;

Property Value

string

Remarks

Used to display the name of the web part in the toolbox, web part gallery and the page.

Supported values: string less than 100 characters

Example: "Text"