import { E as ExactRecord } from './ExactRecord-Do0Gswzd.cjs'; import './IfBoundedRecord-WIX9x_oz.cjs'; import 'type-fest'; /** * Converts a list of objects into an object indexing the objects by the given * key. * * There are several other functions that could be used to build an object from * an array: * * `fromKeys` - Builds an object from an array of *keys* and a mapper for values. * * `pullObject` - Builds an object from an array of items with mappers for *both* keys and values. * * `fromEntries` - Builds an object from an array of key-value pairs. * * `mapToObj` - Builds an object from an array of items and a single mapper for key-value pairs. * Refer to the docs for more details. * * @param data - The array. * @param mapper - The indexing function. * @signature * R.indexBy(array, fn) * @example * R.indexBy(['one', 'two', 'three'], x => x.length) // => {3: 'two', 5: 'three'} * @dataFirst * @category Array */ declare function indexBy(data: ReadonlyArray, mapper: (item: T, index: number, data: ReadonlyArray) => K): ExactRecord; /** * Converts a list of objects into an object indexing the objects by the given * key. * * There are several other functions that could be used to build an object from * an array: * * `fromKeys` - Builds an object from an array of *keys* and a mapper for values. * * `pullObject` - Builds an object from an array of items with mappers for *both* keys and values. * * `fromEntries` - Builds an object from an array of key-value pairs. * * `mapToObj` - Builds an object from an array of items and a single mapper for key-value pairs. * Refer to the docs for more details. * * @param mapper - The indexing function. * @signature * R.indexBy(fn)(array) * @example * R.pipe( * ['one', 'two', 'three'], * R.indexBy(x => x.length) * ) // => {3: 'two', 5: 'three'} * @dataLast * @category Array */ declare function indexBy(mapper: (item: T, index: number, data: ReadonlyArray) => K): (data: ReadonlyArray) => ExactRecord; export { indexBy };