/** * The event object to pass to a callback. */ export interface DataEvent { /** * Additional event detail */ detail?: DataEventDetail; /** * The event type */ type: string; } /** * Additional types for the event object and the event callback. */ /** * Describes the callbacks expected types. This generic interface can be * extended by implementing classes. */ export interface DataEventCallback { /** * * @param this * Event scope pointing to the class instance, where the event happens. * * @param e * Event object with additional event information. */ (this: T, e: E): void; } /** * Additional detail of the event object. */ export type DataEventDetail = Record; /** * Describes methods to attach callbacks to events of a class instance. */ export interface DataEventEmitter { /** * Registered events managed by Highcharts utility functions. */ hcEvents?: DataEventHCEventsCollection; /** * Emits an event on the class instance to all registered callbacks of * this event. * * @param e * Event object containing additional event information. */ emit(e: E): void; /** * Registers a callback for a specific event. * * @param {string} type * Event type as a string. * * @param {DataEventCallback} callback * Function to register for an event callback. * * @return {Function} * Function to unregister callback from the event. */ on(type: T, callback: DataEventCallback>): Function; } /** * Object to manage an event. */ export interface DataEventHCEventObject { fn: DataEventCallback; order?: number; } /** * Collection of events managed by Highcharts utility functions. */ export type DataEventHCEventsCollection = (Record>); export default DataEvent;