import { Hasher } from '../types'; import { Disclosure } from './disclosures'; /** * Mapping from a digest to the corresponding disclosure and its parent disclosures. */ export type DisclosureMap = { [digest: string]: { disclosure: Disclosure; parentDisclosures: Disclosure[]; }; }; /** * Get a mapping in the structure of the pretty payload, to indicate which digests should be disclosed for a * given entry. * * For example if you call this method with the following payload: * ```ts * { * _sd: ['iss_digest', 'nested_field_digest'], * } * ``` * * It can return the following mapping: * ```ts * { * iss: 'iss_digest', * nested_field: { * __digest: 'nested_field_digest', * more_nested_field: { * // index 1 is null, as it's always in the payload, so doesn't need to be disclosed * // separately * a: ['a_0_digest', null, 'a_2_digest'], * } * } * } * ``` * * This method will recursively call itself and `getArrayPayloadDisclosureMapping` if the value of a property is an object or array. */ export declare function getPayloadDisclosureMapping(payload: any, map: DisclosureMap): any[] | Record | null; /** * Get a mapping from a digest to the corresponding disclosure and its parent disclosures. */ export declare const getDisclosureMap: (disclosures: Disclosure[], hasher: Hasher) => Promise;