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

add and update docs

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 4f0e15be
...@@ -88,8 +88,8 @@ ...@@ -88,8 +88,8 @@
- [@ohos.data.distributedData](js-apis-distributed-data.md) - [@ohos.data.distributedData](js-apis-distributed-data.md)
- [@ohos.data.distributedDataObject](js-apis-data-distributedobject.md) - [@ohos.data.distributedDataObject](js-apis-data-distributedobject.md)
- [@ohos.data.rdb](js-apis-data-rdb.md) - [@ohos.data.rdb](js-apis-data-rdb.md)
- [@ohos.data.storage](js-apis-data-storage.md)
- [@ohos.settings](js-apis-settings.md) - [@ohos.settings](js-apis-settings.md)
- [@ohos.data.storage](js-apis-data-storage.md)
- data/rdb/[resultSet](js-apis-data-resultset.md) - data/rdb/[resultSet](js-apis-data-resultset.md)
- File Management - File Management
...@@ -202,6 +202,7 @@ ...@@ -202,6 +202,7 @@
- [@ohos.bytrace](js-apis-bytrace.md) - [@ohos.bytrace](js-apis-bytrace.md)
- [@system.app](js-apis-system-app.md) - [@system.app](js-apis-system-app.md)
- [@system.battery](js-apis-system-battery.md) - [@system.battery](js-apis-system-battery.md)
- [@system.bluetooth](js-apis-system-bluetooth.md)
- [@system.brightness](js-apis-system-brightness.md) - [@system.brightness](js-apis-system-brightness.md)
- [@system.configuration](js-apis-system-configuration.md) - [@system.configuration](js-apis-system-configuration.md)
- [@system.device](js-apis-system-device.md) - [@system.device](js-apis-system-device.md)
...@@ -210,6 +211,7 @@ ...@@ -210,6 +211,7 @@
- [@system.geolocation](js-apis-system-location.md) - [@system.geolocation](js-apis-system-location.md)
- [@system.mediaquery](js-apis-system-mediaquery.md) - [@system.mediaquery](js-apis-system-mediaquery.md)
- [@system.network](js-apis-system-network.md) - [@system.network](js-apis-system-network.md)
- [@system.notification](js-apis-system-notification.md)
- [@system.package](js-apis-system-package.md) - [@system.package](js-apis-system-package.md)
- [@system.prompt](js-apis-system-prompt.md) - [@system.prompt](js-apis-system-prompt.md)
- [@system.request](js-apis-system-request.md) - [@system.request](js-apis-system-request.md)
......
# Notification
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> - The APIs of this module are no longer maintained since API version 7. You are advised to use [`@ohos.notification`](js-apis-notification.md).
>
> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
```
import notification from '@system.notification';
```
## ActionResult
**System capability**: SystemCapability.Notification.Notification
| Name | Readable| Writable| Type | Mandatory| Description |
| ----------- | --- | ---- | ---------------------------------------------- | ---- | ------------------------- |
| bundleName | Yes | Yes | string | Yes | Name of the application bundle to which the notification will be redirected after being clicked. |
| abilityName | Yes | Yes | string | Yes | Name of the application ability to which the notification will be redirected after being clicked.|
| uri | Yes | Yes | string | No | URI of the page to be redirected to. |
## ShowNotificationOptions
**System capability**: SystemCapability.Notification.Notification
| Name | Readable| Writable| Type | Mandatory| Description |
| ------------- | --- | ---- | ---------------------------------------------- | ---- | ------------------------- |
| contentTitle | Yes | Yes | string | No | Notification title. |
| contentText | Yes | Yes | string | No | Notification content. |
| clickAction | Yes | Yes | ActionResult | No | Action triggered when the notification is clicked. |
## notification.show
show(options?: ShowNotificationOptions): void
Displays a notification.
**System capability**: SystemCapability.Notification.Notification
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| options | ShowNotificationOptions | No| Notification title.|
**Example**
```javascript
export default {
show() {
notification.show({
contentTitle: 'title info',
contentText: 'text',
clickAction: {
bundleName: 'com.example.testapp',
abilityName: 'notificationDemo',
uri: '/path/to/notification',
},
});
},
}
;
```
...@@ -53,7 +53,7 @@ Uploads files. ...@@ -53,7 +53,7 @@ Uploads files.
| name | string | Yes | Name&nbsp;of&nbsp;the&nbsp;form&nbsp;element | | name | string | Yes | Name&nbsp;of&nbsp;the&nbsp;form&nbsp;element |
| value | string | Yes | Value&nbsp;of&nbsp;the&nbsp;form&nbsp;element | | value | string | Yes | Value&nbsp;of&nbsp;the&nbsp;form&nbsp;element |
The following values will be returned when the files are successfully uploaded. When the files are successfully uploaded, the following values will be returned.
| Name | Type | Description | | Name | Type | Description |
| -------- | -------- | -------- | | -------- | -------- | -------- |
...@@ -61,6 +61,8 @@ The following values will be returned when the files are successfully uploaded. ...@@ -61,6 +61,8 @@ The following values will be returned when the files are successfully uploaded.
| data | string | Content&nbsp;returned&nbsp;by&nbsp;the&nbsp;server.&nbsp;The&nbsp;value&nbsp;type&nbsp;is&nbsp;determined&nbsp;by&nbsp;the&nbsp;type&nbsp;in&nbsp;the&nbsp;returned&nbsp;headers. | | data | string | Content&nbsp;returned&nbsp;by&nbsp;the&nbsp;server.&nbsp;The&nbsp;value&nbsp;type&nbsp;is&nbsp;determined&nbsp;by&nbsp;the&nbsp;type&nbsp;in&nbsp;the&nbsp;returned&nbsp;headers. |
| headers | Object | Headers&nbsp;returned&nbsp;by&nbsp;the&nbsp;server. | | headers | Object | Headers&nbsp;returned&nbsp;by&nbsp;the&nbsp;server. |
When the files fail to be uploaded, an HTTP status code is returned in **code** of **data**.
**Example** **Example**
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册