import { ValueIteratee } from '../_internal/ValueIteratee.js'; import { ValueIteratorTypeGuard } from '../_internal/ValueIteratorTypeGuard.js'; /** * Creates an array of elements split into two groups, the first of which contains elements * predicate returns truthy for, while the second of which contains elements predicate returns falsey for. * The predicate is invoked with one argument: (value). * * @template T, U * @param {ArrayLike | null | undefined} collection - The collection to iterate over. * @param {(value: T) => value is U} callback - The function invoked per iteration. * @returns {[U[], Array>]} Returns the array of grouped elements. * * @example * partition([1, 2, 3, 4], n => n % 2 === 0); * // => [[2, 4], [1, 3]] */ declare function partition(collection: ArrayLike | null | undefined, callback: ValueIteratorTypeGuard): [U[], Array>]; /** * Creates an array of elements split into two groups, the first of which contains elements * predicate returns truthy for, while the second of which contains elements predicate returns falsey for. * The predicate is invoked with one argument: (value). * * @template T * @param {ArrayLike | null | undefined} collection - The collection to iterate over. * @param {((value: T) => unknown) | PropertyKey | [PropertyKey, any] | Partial} callback - The function invoked per iteration. * @returns {[T[], T[]]} Returns the array of grouped elements. * * @example * partition([1, 2, 3, 4], n => n % 2 === 0); * // => [[2, 4], [1, 3]] */ declare function partition(collection: ArrayLike | null | undefined, callback: ValueIteratee): [T[], T[]]; /** * Creates an array of elements split into two groups, the first of which contains elements * predicate returns truthy for, while the second of which contains elements predicate returns falsey for. * The predicate is invoked with one argument: (value). * * @template T * @param {T | null | undefined} collection - The collection to iterate over. * @param {((value: T[keyof T]) => unknown) | PropertyKey | [PropertyKey, any] | Partial} callback - The function invoked per iteration. * @returns {[Array, Array]} Returns the array of grouped elements. * * @example * partition({ a: 1, b: 2, c: 3 }, n => n % 2 === 0); * // => [[2], [1, 3]] */ declare function partition(collection: T | null | undefined, callback: ValueIteratee): [Array, Array]; export { partition };