Interface
The extension interface for BuilderOperations extension point.
Properties
| Property | Type | Notes |
|---|---|---|
idinherited | string | The unique ID. For widget's provided extension, the id pattern is: widgetId + extensionName |
indexinherited | number | If an extension point supports multiple extensions, the index is used to determine the extension order. |
labelinherited | string | The extension label. |
nameinherited | string | The extension name. |
widgetIdinherited | string | The widget ID that provides the extension. No widget id means the extension is provided by Jimu. |
id
id: stringThe unique ID. For widget's provided extension, the id pattern is: widgetId + extensionName
index
index: numberIf an extension point supports multiple extensions, the index is used to determine the extension order.
widgetId
widgetId: stringThe widget ID that provides the extension. No widget id means the extension is provided by Jimu.
Methods
| Method | Returns | Notes |
|---|---|---|
beforePublish(appConfig) | Promise<string> | Will be invoked before publish app. All extensions must return the updated app config, the updated app config will be used by the next extension. |
beforeSave(appConfig) | Promise<IMAppConfig> | Will be invoked before save app. A widget can use this method to check or update the config before saving the app. All extensions must return the updated app config, the updated app config will be used by the next extension. |
getTranslationKey(appConfig) | Promise<TranslationKey[]> | Will be invoked when opening the multiple language setting panel. All extensions must return the keys that need to be translated. |
beforePublish
beforePublish(appConfig: IMAppConfig): Promise<string>Will be invoked before publish app. All extensions must return the updated app config, the updated app config will be used by the next extension.
Parameters
| Parameter | Type | Notes |
|---|---|---|
app | IMAppConfig | The app config to be published. |
Returns
Promise<string>beforeSave
beforeSave(appConfig: IMAppConfig): Promise<IMAppConfig>Will be invoked before save app. A widget can use this method to check or update the config before saving the app. All extensions must return the updated app config, the updated app config will be used by the next extension.
Parameters
| Parameter | Type | Notes |
|---|---|---|
app | IMAppConfig | The app config to be saved. |
Returns
Promise<IMAppConfig>getTranslationKey
getTranslationKey(appConfig: IMAppConfig): Promise<TranslationKey[]>Will be invoked when opening the multiple language setting panel. All extensions must return the keys that need to be translated.
Parameters
| Parameter | Type |
|---|---|
app | IMAppConfig |
Returns
Promise<TranslationKey[]>