import DidPublicKeyModel from './models/DidPublicKeyModel'; import DocumentModel from './models/DocumentModel'; /** * Class containing reusable DID Document related operations specific to Sidetree. */ export default class Document { /** * Creates a DID Document with a valid Sidetree DID from an encoded original DID Document. * @returns DID Document if encoded original DID Document is valid; `undefined` otherwise. */ static from(encodedOriginalDidDocument: string, didMethodName: string, hashAlgorithmAsMultihashCode: number): DocumentModel | undefined; /** * Verifies that the given encoded string is a valid encoded DID Document that can be accepted by the Sidetree create operation. * @param allowedMaxSizeInBytes Optional. If specified, the given size limit is validated against the decoded buffer of the original DID document. */ static isEncodedStringValidOriginalDocument(encodedOriginalDocument: string, allowedMaxSizeInBytes?: number): boolean; /** * Verifies that the given JSON object is a valid Sidetree specific encoded DID Document that can be accepted by the Sidetree create operation. */ static isObjectValidOriginalDocument(originalDocument: any): boolean; /** * Verifies that the given object is a valid generic DID Document (not Sidetree specific). * @param requireDid Optional. Specifies if validation rules require the `id` property. Defaults to true if not given. */ static isValid(didDocument: any, requireId?: boolean): boolean; /** * Gets the specified public key from the given DID Document. * Returns undefined if not found. * @param keyId The ID of the public-key. */ static getPublicKey(didDocument: DocumentModel, keyId: string): DidPublicKeyModel | undefined; }