*Add dist
This commit is contained in:
parent
10a00c0667
commit
ad426dafb1
|
@ -0,0 +1,12 @@
|
||||||
|
import { Client } from "@lumeweb/libkernel-universal";
|
||||||
|
import type { Peer } from "@lumeweb/peer-discovery";
|
||||||
|
export declare class PeerDiscoveryClient extends Client {
|
||||||
|
register(source: string): Promise<void>;
|
||||||
|
remove(name: string): Promise<boolean>;
|
||||||
|
removeAll(): Promise<void>;
|
||||||
|
exists(name: string): Promise<boolean>;
|
||||||
|
discover(pubkey: string): Promise<Peer | boolean>;
|
||||||
|
}
|
||||||
|
export declare const createClient: (...args: any) => PeerDiscoveryClient;
|
||||||
|
export { Peer };
|
||||||
|
//# sourceMappingURL=index.d.ts.map
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,qBAAa,mBAAoB,SAAQ,MAAM;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMvC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAItC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAGtC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC;CAG/D;AAED,eAAO,MAAM,YAAY,uCAGxB,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@ -0,0 +1,21 @@
|
||||||
|
import { Client, factory } from "@lumeweb/libkernel-universal";
|
||||||
|
export class PeerDiscoveryClient extends Client {
|
||||||
|
async register(source) {
|
||||||
|
const bag = await this.loadBound(source);
|
||||||
|
const ret = await bag.callModule("register");
|
||||||
|
this.handleError(ret);
|
||||||
|
}
|
||||||
|
async remove(name) {
|
||||||
|
return await this.callModuleReturn("remove", { name });
|
||||||
|
}
|
||||||
|
async removeAll() {
|
||||||
|
await this.callModuleReturn("removeAll");
|
||||||
|
}
|
||||||
|
async exists(name) {
|
||||||
|
return await this.callModuleReturn("remove", { name });
|
||||||
|
}
|
||||||
|
async discover(pubkey) {
|
||||||
|
return await this.callModuleReturn("discover", { pubkey });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export const createClient = factory(PeerDiscoveryClient, "FACTQhR-sNQ0K9Nh5QlHlkp5q57rxBdc2DGgacoTdwtIoA");
|
Loading…
Reference in New Issue