| onAcquired(callback: (info: { id: number }) => void) | Triggered when a widget is obtained. This API returns the ID of the obtained widget. |
| onError(callback: (info: { errcode: number, msg: string }) => void) | Triggered when an error occurs during component loading.<br>**errcode**: error code.<br>**msg**: error information. |
| onError(callback: (info: { errcode: number, msg: string }) => void) | Triggered when an error occurs during component loading.<br>**errcode**: error code.<br>**msg**: error information.<br>For details, see [Form Error Codes](../errorcodes/errorcode-form.md). |
| onRouter(callback: (info: any) => void) | Triggered when routing occurs for the widget. This API returns information in [routerEvent](../js-service-widget-ui/js-service-widget-syntax-hml.md#event-binding).|
| onUninstall(callback: (info: { id: number }) => void) | Triggered when a widget is uninstalled. This API returns the ID of the uninstalled widget. |