I don't understand these lines

Viewed 50

I have these lines on a library, something is not working so I'm going deep into the module to figure it out.

on(event: string, listener: (...args: any[]) => void): this;
on(event: 'close', listener: (hadError: boolean) => void): this;
on(event: 'connect', listener: () => void): this;
on(event: 'data', listener: (data: Buffer) => void): this;
on(event: 'drain', listener: () => void): this;
on(event: 'end', listener: () => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: 
string) => void): this;
on(event: 'ready', listener: () => void): this;
on(event: 'timeout', listener: () => void): this;

I have a call to it from a line:

PLC.on("Get Instance Attribute List", async (err, data) => { }

But it does nothing, and the issue is actually that I don't understand the lines, why do I have many on() methods on the class?

0 Answers
Related