import type { Annotation } from './annotation'; import { Bounds } from './boundingbox'; import type { ContinuousBeam } from './continuousbeam'; import { Element } from './element'; import type { TiedBend } from './guitargesture'; import { NienteTip } from './hairpintip'; import { Note } from './note'; import { RenderContext } from './rendercontext'; import { Stave } from './stave'; import { TiedBendDrawing } from './tiedbend'; export type ContinuousSpanKind = 'beam' | 'tie' | 'slur' | 'glissando' | 'crescendo' | 'diminuendo' | 'pedal' | 'lyric' | 'hyphen' | 'volta' | 'ottava' | 'trill' | 'tuplet' | 'palmMute'; export interface ContinuousSpan { kind: ContinuousSpanKind; /** Traditional signs are anchored independently. The release sign ends at the end of its timed event. */ pedalStyle?: 'text' | 'bracket'; /** Apply a flared aperture along the whole crescendo or diminuendo. */ flared?: boolean; /** Draw this pitched glissando with waves perpendicular to its slope. */ wavy?: boolean; /** Stroke the first half of the logical slur with dashes, even across a break. */ halfDashed?: boolean; /** Draw this pitch tie as a dashed arc, including its continuation fragments. */ dashed?: boolean; /** Mark the closed musical endpoint of a crescendo or diminuendo with an open circle. */ niente?: boolean; /** Bend one TAB string through this tie, with rise on the first event and release on the second. */ bend?: TiedBend; /** One-based string shared by both TAB tie or slur endpoints. Defaults to the string of the selected chord position. */ string?: number; /** Required for palmMute. String numbers are one-based. */ strings?: readonly number[]; id: string; from: string; to: string; /** Optional zero-based chord-head indices. On TAB ties and slurs these index the positions arrays. */ fromHead?: number; toHead?: number; side?: 'above' | 'below'; /** Syllable, ending number, tuplet ratio or octave label, according to kind. */ text?: string; /** Optional type size for this label, in points. Measured before system breaks are chosen. */ labelFontSize?: number; /** For a lyric extender, take the baseline and ink edge from this Annotation on the source note. */ syllableId?: string; /** Leave clearance before the ink of this arrival syllable on the destination note. */ toSyllableId?: string; } export interface SpanAnchor { measure: number; staff: number; note: Note; } export interface ResolvedSpan { spec: ContinuousSpan; first: SpanAnchor; last: SpanAnchor; label?: Element; syllable?: Annotation; toSyllable?: Annotation; beam?: ContinuousBeam; bendLabel?: Element; } export interface SpanFragment { id: string; kind: ContinuousSpanKind; /** Apply a flared aperture along the whole crescendo or diminuendo. */ flared?: boolean; /** Draw this pitched glissando with waves perpendicular to its slope. */ wavy?: boolean; /** Stroke the first half of the logical slur with dashes, even across a break. */ halfDashed?: boolean; /** Draw this pitch tie as a dashed arc, including its continuation fragments. */ dashed?: boolean; row: number; part: 'single' | 'first' | 'middle' | 'last'; x1: number; x2: number; y1: number; y2: number; /** Fraction of the drawn span used to interpolate the aperture across a system break. */ progress: [number, number]; /** Present only on the fragment that owns the closed musical endpoint. */ nienteTip?: NienteTip; /** Row-local geometry and authored envelope of a tied string bend. */ bend?: TiedBendDrawing; /** String numbers covered by a TAB curve or palm-mute fragment. */ strings?: readonly number[]; /** Authored TAB endpoints appear on the fragments containing them. */ from?: string; to?: string; rise?: number; above: boolean; space: number; } /** Unlike a glyph sized in a default font, labels contribute their actual current text width to reservations. */ export declare function spanLabel(spec: ContinuousSpan): Element | undefined; export declare function spanAbove(span: ContinuousSpan): boolean; /** Retain the written pitch through a clef change at a continuation edge. */ export declare function continuationPitch(anchor: SpanAnchor, stave: Stave, index?: number): number; /** Interpolate the two written heads on this staff, so a broken slide keeps its direction across rows. */ export declare function glissandoY(span: ResolvedSpan, stave: Stave, progress: number): number; /** Subdivide the actual ribbon for collision checks and vertical fitting. */ export declare function curveParts(f: SpanFragment): Bounds[]; /** Prefer the shallowest clear curve. Preserve the best finite candidate if the space is infeasible. */ export declare function fitSpan(f: SpanFragment, obstacles: Bounds[]): boolean; /** Draw only the hooks, labels and wedge apertures belonging to this particular segment. */ export declare function drawSpan(ctx: RenderContext, f: SpanFragment, label?: Element, bendLabel?: Element): void;