libp2p-ts/libp2p-mdns/index.d.ts

30 lines
632 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-22 21:00:40 +02:00
declare module 'libp2p-mdns' {
2018-06-22 15:43:18 +02:00
// @ts-ignore
import PeerInfo from 'peer-info';
2018-06-21 15:15:18 +02:00
type Options = {
broadcast?: boolean,
interval?: number,
peerInfo: PeerInfo,
port?: number,
serviceTag?: string
};
type Events = 'peer';
2018-06-22 15:43:18 +02:00
export class LibP2pMdns {
2018-06-21 15:15:18 +02:00
constructor (options: Options);
on (event: Events, cb: (peerInfo: PeerInfo) => any): void;
}
2018-06-22 15:43:18 +02:00
const Mdns: typeof LibP2pMdns;
export default Mdns;
}