/** * Core Knuth-Plass dynamic-programming breakpoint selection. */ import type { KPItem, KPOptions } from './types.js'; /** A line's adjustment ratio and the tracking it takes (see * {@link adjustLine}). */ export interface LineAdjustment { /** Adjustment ratio of the word spaces once tracking has taken its part. */ r: number; /** Tracking the line takes, px after every character; negative tightens. */ tracking: number; /** Share of the line's tracking capacity it uses (0–1). */ share: number; } /** * The adjustment ratio of a line whose content leaves `slack` px against * its measure (negative when it runs over), with `stretch` / `shrink` px of * word-space give. With `trackingPerChar` set and the line holding at least * one word space (`trackable`), the part of the adjustment beyond the * limits (a ratio above 1, or below -1) goes into tracking on its `chars` * characters, up to `trackingPerChar` each: a loose line's spaces come back * to the stretch limit, a tight one fits at the shrink limit. Shared by the * breaker and the line reconstruction, so both agree on every line. */ export declare function adjustLine(slack: number, stretch: number, shrink: number, chars: number, trackingPerChar: number, trackable: boolean): LineAdjustment; /** * The breaks of a paragraph: the index of the item each line ends at. Set * by the Rust line breaker compiled to WebAssembly when it is available * (see `wasm/engine.ts`), else by {@link breakpoints}; the two choose the * same breaks. */ export declare function computeBreakpoints(items: KPItem[], options: KPOptions): number[]; /** {@link computeBreakpoints} in TypeScript: the reference the WebAssembly * breaker is tested against. */ export declare function computeBreakpointsTs(items: KPItem[], options: KPOptions): number[]; //# sourceMappingURL=breakpoints.d.ts.map