libpeerdiscovery/dist/index.d.ts

15 lines
492 B
TypeScript

/// <reference types="node" />
export interface Peer {
host: string;
port: number;
}
export type PeerSource = (pubkey: Buffer, options?: any) => Promise<boolean | Peer>;
export declare class PeerDiscovery {
private _sources;
registerSource(name: string, source: PeerSource): boolean;
removeSource(name: string): boolean;
removeAllSources(): void;
sourceExists(name: string): boolean;
discover(pubkey: string | Buffer, options?: {}): Promise<Peer | boolean>;
}