mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #46298 Bittorrent protocol add dynamic property key for extensions by @RonaldZielaznicki
* Add dynamic property to Wire Interface * Attempt to access wire extensions name to test that extension can be accessed.
This commit is contained in:
parent
18204efa01
commit
67d6207759
@ -27,4 +27,7 @@ net.createServer(socket => {
|
||||
|
||||
// Extend wire using the test extension
|
||||
wire.extended('extname', {});
|
||||
|
||||
// Confirm extension has been added to Wire instance.
|
||||
console.log(wire.extname.name);
|
||||
}).listen(6881);
|
||||
|
||||
2
types/bittorrent-protocol/index.d.ts
vendored
2
types/bittorrent-protocol/index.d.ts
vendored
@ -56,6 +56,8 @@ declare namespace BittorrentProtocol {
|
||||
|
||||
use(ext: ExtensionConstructor): void;
|
||||
|
||||
[key: string]: any;
|
||||
|
||||
handshake(infoHash: string | Buffer, peerId: string | Buffer, extensions?: any): void;
|
||||
|
||||
choke(): void;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user