import type { Annotation } from './annotation'; import type { Bounds } from './boundingbox'; import type { ContinuousLayout } from './continuouslayout'; import type { PlacedCompositionMark } from './easyscore/engraving'; import { Factory } from './factory'; import type { RenderContext } from './rendercontext'; import { StaveNote } from './stavenote'; import { System, SystemOptions } from './system'; /** Dimensions are in rendering units (normally pixels). */ export interface SheetOptions { factory: Factory; width?: number; x?: number; y?: number; rowGap?: number; measureGap?: number; measurePadding?: number; justify?: boolean; } /** A drum hand at a native attack. Rests and entries without a hand remain unmarked. */ export interface StickingAssignment { note: StaveNote; hand?: 'R' | 'L'; } /** Layout result. Oversized measures occupy their own row and remain readable. */ export interface SheetRow { systems: System[]; x: number; y: number; width: number; height: number; overflow: number; } /** Arrange measure-sized Systems left to right, wrapping at a requested width. */ export declare class Sheet { private options; private continuous?; /** Note-owned marks, grouped by measure so a line can follow any set of row breaks. */ private stickingLines; private placeEngraving?; private engravingMarks; /** @internal Run the composition's final-placement hook after all its systems have coordinates. */ setEngravingPlacement(place: (rows: readonly SheetRow[]) => PlacedCompositionMark[]): void; /** Source-owned native and custom ink in the sheet coordinate system. Recomputed on every format. */ getEngravingMarks(): readonly PlacedCompositionMark[]; /** @internal Paint after native notation. SVG groups retain the anchor and index into the measured marks. */ drawEngraving(context: RenderContext): void; private alignedWidths?; /** @internal Fit a single reference system to the already formatted measures of a publication. */ alignToMeasures(widths: readonly number[]): this; /** Composition installs a score-aware layout while retaining the native sheet resize and draw API. */ setContinuousLayout(layout: ContinuousLayout): this; getContinuousLayout(): ContinuousLayout | undefined; private systems; private rows; constructor(options: SheetOptions); /** Create a measure. Add its staves and voices with the existing System API. */ addSystem(options?: Omit): System; /** Attach a percussion sticking line after the passage's voices have been added to the sheet. */ addStickingLine(assignments: readonly StickingAssignment[]): Annotation[]; /** @internal Carry the lowest solved sticking baseline across the row before placing the next row. */ alignSticking(row: SheetRow, includeInk?: (box: Bounds) => void): void; /** Update the available row width. Call format() or Factory.draw() to reflow. */ setWidth(width: number): this; /** Access the measures without exposing the membership array. */ getSystems(): System[]; /** Inspect row bounds and overflow after formatting. */ getRows(): SheetRow[]; /** Required drawing height, including the top inset and final custom ink. */ getHeight(): number; /** Measure and pack rows. Always recompute, so repeated resize is deterministic. */ format(): this; /** Measure and position native rows before custom elements read final coordinates. */ private formatRows; /** Measure intrinsic widths without carrying coordinates over from a prior layout. */ private measureSystems; /** Greedy packing keeps measure order and gives oversized measures their own rows. */ private packRows; /** Include staff envelopes and note bounds in the ordinary vertical layout. */ private verticalBounds; /** Justify a row horizontally, then place every measure on a shared baseline. */ private formatRow; }