UNPKG

iteragain

Version:

Javascript Iterable/Iterator/Generator-function utilities.

12 lines 930 B
import type { IterSource, IteratorOrIterable, Tuple } from './types'; /** * Returns `size` length subsequences of the input iterator. * @see https://docs.python.org/3/library/itertools.html#itertools.combinations for more info. * @see https://docs.python.org/3/library/itertools.html#itertools.combinations_with_replacement for more info. * @param size The size of each combination. * @param withReplacement Whether or not to allow duplicate elements in the combinations. */ export declare function combinations<T extends IteratorOrIterable<any>, Size extends number>(arg: T, size: Size, withReplacement?: boolean): IterableIterator<Tuple<IterSource<T>, Size>>; export declare function combinations<T extends IteratorOrIterable<any>, Size extends number>(size: Size, withReplacement?: boolean): (arg: T) => IterableIterator<Tuple<IterSource<T>, Size>>; export default combinations; //# sourceMappingURL=combinations.d.ts.map