diff --git a/packages/did-resolver/src/resolver.ts b/packages/did-resolver/src/resolver.ts index 84fe4db09..45fd3feab 100644 --- a/packages/did-resolver/src/resolver.ts +++ b/packages/did-resolver/src/resolver.ts @@ -8,14 +8,24 @@ import { parse as parseDID, Resolvable, } from 'did-resolver' + export { DIDDocument } import Debug from 'debug' + const debug = Debug('veramo:resolver') interface Options { resolver: Resolvable } +/** + * A Veramo Plugin that enables users to resolve DID documents. + * + * This plugin is used automatically by plugins that create or verify Verifiable Credentials or Presentations or when + * working with DIDComm + * + * @public + */ export class DIDResolverPlugin implements IAgentPlugin { readonly methods: IResolver readonly schema = schema.IResolver @@ -33,9 +43,9 @@ export class DIDResolverPlugin implements IAgentPlugin { /** {@inheritDoc @veramo/core#IResolver.resolveDid} */ async resolveDid({ - didUrl, - options, - }: { + didUrl, + options, + }: { didUrl: string options?: DIDResolutionOptions }): Promise { @@ -62,10 +72,10 @@ export class DIDResolverPlugin implements IAgentPlugin { /** {@inheritDoc @veramo/core#IResolver.getDIDComponentById} */ async getDIDComponentById({ - didDocument, - didUrl, - section, - }: { + didDocument, + didUrl, + section, + }: { didDocument: DIDDocument didUrl: string section?: DIDDocumentSection diff --git a/packages/did-resolver/src/universal-resolver.ts b/packages/did-resolver/src/universal-resolver.ts index 33227b17f..40c2c101e 100644 --- a/packages/did-resolver/src/universal-resolver.ts +++ b/packages/did-resolver/src/universal-resolver.ts @@ -7,6 +7,8 @@ interface Options { /** * @deprecated please use `getUniresolver(url)` or `getUniresolverFor(methods, url)` instead + * + * @internal */ export class UniversalResolver { constructor(options: Options) { @@ -27,8 +29,10 @@ export class UniversalResolver { * }) * ``` * - * @param url the URL for the universal resolver instance (See https://uniresolver.io ) + * @param url - the URL for the universal resolver instance (See https://uniresolver.io ) * @returns `DIDResolver` + * + * @public */ export function getUniversalResolver( url: string = 'https://dev.uniresolver.io/1.0/identifiers/', @@ -62,9 +66,11 @@ export function getUniversalResolver( * }) * ``` * - * @param methods an array of DID methods that should be resolved by this universal resolver - * @param url the URL for the universal resolver instance (See https://uniresolver.io ) + * @param methods - an array of DID methods that should be resolved by this universal resolver + * @param url - the URL for the universal resolver instance (See https://uniresolver.io ) * @returns `Record` a mapping of the given methods to an instance of `DIDResolver` + * + * @public */ export function getUniversalResolverFor( methods: string[],