import type { VDTBlock, VDTDocument, VDTLine, VDTPage } from './vdt.js'; /** * The word spacing of a justified line in the units of * `bodyText.minWordSpacing` and `maxWordSpacing` (#704): the ratio the * breaker bounds (`justifiedSpaceLimitRatio`) when the line carries one, * else `justifiedSpaceRatio`, which is the same number on a line whose * spaces all come from the regular face. Undefined for a line that is not * justified. Compare this with the limits, not `justifiedSpaceRatio`: a * line that holds a bold or an italic space is painted a little over or * under the limit it was broken within. */ export declare function lineWordSpacing(line: Pick): number | undefined; /** * How loosely a line is set, as a word-space ratio: its word spacing * ({@link lineWordSpacing}), or, for a CJK line spread between its characters * (segment `tracking`), `1 + tracking / (β…› em)` β€” at the default threshold * of 3, a line whose characters are spread by more than ΒΌ em is loose. The * larger of the two when a line has both; undefined when it has neither. * `fontSizePx` is the block's text size. */ export declare function lineLooseness(line: VDTLine, fontSizePx: number): number | undefined; /** A justified line whose word spaces stretch past the loose-line threshold, * with the band the highlight covers. */ export interface LooseLine { block: VDTBlock; line: VDTLine; /** The line's word spacing as the limits bound it * ({@link lineWordSpacing}); for a CJK line spread between its * characters, the ratio {@link lineLooseness} gives. */ ratio: number; /** The highlight band, in page pixels: the block's full width across the * line's box. */ x: number; y: number; width: number; height: number; } export interface FindLooseLinesOptions { /** A line counts as loose when its ratio exceeds this. Default: 3, the * default `debug.looseLineHighlight.threshold`; pass a config's own with * `resolveDebugConfig(config.debug).looseLineHighlight.threshold`. */ threshold?: number; /** Only the lines of this page. Default: every page. */ pageIndex?: number; } export interface DrawLooseLinesOptions { /** See {@link FindLooseLinesOptions.threshold}. */ threshold?: number; /** Any canvas fill style. Default: `#ff000040` (a translucent red), the * default `debug.looseLineHighlight.color`. */ color?: string; } /** * The loose lines of a laid-out document, in block and line order: the lines * the Sandbox's loose-line highlight and its `looseLine` check mark. */ export declare function findLooseLines(doc: VDTDocument, options?: FindLooseLinesOptions): LooseLine[]; /** * Paint the loose-line highlight of one page onto a 2D context, in page * pixels under the context's current transform β€” call it right after * `renderPage` / `renderPageToCanvas` on the same canvas, which leave the * context scaled to the page. Returns the lines it painted. */ export declare function drawLooseLines(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, page: VDTPage, doc: VDTDocument, options?: DrawLooseLinesOptions): LooseLine[]; //# sourceMappingURL=looseLines.d.ts.map