From 3832d4175e3e82875fe513478a30bf7da59381b8 Mon Sep 17 00:00:00 2001 From: cheerful_ricky Date: Fri, 5 Sep 2025 17:41:50 +0800 Subject: [PATCH] add 1500006 invalid userId error code for publishAsUser Signed-off-by: cheerful_ricky --- api/@ohos.commonEventManager.d.ts | 38 ++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/api/@ohos.commonEventManager.d.ts b/api/@ohos.commonEventManager.d.ts index 472432ef21..5676244886 100644 --- a/api/@ohos.commonEventManager.d.ts +++ b/api/@ohos.commonEventManager.d.ts @@ -196,6 +196,23 @@ declare namespace commonEventManager { * @since arkts {'1.1':'20', '1.2':'20'} * @arkts 1.1&1.2 */ + /** + * 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 } callback - The callback of publishAsUser. + * @throws { BusinessError } 202 - not system app + * @throws { BusinessError } 1500003 - The common event sending frequency too high. + * @throws { BusinessError } 1500006 - Invalid userId. + * @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 arkts {'1.1':'21', '1.2':'21'} + * @arkts 1.1&1.2 + */ function publishAsUser(event: string, userId: number, callback: AsyncCallback): void; /** @@ -216,7 +233,7 @@ 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. @@ -234,6 +251,25 @@ declare namespace commonEventManager { * @since arkts {'1.1':'20', '1.2':'20'} * @arkts 1.1&1.2 */ + /** + * 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 } callback - The callback of publishAsUser. + * @throws { BusinessError } 202 - not system app + * @throws { BusinessError } 1500003 - The common event sending frequency too high. + * @throws { BusinessError } 1500006 - Invalid userId. + * @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 arkts {'1.1':'21', '1.2':'21'} + * @arkts 1.1&1.2 + */ function publishAsUser( event: string, userId: number, -- Gitee