import Vex from './vexflow'; import Artist from './artist'; import VexTab from './vextab'; import Player, { type PlayerOptions } from './player'; import type { PlaybackPlugin } from './playback/transport'; import type { SourceRange } from './score/source'; import type { ScoreReadingEvent } from 'vexflow'; import { type ScoreCapacity } from './score/parse'; import { type PartSelector } from './score/conductor'; import { type Part } from './score/layout'; import type { ParsedScore } from './score/model'; import type { ScoreV2 } from './score/grammar2/model'; /** A grand staff needs the shared measure formatter. An explicit embed layout wins. */ export declare function usesFlowLayout(host: HTMLElement, source: string): boolean; /** Host integrations can supply an instrument without loading any synthesizer into VexTab. */ export interface DivOptions { language?: 1 | 2; /** The host can opt into bounded large grammar-v2 documents. */ capacity?: ScoreCapacity; partIndex?: number; partId?: string; view?: 'parts' | 'conductor'; playback?: PlaybackPlugin; /** Choose performed order to follow repeat signs and endings. */ order?: 'written' | 'performed'; performer?: PlayerOptions['performer']; seed?: number; /** Force the embed player on or off. Omit to follow its source or configured controls. */ player?: boolean; /** Enable, hide or place sheet controls. An HTMLElement mounts the buttons in a separate toolbar. */ playbackControls?: PlayerOptions['controls']; } declare class Div { private player?; private readonly playback; private readonly enablePlayer?; private readonly playbackControls?; private sel; private code; private width; private autoWidth; private scale; private rendererBackend; private flow; private readonly capacity; private readonly grammar2; private partIndex?; private partId?; private conductor; private readonly performer; private readonly seed?; private readonly order; private part; private observer?; private resizeFrame?; private disposed; private composing; private diagnostic?; private candidate?; private document?; private current?; private surface; private editor; private show_errors; private editor_width; private editor_height; private text_area; private editor_error; private timeoutID; private artist; private parser; /** * Construct the Div renderer and immediately render the initial markup. * Design note: we read once from the DOM and then manage our own state. */ constructor(sel: string | HTMLElement, options?: DivOptions); /** Stop observing an embed when a host removes it or replaces the editor. */ dispose(): void; /** Wait for a complete IME composition before parsing the edited source. */ private scheduleEdit; /** Engrave the live editor contents immediately. */ run(): this; /** Reader IDs are valid only for the current, successfully drawn source revision. */ getReadingEvents(): readonly ScoreReadingEvent[]; /** Return the current source diagnostic, including a located engraving warning. */ getDiagnosticRange(): SourceRange | undefined; /** Select the precise compiler diagnostic in the editor that produced it. */ selectError(): boolean; /** Return the current parsed v2 document, including when just its conductor layout fails. */ getScoreDocument(): ScoreV2 | undefined; /** Switch between the conductor and an instrument while retaining the live editor contents. */ setInstrumentView(target: 'conductor' | PartSelector, part?: Part): this; /** Change the projection without rewriting the score or losing the current editor revision. */ setPart(part: Part): this; /** * Parse and draw the current code in one pass for convenience. */ redraw(): this; /** Report errors as text and identify the last successfully drawn score. */ private reportError; /** Only expose a flow score while its source matches the live editor, even during debounce. */ getScore(): ParsedScore | undefined; /** Rebuild flow geometry from the same parsed revision at a new width. */ setWidth(width: number): this; /** Accept either a musical ID or a projection ID from the current layout. */ selectSource(id: string, revision: ParsedScore): boolean; /** Bind editor selection to this surface and its current instrument or conductor geometry. */ private drawView; /** Mount the conductor, the selected part, or independent parts in source order. */ private drawFlow; /** Commit a new surface only after engraving succeeds, including Canvas pixels. */ private drawInternal; /** Reset the construction state before parsing each editor revision. */ private parseInternal; /** * Public wrapper around parseInternal() with benchmark timing. */ parse(): this; /** * Public wrapper around drawInternal() with benchmark timing. */ draw(): this; } export default Div; export { Div, Vex, Artist, VexTab, Player };