import { ReduceArrayIterator, ReduceArrayLikeIterator, ReduceObjectIterator, ReduceStringIterator, WithNullable } from './types'; export interface Reduce { (collection: WithNullable, iteratee: ReduceArrayIterator, initialValue: R): R; (collection: WithNullable, iteratee: ReduceStringIterator, initialValue: R): R; (collection: WithNullable>, iteratee: ReduceArrayLikeIterator, initialValue: R): R; (collection: WithNullable, iteratee: ReduceObjectIterator, initialValue: R): R; (collection: WithNullable, iteratee?: ReduceArrayIterator): T | undefined; (collection: WithNullable, iteratee?: ReduceStringIterator): string | undefined; (collection: WithNullable>, iteratee?: ReduceArrayLikeIterator): T | undefined; (collection: WithNullable, iteratee?: ReduceObjectIterator): T[keyof T] | undefined; } /** * 创建 reducer 函数 * * @private * @param dir 迭代方向 * @returns reduce 方法 */ declare function createReduce(dir: 1 | -1): Reduce; export default createReduce;