diff --git a/api/application/EventHub.d.ts b/api/application/EventHub.d.ts index 09738ce0f0d4e0a7e4e73248f81fc2c9e9e4baea..7dc88272b96b3c86b7c64afaf9469a3e1c42e2a1 100644 --- a/api/application/EventHub.d.ts +++ b/api/application/EventHub.d.ts @@ -80,7 +80,8 @@ declare class EventHub { * @stagemodelonly * @crossplatform * @atomicservice - * @since 12 + * @since arkts{ '1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ on(event: string, callback: Function): void; @@ -118,7 +119,8 @@ declare class EventHub { * @stagemodelonly * @crossplatform * @atomicservice - * @since 12 + * @since arkts{ '1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ off(event: string, callback?: Function): void; @@ -159,6 +161,19 @@ declare class EventHub { * @since 12 */ emit(event: string, ...args: Object[]): void; + + /** + * Trigger the event callbacks. + * + * @param { string } event - Indicates the event. + * @param { (Object|null|undefined)[] } args - Indicates the callback arguments. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + emit(event: string, ...args: (Object|null|undefined)[]): void; } export default EventHub; \ No newline at end of file