bae705aa97
- Add NFC ePassport roadmap (ICAO 9303, eIDAS) - Add TensorFlow.js edge face detection (BlazeFace) - Add structured audit logger (GDPR-compliant) - Risk scoring support Part of KYC Apple Native UX v1.1.0
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
export = EventEmitter;
|
|
|
|
type EventEmitterListener = (...args: any[]) => {};
|
|
|
|
/**
|
|
* Constructs a new event emitter instance.
|
|
* @classdesc A minimal event emitter.
|
|
* @memberof util
|
|
* @constructor
|
|
*/
|
|
declare class EventEmitter {
|
|
|
|
/**
|
|
* Constructs a new event emitter instance.
|
|
* @classdesc A minimal event emitter.
|
|
* @memberof util
|
|
* @constructor
|
|
*/
|
|
constructor();
|
|
|
|
/**
|
|
* Registers an event listener.
|
|
* @param {string} evt Event name
|
|
* @param {EventEmitterListener} fn Listener
|
|
* @param {*} [ctx] Listener context
|
|
* @returns {this} `this`
|
|
*/
|
|
public on(evt: string, fn: EventEmitterListener, ctx?: any): EventEmitter;
|
|
|
|
/**
|
|
* Removes an event listener or any matching listeners if arguments are omitted.
|
|
* @param {string} [evt] Event name. Removes all listeners if omitted.
|
|
* @param {EventEmitterListener} [fn] Listener to remove. Removes all listeners of `evt` if omitted.
|
|
* @returns {this} `this`
|
|
*/
|
|
public off(evt?: string, fn?: EventEmitterListener): EventEmitter;
|
|
|
|
/**
|
|
* Emits an event by calling its listeners with the specified arguments.
|
|
* @param {string} evt Event name
|
|
* @param {...*} args Arguments
|
|
* @returns {this} `this`
|
|
*/
|
|
public emit(evt: string, ...args: any[]): EventEmitter;
|
|
}
|