未验证 提交 7e3a69d2 编写于 作者: O openharmony_ci 提交者: Gitee

!12228 【仅md格式规范】Fix issues of Notification docs

Merge pull request !12228 from xuzhihao/master
......@@ -183,7 +183,7 @@ publish(event: string, callback: AsyncCallback\<void>): void
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ---------------------- |
| event | string | 是 | 表示要发送的公共事件。 |
| callback | AsyncCallback\<void> | 是 | 表示被指定的回调方法。 |
......@@ -216,7 +216,7 @@ publish(event: string, options: CommonEventPublishData, callback: AsyncCallback\
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---------------------- |
| event | string | 是 | 表示要发布的公共事件。 |
| options | [CommonEventPublishData](#commoneventpublishdata) | 是 | 表示发布公共事件的属性。 |
......@@ -260,7 +260,7 @@ publishAsUser(event: string, userId: number, callback: AsyncCallback\<void>): vo
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ---------------------------------- |
| event | string | 是 | 表示要发送的公共事件。 |
| userId | number | 是 | 表示指定向该用户ID发送此公共事件。 |
......@@ -299,7 +299,7 @@ publishAsUser(event: string, userId: number, options: CommonEventPublishData, ca
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---------------------- |
| event | string | 是 | 表示要发布的公共事件。 |
| userId | number | 是 | 表示指定向该用户ID发送此公共事件。 |
......@@ -344,7 +344,7 @@ createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallbac
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| ------------- | ------------------------------------------------------------ | ---- | -------------------------- |
| subscribeInfo | [CommonEventSubscribeInfo](#commoneventsubscribeinfo) | 是 | 表示订阅信息。 |
| callback | AsyncCallback\<[CommonEventSubscriber](#commoneventsubscriber)> | 是 | 表示创建订阅者的回调方法。 |
......@@ -386,7 +386,7 @@ createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise\<CommonEventS
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| ------------- | ----------------------------------------------------- | ---- | -------------- |
| subscribeInfo | [CommonEventSubscribeInfo](#commoneventsubscribeinfo) | 是 | 表示订阅信息。 |
......@@ -426,7 +426,7 @@ subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback\<CommonEven
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ---------------------------------------------------- | ---- | -------------------------------- |
| subscriber | [CommonEventSubscriber](#commoneventsubscriber) | 是 | 表示订阅者对象。 |
| callback | AsyncCallback\<[CommonEventData](#commoneventdata)> | 是 | 表示接收公共事件数据的回调函数。 |
......@@ -478,7 +478,7 @@ unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback\<void>):
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ----------------------------------------------- | ---- | ------------------------ |
| subscriber | [CommonEventSubscriber](#commoneventsubscriber) | 是 | 表示订阅者对象。 |
| callback | AsyncCallback\<void> | 否 | 表示取消订阅的回调方法。 |
......@@ -542,7 +542,7 @@ getCode(callback: AsyncCallback\<number>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ------------------ |
| callback | AsyncCallback\<number> | 是 | 公共事件的结果代码。 |
......@@ -598,7 +598,7 @@ setCode(code: number, callback: AsyncCallback\<void>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ---------------------- |
| code | number | 是 | 公共事件的结果代码。 |
| callback | AsyncCallback\<void> | 是 | 表示被指定的回调方法。 |
......@@ -629,7 +629,7 @@ setCode(code: number): Promise\<void>
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------------------ |
| code | number | 是 | 公共事件的结果代码。 |
......@@ -661,7 +661,7 @@ getData(callback: AsyncCallback\<string>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | -------------------- |
| callback | AsyncCallback\<string> | 是 | 公共事件的结果数据。 |
......@@ -717,7 +717,7 @@ setData(data: string, callback: AsyncCallback\<void>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | -------------------- |
| data | string | 是 | 公共事件的结果数据。 |
| callback | AsyncCallback\<void> | 是 | 表示被指定的回调方法。 |
......@@ -748,7 +748,7 @@ setData(data: string): Promise\<void>
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | -------------------- |
| data | string | 是 | 公共事件的结果数据。 |
......@@ -780,7 +780,7 @@ setCodeAndData(code: number, data: string, callback:AsyncCallback\<void>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ---------------------- |
| code | number | 是 | 公共事件的结果代码。 |
| data | string | 是 | 公共事件的结果数据。 |
......@@ -812,7 +812,7 @@ setCodeAndData(code: number, data: string): Promise\<void>
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | -------------------- |
| code | number | 是 | 公共事件的结果代码。 |
| data | string | 是 | 公共事件的结果数据。 |
......@@ -847,7 +847,7 @@ isOrderedCommonEvent(callback: AsyncCallback\<boolean>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ---------------------------------- |
| callback | AsyncCallback\<boolean> | 是 | 当前公共事件的是否为有序公共事件。 |
......@@ -907,7 +907,7 @@ isStickyCommonEvent(callback: AsyncCallback\<boolean>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ---------------------------------- |
| callback | AsyncCallback\<boolean> | 是 | 当前公共事件的是否为粘性公共事件。 |
......@@ -965,7 +965,7 @@ abortCommonEvent(callback: AsyncCallback\<void>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | -------------------- |
| callback | AsyncCallback\<void> | 是 | 取消当前的公共事件。 |
......@@ -1021,7 +1021,7 @@ clearAbortCommonEvent(callback: AsyncCallback\<void>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | -------------------- |
| callback | AsyncCallback\<void> | 是 | 表示被指定的回调方法。 |
......@@ -1077,7 +1077,7 @@ getAbortCommonEvent(callback: AsyncCallback\<boolean>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ---------------------------------- |
| callback | AsyncCallback\<boolean> | 是 | 表示当前有序公共事件是否取消的状态。 |
......@@ -1133,7 +1133,7 @@ getSubscribeInfo(callback: AsyncCallback\<CommonEventSubscribeInfo>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ---------------------- |
| callback | AsyncCallback\<[CommonEventSubscribeInfo](#commoneventsubscribeinfo)> | 是 | 表示订阅者的订阅信息。 |
......@@ -1189,7 +1189,7 @@ finishCommonEvent(callback: AsyncCallback\<void\>): void
**参数:**
| 参数名 | 类型 | 必填 | 描述 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | -------------------------------- |
| callback | AsyncCallback\<void> | 是 | 表示有序公共事件结束后的回调函数。 |
......@@ -1241,13 +1241,13 @@ subscriber.finishCommonEvent().then(() => {
**系统能力:** 以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent
| 名称 | 可读 | 可写 | 类型 | 描述 |
| ---------- | ---- | ---- | -------------------- | ------------------------------------------------------- |
| event | 是 | 否 | string | 表示当前接收的公共事件名称。 |
| bundleName | 是 | 否 | string | 表示包名称。 |
| code | 是 | 否 | number | 表示公共事件的结果代码,用于传递int类型的数据。 |
| data | 是 | 否 | string | 表示公共事件的自定义结果数据,用于传递string类型的数据。 |
| parameters | 是 | 否 | {[key: string]: any} | 表示公共事件的附加信息。 |
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ---------- |-------------------- | ---- | ---- | ------------------------------------------------------- |
| event | string | 是 | 否 | 表示当前接收的公共事件名称。 |
| bundleName | string | 是 | 否 | 表示包名称。 |
| code | number | 是 | 否 | 表示公共事件的结果代码,用于传递int类型的数据。 |
| data | string | 是 | 否 | 表示公共事件的自定义结果数据,用于传递string类型的数据。 |
| parameters | {[key: string]: any} | 是 | 否 | 表示公共事件的附加信息。 |
## CommonEventPublishData
......@@ -1256,15 +1256,15 @@ subscriber.finishCommonEvent().then(() => {
**系统能力:** 以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent
| 名称 | 可读 | 可写 | 类型 | 描述 |
| --------------------- | ---- | ---- | -------------------- | ---------------------------- |
| bundleName | 是 | 否 | string | 表示包名称。 |
| code | 是 | 否 | number | 表示公共事件的结果代码。 |
| data | 是 | 否 | string | 表示公共事件的自定义结果数据。 |
| subscriberPermissions | 是 | 否 | Array\<string> | 表示订阅者的权限。 |
| isOrdered | 是 | 否 | boolean | 表示是否是有序事件。 |
| isSticky | 是 | 否 | boolean | 表示是否是粘性事件。仅系统应用或系统服务允许发送粘性事件。 |
| parameters | 是 | 否 | {[key: string]: any} | 表示公共事件的附加信息。 |
| 名称 | 类型 | 可读 | 可写 | 说明 |
| --------------------- | -------------------- | ---- | ---- | ---------------------------- |
| bundleName | string | 是 | 否 | 表示包名称。 |
| code | number | 是 | 否 | 表示公共事件的结果代码。 |
| data | string | 是 | 否 | 表示公共事件的自定义结果数据。 |
| subscriberPermissions | Array\<string> | 是 | 否 | 表示订阅者的权限。 |
| isOrdered | boolean | 是 | 否 | 表示是否是有序事件。 |
| isSticky | boolean | 是 | 否 | 表示是否是粘性事件。仅系统应用或系统服务允许发送粘性事件。 |
| parameters | {[key: string]: any} | 是 | 否 | 表示公共事件的附加信息。 |
## CommonEventSubscribeInfo
......@@ -1272,10 +1272,10 @@ subscriber.finishCommonEvent().then(() => {
**系统能力:** 以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent
| 名称 | 可读 | 可写 | 类型 | 描述 |
| ------------------- | ---- | ---- | -------------- | ------------------------------------------------------------ |
| events | 是 | 否 | Array\<string> | 表示要发送的公共事件。 |
| publisherPermission | 是 | 否 | string | 表示发布者的权限。 |
| publisherDeviceId | 是 | 否 | string | 表示设备ID,该值必须是同一ohos网络上的现有设备ID。 |
| userId | 是 | 否 | number | 表示用户ID。此参数是可选的,默认值当前用户的ID。如果指定了此参数,则该值必须是系统中现有的用户ID。 |
| priority | 是 | 否 | number | 表示订阅者的优先级。值的范围是-100到1000。 |
\ No newline at end of file
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ------------------- | -------------- | ---- | ---- | ------------------------------------------------------------ |
| events | Array\<string> | 是 | 否 | 表示要发送的公共事件。 |
| publisherPermission | string | 是 | 否 | 表示发布者的权限。 |
| publisherDeviceId | string | 是 | 否 | 表示设备ID,该值必须是同一ohos网络上的现有设备ID。 |
| userId | number | 是 | 否 | 表示用户ID。此参数是可选的,默认值当前用户的ID。如果指定了此参数,则该值必须是系统中现有的用户ID。 |
| priority | number | 是 | 否 | 表示订阅者的优先级。值的范围是-100到1000。 |
\ No newline at end of file
......@@ -139,7 +139,7 @@ emitter.emit(innerEvent, eventData);
**系统能力**: 以下各项对应的系统能力均为 SystemCapability.Notification.Emitter
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------- | ------------------------------- | ---- | ---- | ---------------------------------- |
| eventId | number | 是 | 是 | 事件的ID,由开发者定义用来辨别事件。 |
| priority | [EventPriority](#eventpriority) | 是 | 是 | 事件被投递的优先级。 |
......@@ -150,6 +150,6 @@ emitter.emit(innerEvent, eventData);
**系统能力**: 以下各项对应的系统能力均为 SystemCapability.Notification.Emitter
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ---- | ------------------ | ---- | ---- | -------------- |
| data | [key: string]: any | 是 | 是 | 发送事件时传递的数据,数据类型支持字符串、整型和布尔型。 |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册