提交 e95cff43 编写于 作者: E ester.zhou

Update docs (21645)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 3276fef7
...@@ -40,7 +40,7 @@ ErrorCallback\<T extends Error = BusinessError> { ...@@ -40,7 +40,7 @@ ErrorCallback\<T extends Error = BusinessError> {
Defines a common callback that carries an error parameter. Defines a common callback that carries an error parameter.
The error parameter is of the [BusinessError](#businesserror) type. The information returned by the callback is of the [BusinessError](#businesserror) type.
**System capability**: SystemCapability.Base **System capability**: SystemCapability.Base
...@@ -68,7 +68,7 @@ The type of the asynchronous return value is defined by the developer. ...@@ -68,7 +68,7 @@ The type of the asynchronous return value is defined by the developer.
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ---- | ------------------------------------------------------------ | ---- | ---------------------------- | | ---- | ------------------------------------------------------------ | ---- | ---------------------------- |
| err | [BusinessError](https://gitee.com/openharmony/docs/pulls/20172/files#businesserror) | Yes | Common error information about the API invoking failure.| | err | [BusinessError](#businesserror) | Yes | Common error information about the API invoking failure.|
| data | T | Yes | Common callback information. | | data | T | Yes | Common callback information. |
## BusinessError ## BusinessError
......
...@@ -22,6 +22,8 @@ Sets the system time. This API uses an asynchronous callback to return the resul ...@@ -22,6 +22,8 @@ Sets the system time. This API uses an asynchronous callback to return the resul
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Required permissions**: ohos.permission.SET_TIME
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -57,6 +59,8 @@ Sets the system time. This API uses a promise to return the result. ...@@ -57,6 +59,8 @@ Sets the system time. This API uses a promise to return the result.
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Required permissions**: ohos.permission.SET_TIME
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
...@@ -158,7 +162,7 @@ Obtains the time elapsed since the Unix epoch. This API uses a promise to return ...@@ -158,7 +162,7 @@ Obtains the time elapsed since the Unix epoch. This API uses a promise to return
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ------------------------- | | ------ | ------- | ---- | ------------------------- |
| isNano | boolean | No | Whether the time to return is in nanoseconds.<br>- **true**: The time to return is in nanoseconds.<br>- **false**: The time to return is in milliseconds.| | isNano | boolean | No | Whether the time to return is in nanoseconds. The default value is **false**.<br>- **true**: The time to return is in nanoseconds.<br>- **false**: The time to return is in milliseconds.|
**Return value** **Return value**
...@@ -253,7 +257,7 @@ Obtains the time elapsed since system startup, excluding the deep sleep time. Th ...@@ -253,7 +257,7 @@ Obtains the time elapsed since system startup, excluding the deep sleep time. Th
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ----------------------------------- | | ------ | ------- | ---- | ----------------------------------- |
| isNano | boolean | No | Whether the time to return is in nanoseconds.<br>- **true**: The time to return is in nanoseconds.<br>- **false**: The time to return is in milliseconds.| | isNano | boolean | No | Whether the time to return is in nanoseconds. The default value is **false**.<br>- **true**: The time to return is in nanoseconds.<br>- **false**: The time to return is in milliseconds.|
**Return value** **Return value**
...@@ -348,7 +352,7 @@ Obtains the time elapsed since system startup, including the deep sleep time. Th ...@@ -348,7 +352,7 @@ Obtains the time elapsed since system startup, including the deep sleep time. Th
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ------------------------------- | | ------ | ------- | ---- | ------------------------------- |
| isNano | boolean | No | Whether the time to return is in nanoseconds.<br>- **true**: The time to return is in nanoseconds.<br>- **false**: The time to return is in milliseconds.| | isNano | boolean | No | Whether the time to return is in nanoseconds. The default value is **false**.<br>- **true**: The time to return is in nanoseconds.<br>- **false**: The time to return is in milliseconds.|
**Return value** **Return value**
...@@ -380,6 +384,8 @@ Sets the system date. This API uses an asynchronous callback to return the resul ...@@ -380,6 +384,8 @@ Sets the system date. This API uses an asynchronous callback to return the resul
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Required permissions**: ohos.permission.SET_TIME
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -414,6 +420,8 @@ Sets the system date. This API uses a promise to return the result. ...@@ -414,6 +420,8 @@ Sets the system date. This API uses a promise to return the result.
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Required permissions**: ohos.permission.SET_TIME
**Parameters** **Parameters**
| Name| Type| Mandatory| Description | | Name| Type| Mandatory| Description |
...@@ -509,6 +517,8 @@ Sets the system time zone. This API uses an asynchronous callback to return the ...@@ -509,6 +517,8 @@ Sets the system time zone. This API uses an asynchronous callback to return the
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Required permissions**: ohos.permission.SET_TIME_ZONE
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -542,6 +552,8 @@ Sets the system time zone. This API uses a promise to return the result. ...@@ -542,6 +552,8 @@ Sets the system time zone. This API uses a promise to return the result.
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Required permissions**: ohos.permission.SET_TIME_ZONE
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
......
...@@ -36,8 +36,8 @@ Defines the initialization options for **createTimer**. ...@@ -36,8 +36,8 @@ Defines the initialization options for **createTimer**.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | --------------------------------------------- | ---- | ------------------------------------------------------------ | | --------- | --------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | number | Yes | Timer type.<br>**1**: CPU time type. (The start time of the timer cannot be later than the current system time.)<br>**2**: wakeup type.<br>**4**: exact type.<br>**8**: idle type (not supported currently).| | type | number | Yes | Timer type.<br>**1**: CPU time type. (The start time of the timer cannot be later than the current system time.)<br>**2**: wakeup type.<br>**4**: exact type.<br>**8**: idle type (not supported currently).|
| repeat | boolean | Yes | Whether the timer is a repeating timer. The value **true** means that the timer is a repeating timer, and **false** means that the timer is a one-shot timer. | | repeat | boolean | Yes | Whether the timer is a repeating timer.<br>The value **true** means that the timer is a repeating timer, and **false** means that the timer is a one-shot timer. |
| interval | number | No | Repeat interval. For a repeating timer, the value must be greater than 5000 ms. For a one-shot timer, the value is **0**.| | interval | number | No | Repeat interval.<br>For a repeating timer, the value must be greater than 5000 ms. For a one-shot timer, the value is **0**.|
| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | No | **WantAgent** object of the notification to be sent when the timer expires. (An application MainAbility can be started, but not a Service ability.)| | wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | No | **WantAgent** object of the notification to be sent when the timer expires. (An application MainAbility can be started, but not a Service ability.)|
| callback | number | Yes | Callback used to return the timer ID. | | callback | number | Yes | Callback used to return the timer ID. |
...@@ -48,8 +48,6 @@ createTimer(options: TimerOptions, callback: AsyncCallback&lt;number&gt;): void ...@@ -48,8 +48,6 @@ createTimer(options: TimerOptions, callback: AsyncCallback&lt;number&gt;): void
Creates a timer. This API uses an asynchronous callback to return the result. Creates a timer. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Parameters** **Parameters**
...@@ -89,7 +87,6 @@ createTimer(options: TimerOptions): Promise&lt;number&gt; ...@@ -89,7 +87,6 @@ createTimer(options: TimerOptions): Promise&lt;number&gt;
Creates a timer. This API uses a promise to return the result. Creates a timer. This API uses a promise to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
...@@ -133,8 +130,6 @@ startTimer(timer: number, triggerTime: number, callback: AsyncCallback&lt;void&g ...@@ -133,8 +130,6 @@ startTimer(timer: number, triggerTime: number, callback: AsyncCallback&lt;void&g
Starts a timer. This API uses an asynchronous callback to return the result. Starts a timer. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Parameters** **Parameters**
...@@ -178,8 +173,6 @@ startTimer(timer: number, triggerTime: number): Promise&lt;void&gt; ...@@ -178,8 +173,6 @@ startTimer(timer: number, triggerTime: number): Promise&lt;void&gt;
Starts a timer. This API uses a promise to return the result. Starts a timer. This API uses a promise to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Parameters** **Parameters**
...@@ -226,8 +219,6 @@ stopTimer(timer: number, callback: AsyncCallback&lt;void&gt;): void ...@@ -226,8 +219,6 @@ stopTimer(timer: number, callback: AsyncCallback&lt;void&gt;): void
Stops a timer. This API uses an asynchronous callback to return the result. Stops a timer. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Parameters** **Parameters**
...@@ -271,8 +262,6 @@ stopTimer(timer: number): Promise&lt;void&gt; ...@@ -271,8 +262,6 @@ stopTimer(timer: number): Promise&lt;void&gt;
Stops a timer. This API uses a promise to return the result. Stops a timer. This API uses a promise to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Parameters** **Parameters**
...@@ -319,8 +308,6 @@ destroyTimer(timer: number, callback: AsyncCallback&lt;void&gt;): void ...@@ -319,8 +308,6 @@ destroyTimer(timer: number, callback: AsyncCallback&lt;void&gt;): void
Destroys a timer. This API uses an asynchronous callback to return the result. Destroys a timer. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Parameters** **Parameters**
...@@ -365,8 +352,6 @@ destroyTimer(timer: number): Promise&lt;void&gt; ...@@ -365,8 +352,6 @@ destroyTimer(timer: number): Promise&lt;void&gt;
Destroys a timer. This API uses a promise to return the result. Destroys a timer. This API uses a promise to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.MiscServices.Time **System capability**: SystemCapability.MiscServices.Time
**Parameters** **Parameters**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册