2022-12-20 12:28:01 +00:00
|
|
|
/// <reference types="node" />
|
|
|
|
export interface Peer {
|
|
|
|
host: string;
|
|
|
|
port: number;
|
|
|
|
}
|
2023-01-15 07:58:50 +00:00
|
|
|
export type PeerSource = (pubkey: Buffer, options?: any) => Promise<boolean | Peer>;
|
2022-12-20 12:28:01 +00:00
|
|
|
export declare class PeerDiscovery {
|
|
|
|
private _sources;
|
|
|
|
registerSource(name: string, source: PeerSource): boolean;
|
|
|
|
removeSource(name: string): boolean;
|
2023-01-15 08:36:25 +00:00
|
|
|
removeAllSources(): void;
|
2023-01-15 08:50:17 +00:00
|
|
|
sourceExists(name: string): boolean;
|
2023-01-15 07:58:50 +00:00
|
|
|
discover(pubkey: string | Buffer, options?: {}): Promise<Peer | boolean>;
|
2022-12-20 12:28:01 +00:00
|
|
|
}
|