*Update dist
This commit is contained in:
parent
b6469a6a45
commit
038555ac62
|
@ -9,5 +9,6 @@ export declare class PeerDiscovery {
|
||||||
registerSource(name: string, source: PeerSource): boolean;
|
registerSource(name: string, source: PeerSource): boolean;
|
||||||
removeSource(name: string): boolean;
|
removeSource(name: string): boolean;
|
||||||
removeAllSources(): void;
|
removeAllSources(): void;
|
||||||
|
sourceExists(name: string): boolean;
|
||||||
discover(pubkey: string | Buffer, options?: {}): Promise<Peer | boolean>;
|
discover(pubkey: string | Buffer, options?: {}): Promise<Peer | boolean>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,9 @@ class PeerDiscovery {
|
||||||
removeAllSources() {
|
removeAllSources() {
|
||||||
this._sources.clear();
|
this._sources.clear();
|
||||||
}
|
}
|
||||||
|
sourceExists(name) {
|
||||||
|
return this._sources.has(name);
|
||||||
|
}
|
||||||
async discover(pubkey, options = {}) {
|
async discover(pubkey, options = {}) {
|
||||||
if (!b4a_1.default.isBuffer(pubkey)) {
|
if (!b4a_1.default.isBuffer(pubkey)) {
|
||||||
pubkey = b4a_1.default.from(pubkey, "hex");
|
pubkey = b4a_1.default.from(pubkey, "hex");
|
||||||
|
|
Loading…
Reference in New Issue