mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2025-04-17 20:50:34 +00:00
!18471 add new error code
Merge pull request !18471 from CheerfulRicky/work
This commit is contained in:
commit
b116b1da6f
86
api/@ohos.commonEventManager.d.ts
vendored
86
api/@ohos.commonEventManager.d.ts
vendored
@ -83,6 +83,22 @@ declare namespace commonEventManager {
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
/**
|
||||
* Publishes an ordered, sticky, or standard common event.
|
||||
*
|
||||
* @param { string } event - name of the common event.
|
||||
* @param { AsyncCallback<void> } callback - The callback of publish.
|
||||
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
|
||||
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
|
||||
* @throws { BusinessError } 1500003 - The common event sending frequency too high.
|
||||
* @throws { BusinessError } 1500007 - Failed to send the message to the common event service.
|
||||
* @throws { BusinessError } 1500008 - Failed to initialize the common event service.
|
||||
* @throws { BusinessError } 1500009 - Failed to obtain system parameters.
|
||||
* @syscap SystemCapability.Notification.CommonEvent
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 19
|
||||
*/
|
||||
function publish(event: string, callback: AsyncCallback<void>): void;
|
||||
|
||||
/**
|
||||
@ -133,6 +149,24 @@ declare namespace commonEventManager {
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
/**
|
||||
* Publishes an ordered, sticky, or standard common event.
|
||||
*
|
||||
* @param { string } event - name of the common event.
|
||||
* @param { CommonEventPublishData } options - Indicate the CommonEventPublishData containing the common event
|
||||
* content and attributes.
|
||||
* @param { AsyncCallback<void> } callback - The callback of publish.
|
||||
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
|
||||
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
|
||||
* @throws { BusinessError } 1500003 - The common event sending frequency too high.
|
||||
* @throws { BusinessError } 1500007 - Failed to send the message to the common event service.
|
||||
* @throws { BusinessError } 1500008 - Failed to initialize the common event service.
|
||||
* @throws { BusinessError } 1500009 - Failed to obtain system parameters.
|
||||
* @syscap SystemCapability.Notification.CommonEvent
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 19
|
||||
*/
|
||||
function publish(event: string, options: CommonEventPublishData, callback: AsyncCallback<void>): void;
|
||||
|
||||
/**
|
||||
@ -151,6 +185,23 @@ declare namespace commonEventManager {
|
||||
* @systemapi
|
||||
* @since 9
|
||||
*/
|
||||
/**
|
||||
* Publishes an ordered, sticky, or standard common event to a specified user.
|
||||
*
|
||||
* @param { string } event - Specified the names of the common events.
|
||||
* @param { number } userId - Specified the user to receive the common events.
|
||||
* @param { AsyncCallback<void> } callback - The callback of publishAsUser.
|
||||
* @throws { BusinessError } 202 - not system app
|
||||
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
|
||||
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
|
||||
* @throws { BusinessError } 1500003 - The common event sending frequency too high.
|
||||
* @throws { BusinessError } 1500007 - Failed to send the message to the common event service.
|
||||
* @throws { BusinessError } 1500008 - Failed to initialize the common event service.
|
||||
* @throws { BusinessError } 1500009 - Failed to obtain system parameters.
|
||||
* @syscap SystemCapability.Notification.CommonEvent
|
||||
* @systemapi
|
||||
* @since 19
|
||||
*/
|
||||
function publishAsUser(event: string, userId: number, callback: AsyncCallback<void>): void;
|
||||
|
||||
/**
|
||||
@ -170,6 +221,25 @@ declare namespace commonEventManager {
|
||||
* @syscap SystemCapability.Notification.CommonEvent
|
||||
* @systemapi
|
||||
* @since 9
|
||||
*/
|
||||
/**
|
||||
* Publishes an ordered, sticky, or standard common event to a specified user.
|
||||
*
|
||||
* @param { string } event - Specified the names of the common events.
|
||||
* @param { number } userId - Specified the user to receive the common events.
|
||||
* @param { CommonEventPublishData } options - Indicates the CommonEventPublishData containing the common event
|
||||
* content and attributes.
|
||||
* @param { AsyncCallback<void> } callback - The callback of publishAsUser.
|
||||
* @throws { BusinessError } 202 - not system app
|
||||
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
|
||||
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
|
||||
* @throws { BusinessError } 1500003 - The common event sending frequency too high.
|
||||
* @throws { BusinessError } 1500007 - Failed to send the message to the common event service.
|
||||
* @throws { BusinessError } 1500008 - Failed to initialize the common event service.
|
||||
* @throws { BusinessError } 1500009 - Failed to obtain system parameters.
|
||||
* @syscap SystemCapability.Notification.CommonEvent
|
||||
* @systemapi
|
||||
* @since 19
|
||||
*/
|
||||
function publishAsUser(
|
||||
event: string,
|
||||
@ -282,6 +352,22 @@ declare namespace commonEventManager {
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
/**
|
||||
* Subscribe an ordered, sticky, or standard common event.
|
||||
*
|
||||
* @param { CommonEventSubscriber } subscriber - Indicate the subscriber of the common event.
|
||||
* @param { AsyncCallback<CommonEventData> } callback - The callback is used to return the CommonEventData object.
|
||||
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
|
||||
* <br>2. Incorrect parameter types. 3. Parameter verification failed.
|
||||
* @throws { BusinessError } 801 - capability not supported
|
||||
* @throws { BusinessError } 1500007 - Failed to send the message to the common event service.
|
||||
* @throws { BusinessError } 1500008 - Failed to initialize the common event service.
|
||||
* @throws { BusinessError } 1500010 - The count of subscriber exceed system specification.
|
||||
* @syscap SystemCapability.Notification.CommonEvent
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 19
|
||||
*/
|
||||
function subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback<CommonEventData>): void;
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user