[], const P extends Iterable = []>(iterables: readonly [...T], options: ZipOptions | ZipLongestOptions) => IteratorObject<{ [K in keyof T]: FlattenableItem | ZipPadding }, undefined, unknown>
) & (
>(iterables: Iterable, options?: ZipOptions) => IteratorObject[], undefined, unknown>
) & (
, const P extends Iterable = []>(iterables: Iterable, options: ZipOptions | ZipLongestOptions) => IteratorObject<(FlattenableItem | ZipPadding)[], undefined, unknown>
);
/**
* Same as `zip`, but takes an object of iterables, and yields objects with the
* same keys, like `Iterator.zipKeyed` from the Joint Iteration proposal. Keys
* whose value is `undefined` are left out. In `longest` mode, `padding` is an
* object with a value for each key.
*/
export const zipKeyed: (
(iterables: T, options?: ZipOptions) => IteratorObject<{ [K in keyof T as ZipKey]: ZipKeyedItem }, undefined, unknown>
) & (
(iterables: T, options: ZipOptions | ZipLongestOptions) => IteratorObject<{ [K in keyof T as ZipKey]: ZipKeyedItem | (K extends keyof P ? P[K] : undefined) }, undefined, unknown>
);
export type ZipKeyedInputs = Record | undefined>;
type ZipKeyedItem = FlattenableItem | (undefined extends R ? undefined : never);
/**
* Yields values from each iterator in order.
*/
export const concat: []>(...iterables: T) => IteratorObject, undefined, unknown>;
/**
* Reduce an iterator to a single value. Without an initial value, the first
* value in the iterator is the initial value, and an empty iterator throws a
* TypeError.
*/
export const reduce: (
(fn: Reducer, initial: B) => (iterable: Iterable) => B
) & (
(fn: Reducer) => (iterable: Iterable) => A
);
export type Reducer = (acc: B, item: A, index: number) => B;
/**
* Returns a boolean indicating whether or not all values in the iterator passes
* the predicate function.
*/
export const every: (fn: Predicate) => (iterable: Iterable) => boolean;
/**
* Returns a boolean indicating whether or not there exists a value in the
* iterator that passes the predicate function.
*/
export const some: (fn: Predicate) => (iterable: Iterable) => boolean;
/**
* Returns the first value that passes the predicate function. A predicate
* that's a type guard narrows the type of the value.
*/
export const find: (
(fn: TypeGuard) => (iterable: Iterable) => S | undefined
) & (
(fn: Predicate) => (iterable: Iterable) => B | undefined
);
/**
* Call a function with every value in the iterator. Unlike `tap`, it ends a
* pipeline.
*/
export const forEach: (fn: Tapper) => (iterable: Iterable) => void;
/**
* Returns the number of items in the iterator.
*/
export const count: (iterable: Iterable) => number;
/**
* Collect all the items in the iterator into an array.
*/
export const toArray: (iterable: Iterable) => A[];
/**
* Collect all the items in the iterator into a Set.
*/
export const toSet: (iterable: Iterable) => Set;
/**
* Collect all the key/value tuples in the iterator into a Map.
*/
export const toMap: (iterable: Iterable) => Map;
/**
* Collect all the key/value tuples in the iterator into an Object.
*/
export const toObject: (iterable: Iterable) => Record;
/**
* Collect all the items in the iterator into a string separated by the
* separator token.
*/
export const join: (separator: string) => (iterable: Iterable) => string;