import type { AbstractKeyPair, IDID, IDIDDocument, IVerificationMethodEntry } from '@interop/data-integrity-core'; export type IKeyMap = Map; /** * Tests whether this DID Document contains a verification relationship * between the subject and a method id, for a given purpose. * * @example * didDocument.approvesMethodFor({ * methodId: 'did:ex:1234#abcd', purpose: 'authentication' * }); * // -> true * @example * didDocument.approvesMethodFor({ * methodId: 'did:ex:1234#abcd', purpose: 'assertionMethod' * }); * // -> false * * @param {object} options - Options hashmap. * @param {object} options.doc - DID Document. * @param {string} options.methodId - Verification method id (a uri). * @param {string} options.purpose - E.g. 'authentication', etc. * * @returns {boolean} Returns whether a method id is authorized for purpose. */ export declare function approvesMethodFor({ doc, methodId, purpose }: { doc: IDIDDocument; methodId: string; purpose: string; }): boolean; /** * Finds a verification method for a given methodId or purpose. * * If a method id is given, returns the object for that method (for example, * returns the public key definition for that id). * * If a purpose (verification relationship) is given, returns the first * available verification method for that purpose. * * If no method is found (for the given id or purpose), returns undefined. * * @example * findVerificationMethod({doc, methodId: 'did:ex:123#abcd'}); * // -> * { * id: 'did:ex:123#abcd', * controller: 'did:ex:123', * type: 'Ed25519VerificationKey2020', * publicKeyMultibase: '...' * } * @example * didDocument.findVerificationMethod({doc, purpose: 'authentication'}); * // -> * { * id: 'did:ex:123#abcd', * controller: 'did:ex:123', * type: 'Ed25519VerificationKey2020', * publicKeyMultibase: '...' * } * @param {object} options - Options hashmap. * @param {object} options.doc - DID Document. * * One of the following is required. * @param {string} [options.methodId] - Verification method id. * @param {string} [options.purpose] - Method purpose (verification * relationship). * * @returns {object} Returns the verification method, or undefined if not found. */ export declare function findVerificationMethod({ doc, methodId, purpose }: { doc: IDIDDocument; methodId?: string; purpose?: string; }): IVerificationMethodEntry | undefined; /** * Finds a verification method for a given id and returns it. * * @param {object} options - Options hashmap. * @param {object} options.doc - DID Document. * @param {string} options.methodId - Verification method id. * * @returns {object} Returns the verification method. */ export declare function _methodById({ doc, methodId }: { doc: IDIDDocument; methodId: string; }): IVerificationMethodEntry | undefined; /** * Parses the DID into various components (currently, only cares about prefix). * * @example * parseDid({did: 'did:v1:test:nym'}); * // -> {prefix: 'v1'} * * @param {string} did - DID uri. * * @returns {{prefix: string}} Returns the method prefix (without `did:`). */ export declare function parseDid({ did }: { did: IDID | string; }): { prefix: string; }; //# sourceMappingURL=did-io.d.ts.map