import { ValueIteratee } from "../_internal/ValueIteratee.js"; import { ValueIteratorTypeGuard } from "../_internal/ValueIteratorTypeGuard.js"; //#region src/compat/array/partition.d.ts /** * 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 collection - The collection to iterate over. * @param callback - The function invoked per iteration. * @returns 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 collection - The collection to iterate over. * @param callback - The function invoked per iteration. * @returns 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 collection - The collection to iterate over. * @param callback - The function invoked per iteration. * @returns 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]; //#endregion export { partition };