import { Operator } from '../core/types'; /** * @short * Like `pairwise`, but you *slide through* a custom window size. * * @categories * operator * * @description * Processes an iterable by yielding successive overlapping tuples of a specified * window size. Each tuple contains `windowSize` consecutive elements from the source * iterable. As iteration progresses, the window slides forward by one position, * excluding the first element of the previous window and including the next element * from the iterable. This operation continues until the source iterable is fully * consumed. * * It follows that the size of the resulting iterable will be the same as the window * size, unless the size of the source iterable is less than the window size -- in * that case, the resulting iterable is empty. * * This is a generalization of {@link pairwise}. * * @since * 0.0.4 * * @parameter * windowSize * number * The size of each yielded tuple. * * @returns * Operator> * * @example * j.pipe( * [1, 2, 3, 4, 5], * j.slideThrough(3), * ) * // => [[1, 2, 3], [2, 3, 4], [3, 4, 5]] * * @example * j.pipe( * [1, 2, 3], * j.slideThrough(4), * ) * // => [] */ export declare function slideThrough(windowSize: 1): Operator; export declare function slideThrough(windowSize: 2): Operator; export declare function slideThrough(windowSize: 3): Operator; export declare function slideThrough(windowSize: 4): Operator; export declare function slideThrough(windowSize: 5): Operator; export declare function slideThrough(windowSize: 6): Operator; export declare function slideThrough(windowSize: 7): Operator; export declare function slideThrough(windowSize: 8): Operator; export declare function slideThrough(windowSize: 9): Operator; export declare function slideThrough(windowSize: 10): Operator; export declare function slideThrough(windowSize: number): Operator>; /** * @short * Like `slideThrough`, but *cyclic*. * * @categories * operator * * @description * Processes an iterable by yielding successive overlapping sub-arrays of a specified * window size, similar to `slideThrough`. However, upon fully consuming the source * iterable, this operator wraps around to the beginning, continuing the sliding * window operation in a cyclic manner. The final sub-arrays combine elements from * the end of the iterable with those from the beginning, forming a continuous loop. * * It follows that the size of the resulting iterable will always be either the size * of the source iterable or the window size, whichever is smaller. * * This is a generalization of {@link pairwiseCyclic}. * * @since * 0.0.4 * * @parameter * windowSize * number * The size of each yielded tuple. * * @returns * Operator> * * @example * j.pipe( * [1, 2, 3, 4, 5], * j.slideThrough(3), * ) * // => [ * // [1, 2, 3], * // [2, 3, 4], * // [3, 4, 5], * // [4, 5, 1], * // [5, 1, 2], * // ] * * @example * j.pipe( * [1, 2, 3], * j.slideThrough(4), * ) * // => [ * // [1, 2, 3, 1], * // [2, 3, 1, 2], * // [3, 1, 2, 3], * // ] */ export declare function slideThroughCyclic(windowSize: 1): Operator; export declare function slideThroughCyclic(windowSize: 2): Operator; export declare function slideThroughCyclic(windowSize: 3): Operator; export declare function slideThroughCyclic(windowSize: 4): Operator; export declare function slideThroughCyclic(windowSize: 5): Operator; export declare function slideThroughCyclic(windowSize: 6): Operator; export declare function slideThroughCyclic(windowSize: 7): Operator; export declare function slideThroughCyclic(windowSize: 8): Operator; export declare function slideThroughCyclic(windowSize: 9): Operator; export declare function slideThroughCyclic(windowSize: 10): Operator; export declare function slideThroughCyclic(windowSize: number): Operator>;