import { BoundingBox } from './boundingbox'; import { Element } from './element'; import { Factory } from './factory'; import { FormatParams, Formatter, FormatterOptions } from './formatter'; import { PhraseLayout } from './phraselayout'; import { RenderContext } from './rendercontext'; import { Stave, StaveOptions } from './stave'; import { StaveConnector, StaveConnectorType } from './staveconnector'; import { Voice } from './voice'; export interface SystemFormatterOptions extends FormatterOptions { alpha?: number; } export interface SystemStave { voices: Voice[]; stave?: Stave; noJustification?: boolean; options?: StaveOptions; spaceAbove?: number; spaceBelow?: number; debugNoteMetrics?: boolean; } interface StaveInfo { noJustification: boolean; options: StaveOptions; spaceAbove: number; spaceBelow: number; debugNoteMetrics: boolean; } /** * Formatting for systems created/drawn from factory: * * If width is provided, the system will use the specified width. * * If noJustification flag is 'true', there is no justification between voices * Otherwise, autoWidth defaults to true. * * If autowidth is true, the system uses format.preCalculateMinWidth * for the width of all voices, and default stave padding */ export interface SystemOptions { factory?: Factory; noPadding?: boolean; debugFormatter?: boolean; spaceBetweenStaves?: number; formatIterations?: number; autoWidth?: boolean; x?: number; width?: number; y?: number; details?: SystemFormatterOptions; formatOptions?: FormatParams; noJustification?: boolean; } /** * System implements a musical system, which is a collection of staves, * each which can have one or more voices. All voices across all staves in * the system are formatted together. */ export declare class System extends Element { static get CATEGORY(): string; protected options: Required; private requestedStaffDistance?; protected factory: Factory; protected formatter?: Formatter; protected startX?: number; protected lastY?: number; protected partStaves: Stave[]; protected partStaveInfos: StaveInfo[]; protected partVoices: Voice[]; protected connector?: StaveConnector; protected debugNoteMetricsYs?: { y: number; stave: Stave; }[]; constructor(params?: SystemOptions); /** Set formatting options. */ setOptions(options?: SystemOptions): void; /** Get origin X. */ getX(): number; /** Set origin X. */ setX(x: number): this; /** Get origin y. */ getY(): number; /** Set origin y. */ setY(y: number): this; /** Get associated staves. */ getStaves(): Stave[]; /** Get associated voices. */ getVoices(): Voice[]; /** Set a fixed layout width, or request the minimum width when omitted. */ setWidth(width?: number): this; /** Width assigned by the latest layout. */ getWidth(): number; /** Set associated context. */ setContext(context: RenderContext): this; /** * Add connector between staves. * @param type see {@link StaveConnector.typeString} */ addConnector(type?: StaveConnectorType): StaveConnector; /** Replace this measure's ending bars with one Mensurstrich per gap. Call after adding all staves. */ addMensurstriche(): StaveConnector[]; /** * Add a stave to the system. * * Example (one voice): * * `system.addStave({voices: [score.voice(score.notes('C#5/q, B4, A4, G#4'))]});` * * Example (two voices): * * `system.addStave({voices: [` * `score.voice(score.notes('C#5/q, B4, A4, G#4', {stem: 'up'})),` * `score.voice(score.notes('C#4/h, C#4', {stem: 'down'}))` * `]});` */ addStave(params: SystemStave): Stave; /** * Add voices to the system with stave already assigned. */ addVoices(voices: Voice[]): void; private phrase?; /** Opt in to local phrase placement on this system and register its verses and spans. */ getPhraseLayout(): PhraseLayout; /** Minimum origin-to-origin distance for profiled staves, including per-staff padding. */ getMinimumStaffDistance(upper: number, lower: number): number; /** Ink positioned by registered phrase lanes and routes on this stave. */ getPhraseInk(stave: Stave): import("./boundingbox").Bounds[]; /** Group bar-edge signs by physical stave and text line before choosing the measure width. */ private formatDirections; /** Format the system. */ format(row?: { staffOffsets?: readonly number[]; endPadding?: number; deferStaffSpacing?: boolean; }): void; /** Get the boundingBox. */ getBoundingBox(): BoundingBox; /** Render the system. */ draw(): void; } export {};