Extending EventEmitter stops module class from checking
- Lingua principale
- Rust
- Stelle
- 22.3k
- Fork
- 1.9k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I have this declaration file for an [external module](https://github.com/node-hid/node-hid)
``` javascript
import {EventEmitter} from 'events';
declare module 'node-hid' {
declare type HIDDeviceDescription = {
vendorId: number;
productId: number;
path: string;
}
declare function devices(): Array;
declare class HID extends EventEmitter {
constructor(path: string): void;
write(buffer: Array): void;
pause(): void;
resume(): void;
close(): void;
}
}
```
And this is in my code
``` javascript
import * as HID from 'node-hid';
var device = new HID.HID("123");
device.foobar();
```
`device.foobar` should throw an error, but it doesn't. Removing `extends EventEmitter` fixes that, but then, I cannot use EventEmitter's functions.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.