*Update dist
This commit is contained in:
parent
cf6435ef1e
commit
b094b6ffe5
|
@ -0,0 +1,21 @@
|
|||
import { Client } from "@lumeweb/libkernel-universal";
|
||||
import { DnsClient } from "./index.js";
|
||||
import { DNSResult, ResolverOptions } from "@lumeweb/libresolver";
|
||||
export declare class ResolverModule extends Client {
|
||||
private domain;
|
||||
constructor(domain: string, resolver?: DnsClient);
|
||||
private _resolver?;
|
||||
get resolver(): DnsClient;
|
||||
set resolver(value: DnsClient);
|
||||
resolve(
|
||||
domain: string,
|
||||
options: ResolverOptions,
|
||||
bypassCache: boolean
|
||||
): Promise<DNSResult>;
|
||||
getSupportedTlds(): Promise<string[]>;
|
||||
}
|
||||
export declare const createModule: (
|
||||
module: string,
|
||||
client: DnsClient
|
||||
) => ResolverModule;
|
||||
//# sourceMappingURL=module.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACL,SAAS,EAET,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,cAAe,SAAQ,MAAM;IACxC,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS;IAMhD,OAAO,CAAC,SAAS,CAAC,CAAY;IAE9B,IAAI,QAAQ,IAAI,SAAS,CAExB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,SAAS,EAE5B;IAEK,OAAO,CACX,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,SAAS,CAAC;IAWf,gBAAgB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAG5C;AAED,eAAO,MAAM,YAAY,WACf,MAAM,UACN,SAAS,KAChB,cAC8D,CAAC"}
|
|
@ -0,0 +1,33 @@
|
|||
import { Client, factory } from "@lumeweb/libkernel-universal";
|
||||
import { resolverError, } from "@lumeweb/libresolver";
|
||||
export class ResolverModule extends Client {
|
||||
domain;
|
||||
constructor(domain, resolver) {
|
||||
super();
|
||||
this._resolver = resolver;
|
||||
this.domain = domain;
|
||||
}
|
||||
_resolver;
|
||||
get resolver() {
|
||||
return this._resolver;
|
||||
}
|
||||
set resolver(value) {
|
||||
this._resolver = value;
|
||||
}
|
||||
async resolve(domain, options, bypassCache) {
|
||||
try {
|
||||
return this.callModuleReturn("resolve", {
|
||||
domain,
|
||||
options,
|
||||
bypassCache,
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
return resolverError(e);
|
||||
}
|
||||
}
|
||||
async getSupportedTlds() {
|
||||
return this.callModuleReturn("getSupportedTlds");
|
||||
}
|
||||
}
|
||||
export const createModule = (module, client) => factory(ResolverModule, module)(module, client);
|
Loading…
Reference in New Issue