/************************************************************************* * Copyright 2020 Adobe * All Rights Reserved. * * NOTICE: Adobe permits you to use, modify, and distribute this file in * accordance with the terms of the Adobe license agreement accompanying * it. If you have received this file from a source other than Adobe, * then your use, modification, or distribution of it requires the prior * written permission of Adobe. **************************************************************************/ /** * @packageDocumentation * @module "index" */ /** * @ignore */ export default interface EventEmitter> { /** * Register an event handler for the given type. * @param type Type of event to listen for. * @param handler Function to call in response to given event. * @category EventEmitter */ on(type: K, handler: (event?: T[K]) => void): void; /** * Remove an event handler for the given type. * @param type Type of event to unregister `handler` from. * @param handler Handler function to remove. * @category EventEmitter */ off(type: K, handler: (event?: T[K]) => void): void; /** * Invoke all handlers for the given type. * @param type The event type to invoke. * @param event Any value (object is recommended and powerful), passed to each handler. * @category EventEmitter */ emit(type: K, event?: T[K]): void; }