import { Operator } from '../core/types'; /** * @short * *Chunk* an iterable into tuples. * * @categories * operator * * @description * Creates an iterable of elements split into tuples (arrays) of the provided * length. The last tuple can be shorter if the iterable size is not a multiple * of chunk size. * * This is a specialization of {@link segmentizeBy}. * * @parameter * chunkSize * number * Size of a chunk tuple. * * @returns * Operator> * * @throws * `RangeError` when the given `chunkSize` parameter is not an integer, or is less than one. * * @example * j.pipe( * [1, 2, 3, 4], * j.chunk(2), * ) * // => [[1, 2], [3, 4]] * * @example * j.pipe( * [1, 2, 3, 4, 5], * j.chunk(2), * ) * // => [[1, 2], [3, 4], [5]] */ export declare function chunk(chunkSize: 1): Operator; export declare function chunk(chunkSize: 2): Operator; export declare function chunk(chunkSize: 3): Operator; export declare function chunk(chunkSize: 4): Operator; export declare function chunk(chunkSize: 5): Operator; export declare function chunk(chunkSize: 6): Operator; export declare function chunk(chunkSize: 7): Operator; export declare function chunk(chunkSize: 8): Operator; export declare function chunk(chunkSize: 9): Operator; export declare function chunk(chunkSize: 10): Operator; export declare function chunk(chunkSize: number): Operator>; /** * @short * *Chunk* an iterable into tuples of *strictly* defined sizes. * * @categories * operator * * @description * Creates an iterable of elements split into tuples (arrays) of the provided * length. If the element count of the source iterable is such that it's not * possible for the last tuple to be of the specified size, an error will be * thrown. * * Note that, even when an error is thrown, the source iterable will be fully * consumed and all the valid chunks will have been yielded already. * * This is a specialization of {@link segmentizeBy}. * * @parameter * chunkSize * number * Size of a chunk tuple. * * @returns * Operator> * * @throws * `RangeError` when the given `chunkSize` parameter is not an integer, or is less than one. * * @example * j.pipe( * [1, 2, 3, 4], * j.chunk(2), * ) * // => [[1, 2], [3, 4]] * * @example * j.pipe( * [1, 2, 3, 4, 5], * j.chunk(2), * ) * // => [[1, 2], [3, 4], Error */ export declare function chunkStrict(chunkSize: 1): Operator; export declare function chunkStrict(chunkSize: 2): Operator; export declare function chunkStrict(chunkSize: 3): Operator; export declare function chunkStrict(chunkSize: 4): Operator; export declare function chunkStrict(chunkSize: 5): Operator; export declare function chunkStrict(chunkSize: 6): Operator; export declare function chunkStrict(chunkSize: 7): Operator; export declare function chunkStrict(chunkSize: 8): Operator; export declare function chunkStrict(chunkSize: 9): Operator; export declare function chunkStrict(chunkSize: 10): Operator; export declare function chunkStrict(chunkSize: number): Operator>;