Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jajbshjahavahh
GitHub Repository: jajbshjahavahh/Gojo-Satoru
Path: blob/master/node_modules/@protobufjs/eventemitter/index.d.ts
2591 views
1
export = EventEmitter;
2
3
/**
4
* Constructs a new event emitter instance.
5
* @classdesc A minimal event emitter.
6
* @memberof util
7
* @constructor
8
*/
9
declare class EventEmitter {
10
11
/**
12
* Constructs a new event emitter instance.
13
* @classdesc A minimal event emitter.
14
* @memberof util
15
* @constructor
16
*/
17
constructor();
18
19
/**
20
* Registers an event listener.
21
* @param {string} evt Event name
22
* @param {function} fn Listener
23
* @param {*} [ctx] Listener context
24
* @returns {util.EventEmitter} `this`
25
*/
26
on(evt: string, fn: () => any, ctx?: any): EventEmitter;
27
28
/**
29
* Removes an event listener or any matching listeners if arguments are omitted.
30
* @param {string} [evt] Event name. Removes all listeners if omitted.
31
* @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.
32
* @returns {util.EventEmitter} `this`
33
*/
34
off(evt?: string, fn?: () => any): EventEmitter;
35
36
/**
37
* Emits an event by calling its listeners with the specified arguments.
38
* @param {string} evt Event name
39
* @param {...*} args Arguments
40
* @returns {util.EventEmitter} `this`
41
*/
42
emit(evt: string, ...args: any[]): EventEmitter;
43
}
44
45