/** * Represents a salt value used in hashing. */ export type HashSalt = string; /** * A Map used for decoding hashed string values. * * @template H The type of the hashed string (key). * @template V The type of the original string (value). */ export type HashDecodeMap = Map; /** * Decodes a list of hashed string values using a provided list of potential original values and a hash function. * * @param hashedValues - An array of hashed strings to decode. * @param decodeValues - An array of potential original string values. * @param hashFn - A function that takes a string and returns its hashed representation. * @returns An array of decoded strings. Values that cannot be decoded are filtered out. * * @example * ```ts * const hashed = [hashFn('apple'), hashFn('banana')]; * decodeHashedValues(hashed, ['apple', 'banana', 'cherry'], hashFn); * // ['apple', 'banana'] * ``` */ export declare function decodeHashedValues(hashedValues: string[], decodeValues: string[], hashFn: (value: string) => string): string[]; /** * Creates a `HashDecodeMap` from a list of potential original string values and a hash function. * The map's keys are the hashed versions of the `decodeValues`, and the values are the original `decodeValues`. * * @param decodeValues - An array of potential original string values. * @param hashFn - A function that takes a string and returns its hashed representation. * @returns A {@link HashDecodeMap} for decoding hashed values. */ export declare function makeHashDecodeMap(decodeValues: string[], hashFn: (value: string) => string): HashDecodeMap; /** * Decodes a list of hashed string values using a pre-built `HashDecodeMap`. * * @param hashedValues - An array of hashed strings to decode. * @param decodeMap - A {@link HashDecodeMap} to use for looking up original values. * @returns An array of decoded strings. Values that cannot be decoded are filtered out. */ export declare function decodeHashedValuesWithDecodeMap(hashedValues: string[], decodeMap: HashDecodeMap): string[];