接口变更:emitter.off接口新增第二个可选参数callback

Signed-off-by: Baisong Zhong <zhongbaisong@huawei.com>
Change-Id: I293f87b010855c5f013f52b5b8525049ff67307a
This commit is contained in:
Baisong Zhong 2023-06-24 18:58:49 +08:00
parent 1886cd4d93
commit 41752bb1e6

View File

@ -54,6 +54,16 @@ declare namespace emitter {
*/
function off(eventId: number): void;
/**
* Unsubscribe from an event.
*
* @param { number } eventId - indicates ID of the event to unsubscribe from.
* @param { Callback<EventData> } callback - indicates callback used to receive the event.
* @syscap SystemCapability.Notification.Emitter
* @since 10
*/
function off(eventId: number, callback: Callback<EventData>): void;
/**
* Emits an event to the event queue.
*
@ -115,4 +125,4 @@ declare namespace emitter {
}
}
export default emitter;
export default emitter;