diff --git a/en/application-dev/reference/apis/js-apis-vibrator.md b/en/application-dev/reference/apis/js-apis-vibrator.md
index 8d0c0ad48f1dc919c5032dc1d37ad39026071583..699ab299f5050594fd943c95e36c0538e9d0ec24 100644
--- a/en/application-dev/reference/apis/js-apis-vibrator.md
+++ b/en/application-dev/reference/apis/js-apis-vibrator.md
@@ -13,11 +13,11 @@ The **Vibrator** module provides APIs for triggering or stopping vibration.
import vibrator from '@ohos.vibrator';
```
-## vibrator.vibrate
+## vibrator.startVibration9+
-vibrate(duration: number): Promise<void>
+startVibration(effect: VibrateEffect, attribute: VibrateAttribute, callback: AsyncCallback<void>): void
-Triggers vibration with the specified duration. This API uses a promise to return the result.
+Triggers vibration with the specified effect and attribute. This API uses a promise to return the result.
**Required permissions**: ohos.permission.VIBRATE
@@ -25,29 +25,37 @@ Triggers vibration with the specified duration. This API uses a promise to retur
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------ | ---- | ---------------------- |
-| duration | number | Yes | Vibration duration, in ms.|
-
-**Return value**
-
-| Type | Description |
-| ------------------- | -------------------------------------- |
-| Promise<void> | Promise that returns no value.|
+| Name | Type | Mandatory| Description |
+| --------- | -------------------------------------- | ---- | :--------------------------------------------------------- |
+| effect | [VibrateEffect](#vibrateeffect9) | Yes | Vibration effect. |
+| attribute | [VibrateAttribute](#vibrateattribute9) | Yes | Vibration attribute. |
+| callback | AsyncCallback<void> | Yes | Callback used to the result. If the vibration starts, **err** is **undefined**. Otherwise, **err** is an error object.|
**Example**
- ```js
- vibrator.vibrate(1000).then(()=>{
- console.log("Promise returned to indicate a successful vibration.");
- }, (error)=>{
- console.log("error.code"+error.code+"error.message"+error.message);
- });
- ```
+```js
+try {
+ vibrator.startVibration({
+ type:'time',
+ duration:1000,
+ },{
+ id:0,
+ usage: 'alarm'
+ }, (error)=>{
+ if(error){
+ console.log('vibrate fail, error.code: ' + error.code + 'error.message: ', + error.message);
+ }else{
+ console.log('Callback returned to indicate a successful vibration.');
+ }
+ });
+} catch(err) {
+ console.info('errCode: ' + err.code + ' ,msg: ' + err.message);
+}
+```
-## vibrator.vibrate9+
+## vibrator.startVibration9+
-vibrate(effect: VibrateEffect, attribute: VibrateAttribute): Promise<void>
+startVibration(effect: VibrateEffect, attribute: VibrateAttribute): Promise<void>
Triggers vibration with the specified effect and attribute. This API uses a promise to return the result.
@@ -58,7 +66,7 @@ Triggers vibration with the specified effect and attribute. This API uses a prom
**Parameters**
| Name | Type | Mandatory| Description |
-| --------- | -------------------------------------- | ---- | :------------- |
+| --------- | -------------------------------------- | ---- | -------------- |
| effect | [VibrateEffect](#vibrateeffect9) | Yes | Vibration effect.|
| attribute | [VibrateAttribute](#vibrateattribute9) | Yes | Vibration attribute.|
@@ -70,146 +78,60 @@ Triggers vibration with the specified effect and attribute. This API uses a prom
**Example**
-```js
-vibrator.vibrate({
+ ```js
+try {
+ vibrator.startVibration({
type: 'time',
duration: 1000
-}, {
- id: 0,
- usage: 'alarm'
-}).then(()=>{
- console.log("Promise returned to indicate a successful vibration");
-}).catch((error)=>{
- console.log("error.code" + error.code + "error.message" + error.message);
-})
-```
-
-## vibrator.vibrate
-
-vibrate(duration: number, callback?: AsyncCallback<void>): void
-
-Triggers vibration with the specified duration. This API uses an asynchronous callback to return the result.
-
-**Required permissions**: ohos.permission.VIBRATE
-
-**System capability**: SystemCapability.Sensors.MiscDevice
-
-**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------- | ---- | ---------------------------------------------------------- |
-| duration | number | Yes | Vibration duration, in ms. |
-| callback | AsyncCallback<void> | No | Callback used to the result. If the vibration starts, **err** is **undefined**. Otherwise, **err** is an error object.|
-
-**Example**
-
- ```js
- vibrator.vibrate(1000,function(error){
- if(error){
- console.log("error.code" + error.code + "error.message" + error.message);
- }else{
- console.log("Callback returned to indicate a successful vibration.");
- }
- })
+ }, {
+ id: 0,
+ usage: 'alarm'
+ }).then(()=>{
+ console.log('Promise returned to indicate a successful vibration');
+ }).catch((error)=>{
+ console.log('error.code' + error.code + 'error.message' + error.message);
+ })
+} catch(err) {
+ console.info('errCode: ' + err.code + ' ,msg: ' + err.message);
+}
```
+## vibrator.stopVibration9+
-## vibrator.vibrate
+stopVibration(stopMode: VibratorStopMode, callback: AsyncCallback<void>): void
-vibrate(effectId: EffectId): Promise<void>
-
-Triggers vibration with the specified effect. This API uses a promise to return the result.
+Stops the vibration with the specified **stopMode**. This API uses a promise to return the result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called.
**Required permissions**: ohos.permission.VIBRATE
**System capability**: SystemCapability.Sensors.MiscDevice
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | --------------------- | ---- | ------------------ |
-| effectId | [EffectId](#effectid) | Yes | Preset vibration effect ID.|
-**Return value**
-| Type | Description |
-| ------------------- | -------------------------------------- |
-| Promise<void> | Promise that returns no value.|
-
-**Example**
- ```js
- vibrator.vibrate(vibrator.EffectId.EFFECT_CLOCK_TIMER).then(()=>{
- console.log("Promise returned to indicate a successful vibration.");
- }, (error)=>{
- console.log("error.code" + error.code + "error.message" + error.message);
- });
- ```
-
-
-## vibrator.vibrate
-
-vibrate(effectId: EffectId, callback?: AsyncCallback<void>): void
-
-Triggers vibration with the specified effect. This API uses an asynchronous callback to return the result.
-
-**Required permissions**: ohos.permission.VIBRATE
-
-**System capability**: SystemCapability.Sensors.MiscDevice
-
-**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------- | ---- | ---------------------------------------------------------- |
-| effectId | [EffectId](#effectid) | Yes | Preset vibration effect ID. |
-| callback | AsyncCallback<void> | No | Callback used to the result. If the vibration starts, **err** is **undefined**. Otherwise, **err** is an error object.|
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------- | ---- | ------------------------------------------------------------ |
+| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Mode to stop the vibration. |
+| callback | AsyncCallback<void> | Yes | Callback used to the result. If the vibration stops, **err** is **undefined**. Otherwise, **err** is an error object.|
**Example**
```js
- vibrator.vibrate(vibrator.EffectId.EFFECT_CLOCK_TIMER, function(error){
- if(error){
- console.log("error.code" + error.code + "error.message" + error.message);
- }else{
- console.log("Callback returned to indicate a successful vibration.");
- }
- })
+try {
+ vibrator.stopVibration(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET, function(error){
+ if(error){
+ console.log('error.code' + error.code + 'error.message' + error.message);
+ }else{
+ console.log('Callback returned to indicate successful.');
+ }
+ })
+} catch(err) {
+ console.info('errCode: ' + err.code + ' ,msg: ' + err.message);
+}
```
-## vibrator.vibrate9+
-
-vibrate(effect: VibrateEffect, attribute: VibrateAttribute, callback: AsyncCallback<void>): void
-
-Triggers vibration with the specified effect and attribute. This API uses an asynchronous callback to return the result.
-
-**Required permissions**: ohos.permission.VIBRATE
+## vibrator.stopVibration9+
-**System capability**: SystemCapability.Sensors.MiscDevice
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| --------- | -------------------------------------- | ---- | :--------------------------------------------------------- |
-| effect | [VibrateEffect](#vibrateeffect9) | Yes | Vibration effect. |
-| attribute | [VibrateAttribute](#vibrateattribute9) | Yes | Vibration attribute. |
-| callback | AsyncCallback<void> | Yes | Callback used to the result. If the vibration starts, **err** is **undefined**. Otherwise, **err** is an error object.|
-
-**Example**
-
-```js
-vibrator.vibrate({
- type:'time',
- duration:1000,
-},{
- id:0,
- usage: 'alarm'
-}, (error)=>{
- if(error){
- console.log("vibrate fail, error.code:" + error.code + ",error.message:" + error.message);
- }else{
- console.log("Callback returned to indicate a successful vibration.");
- }
-});
-```
-
-## vibrator.stop
-
-stop(stopMode: VibratorStopMode): Promise<void>
+stopVibration(stopMode: VibratorStopMode): Promise<void>
Stops the vibration with the specified **stopMode**. This API uses a promise to return the result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called.
@@ -218,6 +140,7 @@ Stops the vibration with the specified **stopMode**. This API uses a promise to
**System capability**: SystemCapability.Sensors.MiscDevice
**Parameters**
+
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ------------------------ |
| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Mode to stop the vibration.|
@@ -231,43 +154,17 @@ Stops the vibration with the specified **stopMode**. This API uses a promise to
**Example**
```js
- vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET).then(()=>{
- console.log("Promise returned to indicate a successful vibration.");
- }, (error)=>{
- console.log("error.code" + error.code + "error.message" + error.message);
- });
- ```
-
-
-## vibrator.stop
-
-stop(stopMode: VibratorStopMode, callback?: AsyncCallback<void>): void;
-
-Stops the vibration with the specified **stopMode**. This API uses an asynchronous callback to return the result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called.
-
-**Required permissions**: ohos.permission.VIBRATE
-
-**System capability**: SystemCapability.Sensors.MiscDevice
-
-**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------------------- | ---- | ------------------------------------------------------------ |
-| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Mode to stop the vibration. |
-| callback | AsyncCallback<void> | No | Callback used to the result. If the vibration stops, **err** is **undefined**. Otherwise, **err** is an error object.|
-
-**Example**
-
- ```js
- vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET, function(error){
- if(error){
- console.log("error.code" + error.code + "error.message" + error.message);
- }else{
- console.log("Callback returned to indicate a successful stop.");
- }
- })
+try {
+ vibrator.stopVibration(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET).then(()=>{
+ console.log('Promise returned to indicate a successful vibration.');
+ }, (error)=>{
+ console.log('error.code' + error.code + 'error.message' + error.message);
+ });
+} catch(err) {
+ console.info('errCode: ' + err.code + ' ,msg: ' + err.message);
+}
```
-
## EffectId
Describes the vibration effect ID.
@@ -352,3 +249,201 @@ Enumerates the vibration scenarios.
| media | string | Multimedia vibration scenario. |
| physicalFeedback | string | Physical feedback vibration scenario. |
| simulateReality | string | Simulated reality vibration scenario. |
+
+## vibrator.vibrate(deprecated)
+
+vibrate(duration: number): Promise<void>
+
+Triggers vibration with the specified duration. This API uses a promise to return the result.
+
+This API is deprecated since API version 9. You are advised to use [vibrator.startVibration](#vibratorstartvibration9-1) instead.
+
+**Required permissions**: ohos.permission.VIBRATE
+
+**System capability**: SystemCapability.Sensors.MiscDevice
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------ | ---- | ---------------------- |
+| duration | number | Yes | Vibration duration, in ms.|
+
+**Return value**
+
+| Type | Description |
+| ------------------- | -------------------------------------- |
+| Promise<void> | Promise that returns no value.|
+
+**Example**
+
+ ```js
+vibrator.vibrate(1000).then(()=>{
+ console.log('Promise returned to indicate a successful vibration.');
+}, (error)=>{
+ console.log('error.code' + error.code + 'error.message' + error.message);
+});
+ ```
+
+## vibrator.vibrate(deprecated)
+
+vibrate(duration: number, callback?: AsyncCallback<void>): void
+
+Triggers vibration with the specified duration. This API uses an asynchronous callback to return the result.
+
+This API is deprecated since API version 9. You are advised to use [vibrator.startVibration](#vibratorstartvibration9) instead.
+
+**Required permissions**: ohos.permission.VIBRATE
+
+**System capability**: SystemCapability.Sensors.MiscDevice
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------- | ---- | ---------------------------------------------------------- |
+| duration | number | Yes | Vibration duration, in ms. |
+| callback | AsyncCallback<void> | No | Callback used to the result. If the vibration starts, **err** is **undefined**. Otherwise, **err** is an error object.|
+
+**Example**
+
+ ```js
+vibrator.vibrate(1000,function(error){
+ if(error){
+ console.log('error.code' + error.code + 'error.message' + error.message);
+ }else{
+ console.log('Callback returned to indicate a successful vibration.');
+ }
+})
+ ```
+
+
+## vibrator.vibrate(deprecated)
+
+vibrate(effectId: EffectId): Promise<void>
+
+Triggers vibration with the specified effect. This API uses a promise to return the result.
+
+This API is deprecated since API version 9. You are advised to use [vibrator.startVibration](#vibratorstartvibration9-1) instead.
+
+**Required permissions**: ohos.permission.VIBRATE
+
+**System capability**: SystemCapability.Sensors.MiscDevice
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | --------------------- | ---- | ------------------ |
+| effectId | [EffectId](#effectid) | Yes | Preset vibration effect ID.|
+
+**Return value**
+
+| Type | Description |
+| ------------------- | -------------------------------------- |
+| Promise<void> | Promise that returns no value.|
+
+**Example**
+
+ ```js
+vibrator.vibrate(vibrator.EffectId.EFFECT_CLOCK_TIMER).then(()=>{
+ console.log('Promise returned to indicate a successful vibration.');
+}, (error)=>{
+ console.log('error.code' + error.code + 'error.message' + error.message);
+});
+ ```
+
+
+## vibrator.vibrate(deprecated)
+
+vibrate(effectId: EffectId, callback?: AsyncCallback<void>): void
+
+Triggers vibration with the specified effect. This API uses an asynchronous callback to return the result.
+
+This API is deprecated since API version 9. You are advised to use [vibrator.startVibration](#vibratorstartvibration9) instead.
+
+**Required permissions**: ohos.permission.VIBRATE
+
+**System capability**: SystemCapability.Sensors.MiscDevice
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------- | ---- | ---------------------------------------------------------- |
+| effectId | [EffectId](#effectid) | Yes | Preset vibration effect ID. |
+| callback | AsyncCallback<void> | No | Callback used to the result. If the vibration starts, **err** is **undefined**. Otherwise, **err** is an error object.|
+
+**Example**
+
+ ```js
+vibrator.vibrate(vibrator.EffectId.EFFECT_CLOCK_TIMER, function(error){
+ if(error){
+ console.log('error.code' + error.code + 'error.message' + error.message);
+ }else{
+ console.log('Callback returned to indicate a successful vibration.');
+ }
+})
+ ```
+
+## vibrator.stop(deprecated)
+
+stop(stopMode: VibratorStopMode): Promise<void>
+
+Stops the vibration with the specified **stopMode**. This API uses a promise to return the result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called.
+
+This API is deprecated since API version 9. You are advised to use [vibrator.stopVibration](#vibratorstopvibration9-1) instead.
+
+**Required permissions**: ohos.permission.VIBRATE
+
+**System capability**: SystemCapability.Sensors.MiscDevice
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------- | ---- | ------------------------ |
+| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Mode to stop the vibration.|
+
+**Return value**
+
+| Type | Description |
+| ------------------- | -------------------------------------- |
+| Promise<void> | Promise that returns no value.|
+
+**Example**
+
+ ```js
+vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET).then(()=>{
+ console.log('Promise returned to indicate a successful vibration.');
+}, (error)=>{
+ console.log('error.code' + error.code + 'error.message' + error.message);
+});
+ ```
+
+
+## vibrator.stop(deprecated)
+
+stop(stopMode: VibratorStopMode, callback?: AsyncCallback<void>): void
+
+Stops the vibration with the specified **stopMode**. This API uses a promise to return the result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called.
+
+This API is deprecated since API version 9. You are advised to use [vibrator.stopVibration](#vibratorstopvibration9) instead.
+
+**Required permissions**: ohos.permission.VIBRATE
+
+**System capability**: SystemCapability.Sensors.MiscDevice
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------- | ---- | ------------------------------------------------------------ |
+| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Mode to stop the vibration. |
+| callback | AsyncCallback<void> | No | Callback used to the result. If the vibration stops, **err** is **undefined**. Otherwise, **err** is an error object.|
+
+**Example**
+
+ ```js
+vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET, function(error){
+ if(error){
+ console.log('error.code' + error.code + 'error.message' + error.message);
+ }else{
+ console.log('Callback returned to indicate successful.');
+ }
+})
+ ```