1e41f4b71Sopenharmony_ci# @ohos.bundle.overlay (overlay) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **overlay** module provides APIs for installing a [module with the overlay feature](#module-with-the-overlay-feature), querying the [module information](js-apis-bundleManager-overlayModuleInfo.md), and disabling and enabling the module. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## Modules to Import 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci``` ts 12e41f4b71Sopenharmony_ciimport { overlay } from '@kit.AbilityKit'; 13e41f4b71Sopenharmony_ci``` 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci## overlay.setOverlayEnabled 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_cisetOverlayEnabled(moduleName:string, isEnabled: boolean): Promise\<void> 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ciEnables or disables a module with the overlay feature in the current application. This API uses a promise to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned. 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci**Parameters** 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 26e41f4b71Sopenharmony_ci| ----------- | ------ | ---- | --------------------------------------- | 27e41f4b71Sopenharmony_ci| moduleName | string | Yes | Name of the module with the overlay feature. | 28e41f4b71Sopenharmony_ci| isEnabled | boolean | Yes | Whether to enable the module with the overlay feature. The value **true** means to enable the module, and **false** means to disable the module. | 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci**Return value** 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci| Type | Description | 33e41f4b71Sopenharmony_ci| ------------------------- | ------------------ | 34e41f4b71Sopenharmony_ci| Promise\<void> | Promise that returns no value. | 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ci**Error codes** 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 39e41f4b71Sopenharmony_ci 40e41f4b71Sopenharmony_ci| ID | Error Message | 41e41f4b71Sopenharmony_ci| ------ | -------------------------------------- | 42e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 43e41f4b71Sopenharmony_ci| 17700002 | The specified module name is not found. | 44e41f4b71Sopenharmony_ci| 17700033 | The specified module is not an overlay module. | 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci**Example** 47e41f4b71Sopenharmony_ci 48e41f4b71Sopenharmony_ci```ts 49e41f4b71Sopenharmony_ciimport { overlay } from '@kit.AbilityKit'; 50e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_cilet moduleName = "feature"; 53e41f4b71Sopenharmony_cilet isEnabled = false; 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_citry { 56e41f4b71Sopenharmony_ci overlay.setOverlayEnabled(moduleName, isEnabled) 57e41f4b71Sopenharmony_ci .then(() => { 58e41f4b71Sopenharmony_ci console.info('setOverlayEnabled success'); 59e41f4b71Sopenharmony_ci }).catch((err: BusinessError) => { 60e41f4b71Sopenharmony_ci console.info('setOverlayEnabled failed due to err code: ' + err.code + ' ' + 'message:' + err.message); 61e41f4b71Sopenharmony_ci }); 62e41f4b71Sopenharmony_ci} catch (err) { 63e41f4b71Sopenharmony_ci let code = (err as BusinessError).code; 64e41f4b71Sopenharmony_ci let message = (err as BusinessError).message; 65e41f4b71Sopenharmony_ci console.info('setOverlayEnabled failed due to err code: ' + code + ' ' + 'message:' + message); 66e41f4b71Sopenharmony_ci} 67e41f4b71Sopenharmony_ci``` 68e41f4b71Sopenharmony_ci 69e41f4b71Sopenharmony_ci## overlay.setOverlayEnabled 70e41f4b71Sopenharmony_ci 71e41f4b71Sopenharmony_cisetOverlayEnabled(moduleName:string, isEnabled: boolean, callback: AsyncCallback\<void>): void 72e41f4b71Sopenharmony_ci 73e41f4b71Sopenharmony_ciEnables or disables a module with the overlay feature in the current application. This API uses an asynchronous callback to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned. 74e41f4b71Sopenharmony_ci 75e41f4b71Sopenharmony_ci**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay 76e41f4b71Sopenharmony_ci 77e41f4b71Sopenharmony_ci**Parameters** 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 80e41f4b71Sopenharmony_ci| ----------- | ------ | ---- | --------------------------------------- | 81e41f4b71Sopenharmony_ci| moduleName | string | Yes | Name of the module with the overlay feature. | 82e41f4b71Sopenharmony_ci| isEnabled | boolean | Yes | Whether to enable the module with the overlay feature. The value **true** means to enable the module, and **false** means to disable the module.| 83e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **null**; otherwise, **err** is an error object. | 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci**Error codes** 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ci| ID | Error Message | 90e41f4b71Sopenharmony_ci| ------ | -------------------------------------- | 91e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 92e41f4b71Sopenharmony_ci| 17700002 | The specified module name is not found. | 93e41f4b71Sopenharmony_ci| 17700033 | The specified module is not an overlay module. | 94e41f4b71Sopenharmony_ci 95e41f4b71Sopenharmony_ci**Example** 96e41f4b71Sopenharmony_ci 97e41f4b71Sopenharmony_ci```ts 98e41f4b71Sopenharmony_ciimport { overlay } from '@kit.AbilityKit'; 99e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 100e41f4b71Sopenharmony_ci 101e41f4b71Sopenharmony_cilet moduleName = "feature"; 102e41f4b71Sopenharmony_cilet isEnabled = false; 103e41f4b71Sopenharmony_ci 104e41f4b71Sopenharmony_citry { 105e41f4b71Sopenharmony_ci overlay.setOverlayEnabled(moduleName, isEnabled, (err, data) => { 106e41f4b71Sopenharmony_ci if (err) { 107e41f4b71Sopenharmony_ci console.info('setOverlayEnabled failed due to err code: ' + err.code + ' ' + 'message:' + err.message); 108e41f4b71Sopenharmony_ci return; 109e41f4b71Sopenharmony_ci } 110e41f4b71Sopenharmony_ci console.info('setOverlayEnabled success'); 111e41f4b71Sopenharmony_ci }); 112e41f4b71Sopenharmony_ci} catch (err) { 113e41f4b71Sopenharmony_ci let code = (err as BusinessError).code; 114e41f4b71Sopenharmony_ci let message = (err as BusinessError).message; 115e41f4b71Sopenharmony_ci console.info('setOverlayEnabled failed due to err code: ' + code + ' ' + 'message:' + message); 116e41f4b71Sopenharmony_ci} 117e41f4b71Sopenharmony_ci``` 118e41f4b71Sopenharmony_ci 119e41f4b71Sopenharmony_ci## overlay.getOverlayModuleInfo 120e41f4b71Sopenharmony_ci 121e41f4b71Sopenharmony_cigetOverlayModuleInfo(moduleName: string): Promise\<OverlayModuleInfo> 122e41f4b71Sopenharmony_ci 123e41f4b71Sopenharmony_ciObtains the information about a module with the overlay feature in the current application. This API uses a promise to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned. 124e41f4b71Sopenharmony_ci 125e41f4b71Sopenharmony_ci**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay 126e41f4b71Sopenharmony_ci 127e41f4b71Sopenharmony_ci**Parameters** 128e41f4b71Sopenharmony_ci 129e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 130e41f4b71Sopenharmony_ci| ----------- | ------ | ---- | ------------------------------------------ | 131e41f4b71Sopenharmony_ci| moduleName | string | Yes | Name of the module with the overlay feature. | 132e41f4b71Sopenharmony_ci 133e41f4b71Sopenharmony_ci**Return value** 134e41f4b71Sopenharmony_ci 135e41f4b71Sopenharmony_ci| Type | Description | 136e41f4b71Sopenharmony_ci| ------------------------- | ------------------ | 137e41f4b71Sopenharmony_ci| Promise\<[OverlayModuleInfo](js-apis-bundleManager-overlayModuleInfo.md)> | Promise used to return the result, which is an [OverlayModuleInfo](js-apis-bundleManager-overlayModuleInfo.md) object.| 138e41f4b71Sopenharmony_ci 139e41f4b71Sopenharmony_ci**Error codes** 140e41f4b71Sopenharmony_ci 141e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 142e41f4b71Sopenharmony_ci 143e41f4b71Sopenharmony_ci| ID | Error Message | 144e41f4b71Sopenharmony_ci| ------ | -------------------------------------- | 145e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 146e41f4b71Sopenharmony_ci| 17700002 | The specified module name is not found. | 147e41f4b71Sopenharmony_ci| 17700032 | The specified bundle does not contain any overlay module. | 148e41f4b71Sopenharmony_ci| 17700033 | The specified module is not an overlay module. | 149e41f4b71Sopenharmony_ci 150e41f4b71Sopenharmony_ci**Example** 151e41f4b71Sopenharmony_ci 152e41f4b71Sopenharmony_ci```ts 153e41f4b71Sopenharmony_ciimport { overlay } from '@kit.AbilityKit'; 154e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 155e41f4b71Sopenharmony_ci 156e41f4b71Sopenharmony_cilet moduleName = "feature"; 157e41f4b71Sopenharmony_ci 158e41f4b71Sopenharmony_ci(async () => { 159e41f4b71Sopenharmony_ci try { 160e41f4b71Sopenharmony_ci let overlayModuleInfo = await overlay.getOverlayModuleInfo(moduleName); 161e41f4b71Sopenharmony_ci console.log('overlayModuleInfo is ' + JSON.stringify(overlayModuleInfo)); 162e41f4b71Sopenharmony_ci } catch (err) { 163e41f4b71Sopenharmony_ci let code = (err as BusinessError).code; 164e41f4b71Sopenharmony_ci let message = (err as BusinessError).message; 165e41f4b71Sopenharmony_ci console.log('getOverlayModuleInfo failed due to err code : ' + code + ' ' + 'message :' + message); 166e41f4b71Sopenharmony_ci } 167e41f4b71Sopenharmony_ci})(); 168e41f4b71Sopenharmony_ci``` 169e41f4b71Sopenharmony_ci 170e41f4b71Sopenharmony_ci## overlay.getOverlayModuleInfo 171e41f4b71Sopenharmony_ci 172e41f4b71Sopenharmony_cigetOverlayModuleInfo(moduleName: string, callback: AsyncCallback\<OverlayModuleInfo>): void 173e41f4b71Sopenharmony_ci 174e41f4b71Sopenharmony_ciObtains the information about a module with the overlay feature in the current application. This API uses an asynchronous callback to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned. 175e41f4b71Sopenharmony_ci 176e41f4b71Sopenharmony_ci**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay 177e41f4b71Sopenharmony_ci 178e41f4b71Sopenharmony_ci**Parameters** 179e41f4b71Sopenharmony_ci 180e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 181e41f4b71Sopenharmony_ci| ----------- | ------ | ---- | --------------------------------------- | 182e41f4b71Sopenharmony_ci| moduleName | string | Yes | Name of the module with the overlay feature. | 183e41f4b71Sopenharmony_ci| callback | AsyncCallback\<[OverlayModuleInfo](js-apis-bundleManager-overlayModuleInfo.md)> | Yes | Callback used to return the result, which is an [OverlayModuleInfo](js-apis-bundleManager-overlayModuleInfo.md) object. If the operation is successful, **err** is **null**; otherwise, **err** is an error object. | 184e41f4b71Sopenharmony_ci 185e41f4b71Sopenharmony_ci**Error codes** 186e41f4b71Sopenharmony_ci 187e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 188e41f4b71Sopenharmony_ci 189e41f4b71Sopenharmony_ci| ID | Error Message | 190e41f4b71Sopenharmony_ci| ------ | -------------------------------------- | 191e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 192e41f4b71Sopenharmony_ci| 17700002 | The specified module name is not found. | 193e41f4b71Sopenharmony_ci| 17700032 | The specified bundle does not contain any overlay module. | 194e41f4b71Sopenharmony_ci| 17700033 | The specified module is not an overlay module. | 195e41f4b71Sopenharmony_ci 196e41f4b71Sopenharmony_ci**Example** 197e41f4b71Sopenharmony_ci 198e41f4b71Sopenharmony_ci```ts 199e41f4b71Sopenharmony_ciimport { overlay } from '@kit.AbilityKit'; 200e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 201e41f4b71Sopenharmony_ci 202e41f4b71Sopenharmony_cilet moduleName = "feature"; 203e41f4b71Sopenharmony_ci 204e41f4b71Sopenharmony_citry { 205e41f4b71Sopenharmony_ci overlay.getOverlayModuleInfo(moduleName, (err, data) => { 206e41f4b71Sopenharmony_ci if (err) { 207e41f4b71Sopenharmony_ci console.log('getOverlayModuleInfo failed due to err code : ' + err.code + ' ' + 'message :' + err.message); 208e41f4b71Sopenharmony_ci return; 209e41f4b71Sopenharmony_ci } 210e41f4b71Sopenharmony_ci console.log('overlayModuleInfo is ' + JSON.stringify(data)); 211e41f4b71Sopenharmony_ci }); 212e41f4b71Sopenharmony_ci} catch (err) { 213e41f4b71Sopenharmony_ci let code = (err as BusinessError).code; 214e41f4b71Sopenharmony_ci let message = (err as BusinessError).message; 215e41f4b71Sopenharmony_ci console.log('getOverlayModuleInfo failed due to err code : ' + code + ' ' + 'message :' + message); 216e41f4b71Sopenharmony_ci} 217e41f4b71Sopenharmony_ci``` 218e41f4b71Sopenharmony_ci 219e41f4b71Sopenharmony_ci## overlay.getTargetOverlayModuleInfos 220e41f4b71Sopenharmony_ci 221e41f4b71Sopenharmony_cigetTargetOverlayModuleInfos(targetModuleName: string): Promise\<Array\<OverlayModuleInfo>> 222e41f4b71Sopenharmony_ci 223e41f4b71Sopenharmony_ciObtains the information about modules with the overlay feature in the current application based on the target module name. This API uses a promise to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned. 224e41f4b71Sopenharmony_ci 225e41f4b71Sopenharmony_ci**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay 226e41f4b71Sopenharmony_ci 227e41f4b71Sopenharmony_ci**Parameters** 228e41f4b71Sopenharmony_ci 229e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 230e41f4b71Sopenharmony_ci| ----------- | ------ | ---- | --------------------------------------- | 231e41f4b71Sopenharmony_ci| targetModuleName | string | Yes | Name of the target module specified by modules with the overlay feature. | 232e41f4b71Sopenharmony_ci 233e41f4b71Sopenharmony_ci**Return value** 234e41f4b71Sopenharmony_ci 235e41f4b71Sopenharmony_ci| Type | Description | 236e41f4b71Sopenharmony_ci| ------------------------------------------------------------ | ------------------------------------------------------------ | 237e41f4b71Sopenharmony_ci| Promise\<Array\<[OverlayModuleInfo](js-apis-bundleManager-overlayModuleInfo.md)>> | Promise used to return the result, which is an array of [OverlayModuleInfo](js-apis-bundleManager-overlayModuleInfo.md) objects. | 238e41f4b71Sopenharmony_ci 239e41f4b71Sopenharmony_ci**Error codes** 240e41f4b71Sopenharmony_ci 241e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 242e41f4b71Sopenharmony_ci 243e41f4b71Sopenharmony_ci| ID | Error Message | 244e41f4b71Sopenharmony_ci| ------ | -------------------------------------- | 245e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 246e41f4b71Sopenharmony_ci| 17700002 | The specified module name is not found. | 247e41f4b71Sopenharmony_ci| 17700034 | The specified module is an overlay module. | 248e41f4b71Sopenharmony_ci 249e41f4b71Sopenharmony_ci**Example** 250e41f4b71Sopenharmony_ci 251e41f4b71Sopenharmony_ci```ts 252e41f4b71Sopenharmony_ciimport { overlay } from '@kit.AbilityKit'; 253e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 254e41f4b71Sopenharmony_ci 255e41f4b71Sopenharmony_cilet targetModuleName = "feature"; 256e41f4b71Sopenharmony_ci 257e41f4b71Sopenharmony_ci(async () => { 258e41f4b71Sopenharmony_ci try { 259e41f4b71Sopenharmony_ci let overlayModuleInfos = await overlay.getTargetOverlayModuleInfos(targetModuleName); 260e41f4b71Sopenharmony_ci console.log('overlayModuleInfos are ' + JSON.stringify(overlayModuleInfos)); 261e41f4b71Sopenharmony_ci } catch (err) { 262e41f4b71Sopenharmony_ci let code = (err as BusinessError).code; 263e41f4b71Sopenharmony_ci let message = (err as BusinessError).message; 264e41f4b71Sopenharmony_ci console.log('getTargetOverlayModuleInfos failed due to err code : ' + code + ' ' + 'message :' + message); 265e41f4b71Sopenharmony_ci } 266e41f4b71Sopenharmony_ci})(); 267e41f4b71Sopenharmony_ci``` 268e41f4b71Sopenharmony_ci 269e41f4b71Sopenharmony_ci## overlay.getTargetOverlayModuleInfos 270e41f4b71Sopenharmony_ci 271e41f4b71Sopenharmony_cigetTargetOverlayModuleInfos(targetModuleName: string, callback: AsyncCallback\<Array\<OverlayModuleInfo>>): void 272e41f4b71Sopenharmony_ci 273e41f4b71Sopenharmony_ciObtains the information about modules with the overlay feature in the current application based on the target module name. This API uses an asynchronous callback to return the result. If the operation is successful, **null** is returned; otherwise, an error message is returned. 274e41f4b71Sopenharmony_ci 275e41f4b71Sopenharmony_ci**System capability**: SystemCapability.BundleManager.BundleFramework.Overlay 276e41f4b71Sopenharmony_ci 277e41f4b71Sopenharmony_ci**Parameters** 278e41f4b71Sopenharmony_ci 279e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 280e41f4b71Sopenharmony_ci| ----------- | ------ | ---- | --------------------------------------- | 281e41f4b71Sopenharmony_ci| targetModuleName | string | Yes | Name of the target module specified by modules with the overlay feature. | 282e41f4b71Sopenharmony_ci| callback | AsyncCallback\<Array\<[OverlayModuleInfo](js-apis-bundleManager-overlayModuleInfo.md)>> | Yes | Callback used to return the result, which is an array of [OverlayModuleInfo](js-apis-bundleManager-overlayModuleInfo.md) objects. If the operation is successful, **err** is **null**; otherwise, **err** is an error object. | 283e41f4b71Sopenharmony_ci 284e41f4b71Sopenharmony_ci**Error codes** 285e41f4b71Sopenharmony_ci 286e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md). 287e41f4b71Sopenharmony_ci 288e41f4b71Sopenharmony_ci| ID | Error Message | 289e41f4b71Sopenharmony_ci| ------ | -------------------------------------- | 290e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 291e41f4b71Sopenharmony_ci| 17700002 | The specified module name is not found. | 292e41f4b71Sopenharmony_ci| 17700034 | The specified module is an overlay module. | 293e41f4b71Sopenharmony_ci 294e41f4b71Sopenharmony_ci**Example** 295e41f4b71Sopenharmony_ci 296e41f4b71Sopenharmony_ci```ts 297e41f4b71Sopenharmony_ciimport { overlay } from '@kit.AbilityKit'; 298e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 299e41f4b71Sopenharmony_ci 300e41f4b71Sopenharmony_cilet targetModuleName = "feature"; 301e41f4b71Sopenharmony_ci 302e41f4b71Sopenharmony_citry { 303e41f4b71Sopenharmony_ci overlay.getTargetOverlayModuleInfos(targetModuleName, (err, data) => { 304e41f4b71Sopenharmony_ci if (err) { 305e41f4b71Sopenharmony_ci console.log('getTargetOverlayModuleInfos failed due to err code : ' + err.code + ' ' + 'message :' + err.message); 306e41f4b71Sopenharmony_ci return; 307e41f4b71Sopenharmony_ci } 308e41f4b71Sopenharmony_ci console.log('overlayModuleInfo is ' + JSON.stringify(data)); 309e41f4b71Sopenharmony_ci }); 310e41f4b71Sopenharmony_ci} catch (err) { 311e41f4b71Sopenharmony_ci let code = (err as BusinessError).code; 312e41f4b71Sopenharmony_ci let message = (err as BusinessError).message; 313e41f4b71Sopenharmony_ci console.log('getTargetOverlayModuleInfos failed due to err code : ' + code + ' ' + 'message :' + message); 314e41f4b71Sopenharmony_ci} 315e41f4b71Sopenharmony_ci``` 316e41f4b71Sopenharmony_ci 317e41f4b71Sopenharmony_ci## Module with the Overlay Feature 318e41f4b71Sopenharmony_ci 319e41f4b71Sopenharmony_ci**Concept** 320e41f4b71Sopenharmony_ciA module with the overlay feature generally provides additional resource files for modules without the overlay feature on the device, so that the target modules can use these resource files at runtime to display different colors, labels, themes, and the like. The overlay feature applies only to the stage model. 321e41f4b71Sopenharmony_ci 322e41f4b71Sopenharmony_ci**How do I identify a module with the overlay feature?** 323e41f4b71Sopenharmony_ciIf the **module.json5** file of a module contains the **targetModuleName** and **targetPriority fields** during project creation on DevEco Studio, the module is identified as a module with the overlay feature in the installation phase. 324