@naturalcycles/nodejs-lib
Version:
Standard library for Node.js
12 lines (11 loc) • 614 B
TypeScript
import type { PositiveInteger } from '@naturalcycles/js-lib/types';
import type { TransformOptions, TransformTyped } from '../stream.model.js';
/**
* Similar to RxJS bufferCount(),
* allows to "chunk" the input stream into chunks of `opt.chunkSize` size.
* Last chunk will contain the remaining items, possibly less than chunkSize.
*
* `chunkSize` indicates how many items to include in each chunk.
* Last chunk will contain the remaining items, possibly less than chunkSize.
*/
export declare function transformChunk<IN = any>(chunkSize: PositiveInteger, opt?: TransformOptions): TransformTyped<IN, IN[]>;