Interface
The methods in this class must return the new appConfig.
Properties
Property | Type | Notes |
---|---|---|
(sourceWidgetId: string, sourceAppConfig: IMAppConfig, destWidgetId: string, destAppConfig: IMAppConfig, widgetMap?: { [key: string]: string }) => IMAppConfig | Process the widget's internal config after it is copied if necessary. Only the original widget's extension should get invoked with the new copiedWidgetId. | |
(appConfig: IMAppConfig, dataSourceId: string) => IMAppConfig | If a widget saves the data source id in its internal config, it should override this method to do the clean ups. Only the widgets that save the data source id in it's useDataSources will get invoked. | |
id inherited | string | The unique id. For widget's provided extension, the id pattern is: widgetId + extensionName |
index inherited | number | If an extension point supports multiple extensions, the index is used to determine the extension order. |
(appConfig: IMAppConfig, mapWidgetId: string) => IMAppConfig | If a widget saves some map related data its internal config, it should override this method to do the clean ups. Only the widgets that save the map widget id in it's useMapWidgets will get invoked. | |
name inherited | string | The extension name. |
(appConfig: IMAppConfig, utilityId: string) => IMAppConfig | If a widget saves the utility id in its internal config, it should override this method to do the clean ups. Only the widgets that save the utility id in it's useUtilities will get invoked. | |
widgetId inherited | string | The widget id that provides the extension. No widget id means the extension is provided by Jimu. |
(appConfig: IMAppConfig) => IMAppConfig | Do some cleanup operations before current widget is removed. |
afterWidgetCopied
afterWidgetCopied: (sourceWidgetId: string, sourceAppConfig: IMAppConfig, destWidgetId: string, destAppConfig: IMAppConfig, widgetMap?: { [key: string]: string }) => IMAppConfig
Process the widget's internal config after it is copied if necessary. Only the original widget's extension should get invoked with the new copiedWidgetId.
Type declaration
function(sourceWidgetId: string, sourceAppConfig: IMAppConfig, destWidgetId: string, destAppConfig: IMAppConfig, widgetMap?: { [key: string]: string }): IMAppConfig
Parameters
Parameter | Type | Notes |
---|---|---|
source | string | Id of the widget that is copied. |
source | IMAppConfig | The app config the sourceWidgetId comes from. |
dest | string | Id of the widget that is created in the destAppConfig. |
dest | IMAppConfig | The app config the destWidgetId is created in. |
widget | { [key: string]: string } | The map of widget ids after copying. Only provided when the whole page is duplicated. The key is the widget id in the original page, and the value is the widget id in the copied page. |
Returns
IMAppConfig
dataSourceWillRemove
dataSourceWillRemove: (appConfig: IMAppConfig, dataSourceId: string) => IMAppConfig
If a widget saves the data source id in its internal config, it should override this method to do the clean ups. Only the widgets that save the data source id in it's useDataSources will get invoked.
Type declaration
function(appConfig: IMAppConfig, dataSourceId: string): IMAppConfig
Parameters
Parameter | Type | Notes |
---|---|---|
app | IMAppConfig | The app config. |
data | string | The data source id that is going to be removed. |
Returns
IMAppConfig
id
id: string
The unique id. For widget's provided extension, the id pattern is: widgetId + extensionName
index
index: number
If an extension point supports multiple extensions, the index is used to determine the extension order.
mapWidgetWillRemove
mapWidgetWillRemove: (appConfig: IMAppConfig, mapWidgetId: string) => IMAppConfig
If a widget saves some map related data its internal config, it should override this method to do the clean ups. Only the widgets that save the map widget id in it's useMapWidgets will get invoked.
Type declaration
function(appConfig: IMAppConfig, mapWidgetId: string): IMAppConfig
Parameters
Parameter | Type | Notes |
---|---|---|
app | IMAppConfig | The app config. |
map | string | The map widget id that is going to be removed. |
Returns
IMAppConfig
utilityWillRemove
utilityWillRemove: (appConfig: IMAppConfig, utilityId: string) => IMAppConfig
If a widget saves the utility id in its internal config, it should override this method to do the clean ups. Only the widgets that save the utility id in it's useUtilities will get invoked.
Type declaration
function(appConfig: IMAppConfig, utilityId: string): IMAppConfig
Parameters
Parameter | Type | Notes |
---|---|---|
app | IMAppConfig | The app config. |
utility | string | The utility id that is going to be removed. |
Returns
IMAppConfig
widgetId
widgetId: string
The widget id that provides the extension. No widget id means the extension is provided by Jimu.