27 lines
691 B
TypeScript
Raw Normal View History

2018-06-21 15:23:22 +02:00
// Type definitions for libp2p-railing 0.9.1
2018-08-23 14:35:17 +02:00
// Project: https://github.com/libp2p/js-libp2p-bootstrap
2018-06-21 15:23:22 +02:00
// Definitions by: Jaco Greeff <https://github.com/jacogr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
2018-06-24 10:46:14 +02:00
/// <reference types="multiaddr"/>
/// <reference types="peer-info"/>
2018-06-21 15:23:22 +02:00
2018-08-23 14:35:17 +02:00
declare namespace LibP2pBootstrap {
2018-06-24 10:37:00 +02:00
type Options = {
2020-04-04 15:05:16 -05:00
list: Array<string | import("multiaddr")>,
2018-06-24 10:37:00 +02:00
interval?: number
};
2018-06-21 15:23:22 +02:00
2018-06-24 10:37:00 +02:00
type Events = 'peer';
}
2018-06-21 15:23:22 +02:00
declare class LibP2pBootstrap {
2018-08-23 14:35:17 +02:00
constructor (options: LibP2pBootstrap.Options);
2018-06-21 15:23:22 +02:00
2019-05-30 11:41:19 -05:00
on (event: LibP2pBootstrap.Events, cb: (peerInfo: PeerInfo) => any): this;
2018-06-21 15:23:22 +02:00
}
2018-08-23 14:35:17 +02:00
declare module 'libp2p-bootstrap' {
export default LibP2pBootstrap;
2018-06-22 15:43:18 +02:00
}