*Update dist

This commit is contained in:
Derrick Hammer 2022-08-14 07:33:04 -04:00
parent f404dff8eb
commit 2e20565e54
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 19 additions and 1 deletions

2
dist/index.d.ts vendored
View File

@ -12,6 +12,8 @@ export declare class DHT {
addRelay(pubkey: string): Promise<void>;
removeRelay(pubkey: string): Promise<void>;
clearRelays(): Promise<void>;
getRelays(): Promise<string[]>;
getRelayServers(): Promise<string[]>;
private create;
close(): Promise<boolean>;
private setup;

2
dist/index.d.ts.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAU,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAsBhC,qBAAa,GAAG;IACd,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,EAAE,CAAa;gBAEX,aAAa,UAAO;IAInB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAa/C,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;IAMnB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASvC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY1C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;YAM3B,MAAM;IAaP,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;YAcxB,KAAK;CAIpB;AAED,qBAAa,MAAO,SAAQ,YAAY;IACtC,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,YAAY,CAAqC;gBAE7C,EAAE,EAAE,MAAM;IAKtB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE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AAG,EAAE,KAAK,IAAI,GAAG,IAAI;IAkB/D,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI;IAStC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIrC,GAAG,IAAI,IAAI;IAUX,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,UAAU;CAInB"}

16
dist/index.js vendored
View File

@ -63,6 +63,22 @@ export class DHT {
const dht = !this.useDefaultDht ? this.id : undefined;
await callModule(DHT_MODULE, "clearRelays", { dht });
}
async getRelays() {
await this.setup();
const [list, err] = await callModule(DHT_MODULE, "getRelays");
if (err) {
throw new Error(err);
}
return list;
}
async getRelayServers() {
await this.setup();
const [list, err] = await callModule(DHT_MODULE, "getRelayServers");
if (err) {
throw new Error(err);
}
return list;
}
async create() {
await loadLibs();
if (this.useDefaultDht || this.id > 0) {