1
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"x_library_s": "./lib/x_library_s.har"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user