sflow
Version:
sflow is a powerful and highly-extensible library designed for processing and manipulating streams of data effortlessly. Inspired by the functional programming paradigm, it provides a rich set of utilities for transforming streams, including chunking, fil
25 lines • 853 B
TypeScript
import type { Awaitable } from "./Awaitable";
/**
* Assume Stream content is ordered plain json object, (class is not supported)
* And new element always insert into head
*
* Only emit unmet contents
*
* Once flow done, cache latest contents in windowSize, and skip from cached content next time
*
*
*/
export declare function cacheSkips<T>(store: {
has?: (key: string) => Awaitable<boolean>;
get: (key: string) => Awaitable<T[] | undefined>;
set: (key: string, chunks: T[]) => Awaitable<void>;
}, _options?: string | {
/**
* Key could step name,
* or defaults to `new Error().stack` if you r lazy enough
*/
key?: string;
/** defaults to 1, incase first n header may modify by others you could set it as 2 */
windowSize?: number;
}): TransformStream<any, any>;
//# sourceMappingURL=cacheSkips.d.ts.map