/** * @description Abstract stream processor that buffers ("stashes") consecutive * items matching a predicate before flushing them as a group. Subclasses * implement `shouldStash`, `doMatchesStash`, and `doFlushStash` to define what * constitutes a run. Used by `WordDetectionStream` in `LineConverter` (grouping * same-format text spans) and `VerticalsStream` in `VerticalToHorizontal` * (merging single-character vertical lines into one horizontal line). */ export default class StashingStream { results: any[]; stash: any[]; constructor(); consumeAll(items: any[]): void; consume(item: any): void; pushOnStash(item: any): void; complete(): any[]; matchesStash(item: any): boolean; flushStash(): void; onPushOnStash(item: any): void; shouldStash(item: any): boolean; doMatchesStash(lastItem: any, item: any): boolean; doFlushStash(stash: any[], results: any[]): void; }