>The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import<a name="s56d19203690d4782bfc74069abb6bd71"></a>
<td class="cellrowborder" valign="top" width="67.86%" headers="mcps1.1.3.1.2 "><p id="p229214354254"><a name="p229214354254"></a><a name="p229214354254"></a>Promise used to indicate whether the vibration is triggered successfully.</p>
<td class="cellrowborder" valign="top" width="55.87%" headers="mcps1.1.5.1.4 "><p id="p198631830105015"><a name="p198631830105015"></a><a name="p198631830105015"></a>Callback used to indicate whether the vibration is triggered successfully.</p>
</td>
</tr>
</tbody>
</table>
- Example
- Example
```
```
vibrator.vibrate(1000,function(error){
vibrator.vibrate(1000,function(error){
if(error){
if(error){
...
@@ -128,112 +72,47 @@ Triggers vibration with a specific duration. This method uses a callback to retu
...
@@ -128,112 +72,47 @@ Triggers vibration with a specific duration. This method uses a callback to retu
<td class="cellrowborder" valign="top" width="67.86%" headers="mcps1.1.3.1.2 "><p id="p11853114311918"><a name="p11853114311918"></a><a name="p11853114311918"></a>Promise used to indicate whether the vibration is triggered successfully.</p>
<td class="cellrowborder" valign="top" width="48.17%" headers="mcps1.1.5.1.4 "><p id="p88881930145012"><a name="p88881930145012"></a><a name="p88881930145012"></a>Callback used to indicate whether the vibration is triggered successfully.</p>
Stops the vibration based on the specified **stopMode**. This method uses a promise to return the execution result. If the specified **stopMode** is different from the mode used to trigger the vibration, this method fails to be called.
Stops the vibration based on the specified **stopMode**. This method uses a promise to return the execution result. If the specified **stopMode** is different from the mode used to trigger the vibration, this method fails to be called.
- Parameters
- Parameters
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes| Vibration mode to stop.|
<td class="cellrowborder" valign="top" width="67.86%" headers="mcps1.1.3.1.2 "><p id="p19111047112419"><a name="p19111047112419"></a><a name="p19111047112419"></a>Promise used to indicate whether the vibration is stopped successfully.</p>
Stops the vibration based on the specified **stopMode**. This method uses a callback to return the execution result. If the specified **stopMode** is different from the mode used to trigger the vibration, this method fails to be called.
Stops the vibration based on the specified **stopMode**. This method uses a callback to return the execution result. If the specified **stopMode** is different from the mode used to trigger the vibration, this method fails to be called.
<td class="cellrowborder" valign="top" width="45.85%" headers="mcps1.1.5.1.4 "><p id="p1691013014508"><a name="p1691013014508"></a><a name="p1691013014508"></a>Callback used to indicate whether the vibration is stopped successfully.</p>
<tdclass="cellrowborder"valign="top"width="47.83478347834784%"headers="mcps1.1.4.1.3 "><pid="p198131235115114"><aname="p198131235115114"></a><aname="p198131235115114"></a>Vibration effect of the vibrator when a user adjusts the timer.</p>
<tdclass="cellrowborder"valign="top"width="51.07510751075108%"headers="mcps1.1.4.1.3 "><pid="p10386261671"><aname="p10386261671"></a><aname="p10386261671"></a>Indicates that the vibration to stop is in <strongid="b856012326541"><aname="b856012326541"></a><aname="b856012326541"></a>duration</strong> mode. This vibration is triggered with the parameter <strongid="b1722814576114"><aname="b1722814576114"></a><aname="b1722814576114"></a>duration</strong> of the <strongid="b264554925411"><aname="b264554925411"></a><aname="b264554925411"></a>number</strong> type.</p>
<tdclass="cellrowborder"valign="top"width="51.07510751075108%"headers="mcps1.1.4.1.3 "><pid="p1219354892816"><aname="p1219354892816"></a><aname="p1219354892816"></a>Indicates the vibration to stop is in <strongid="b2716194015546"><aname="b2716194015546"></a><aname="b2716194015546"></a>EffectId</strong> mode. This vibration is triggered with the parameter <strongid="b131201122131212"><aname="b131201122131212"></a><aname="b131201122131212"></a>effectId</strong> of the <strongid="b34910596546"><aname="b34910596546"></a><aname="b34910596546"></a>EffectId</strong> type.</p>
</td>
</tr>
</tbody>
</table>
| Name| Default Value| Description|
| -------- | -------- | -------- |
| VIBRATOR_STOP_MODE_TIME | "time" | The vibration to stop is in **duration** mode. This vibration is triggered with the parameter **duration** of the **number** type.|
| VIBRATOR_STOP_MODE_PRESET | "preset" | The vibration to stop is in **EffectId** mode. This vibration is triggered with the parameter **effectId** of the **EffectId** type.|