29 lines
665 B
TypeScript
Raw Normal View History

2018-06-21 15:15:18 +02:00
// Type definitions for libp2p-mdns 0.12.0
// Project: https://github.com/libp2p/js-libp2p-mdns
// Definitions by: Jaco Greeff <https://github.com/jacogr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
2018-06-24 10:46:14 +02:00
/// <reference types="peer-info"/>
2018-06-21 15:15:18 +02:00
2018-06-24 10:37:00 +02:00
declare namespace LibP2pMdns {
type Options = {
broadcast?: boolean,
interval?: number,
peerInfo: PeerInfo,
port?: number,
serviceTag?: string
};
2018-06-21 15:15:18 +02:00
2018-06-24 10:37:00 +02:00
type Events = 'peer';
}
2018-06-21 15:15:18 +02:00
2018-06-24 10:37:00 +02:00
declare class LibP2pMdns {
constructor (options: LibP2pMdns.Options);
2018-06-21 15:15:18 +02:00
2018-06-24 10:37:00 +02:00
on (event: LibP2pMdns.Events, cb: (peerInfo: PeerInfo) => any): void;
2018-06-21 15:15:18 +02:00
}
2018-06-24 10:37:00 +02:00
declare module 'libp2p-mdns' {
export default LibP2pMdns;
2018-06-22 15:43:18 +02:00
}