From de3267c6ccd7491874bb90727cac8e457c4d8b41 Mon Sep 17 00:00:00 2001 From: heguokai Date: Tue, 24 Jun 2025 22:45:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BA=8C=E6=9C=9F=E6=8E=A5=E5=8F=A3ANI=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: heguokai --- api/@ohos.commonEventManager.d.ts | 15 +-- api/@ohos.events.emitter.d.ts | 27 ++--- api/@ohos.notificationManager.d.ts | 36 +++---- api/@ohos.notificationSubscribe.d.ts | 2 +- api/commonEvent/commonEventSubscriber.d.ts | 109 ++++++++++++++------- 5 files changed, 108 insertions(+), 81 deletions(-) diff --git a/api/@ohos.commonEventManager.d.ts b/api/@ohos.commonEventManager.d.ts index 66e983a761..fa9da25b36 100644 --- a/api/@ohos.commonEventManager.d.ts +++ b/api/@ohos.commonEventManager.d.ts @@ -387,8 +387,7 @@ declare namespace commonEventManager { * @throws { BusinessError } 1500008 - Failed to initialize the common event service. * @syscap SystemCapability.Notification.CommonEvent * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function removeStickyCommonEvent(event: string, callback: AsyncCallback): void; @@ -407,8 +406,7 @@ declare namespace commonEventManager { * @throws { BusinessError } 1500008 - Failed to initialize the common event service. * @syscap SystemCapability.Notification.CommonEvent * @systemapi - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function removeStickyCommonEvent(event: string): Promise; @@ -425,8 +423,7 @@ declare namespace commonEventManager { * @syscap SystemCapability.Notification.CommonEvent * @systemapi Hide this for inner system use. * @StageModelOnly - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function setStaticSubscriberState(enable: boolean, callback: AsyncCallback): void; @@ -443,8 +440,7 @@ declare namespace commonEventManager { * @syscap SystemCapability.Notification.CommonEvent * @systemapi Hide this for inner system use. * @StageModelOnly - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function setStaticSubscriberState(enable: boolean): Promise; @@ -462,8 +458,7 @@ declare namespace commonEventManager { * @syscap SystemCapability.Notification.CommonEvent * @systemapi Hide this for inner system use. * @StageModelOnly - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function setStaticSubscriberState(enable: boolean, events?: Array): Promise; diff --git a/api/@ohos.events.emitter.d.ts b/api/@ohos.events.emitter.d.ts index a36debc317..5d709baa99 100644 --- a/api/@ohos.events.emitter.d.ts +++ b/api/@ohos.events.emitter.d.ts @@ -93,8 +93,7 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function on(eventId: string, callback: Callback): void; @@ -106,8 +105,7 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function on(eventId: string, callback: Callback>): void; @@ -152,8 +150,7 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function once(event: InnerEvent, callback: Callback): void; @@ -176,8 +173,7 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function once(eventId: string, callback: Callback): void; @@ -190,8 +186,7 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function once(eventId: string, callback: Callback>): void; @@ -298,8 +293,7 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function off(eventId: string, callback: Callback): void; @@ -311,8 +305,7 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function off(eventId: string, callback: Callback>): void; @@ -376,8 +369,7 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function emit(eventId: string, data?: EventData): void; @@ -389,8 +381,7 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function emit(eventId: string, data?: GenericEventData): void; diff --git a/api/@ohos.notificationManager.d.ts b/api/@ohos.notificationManager.d.ts index 8825a107cf..ade7131e2d 100644 --- a/api/@ohos.notificationManager.d.ts +++ b/api/@ohos.notificationManager.d.ts @@ -783,7 +783,7 @@ declare namespace notificationManager { function addSlot(type: SlotType): Promise; /** - * Creates a notification slot. + * Creates notification slots. * * @permission ohos.permission.NOTIFICATION_CONTROLLER * @param { Array } slots - Indicates the notification slots to be created, which is set by {@link NotificationSlot}. @@ -803,7 +803,7 @@ declare namespace notificationManager { function addSlots(slots: Array, callback: AsyncCallback): void; /** - * Creates a notification slot. + * Creates notification slots. * * @permission ohos.permission.NOTIFICATION_CONTROLLER * @param { Array } slots - Indicates the notification slots to be created, which is set by {@link NotificationSlot}. @@ -1508,7 +1508,8 @@ declare namespace notificationManager { * @throws { BusinessError } 17700001 - The specified bundle name was not found. * @syscap SystemCapability.Notification.Notification * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function getSlotByBundle(bundle: BundleOption, slotType: SlotType): Promise; @@ -1678,7 +1679,8 @@ declare namespace notificationManager { * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. * @throws { BusinessError } 1600003 - Failed to connect to the service. * @syscap SystemCapability.Notification.Notification - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ function getActiveNotificationCount(callback: AsyncCallback): void; @@ -3531,8 +3533,7 @@ declare namespace notificationManager { * * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER * @param { 'checkNotification' } type - Type of the callback to listen for. - * @param { function } [callback] - callback - The callback - * of check notifications. + * @param { function } [callback] - callback - The callback of check notifications. * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. 3. Parameter verification failed. @@ -3911,40 +3912,40 @@ declare namespace notificationManager { function getDoNotDisturbProfile(id: number): Promise; /** - * Disabling notifications based on the application list. + * Set target device status. * * @permission ohos.permission.NOTIFICATION_CONTROLLER - * @param { boolean } disabled - The switch of disableNotification. - * @param { Array } bundleList - The bundles of disableNotification. + * @param { string } deviceType - The device. + * @param { number } status - The device status. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. 3. Parameter verification failed. - * @throws { BusinessError } 1600001 - Internal error. - * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. * @syscap SystemCapability.Notification.Notification * @systemapi * @since 18 */ - function disableNotificationFeature(disabled:boolean, bundleList: Array): Promise; + function setTargetDeviceStatus(deviceType: string, status: number): Promise; /** - * Set target device status. + * Disabling notifications based on the application list. * * @permission ohos.permission.NOTIFICATION_CONTROLLER - * @param { string } deviceType - The device. - * @param { number } status - The device status. + * @param { boolean } disabled - The switch of disableNotification. + * @param { Array } bundleList - The bundles of disableNotification. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 1600001 - Internal error. + * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. * @syscap SystemCapability.Notification.Notification * @systemapi * @since 18 */ - function setTargetDeviceStatus(deviceType: string, status: number): Promise; + function disableNotificationFeature(disabled:boolean, bundleList: Array): Promise; /** * Set notification slot synchronization switch. @@ -4020,7 +4021,8 @@ declare namespace notificationManager { * @type { ?function } * @syscap SystemCapability.Notification.Notification * @systemapi - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ onResponse?: (notificationId: number, buttonOptions: ButtonOptions) => void; } diff --git a/api/@ohos.notificationSubscribe.d.ts b/api/@ohos.notificationSubscribe.d.ts index 5017408536..69134cea00 100644 --- a/api/@ohos.notificationSubscribe.d.ts +++ b/api/@ohos.notificationSubscribe.d.ts @@ -138,7 +138,7 @@ declare namespace notificationSubscribe { * @throws { BusinessError } 1600012 - No memory space. * @syscap SystemCapability.Notification.Notification * @systemapi - * @since 11 + * @since 11 */ function subscribeSelf(subscriber: NotificationSubscriber): Promise; diff --git a/api/commonEvent/commonEventSubscriber.d.ts b/api/commonEvent/commonEventSubscriber.d.ts index 321161fc23..89e27ea03f 100644 --- a/api/commonEvent/commonEventSubscriber.d.ts +++ b/api/commonEvent/commonEventSubscriber.d.ts @@ -22,6 +22,10 @@ import { AsyncCallback } from './../@ohos.base'; import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo'; /*** endif */ +/*** if arkts 1.2 */ +import { AsyncCallback } from './../@ohos.base'; +import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo'; +/*** endif */ /** * the subscriber of common event @@ -57,7 +61,8 @@ export interface CommonEventSubscriber { *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getCode(callback: AsyncCallback): void; @@ -74,7 +79,8 @@ export interface CommonEventSubscriber { * @returns { Promise } Returns code of this common event * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getCode(): Promise; @@ -91,7 +97,8 @@ export interface CommonEventSubscriber { * @returns { number } Returns code of this common event * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getCodeSync(): number; @@ -114,7 +121,8 @@ export interface CommonEventSubscriber { *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ setCode(code: number, callback: AsyncCallback): void; @@ -137,7 +145,8 @@ export interface CommonEventSubscriber { *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ setCode(code: number): Promise; @@ -158,7 +167,8 @@ export interface CommonEventSubscriber { *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ setCodeSync(code: number): void; @@ -179,7 +189,8 @@ export interface CommonEventSubscriber { *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getData(callback: AsyncCallback): void; @@ -196,7 +207,8 @@ export interface CommonEventSubscriber { * @returns { Promise } Returns data of this common event * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getData(): Promise; @@ -213,7 +225,8 @@ export interface CommonEventSubscriber { * @returns { string } Returns data of this common event * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getDataSync(): string; @@ -236,7 +249,8 @@ export interface CommonEventSubscriber { *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ setData(data: string, callback: AsyncCallback): void; @@ -259,7 +273,8 @@ export interface CommonEventSubscriber { *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ setData(data: string): Promise; @@ -280,7 +295,8 @@ export interface CommonEventSubscriber { *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ setDataSync(data: string): void; @@ -305,7 +321,8 @@ export interface CommonEventSubscriber { *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ setCodeAndData(code: number, data: string, callback: AsyncCallback): void; @@ -330,7 +347,8 @@ export interface CommonEventSubscriber { *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ setCodeAndData(code: number, data: string): Promise; @@ -353,7 +371,8 @@ export interface CommonEventSubscriber { *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ setCodeAndDataSync(code: number, data: string): void; @@ -364,7 +383,8 @@ export interface CommonEventSubscriber { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ isOrderedCommonEvent(callback: AsyncCallback): void; @@ -373,7 +393,8 @@ export interface CommonEventSubscriber { * * @returns { Promise } Returns true if this common event is ordered, false otherwise * @syscap SystemCapability.Notification.CommonEvent - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ isOrderedCommonEvent(): Promise; @@ -382,7 +403,8 @@ export interface CommonEventSubscriber { * * @returns { boolean } Returns true if this common event is ordered, false otherwise * @syscap SystemCapability.Notification.CommonEvent - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ isOrderedCommonEventSync(): boolean; @@ -393,7 +415,8 @@ export interface CommonEventSubscriber { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ isStickyCommonEvent(callback: AsyncCallback): void; @@ -402,7 +425,8 @@ export interface CommonEventSubscriber { * * @returns { Promise } Returns true if this common event is sticky, false otherwise * @syscap SystemCapability.Notification.CommonEvent - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ isStickyCommonEvent(): Promise; @@ -411,7 +435,8 @@ export interface CommonEventSubscriber { * * @returns { boolean } Returns true if this common event is sticky, false otherwise * @syscap SystemCapability.Notification.CommonEvent - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ isStickyCommonEventSync(): boolean; @@ -422,7 +447,8 @@ export interface CommonEventSubscriber { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ abortCommonEvent(callback: AsyncCallback): void; @@ -431,7 +457,8 @@ export interface CommonEventSubscriber { * * @returns { Promise } The promise returned by the function. * @syscap SystemCapability.Notification.CommonEvent - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ abortCommonEvent(): Promise; @@ -439,7 +466,8 @@ export interface CommonEventSubscriber { * Abort the current ordered common event. * * @syscap SystemCapability.Notification.CommonEvent - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ abortCommonEventSync(): void; @@ -450,7 +478,8 @@ export interface CommonEventSubscriber { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ clearAbortCommonEvent(callback: AsyncCallback): void; @@ -459,7 +488,8 @@ export interface CommonEventSubscriber { * * @returns { Promise } The promise returned by the function. * @syscap SystemCapability.Notification.CommonEvent - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ clearAbortCommonEvent(): Promise; @@ -467,7 +497,8 @@ export interface CommonEventSubscriber { * Clears the abort state of the current ordered common event * * @syscap SystemCapability.Notification.CommonEvent - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ clearAbortCommonEventSync(): void; @@ -478,7 +509,8 @@ export interface CommonEventSubscriber { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ getAbortCommonEvent(callback: AsyncCallback): void; @@ -487,7 +519,8 @@ export interface CommonEventSubscriber { * * @returns { Promise } Returns true if this common event is aborted, false otherwise * @syscap SystemCapability.Notification.CommonEvent - * @since 7 + * @since arkts {'1.1':'7', '1.2':'20'} + * @arkts 1.1&1.2 */ getAbortCommonEvent(): Promise; @@ -496,7 +529,8 @@ export interface CommonEventSubscriber { * * @returns { boolean } Returns true if this common event is aborted, false otherwise * @syscap SystemCapability.Notification.CommonEvent - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ getAbortCommonEventSync(): boolean; @@ -518,7 +552,8 @@ export interface CommonEventSubscriber { * @syscap SystemCapability.Notification.CommonEvent * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getSubscribeInfo(callback: AsyncCallback): void; @@ -536,7 +571,8 @@ export interface CommonEventSubscriber { * @syscap SystemCapability.Notification.CommonEvent * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getSubscribeInfo(): Promise; @@ -553,7 +589,8 @@ export interface CommonEventSubscriber { * @returns { CommonEventSubscribeInfo } Returns the commonEvent subscribe information * @syscap SystemCapability.Notification.CommonEvent * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getSubscribeInfoSync(): CommonEventSubscribeInfo; @@ -564,7 +601,8 @@ export interface CommonEventSubscriber { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. 3. Parameter verification failed. * @syscap SystemCapability.Notification.CommonEvent - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ finishCommonEvent(callback: AsyncCallback): void; @@ -573,7 +611,8 @@ export interface CommonEventSubscriber { * * @returns { Promise } The promise returned by the function. * @syscap SystemCapability.Notification.CommonEvent - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ finishCommonEvent(): Promise; } -- Gitee From 6ae03894f5d96b83873fea97c6e38e42146b26f3 Mon Sep 17 00:00:00 2001 From: heguokai Date: Tue, 24 Jun 2025 22:52:14 +0800 Subject: [PATCH 2/2] modify Signed-off-by: heguokai --- api/@ohos.commonEventManager.d.ts | 15 ++++++++++----- api/@ohos.events.emitter.d.ts | 27 ++++++++++++++++++--------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/api/@ohos.commonEventManager.d.ts b/api/@ohos.commonEventManager.d.ts index fa9da25b36..66e983a761 100644 --- a/api/@ohos.commonEventManager.d.ts +++ b/api/@ohos.commonEventManager.d.ts @@ -387,7 +387,8 @@ declare namespace commonEventManager { * @throws { BusinessError } 1500008 - Failed to initialize the common event service. * @syscap SystemCapability.Notification.CommonEvent * @systemapi - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ function removeStickyCommonEvent(event: string, callback: AsyncCallback): void; @@ -406,7 +407,8 @@ declare namespace commonEventManager { * @throws { BusinessError } 1500008 - Failed to initialize the common event service. * @syscap SystemCapability.Notification.CommonEvent * @systemapi - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ function removeStickyCommonEvent(event: string): Promise; @@ -423,7 +425,8 @@ declare namespace commonEventManager { * @syscap SystemCapability.Notification.CommonEvent * @systemapi Hide this for inner system use. * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ function setStaticSubscriberState(enable: boolean, callback: AsyncCallback): void; @@ -440,7 +443,8 @@ declare namespace commonEventManager { * @syscap SystemCapability.Notification.CommonEvent * @systemapi Hide this for inner system use. * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ function setStaticSubscriberState(enable: boolean): Promise; @@ -458,7 +462,8 @@ declare namespace commonEventManager { * @syscap SystemCapability.Notification.CommonEvent * @systemapi Hide this for inner system use. * @StageModelOnly - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function setStaticSubscriberState(enable: boolean, events?: Array): Promise; diff --git a/api/@ohos.events.emitter.d.ts b/api/@ohos.events.emitter.d.ts index 5d709baa99..a36debc317 100644 --- a/api/@ohos.events.emitter.d.ts +++ b/api/@ohos.events.emitter.d.ts @@ -93,7 +93,8 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function on(eventId: string, callback: Callback): void; @@ -105,7 +106,8 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function on(eventId: string, callback: Callback>): void; @@ -150,7 +152,8 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function once(event: InnerEvent, callback: Callback): void; @@ -173,7 +176,8 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function once(eventId: string, callback: Callback): void; @@ -186,7 +190,8 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function once(eventId: string, callback: Callback>): void; @@ -293,7 +298,8 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function off(eventId: string, callback: Callback): void; @@ -305,7 +311,8 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function off(eventId: string, callback: Callback>): void; @@ -369,7 +376,8 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function emit(eventId: string, data?: EventData): void; @@ -381,7 +389,8 @@ declare namespace emitter { * @syscap SystemCapability.Notification.Emitter * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function emit(eventId: string, data?: GenericEventData): void; -- Gitee