import type { BoundingBox } from './boundingbox'; import { Modifier } from './modifier'; import { ModifierContextState } from './modifiercontext'; import { Note } from './note'; import { Voice } from './voice'; type StaveLineAccidentalLayoutMetrics = { column: number; line: number; /** * A flat line needs more clearance above than below. This is * set to true if the accidental is either a flat or double flat. */ flatLine: boolean; /** * Double sharps need less clearance above and below than other * accidentals. */ dblSharpLine: boolean; numAcc: number; width: number; }; /** * An `Accidental` inherits from `Modifier`, and is formatted within a * `ModifierContext`. Accidentals are modifiers that can be attached to * notes. Support is included for both western and microtonal accidentals. * * See `tests/accidental_tests.ts` for usage examples. */ export declare class Accidental extends Modifier { /** Accidental code provided to the constructor. */ readonly type: string; /** To enable logging for this class. Set `VexFlow.Accidental.DEBUG` to `true`. */ static DEBUG: boolean; protected cautionary: boolean; /** The printed sign at this same head, recomputed whenever the modifier group is formatted. */ private sharedWith?; /** Select the pair of glyphs around a cautionary or editorial accidental. */ private enclosure; /** Accidentals category string. */ static get CATEGORY(): string; /** At one onset, compare the actual heads after StaveNote.format has separated colliding voices. */ private static shareUnisonSigns; /** A displaced chord head or a separate unison column needs its own sign. */ private sharesHeadWith; /** Arrange accidentals inside a ModifierContext. */ static format(accidentals: Accidental[], state: ModifierContextState): void; /** Helper function to determine whether two lines of accidentals collide vertically */ protected static checkCollision(line1: StaveLineAccidentalLayoutMetrics, line2: StaveLineAccidentalLayoutMetrics): boolean; /** * Use this method to automatically apply accidentals to a set of `voices`. * The accidentals will be remembered between all the voices provided. * Optionally, you can also provide an initial `keySignature`. */ static applyAccidentals(voices: Voice[], keySignature: string): void; /** * Create accidental. * @param type value from `VexFlow.accidentalCodes.accidentals` table in `tables.ts`. * For example: `#`, `##`, `b`, `n`, etc. */ constructor(type: string); protected reset(): void; /** Attach this accidental to `note`, which must be a `StaveNote`. */ setNote(note: Note): this; /** Enclose the sign in round parentheses or square editorial brackets without changing its pitch spelling. */ setAsCautionary(enclosure?: 'parentheses' | 'brackets'): this; /** Identify explicit cautionary signs without inspecting protected engraving state. */ isCautionary(): boolean; /** Render accidental onto canvas. */ /** Place the glyph using the same coordinates for measurement and drawing. */ private positionGlyph; /** Visible glyph after formatting, including cautionary or authored shifts. */ getInkBounds(): BoundingBox; /** Both voices report the published bounds of their shared sign. */ getBoundingBox(): BoundingBox; /** The representative accidental draws the glyph for every voice sharing this head. */ draw(): void; } export {};