/** * Bounded text extraction. Excerpts are taken before concatenation wherever * the source is a block list, so a node carrying megabytes of tool output never * materializes that text just to keep the first few hundred characters. * * @module dsh-context-snapshot-bar/projection/excerpt */ /** One excerpted string and whether the limit cut it. */ export interface Excerpt { /** The kept text, at most `limit` characters. */ text: string; /** Whether characters were dropped. */ truncated: boolean; } /** * Bound one string to a character limit. * * @param text - the source text. * @param limit - maximum characters to keep. * @returns the kept text and whether it was cut. */ export declare function excerpt(text: string, limit: number): Excerpt; /** * Bound the concatenation of several strings without joining them first. * * Blocks are consumed in order until the limit is reached, so the cost is * bounded by the limit rather than by the total source length. * * @param blocks - the source strings, in display order. * @param limit - maximum characters to keep. * @returns the kept text and whether any source text was dropped. */ export declare function excerptBlocks(blocks: readonly string[], limit: number): Excerpt; //# sourceMappingURL=excerpt.d.ts.map