UNPKG

@blockcerts/hashlink-verifier

Version:
37 lines (35 loc) 1.25 kB
export interface HashlinkModel { hashName: string; hashValue: Uint8Array; meta?: { url?: string[]; "content-type"?: string; experimental?: string; transform?: string; }; } export declare class HashlinkVerifier { private readonly hl; private hashlinkTable; constructor(); /** * decode method, abstract wrapper over Hashlink class from digital bazaar hashlink package * * @param {string} hashlink: the hashlink to be decoded. In this instance it expects a url to be specified. * @param {function} onHashlinkUrlDecoded: a callback function called when the source url has been discovered to enable * early manipulation (ie: update image in DOM). */ decode(hashlink: string, onHashlinkUrlDecoded?: (url: string) => void): Promise<HashlinkModel>; verifyHashlinkTable(): Promise<boolean>; /** * verify method, abstract wrapper over Hashlink class from digital bazaar hashlink package * * @param {string} hashlink: the hashlink to be decoded. It will lookup in the previously decoded hashlinks table. * if not found it will decode the hashlink before verification. */ verify(hashlink: string): Promise<boolean>; hasHashlinksToVerify(): boolean; private getSourceUrlFromHashlink; private getMetaUrl; } export {};