17 lines
381 B
Plaintext
17 lines
381 B
Plaintext
import { x_vibrator } from "x_library_s";
|
|
import { BusinessError } from "@kit.BasicServicesKit";
|
|
|
|
/**
|
|
* 震动
|
|
* @param {number} duriation 震动时间单位ms
|
|
*/
|
|
export function vibrator(duriation : number) : boolean {
|
|
try {
|
|
x_vibrator(duriation)
|
|
} catch (err) {
|
|
let e : BusinessError = err as BusinessError;
|
|
console.error(e.message);
|
|
return false;
|
|
}
|
|
return true;
|
|
} |