import { IndexHelperBase } from './IndexHelperBase.js'; /** * Version 2 index helper. Blinds attributes in two stages: an unkeyed SHA-256 * pre-hash of each canonicalized value (cacheable and byte-concatenated for * compound indexes), followed by a keyed HMAC pass over the resulting digests. * The shared, blinding-agnostic machinery lives in `IndexHelperBase`. */ export declare class IndexHelper extends IndexHelperBase { _cache: any; /** * Creates a new IndexHelper instance that can be used to blind EDV * document attributes to enable indexing. * * @returns {IndexHelper} An IndexHelper instance. */ constructor(); /** * Ensures that future documents inserted or updated using this client * instance will be indexed according to the given attribute, additionally * prewarming the HMAC cache when an `hmac` is supplied. See * `IndexHelperBase.ensureIndex` for the indexing semantics. * * @param {object} options - The options to use. * @param {string|string[]} options.attribute - The attribute name or an * array of attribute names to create a unique compound index. * @param {boolean} [options.unique=false] - Set to `true` if the index * should be considered unique, `false` if not. * @param {object} [options.hmac] - An optional HMAC API with `id`, `sign`, * and `verify` properties for prewarming caches. */ ensureIndex({ attribute, unique, hmac }?: any): void; /** * Blinds a Uint8Array of bytes using the given HMAC API. * * @param {object} hmac - An HMAC API with `id`, `sign`, and `verify` * properties. * @param {Uint8Array} data - The value to blind. * * @returns {Promise} - Resolves to the blinded value. */ _blindData(hmac: any, data: any): Promise; /** * Blinds a hashed attribute (compound or simple) using the given HMAC API. * * @param {object} options - The options to use. * @param {object} options.hmac - An HMAC API with `id`, `sign`, and `verify` * properties. * @param {object} options.hashedAttribute - The attribute with `name`, * `value`, and optional `unique` property; `name` and `value` MUST be * Uint8Arrays. * * @returns {Promise} - Resolves to an object * `{name, value, unique?}`. */ _blindHashedAttribute({ hmac, hashedAttribute }: any): Promise; _buildBlindAttributes({ hmac, doc, equal, has }: any): Promise; /** * Hashes a single attribute, converting its name and value into a hashed * name and hashed value. * * @param {object} options - The options to use. * @param {string} options.name - A name associated with a value. * @param {any} options.value - The value associated with the name for the * attribute. * * @returns {Promise} - Resolves to an object `{name, value}`. */ _hashAttribute({ name, value }: any): Promise<{ name: Uint8Array & Uint8Array; value: Uint8Array & Uint8Array; }>; /** * Builds a hashed compound attribute from an array of hashed attributes * via the given HMAC API. * * @param {object} options - The options to use. * @param {Array} options.hashedAttributes - The hashed attributes that * comprise the compound index. * @param {number} [options.length=options.hashedAttributes.length] - The * number of hashed attributes to go into the compound attribute * (<= `hashedAttributes.length`). * * @returns {Promise} - Resolves to the hashed compound attribute. */ _hashCompoundAttribute({ hashedAttributes, length }: any): Promise<{ name: Uint8Array & Uint8Array; value: Uint8Array & Uint8Array; }>; _prewarmCache({ attributes, hmac }: any): Promise; _cachedHmac({ hmac, data }: any): Promise; } //# sourceMappingURL=IndexHelper.d.ts.map