未验证 提交 2c9fe20b 编写于 作者: O openharmony_ci 提交者: Gitee

!4358 完善misc服务子系统接口完整性和一致性

Merge pull request !4358 from wangdongqi/OpenHarmony-3.1-Release
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
import inputMethod from '@ohos.inputMethod'; import inputMethod from '@ohos.inputMethod';
``` ```
## inputMethod<sup>8+</sup> ## inputMethod<sup>6+</sup>
常量值。 常量值。
...@@ -21,7 +21,7 @@ import inputMethod from '@ohos.inputMethod'; ...@@ -21,7 +21,7 @@ import inputMethod from '@ohos.inputMethod';
| MAX_TYPE_NUM | number | 是 | 否 | 可支持的最大输入法个数。 | | MAX_TYPE_NUM | number | 是 | 否 | 可支持的最大输入法个数。 |
## InputMethodProperty<sup>8+</sup><a name="InputMethodProperty"></a> ## InputMethodProperty<sup>6+</sup><a name="InputMethodProperty"></a>
输入法应用属性。 输入法应用属性。
...@@ -50,7 +50,8 @@ getInputMethodController(): InputMethodController ...@@ -50,7 +50,8 @@ getInputMethodController(): InputMethodController
```js ```js
var InputMethodController = inputMethod.getInputMethodController(); var InputMethodController = inputMethod.getInputMethodController();
``` ```
## inputMethod.getInputMethodSetting<sup>8+</sup><a name="getInputMethodSetting"></a>
## inputMethod.getInputMethodSetting<sup>6+</sup><a name="getInputMethodSetting"></a>
getInputMethodSetting(): InputMethodSetting getInputMethodSetting(): InputMethodSetting
...@@ -60,9 +61,9 @@ getInputMethodSetting(): InputMethodSetting ...@@ -60,9 +61,9 @@ getInputMethodSetting(): InputMethodSetting
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ----------------------------------------- | ---------------------------- | | ----------------------------------------- | ---------------------------- |
| [InputMethodSetting](#InputMethodSetting) | 回调返回当前客户端设置实例。 | | [InputMethodSetting](#InputMethodSetting) | 回调返回当前客户端设置实例。 |
**示例:** **示例:**
...@@ -84,9 +85,9 @@ stopInput(callback: AsyncCallback&lt;boolean&gt;): void ...@@ -84,9 +85,9 @@ stopInput(callback: AsyncCallback&lt;boolean&gt;): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;boolean&gt; | 是 | 返回输入法隐藏是否成功。 | | callback | AsyncCallback&lt;boolean&gt; | 是 | 返回输入法隐藏是否成功。 |
**示例:** **示例:**
...@@ -106,9 +107,9 @@ stopInput(): Promise&lt;boolean&gt; ...@@ -106,9 +107,9 @@ stopInput(): Promise&lt;boolean&gt;
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| Promise&lt;boolean&gt; | 返回输入法隐藏是否成功。 | | Promise&lt;boolean&gt; | 返回输入法隐藏是否成功。 |
**示例:** **示例:**
...@@ -118,7 +119,7 @@ stopInput(): Promise&lt;boolean&gt; ...@@ -118,7 +119,7 @@ stopInput(): Promise&lt;boolean&gt;
console.info('stopInput isSuccess = ' + isSuccess); console.info('stopInput isSuccess = ' + isSuccess);
``` ```
## InputMethodSetting<sup>8+</sup><a name="InputMethodSetting"></a> ## InputMethodSetting<sup>6+</sup><a name="InputMethodSetting"></a>
下列API示例中都需使用[getInputMethodSetting](#getInputMethodSetting)回调获取到InputMethodSetting实例,再通过此实例调用对应方法。 下列API示例中都需使用[getInputMethodSetting](#getInputMethodSetting)回调获取到InputMethodSetting实例,再通过此实例调用对应方法。
...@@ -131,9 +132,9 @@ listInputMethod(callback: AsyncCallback&lt;Array&lt;InputMethodProperty&gt;&gt;) ...@@ -131,9 +132,9 @@ listInputMethod(callback: AsyncCallback&lt;Array&lt;InputMethodProperty&gt;&gt;)
**系统能力**: SystemCapability.Miscservices.InputMethodFramework **系统能力**: SystemCapability.Miscservices.InputMethodFramework
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------------------------------------- | ---- | ---------------------- | | -------- | -------------------------------------------------- | ---- | ---------------------- |
| callback | Array<[InputMethodProperty](#InputMethodProperty)> | 是 | 返回已安装输入法列表。 | | callback | Array<[InputMethodProperty](#InputMethodProperty)> | 是 | 返回已安装输入法列表。 |
**示例:** **示例:**
```js ```js
...@@ -154,9 +155,9 @@ listInputMethod(): Promise&lt;Array&lt;InputMethodProperty&gt;&gt; ...@@ -154,9 +155,9 @@ listInputMethod(): Promise&lt;Array&lt;InputMethodProperty&gt;&gt;
**系统能力**: SystemCapability.Miscservices.InputMethodFramework **系统能力**: SystemCapability.Miscservices.InputMethodFramework
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ----------------------------------------------------------- | ---------------------- | | ----------------------------------------------------------- | ---------------------- |
| Promise<Array<[InputMethodProperty](#InputMethodProperty)>> | 返回已安装输入法列表。 | | Promise<Array<[InputMethodProperty](#InputMethodProperty)>> | 返回已安装输入法列表。 |
**示例:** **示例:**
```js ```js
......
# 设置系统时间 # 设置系统时间
本模块用来设置、获取当前系统时间,设置、获取当前系统日期和设置、获取当前系统时区。 本模块用来设置、获取当前系统时间,设置、获取当前系统日期和设置、获取当前系统时区。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
...@@ -200,7 +201,7 @@ getRealActiveTime(isNano?: boolean): Promise&lt;number&gt; ...@@ -200,7 +201,7 @@ getRealActiveTime(isNano?: boolean): Promise&lt;number&gt;
## systemTime.getRealTime<sup>8+</sup> ## systemTime.getRealTime<sup>8+</sup>
getRealTime(callback: AsyncCallback&lt;number&gt;): void getRealTime(isNano?: boolean, callback: AsyncCallback&lt;number&gt;): void
获取自系统启动以来经过的时间,包括深度睡眠时间,使用callback形式返回结果。 获取自系统启动以来经过的时间,包括深度睡眠时间,使用callback形式返回结果。
...@@ -228,7 +229,7 @@ getRealTime(callback: AsyncCallback&lt;number&gt;): void ...@@ -228,7 +229,7 @@ getRealTime(callback: AsyncCallback&lt;number&gt;): void
## systemTime.getRealTime<sup>8+</sup> ## systemTime.getRealTime<sup>8+</sup>
getRealTime(): Promise&lt;number&gt; getRealTime(isNano?: boolean): Promise&lt;number&gt;
获取自系统启动以来经过的时间,包括深度睡眠时间,使用Promise形式返回结果。 获取自系统启动以来经过的时间,包括深度睡眠时间,使用Promise形式返回结果。
......
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
## setTimeout ## setTimeout
## 导入模块
```
import Time from '@ohos.Time';
```
setTimeout(handler[,delay[,…args]]): number setTimeout(handler[,delay[,…args]]): number
设置一个定时器,该定时器在定时器到期后执行一个函数。 设置一个定时器,该定时器在定时器到期后执行一个函数。
...@@ -20,7 +27,7 @@ setTimeout(handler[,delay[,…args]]): number ...@@ -20,7 +27,7 @@ setTimeout(handler[,delay[,…args]]): number
| number | timeout定时器的ID。 | | number | timeout定时器的ID。 |
- 示例 - 示例
``` ```js
export default { export default {
setTimeOut() { setTimeOut() {
var timeoutID = setTimeout(function() { var timeoutID = setTimeout(function() {
...@@ -43,7 +50,7 @@ clearTimeout(timeoutID: number): void ...@@ -43,7 +50,7 @@ clearTimeout(timeoutID: number): void
| timeoutID | number | 是 | 要取消定时器的ID,&nbsp;是由setTimeout()返回的。 | | timeoutID | number | 是 | 要取消定时器的ID,&nbsp;是由setTimeout()返回的。 |
- 示例 - 示例
``` ```js
export default { export default {
clearTimeOut() { clearTimeOut() {
var timeoutID = setTimeout(function() { var timeoutID = setTimeout(function() {
...@@ -74,7 +81,7 @@ setInterval(handler[, delay[, ...args]]): number ...@@ -74,7 +81,7 @@ setInterval(handler[, delay[, ...args]]): number
| number | intervalID重复定时器的ID。 | | number | intervalID重复定时器的ID。 |
- 示例 - 示例
``` ```js
export default { export default {
setInterval() { setInterval() {
var intervalID = setInterval(function() { var intervalID = setInterval(function() {
...@@ -97,7 +104,7 @@ clearInterval(intervalID: number): void ...@@ -97,7 +104,7 @@ clearInterval(intervalID: number): void
| intervalID | number | 是 | 要取消的重复定时器的ID,是由&nbsp;setInterval()&nbsp;返回的。 | | intervalID | number | 是 | 要取消的重复定时器的ID,是由&nbsp;setInterval()&nbsp;返回的。 |
- 示例 - 示例
``` ```js
export default { export default {
clearInterval() { clearInterval() {
var intervalID = setInterval(function() { var intervalID = setInterval(function() {
...@@ -107,3 +114,4 @@ clearInterval(intervalID: number): void ...@@ -107,3 +114,4 @@ clearInterval(intervalID: number): void
} }
} }
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册