From 9e3fc3818ca07278497271c4969e14b52c1c1d8a Mon Sep 17 00:00:00 2001 From: tngzixiang Date: Tue, 26 Dec 2023 13:30:29 +0800 Subject: [PATCH] chore: resolve typings --- src/did/resolver.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/did/resolver.ts b/src/did/resolver.ts index e97d9979..c0c17c7e 100644 --- a/src/did/resolver.ts +++ b/src/did/resolver.ts @@ -1,4 +1,4 @@ -import { DIDDocument, Resolver, VerificationMethod } from "did-resolver"; +import { DIDDocument, Resolver, ResolverRegistry, VerificationMethod } from "did-resolver"; import { getResolver as ethrGetResolver } from "ethr-did-resolver"; import { getResolver as webGetResolver } from "web-did-resolver"; import NodeCache from "node-cache"; @@ -29,11 +29,14 @@ export const getProviderConfig = () => { const didResolutionCache = new NodeCache({ stdTTL: 5 * 60 }); // 5 min -const defaultResolver = new Resolver({ ...ethrGetResolver(getProviderConfig()), ...webGetResolver() }); +const defaultResolver = new Resolver({ + ...ethrGetResolver(getProviderConfig()), + ...webGetResolver(), +} as ResolverRegistry); export const createResolver = ({ ethrResolverConfig }: { ethrResolverConfig?: EthrResolverConfig }): Resolver => { return ethrResolverConfig - ? new Resolver({ ...ethrGetResolver(ethrResolverConfig), ...webGetResolver() }) + ? new Resolver({ ...ethrGetResolver(ethrResolverConfig), ...webGetResolver() } as ResolverRegistry) : defaultResolver; };