UNPKG

itertools-ts

Version:

Extended itertools port for TypeScript and JavaScript. Provides a huge set of functions for working with iterable collections (including async ones)

26 lines (25 loc) 719 B
/** * Count sequentially forever * * @param start (optional, default 1) * @param step (optional, default 1) */ export declare function count(start?: number, step?: number): Iterable<number>; /** * Cycle through the elements of a collection sequentially forever * * @param iterable */ export declare function cycle<T>(iterable: Iterable<T> | Iterator<T>): Iterable<T>; /** * Cycle through the elements of a async iterable sequentially forever * * @param iterable */ export declare function cycleAsync<T>(iterable: AsyncIterable<T> | AsyncIterator<T> | Iterable<T> | Iterator<T>): AsyncIterable<T>; /** * Repeat an item forever * * @param item */ export declare function repeat<T>(item: T): Iterable<T>;