import { BoundingBox } from './boundingbox'; import { Stave } from './stave'; import { StaveModifier } from './stavemodifier'; /** A custom sign is anchored to a written pitch or to an explicit half-line measured from the top. */ export type OrderedKeySign = { type: string; pitch: string; line?: never; } | { type: string; line: number; pitch?: never; }; /** An edition's named written signatures. Each selection creates an independent stave modifier. */ export declare class KeySignaturePresets { private readonly definitions; /** Register or replace an edition's definition. Existing selections keep their own signs. */ register(name: string, entries: readonly OrderedKeySign[]): this; /** Select a signature by its exact name within this edition. */ select(name: string): KeySignature; } export declare class KeySignature extends StaveModifier { static get CATEGORY(): string; private ordered?; /** Preserve the author's sign order. Resolve pitches against the active clef during formatting. */ setOrdered(entries: readonly OrderedKeySign[]): this; protected paddingForced: boolean; protected formatted?: boolean; protected clefOverride?: string; protected cancelKeySpec?: string; protected accList: { type: string; line: number; }[]; protected keySpec?: string; protected alterKeySpec?: string[]; constructor(keySpec: string, cancelKeySpec?: string, alterKeySpec?: string[]); protected convertToGlyph(acc: { type: string; line: number; }, nextAcc: { type: string; line: number; }, stave: Stave): void; cancelKey(spec: string): this; protected convertToCancelAccList(spec: string): { type: string; accList: { type: string; line: number; }[]; } | undefined; addToStave(stave: Stave): this; setStave(stave: Stave): this; getBoundingBox(): BoundingBox; protected calculateDimensions(): void; protected convertAccLines(clef: string, type?: string, accList?: { type: string; line: number; }[]): void; getPadding(index: number): number; getWidth(): number; /** Override staff clef for an inline signature following an inline clef change. */ setClef(clef?: string): this; setKeySig(keySpec: string, cancelKeySpec?: string, alterKeySpec?: string[]): this; alterKey(alterKeySpec: string[]): this; protected convertToAlterAccList(alterKeySpec: string[]): void; /** * Format and position the modifier. * If no stave is set, a dummy stave is created. */ format(): void; private formattedStaveY?; private formattedClef?; /** End signatures follow an end clef when one is present. Inline signatures can override the stave. */ private activeClef; /** Stave clef and origin can change while the same signature object stays attached. */ private ensureFormatted; /** Refresh the accidental origins after moving a staff and return each positioned glyph. */ getInkParts(): BoundingBox[]; draw(): void; }