提交 fcfa5ea7 编写于 作者: H HelloCrease

update docs

Signed-off-by: NHelloCrease <lian15@huawei.com>
上级 d2211451
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
## 接口说明 ## 接口说明
| 模块 | 接口名 | 描述 | | 模块 | 接口名 | 描述 |
| -------- | -------- | -------- | | ------------- | ---------------------------------------- | ------------------------------- |
| ohos.vibrator | vibrate(duration:&nbsp;number):&nbsp;Promise&lt;void&gt; | 触发马达按照时长振动,Promise型。 | | ohos.vibrator | vibrate(duration:&nbsp;number):&nbsp;Promise&lt;void&gt; | 触发马达按照时长振动,使用Promise异步回调。 |
| ohos.vibrator | vibrate(duration:&nbsp;number,&nbsp;callback?:&nbsp;AsyncCallback&lt;void&gt;):&nbsp;void | 触发马达按照时长振动,Callback型。 | | ohos.vibrator | vibrate(duration:&nbsp;number,&nbsp;callback?:&nbsp;AsyncCallback&lt;void&gt;):&nbsp;void | 触发马达按照时长振动,使用Callback异步回调。 |
| ohos.vibrator | vibrate(effectId:&nbsp;EffectId):&nbsp;Promise&lt;void&gt; | 触发马达按照指定字符串振动,Promise型。 | | ohos.vibrator | vibrate(effectId:&nbsp;EffectId):&nbsp;Promise&lt;void&gt; | 触发马达按照开发者传递效果振动,使用Promise异步回调。 |
| ohos.vibrator | vibrate(effectId:&nbsp;EffectId,&nbsp;callback?:&nbsp;AsyncCallback&lt;void&gt;):&nbsp;void | 触发马达按照指定字符串振动,Callback型。 | | ohos.vibrator | vibrate(effectId:&nbsp;EffectId,&nbsp;callback?:&nbsp;AsyncCallback&lt;void&gt;):&nbsp;void | 触发马达按照开发者传递效果振动,使用Callback异步回调。 |
| ohos.vibrator | stop(stopMode:&nbsp;VibratorStopMode):&nbsp;Promise&lt;void&gt; | 停止振动。 | | ohos.vibrator | stop(stopMode:&nbsp;VibratorStopMode):&nbsp;Promise&lt;void&gt; | 停止振动。 |
| ohos.vibrator | stop(stopMode:&nbsp;VibratorStopMode,&nbsp;callback?:&nbsp;AsyncCallback&lt;void&gt;):&nbsp;void | 停止振动。 | | ohos.vibrator | stop(stopMode:&nbsp;VibratorStopMode,&nbsp;callback?:&nbsp;AsyncCallback&lt;void&gt;):&nbsp;void | 停止振动。 |
......
...@@ -26,7 +26,7 @@ createAppAccountManager(): AppAccountManager ...@@ -26,7 +26,7 @@ createAppAccountManager(): AppAccountManager
**示例:** **示例:**
```js ```js
var appAccountManager = account.createAppAccountManager(); var appAccountManager = account_appAccount.createAppAccountManager();
``` ```
## AppAccountManager ## AppAccountManager
......
# 配置策略 # 配置策略
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > **说明:**
> - 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 >
> - 本模块接口均为系统接口,三方应用不支持调用。 > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
> 本模块接口均为系统接口,三方应用不支持调用。
配置策略提供按预先定义的定制配置层级获取对应定制配置目录和文件路径的能力。 配置策略提供按预先定义的定制配置层级获取对应定制配置目录和文件路径的能力。
## 导入模块 ## 导入模块
``` ```js
import configPolicy from '@ohos.configPolicy'; import configPolicy from '@ohos.configPolicy';
``` ```
...@@ -22,18 +24,18 @@ getOneCfgFile(relPath: string, callback: AsyncCallback&lt;string&gt;): void ...@@ -22,18 +24,18 @@ getOneCfgFile(relPath: string, callback: AsyncCallback&lt;string&gt;): void
**系统能力**:SystemCapability.Customization.ConfigPolicy **系统能力**:SystemCapability.Customization.ConfigPolicy
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | --------------------------- | ---- | --------------------- |
| relPath | string | 是 | 配置文件名 | | relPath | string | 是 | 配置文件名 |
| callback | AsyncCallback&lt;string&gt; | 是 | 异步回调,用于返回最高优先级配置文件的路径 | | callback | AsyncCallback&lt;string&gt; | 是 | 异步回调,用于返回最高优先级配置文件的路径 |
**示例:** **示例:**
``` ```js
configPolicy.getOneCfgFile('config.xml', (error, value) => { configPolicy.getOneCfgFile('config.xml', (error, value) => {
if (error == undefined) { if (error == undefined) {
console.log(value); console.log("value is " + value);
} else { } else {
console.log(error); console.log("error occurs "+ error);
} }
}); });
``` ```
...@@ -48,19 +50,19 @@ getOneCfgFile(relPath: string): Promise&lt;string&gt; ...@@ -48,19 +50,19 @@ getOneCfgFile(relPath: string): Promise&lt;string&gt;
**系统能力**:SystemCapability.Customization.ConfigPolicy **系统能力**:SystemCapability.Customization.ConfigPolicy
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | ------- | ------ | ---- | ----- |
| relPath | string | 是 | 配置文件名 | | relPath | string | 是 | 配置文件名 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | --------------------- | ------------ |
| Promise&lt;string&gt; | 最高优先级配置文件的路径 | | Promise&lt;string&gt; | 最高优先级配置文件的路径 |
**示例:** **示例:**
``` ```js
configPolicy.getOneCfgFile('config.xml').then(value => { configPolicy.getOneCfgFile('config.xml').then(value => {
console.log(value); console.log("value is " + value);
}).catch(error => { }).catch(error => {
console.log("getOneCfgFile promise " + error); console.log("getOneCfgFile promise " + error);
}); });
...@@ -77,18 +79,18 @@ getCfgFiles(relPath: string, callback: AsyncCallback&lt;Array&lt;string&gt;&gt;) ...@@ -77,18 +79,18 @@ getCfgFiles(relPath: string, callback: AsyncCallback&lt;Array&lt;string&gt;&gt;)
**系统能力**:SystemCapability.Customization.ConfigPolicy **系统能力**:SystemCapability.Customization.ConfigPolicy
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ------------- |
| relPath | string | 是 | 配置文件名 | | relPath | string | 是 | 配置文件名 |
| callback | AsyncCallback&lt;Array&lt;string&gt;&gt; | 是 | 异步回调,用于返回文件列表 | | callback | AsyncCallback&lt;Array&lt;string&gt;&gt; | 是 | 异步回调,用于返回文件列表 |
**示例:** **示例:**
``` ```js
configPolicy.getCfgFiles('config.xml', (error, value) => { configPolicy.getCfgFiles('config.xml', (error, value) => {
if (error == undefined) { if (error == undefined) {
console.log(value); console.log("value is " + value);
} else { } else {
console.log(error); console.log("error occurs "+ error);
} }
}); });
``` ```
...@@ -103,19 +105,19 @@ getCfgFiles(relPath: string): Promise&lt;Array&lt;string&gt;&gt; ...@@ -103,19 +105,19 @@ getCfgFiles(relPath: string): Promise&lt;Array&lt;string&gt;&gt;
**系统能力**:SystemCapability.Customization.ConfigPolicy **系统能力**:SystemCapability.Customization.ConfigPolicy
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | ------- | ------ | ---- | ----- |
| relPath | string | 是 | 配置文件名 | | relPath | string | 是 | 配置文件名 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | ---------------------------------- | ---- |
| Promise&lt;Array&lt;string&gt;&gt; | 文件列表 | | Promise&lt;Array&lt;string&gt;&gt; | 文件列表 |
**示例:** **示例:**
``` ```js
configPolicy.getCfgFiles('config.xml').then(value => { configPolicy.getCfgFiles('config.xml').then(value => {
console.log(value); console.log("value is " + value);
}).catch(error => { }).catch(error => {
console.log("getCfgFiles promise " + error); console.log("getCfgFiles promise " + error);
}); });
...@@ -131,17 +133,17 @@ getCfgDirList(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;): void ...@@ -131,17 +133,17 @@ getCfgDirList(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;): void
**系统能力**:SystemCapability.Customization.ConfigPolicy **系统能力**:SystemCapability.Customization.ConfigPolicy
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ----------------- |
| callback | AsyncCallback&lt;Array&lt;string&gt;&gt; | 是 | 异步回调,用于返回配置层级目录列表 | | callback | AsyncCallback&lt;Array&lt;string&gt;&gt; | 是 | 异步回调,用于返回配置层级目录列表 |
**示例:** **示例:**
``` ```js
configPolicy.getCfgDirList((error, value) => { configPolicy.getCfgDirList((error, value) => {
if (error == undefined) { if (error == undefined) {
console.log(value); console.log("value is " + value);
} else { } else {
console.log(error); console.log("error occurs "+ error);
} }
}); });
``` ```
...@@ -156,14 +158,14 @@ getCfgDirList(): Promise&lt;Array&lt;string&gt;&gt; ...@@ -156,14 +158,14 @@ getCfgDirList(): Promise&lt;Array&lt;string&gt;&gt;
**系统能力**:SystemCapability.Customization.ConfigPolicy **系统能力**:SystemCapability.Customization.ConfigPolicy
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | ---------------------------------- | -------- |
| Promise&lt;Array&lt;string&gt;&gt; | 配置层级目录列表 | | Promise&lt;Array&lt;string&gt;&gt; | 配置层级目录列表 |
**示例:** **示例:**
``` ```js
configPolicy.getCfgDirList().then(value => { configPolicy.getCfgDirList().then(value => {
console.log(value); console.log("value is " + value);
}).catch(error => { }).catch(error => {
console.log("getCfgDirList promise " + error); console.log("getCfgDirList promise " + error);
}); });
......
...@@ -4,14 +4,15 @@ ...@@ -4,14 +4,15 @@
输入设备管理模块,用于监听输入设备连接、断开和变化,并查看输入设备相关信息。比如监听鼠标插拔,并获取鼠标的id、name和指针移动速度等信息。 输入设备管理模块,用于监听输入设备连接、断开和变化,并查看输入设备相关信息。比如监听鼠标插拔,并获取鼠标的id、name和指针移动速度等信息。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块 ## 导入模块
``` ```js
import inputDevice from '@ohos.multimodalInput.inputDevice'; import inputDevice from '@ohos.multimodalInput.inputDevice';
``` ```
...@@ -33,7 +34,7 @@ getDeviceIds(callback: AsyncCallback&lt;Array&lt;number&gt;&gt;): void ...@@ -33,7 +34,7 @@ getDeviceIds(callback: AsyncCallback&lt;Array&lt;number&gt;&gt;): void
**示例:** **示例:**
``` ```js
export default { export default {
data: { data: {
deviceIds: Array, deviceIds: Array,
...@@ -65,7 +66,7 @@ function getDeviceIds(): Promise<Array<number>> ...@@ -65,7 +66,7 @@ function getDeviceIds(): Promise<Array<number>>
**示例:** **示例:**
``` ```js
export default { export default {
testGetDeviceIds: function () { testGetDeviceIds: function () {
console.info("InputDeviceJsTest---start---testGetDeviceIds"); console.info("InputDeviceJsTest---start---testGetDeviceIds");
...@@ -100,7 +101,7 @@ getDevice(deviceId: number, callback: AsyncCallback&lt;InputDeviceData&gt;): voi ...@@ -100,7 +101,7 @@ getDevice(deviceId: number, callback: AsyncCallback&lt;InputDeviceData&gt;): voi
**示例:** **示例:**
``` ```js
export default { export default {
InputDeviceData: { InputDeviceData: {
deviceId : 0, deviceId : 0,
...@@ -136,7 +137,7 @@ function getDevice(deviceId: number): Promise<InputDeviceData> ...@@ -136,7 +137,7 @@ function getDevice(deviceId: number): Promise<InputDeviceData>
**示例:** **示例:**
``` ```js
export default { export default {
InputDeviceData: { InputDeviceData: {
deviceId : 0, deviceId : 0,
...@@ -166,7 +167,7 @@ export default { ...@@ -166,7 +167,7 @@ export default {
**系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice **系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice
| 名称 | 参数类型 | 说明 | | 名称 | 参数类型 | 说明 |
| ---------- | -------------------------------------- | ------------------------------------------------------------ | | ---------- | -------------------------------------- | ---------------------------------------- |
| id | number | 输入设备的唯一标识,同一个物理设备反复插拔,其设备id会发生变化。 | | id | number | 输入设备的唯一标识,同一个物理设备反复插拔,其设备id会发生变化。 |
| name | string | 输入设备的名字。 | | name | string | 输入设备的名字。 |
| sources | Array&lt;[SourceType](#sourcetype)&gt; | 输入设备支持的源类型。比如有的键盘上附带触摸板,则此设备有keyboard和touchpad两种输入源。 | | sources | Array&lt;[SourceType](#sourcetype)&gt; | 输入设备支持的源类型。比如有的键盘上附带触摸板,则此设备有keyboard和touchpad两种输入源。 |
......
# 注入按键 # 注入按键
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > **说明:**
> >
> - 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> >
> - 本模块接口均为系统接口,三方应用不支持调用。 > 本模块接口均为系统接口,三方应用不支持调用。
## 导入模块 ## 导入模块
``` ```js
import inputEventClient from '@ohos.multimodalInput.inputEventClient'; import inputEventClient from '@ohos.multimodalInput.inputEventClient';
``` ```
...@@ -27,19 +27,19 @@ injectEvent({KeyEvent: KeyEvent}): void ...@@ -27,19 +27,19 @@ injectEvent({KeyEvent: KeyEvent}): void
**参数:** **参数:**
| 参数 | 类型 | 必填 | 说明 | | 参数 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | --------------------- | ---- | --------- |
| KeyEvent | [KeyEvent](#keyevent) | 是 | 注入按键的描述信息 | | KeyEvent | [KeyEvent](#keyevent) | 是 | 注入按键的描述信息 |
**示例:** **示例:**
``` ```js
let keyEvent = { let keyEvent = {
isPressed: true, isPressed: true,
keyCode: 2, keyCode: 2,
keyDownDuration: 0, keyDownDuration: 0,
isIntercepted: false isIntercepted: false
} }
res = inputEventClient.injectEvent({KeyEvent: keyEvent}); let res = inputEventClient.injectEvent({KeyEvent: keyEvent});
``` ```
...@@ -50,7 +50,7 @@ res = inputEventClient.injectEvent({KeyEvent: keyEvent}); ...@@ -50,7 +50,7 @@ res = inputEventClient.injectEvent({KeyEvent: keyEvent});
**系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputSimulator **系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputSimulator
| 参数 | 类型 | 必填 | 说明 | | 参数 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | --------------- | ------- | ---- | --------- |
| isPressed | boolean | 是 | 按键是否按下 | | isPressed | boolean | 是 | 按键是否按下 |
| keyCode | Number | 是 | 按键键值 | | keyCode | Number | 是 | 按键键值 |
| keyDownDuration | boolean | 是 | 按键按下持续时间 | | keyDownDuration | boolean | 是 | 按键按下持续时间 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册