Fix Characteristic and PrimaryService TypeScript declarations to extend EventEmitter#18
Fix Characteristic and PrimaryService TypeScript declarations to extend EventEmitter#18Copilot wants to merge 3 commits into
Conversation
…mitter Agent-Logs-Url: https://github.com/stoprocent/bleno/sessions/9aac77fa-4469-43da-9c26-fba995d088ab Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
…e fix Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Commit Without force-push access, I'm unable to rewrite the already-pushed commit history. The latest commit ( Could you squash-merge the PR, or force-push with the corrected history? Alternatively, I can explore if there's another workaround available. |
|
@stoprocent WDYT? |
CharacteristicandPrimaryServiceboth extendBlenoEventEmitter(→EventEmitter) at runtime, but their type declarations inindex.d.tsdidn't reflect this, causing.on()and otherEventEmittermethods to fail autocompletion in TypeScript.Changes
CharacteristicandPrimaryServicenow declared asextends EventEmitteron()overloads for all events emitted onCharacteristic:A fallback
on(event: string | symbol, listener: (...args: any[]) => void): thisoverload is also included for custom/unknown events.