/** * Try to spread out the batches evenly. * That is, if the list has 11 items with a `maxPerBatch` of 5, * instead of getting `[5, 5, 1]` you would get `[4, 4, 3]`. */ export declare const SPREAD_BATCHES = "spread"; /** * Fill each batch to the maximum, except possibly the last. * That is, if the list has 11 items with a `maxPerBatch` of 5, * you would get `[5, 5, 1]`. */ export declare const FILL_BATCHES = "fill"; /** * Strategy for grouping array items into batches. */ export type ToBatchesMode = typeof SPREAD_BATCHES | typeof FILL_BATCHES; /** * Group the given list into batches of the given maximum count, * optionally using a given strategy. */ export declare const toBatches: (maxPerBatch: number, list: T[], mode?: ToBatchesMode) => T[][]; /** * Generate an array reducer which will group the given list into * batches of the given maximum count, optionally using a given strategy. * @example * const batches = list.reduce(...toBatchesReducer(5)); */ export declare const toBatchesReducer: (maxPerBatch: number, mode?: ToBatchesMode) => [reduce: (prev: T[][], cur: T, index: number, list: T[]) => T[][], initial: T[][]]; //# sourceMappingURL=to-batches.d.ts.map