UNPKG

data-collectors

Version:

A collection of composable reduction operations for arbitrary streams of values

14 lines (13 loc) 751 B
import { Collector, BaseCollector } from "../collector"; import { Mapper } from "../collections/groupingBy"; export declare class FlatMappingCollector<T, U, A, R> extends BaseCollector<T, A, R> { protected mapper: Mapper<T, Iterable<U>>; protected collector: Collector<U, A, R>; constructor(mapper: Mapper<T, Iterable<U>>, collector: Collector<U, A, R>); supply(): A; accumulate(container: A, item: T): void; combine(container1: A, container2: A): A; finish(container: A): R; } export declare function flatMapping<T, U>(mapper: Mapper<T, Iterable<U>>): Collector<T, U[], U[]>; export declare function flatMapping<T, U, A, R>(mapper: Mapper<T, Iterable<U>>, collector?: Collector<U, A, R>): Collector<T, A, R>;