import { Annotation } from './annotation'; import { Articulation } from './articulation'; import { BoundingBox, Bounds } from './boundingbox'; import { Curve } from './curve'; import { Element } from './element'; import { Ornament } from './ornament'; import { PedalMarking } from './pedalmarking'; import { RenderContext } from './rendercontext'; import { Stave } from './stave'; import { StaveHairpin } from './stavehairpin'; import { StaveNote } from './stavenote'; import { StaveTie } from './stavetie'; import { TextBracket } from './textbracket'; import { Voice } from './voice'; /** A syllable owns one event. Hyphens lead to the next syllable; extenders end on a named event. */ export interface PhraseSyllable { note: StaveNote; text: string; /** A second syllable sung on this attack, joined to the first by an engraved undertie. */ elideWith?: string; hyphenAfter?: boolean; extendTo?: StaveNote; } export type PhraseMark = Annotation | StaveHairpin | PedalMarking | TextBracket; export interface PhraseLaneOptions { side?: 'above' | 'below'; /** Pin the common baseline in staff spaces from the top line, positive downward. */ baselineSpaces?: number; } /** Print the supplied stanza text once at the left margin of this verse. */ export interface PhraseVerseOptions extends PhraseLaneOptions { stanza?: string; } export interface PhraseDiagnostic { code: 'PinnedCollision' | 'UnresolvedCollision' | 'CrossingSpans' | 'UnsupportedGeometry' | 'UnsupportedScript' | 'InvalidAnchor' | 'IterationLimit' | 'InsufficientLyricSpace'; sources: string[]; } type Route = Curve | StaveTie; type LocalMark = Articulation | Ornament; /** Opt-in system-local layout. Register native spans and outside marks before formatting. */ export declare class PhraseLayout { readonly diagnostics: PhraseDiagnostic[]; private lanes; private routes; private fixed; private pins; private managed; private restLines; private obstacles; private connectors; private stanzaLabels; private messages; private iterationLimit; private lockedStaves; bounds?: BoundingBox; passes: number; /** Include a native span or additional positioned obstacle, e.g. a tuplet on a second voice. */ addObstacle(stave: Stave, owner: Element): this; /** Keep authored rest lines, mark placement or curve controls. Report any unresolved collision. */ pin(owner: LocalMark | StaveNote | Route): this; /** Preserve the configured distance above this stave. */ lockStaffGap(stave: Stave): this; /** Bound the number of staff-spacing and cross-staff beam refits. */ setPassLimit(limit: number): this; /** Fit ties before slurs. Explicit control points remain authoritative. */ route(span: Route): this; /** One lane aligns dynamics with wedges, or places a pedal or ottava outside earlier lanes. */ addLane(stave: Stave, marks: PhraseMark[], options?: PhraseLaneOptions): this; /** Pin a registered text lane to the shared row solution before its final native layout. */ setRowBaseline(first: Annotation, spaces: number | undefined): void; /** Each whole syllable uses native text shaping and participates in ModifierContext horizontal spacing. */ addVerse(stave: Stave, syllables: PhraseSyllable[], options?: PhraseVerseOptions): Annotation[]; /** Width of the shared stanza column, including its side margins in staff spaces. */ getStanzaColumnWidth(stave: Stave): number; /** Restore derived rest positions before native formatting; preserve subsequent authored edits. */ resetPlacement(): void; private report; private addParts; private measure; /** Collect native ink once per owner. Bare staff lines constrain outside lanes but permit notes and curves. */ private collect; private hits; private placeRest; private placeAttachment; /** Inner spans reserve their ribbons first. Ties use modest quadratic lifts, slurs a wider cubic search. */ private placeRoutes; /** Reject detached, reversed and foreign anchors before asking a mark for drawing coordinates. */ private validLane; private lyricLines; private placeLane; /** Staff-owned ink after placement, excluding stems and beams that bridge a movable gap. */ getStaffInk(stave: Stave): Bounds[]; /** Refit from the native staff positions on every format, never from the previous solution. */ format(staves: Stave[], voices: Voice[], deferStaffSpacing?: boolean): void; /** Staff-space placement in renderer coordinates. The result is a snapshot after format. */ getLyricConnectors(): BoundingBox[]; /** Draw stanza labels and connectors. Syllables are drawn by their notes. */ draw(context: RenderContext): void; } export {};