diff --git a/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md b/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md index 499dafec721fd280beee9e9ccfcab76ae895bd14..4c04dd7a835c647889d70dff754d6baf14730efb 100644 --- a/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md +++ b/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md @@ -119,6 +119,25 @@ Subscribes to device connection events. This API uses an asynchronous callback t > This API is deprecated since API version 9. You are advised to use [on](#continuationmanagerondeviceconnect9) instead. +**System capability**: SystemCapability.Ability.DistributedAbilityManager + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | type | string | Yes| Event type. The value is fixed at **deviceConnect**.| + | callback | Callback\<[ContinuationResult](js-apis-continuation-continuationResult.md)> | Yes| Callback invoked when a device is selected from the device list provided by the device selection module. This callback returns the device ID, type, and name.| + +**Example** + + ```js + continuationManager.on("deviceConnect", (data) => { + console.info('onDeviceConnect deviceId: ' + JSON.stringify(data.id)); + console.info('onDeviceConnect deviceType: ' + JSON.stringify(data.type)); + console.info('onDeviceConnect deviceName: ' + JSON.stringify(data.name)); + }); + ``` + ## continuationManager.on("deviceDisconnect")(deprecated) on(type: "deviceDisconnect", callback: Callback\): void; @@ -127,6 +146,23 @@ Subscribes to device disconnection events. This API uses an asynchronous callbac > This API is deprecated since API version 9. You are advised to use [on](#continuationmanagerondevicedisconnect9) instead. +**System capability**: SystemCapability.Ability.DistributedAbilityManager + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | type | string | Yes| Event type. The value is fixed at **deviceDisconnect**.| + | callback | Callback\ | Yes| Callback invoked when a device is disconnected in the device selection module. This callback returns the device ID.| + +**Example** + + ```js + continuationManager.on("deviceDisconnect", (data) => { + console.info('onDeviceDisconnect deviceId: ' + JSON.stringify(data)); + }); + ``` + ## continuationManager.off("deviceConnect")(deprecated) off(type: "deviceConnect", callback?: Callback\): void; @@ -135,6 +171,25 @@ Unsubscribes from device connection events. This API uses an asynchronous callba > This API is deprecated since API version 9. You are advised to use [off](#continuationmanageroffdeviceconnect9) instead. +**System capability**: SystemCapability.Ability.DistributedAbilityManager + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | type | string | Yes| Event type. The value is fixed at **deviceConnect**.| + | callback | Callback\<[ContinuationResult](js-apis-continuation-continuationResult.md)> | No| Callback invoked when a device is selected from the device list provided by the device selection module. This callback returns the device ID, type, and name.| + +**Example** + + ```js + continuationManager.off("deviceConnect", (data) => { + console.info('onDeviceConnect deviceId: ' + JSON.stringify(data.id)); + console.info('onDeviceConnect deviceType: ' + JSON.stringify(data.type)); + console.info('onDeviceConnect deviceName: ' + JSON.stringify(data.name)); + }); + ``` + ## continuationManager.off("deviceDisconnect")(deprecated) off(type: "deviceDisconnect", callback?: Callback\): void; @@ -143,6 +198,23 @@ Unsubscribes from device disconnection events. This API uses an asynchronous cal > This API is deprecated since API version 9. You are advised to use [off](#continuationmanageroffdevicedisconnect9) instead. +**System capability**: SystemCapability.Ability.DistributedAbilityManager + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | type | string | Yes| Event type. The value is fixed at **deviceDisconnect**.| + | callback | Callback\ | No| Callback invoked when a device is disconnected in the device selection module. This callback returns the device ID.| + +**Example** + + ```js + continuationManager.off("deviceDisconnect", (data) => { + console.info('onDeviceDisconnect deviceId: ' + JSON.stringify(data)); + }); + ``` + ## continuationManager.on("deviceConnect")9+ on(type: "deviceConnect", token: number, callback: Callback\>): void;