import { ImageCompression } from "jspdf"; /** * Used to mark a paragraph as chorus * @constant * @type {string} */ export const CHORUS = "chorus"; /** * Used to mark a paragraph as containing lines with both verse and chorus type * @constant * @type {string} */ export const INDETERMINATE = "indeterminate"; /** * Used to mark a paragraph as not containing a line marked with a type * @constant * @type {string} */ export const NONE = "none"; /** * Used to mark a paragraph as tab * @constant * @type {string} */ export const TAB = "tab"; /** * Used to mark a paragraph as verse * @constant * @type {string} */ export const VERSE = "verse"; /** * Used to mark a paragraph as part * @constant * @type {string} */ export const PART = "part"; /** * Used to mark a section as Lilypond notation * @constant * @type {string} */ export const LILYPOND = "ly"; /** * Used to mark a section as ABC music notation * @constant * @type {string} */ export const ABC = "abc"; /** * Used to mark a section as SVG image * @constant * @type {string} */ export const SVG = "svg"; /** * Used to mark a paragraph as textblock * @constant * @type {string} */ export const TEXTBLOCK = "textblock"; type ParagraphType = 'abc' | 'bridge' | 'chorus' | 'grid' | 'indeterminate' | 'ly' | 'none' | 'svg' | 'tab' | 'textblock' | 'verse' | 'part' | string; export const SYMBOL = "symbol"; export const NUMERIC = "numeric"; export const NUMERAL = "numeral"; export const SOLFEGE = "solfege"; type Accidental = '#' | 'b'; type NoAccidental = 'NM'; type AccidentalMaybe = Accidental | NoAccidental; type ChordType = 'symbol' | 'solfege' | 'numeric' | 'numeral'; type FretNumber = number; type OpenFret = 0; type NonSoundingString = '-1' | 'N' | 'x'; type Fret = FretNumber | OpenFret | NonSoundingString; /** * Represents a comment. See https://www.chordpro.org/chordpro/chordpro-file-format-specification/#overview */ export class Comment { content: string; parentLine: Line | null; constructor(content: string); /** * Indicates whether a Comment should be visible in a formatted chord sheet (except for ChordPro sheets) * @returns {boolean} */ isRenderable(): boolean; /** * Returns a deep copy of the Comment, useful when programmatically transforming a song * @returns {Comment} */ clone(): Comment; toString(): string; } type Size = 'px' | '%'; declare class FontSize { /** * The size unit, either `"px"` or `"%"` * @member {string} */ unit: Size; /** * The font size * @member {number} */ fontSize: number; constructor(fontSize: number, kind: Size); clone(): FontSize; multiply(percentage: any): FontSize; /** * Stringifies the font size by concatenating size and unit * * @example * // Returns "30px" * new FontSize(30, 'px').toString() * @example * // Returns "120%" * new FontSize(120, '%').toString() * * @return {string} The font size */ toString(): string; static parse(fontSize: string, parent: FontSize | null): FontSize; static parseNotANumber(parent: FontSize | null): FontSize; static parsePercentage(parsedFontSize: number, parent: FontSize | null): FontSize; } interface FontProperties { font?: string | null; size?: FontSize | null; colour?: string | null; } declare class Font { /** * The font * @member {string | null} */ font: string | null; /** * The font size, expressed in either pixels or percentage. * @member {FontSize | null} */ size: FontSize | null; /** * The font color * @member {string | null} */ colour: string | null; constructor({ font, size, colour }?: FontProperties); clone(): Font; /** * Converts the font, size and color to a CSS string. * If possible, font and size are combined to the `font` shorthand. * If `font` contains double quotes (`"`) those will be converted to single quotes (`'`). * * @example * // Returns "font-family: 'Times New Roman'" * new Font({ font: '"Times New Roman"' }).toCssString() * @example * // Returns "color: red; font-family: Verdana" * new Font({ font: 'Verdana', colour: 'red' }).toCssString() * @example * // Returns "font: 30px Verdana" * new Font({ font: 'Verdana', size: '30' }).toCssString() * @example * // Returns "color: blue; font: 30% Verdana" * new Font({ font: 'Verdana', size: '30%', colour: 'blue' }).toCssString() * * @return {string} The CSS string */ toCssString(): string; } interface TraceInfo { line?: number | null; column?: number | null; offset?: number | null; } declare abstract class AstComponent { parentLine: Line | null; line: number | null; column: number | null; offset: number | null; protected constructor(traceInfo?: TraceInfo | null); abstract clone(): AstComponent; } /** * Image directive. See https://www.chordpro.org/chordpro/directives-image/ * @type {string} */ export const IMAGE = "image"; declare abstract class MetadataAccessors { abstract getMetadataValue(_name: string): string | string[] | null; abstract getSingleMetadataValue(_name: string): string | null; get key(): string | null; get title(): string | null; get subtitle(): string | null; get capo(): string | string[] | null; get duration(): string | null; get tempo(): string | null; get time(): string | string[] | null; get year(): string | null; get album(): string | string[] | null; get copyright(): string | null; get lyricist(): string | string[] | null; get artist(): string | string[] | null; get composer(): string | string[] | null; } /** * Represents a chord definition. * * Definitions are made using the `{chord}` or `{define}` directive. * A chord definitions overrides a previous chord definition for the exact same chord. * * @see https://chordpro.org/chordpro/directives-define/ * @see https://chordpro.org/chordpro/directives-chord/ */ export class ChordDefinition { /** * The chord name, e.g. `C`, `Dm`, `G7`. * @type {string} */ name: string; /** * Defines the offset for the chord, which is the position of the topmost finger. * The offset must be 1 or higher. * @type {number} */ baseFret: number; /** * Defines the string positions. * Strings are enumerated from left (lowest) to right (highest), as they appear in the chord diagrams. * Fret positions are relative to the offset minus one, so with base-fret 1 (the default), * the topmost fret position is 1. With base-fret 3, fret position 1 indicates the 3rd position. * `0` (zero) denotes an open string. Use `-1`, `N` or `x` to denote a non-sounding string. * @type {Fret[]} */ frets: Fret[]; /** * defines finger settings. This part may be omitted. * * For the frets and the fingers positions, there must be exactly as many positions as there are strings, * which is 6 by default. For the fingers positions, values corresponding to open or damped strings are ignored. * Finger settings may be numeric (0 .. 9) or uppercase letters (A .. Z). * Note that the values -, x, X, and N are used to designate a string without finger setting. * @type {number[]} */ fingers: number[]; constructor(name: string, baseFret: number, frets: Fret[], fingers?: number[]); /** * Parses a chord definition in the form of: * - base-fret frets * - base-fret frets fingers * @param chordDefinition * @returns {ChordDefinition} * @see https://chordpro.org/chordpro/directives-define/#common-usage */ static parse(chordDefinition: string): ChordDefinition; clone(): ChordDefinition; } /** * Represents a tag/directive. See https://www.chordpro.org/chordpro/chordpro-directives/ */ export class Tag extends AstComponent { _isMetaTag: boolean; _originalName: string; _name: string; _value: string; chordDefinition?: ChordDefinition; selector: string | null; isNegated: boolean; /** * The tag attributes. For example, section related tags can have a label: * `{start_of_verse: label="Verse 1"}` * @type {Record} */ attributes: Record; constructor(name: string, value?: string | null, traceInfo?: TraceInfo | null, attributes?: Record, selector?: string | null, isNegated?: boolean); static parse(tag: string | Tag): Tag | null; static parseWithRegex(tag: string, regex: RegExp): Tag | null; static parseOrFail(tag: string | Tag): Tag; get label(): string; isSectionDelimiter(): boolean; isSectionStart(): boolean; isSectionEnd(): boolean; isInlineFontTag(): boolean; /** * Checks whether the tag is a comment tag ({comment} or {c}). */ isComment(): boolean; /** * Checks whether the tag is an image tag ({image}). */ isImage(): boolean; set name(name: string); /** * The tag full name. When the original tag used the short name, `name` will return the full name. * @member * @type {string} */ get name(): string; /** * The original tag name that was used to construct the tag. * @member * @type {string} */ get originalName(): string; set value(value: string); /** * The tag value * @member * @type {string} */ get value(): string; /** * Checks whether the tag value is a non-empty string. * @returns {boolean} */ hasValue(): boolean; hasAttributes(): boolean; hasLabel(): boolean; /** * Checks whether the tag is usually rendered inline. It currently only applies to comment tags. * @returns {boolean} */ isRenderable(): boolean; /** * Check whether this tag's label (if any) should be rendered, as applicable to tags like * `start_of_verse` and `start_of_chorus`. * See https://chordpro.org/chordpro/directives-env_chorus/, https://chordpro.org/chordpro/directives-env_verse/, * https://chordpro.org/chordpro/directives-env_bridge/, https://chordpro.org/chordpro/directives-env_tab/ */ hasRenderableLabel(): boolean; /** * Checks whether the tag is a standard meta tag, a custom meta directive (`{x_some_name}`) * or a non-standard meta tag (`{meta: name value}`) * @returns {boolean} */ isMetaTag(): boolean; /** * Checks whether this tag is a standard meta tag or a custom meta directive (`{x_some_name}`) * @returns {boolean} */ isStandardOrCustomMetaTag(): boolean; /** * Returns a clone of the tag. * @returns {Tag} The cloned tag */ clone(): Tag; toString(): string; set({ value }: { value: string; }): Tag; setAttribute(name: string, value: string): Tag; } type MetadataProvider = () => string | null; /** * Stores song metadata. Properties can be accessed using the get() method: * * const metadata = new Metadata({ author: 'John' }); * metadata.get('author') // => 'John' * * See {@link Metadata#get} */ export class Metadata extends MetadataAccessors implements Iterable<[string, string | string[]]> { metadata: Record; providers: Map; constructor(metadata?: Record | Metadata); merge(metadata?: Record | Metadata): Metadata; contains(key: string): boolean; add(key: string, value: string): void; appendValue(key: string, value: string): void; setProvider(key: string, provider: MetadataProvider): void; set(key: string, value: string | null): void; getMetadataValue(name: string): string | string[] | null; getSingleMetadataValue(name: string): string | null; /** * Reads a metadata value by key. This method supports simple value lookup, as well as fetching single array values. * * This method deprecates direct property access, eg: metadata['author'] * * @example * const metadata = new Metadata({ lyricist: 'Pete', author: ['John', 'Mary'] }); * metadata.get('lyricist') // => 'Pete' * metadata.get('author') // => ['John', 'Mary'] * metadata.get('author.1') // => 'John' * metadata.get('author.2') // => 'Mary' * * Using a negative index will start counting at the end of the list: * * const metadata = new Metadata({ lyricist: 'Pete', author: ['John', 'Mary'] }); * metadata.get('author.-1') // => 'Mary' * metadata.get('author.-2') // => 'John' * * @param prop the property name * @returns {Array|String} the metadata value(s). If there is only one value, it will return a String, * else it returns an array of strings. */ get(prop: string): string | string[] | null; /** * Returns all metadata values, including provider values and generated values like `_key`. * @returns {Object.} the metadata values */ all(): Record; ownMetadata(): Record; [Symbol.iterator](): IterableIterator<[string, string | string[]]>; /** * Returns a single metadata value. If the actual value is an array, it returns the first value. Else, it returns * the value. * @ignore * @param {string} prop the property name * @returns {String} The metadata value */ getSingle(prop: string): string | null; parseArrayKey(prop: string): [string, number] | null; getArrayItem(prop: string): string | null; /** * Returns a deep clone of this Metadata object * @returns {Metadata} the cloned Metadata object */ clone(): Metadata; calculateKeyFromCapo(): string | null; assign(metadata: Record): void; } declare abstract class Evaluatable extends AstComponent { abstract evaluate(_metadata: Metadata, _metadataSeparator: string, _variable?: string | null): string; abstract clone(): Evaluatable; } export class Literal extends Evaluatable { string: string; constructor(string: string); evaluate(): string; isRenderable(): boolean; clone(): Literal; } export class Composite extends Evaluatable { expressions: Evaluatable[]; variable: string | null; constructor(expressions: Evaluatable[], variable?: string | null); evaluate(metadata: Metadata, metadataSeparator: string): string; isRenderable(): boolean; clone(): Composite; } type TernaryProperties = TraceInfo & { variable?: string | null; valueTest?: string | null; trueExpression?: Evaluatable[]; falseExpression?: Evaluatable[]; }; export class Ternary extends Evaluatable { variable: string | null; valueTest: string | null; trueExpression: Evaluatable[]; falseExpression: Evaluatable[]; constructor({ variable, valueTest, trueExpression, falseExpression, line, column, offset, }: TernaryProperties); /** * Evaluate the meta expression * @param {Metadata} metadata The metadata object to use for evaluating the expression * @param {string} [metadataSeparator=null] The metadata separator to use if necessary * @returns {string} The evaluated expression */ evaluate(metadata: Metadata, metadataSeparator: string, upperContext?: string | null): string; evaluateToString(value: string[] | string, metadataSeparator: string): string; evaluateWithVariable(metadata: Metadata, metadataSeparator: string): string; evaluateForTruthyValue(metadata: Metadata, metadataSeparator: string, value: string | string[]): string; isRenderable(): boolean; clone(): Ternary; } type Item = ChordLyricsPair | Comment | Tag | Ternary | Literal; export interface SerializedTraceInfo { location?: { offset: number | null; line: number | null; column: number | null; }; } export interface SerializedChord { type: 'chord'; base: string; accidental: Accidental | null; suffix: string | null; bassBase: string | null; bassAccidental: Accidental | null; chordType: ChordType; optional?: boolean; } export interface SerializedChordLyricsPair { type: 'chordLyricsPair'; chord?: SerializedChord | null; chords: string; lyrics: string | null; annotation?: string | null; isRhythmSymbol?: boolean; } export interface SerializedChordDefinition { name: string; baseFret: number; frets: Fret[]; fingers?: number[]; } export type SerializedTag = SerializedTraceInfo & { type: 'tag'; name: string; value: string; chordDefinition?: SerializedChordDefinition; attributes?: Record; selector?: string | null; isNegated?: boolean; }; export interface SerializedComment { type: 'comment'; comment: string; } export type ContentType = 'tab' | 'abc' | 'ly' | 'svg' | 'grid' | 'textblock'; export type PartTypes = 'part' | 'intro' | 'instrumental' | 'tag' | 'end'; export interface SerializedSection { type: 'section'; sectionType: ContentType; content: string[]; startTag: SerializedTag; endTag: SerializedTag; } export type SerializedLiteral = string; export interface SerializedTernary extends SerializedTraceInfo { type: 'ternary'; variable: string | null; valueTest: string | null; trueExpression: (SerializedLiteral | SerializedTernary)[]; falseExpression: (SerializedLiteral | SerializedTernary)[]; } export type SerializedComposite = (SerializedLiteral | SerializedTernary)[]; export interface SerializedSoftLineBreak { type: 'softLineBreak'; } export type SerializedItem = SerializedChordLyricsPair | SerializedComment | SerializedLiteral | SerializedSoftLineBreak | SerializedTag | SerializedTernary; export interface SerializedLine { type: 'line'; items: SerializedItem[]; } export interface SerializedSong { type: 'chordSheet'; lines: SerializedLine[]; } export type SerializedComponent = SerializedLine | SerializedSong | SerializedChordLyricsPair | SerializedTag | SerializedComment | SerializedTernary | SerializedLiteral | SerializedSection | SerializedSoftLineBreak; type MapItemFunc = (_item: Item) => Item | null; /** * Represents a line in a chord sheet, consisting of items of type ChordLyricsPair or Tag */ export class Line { /** * The items ({@link ChordLyricsPair} or {@link Tag} or {@link Comment}) of which the line consists * @type {Array.<(ChordLyricsPair|Tag|Comment)>} */ items: Item[]; /** * The line type, This is set by the ChordProParser when it read tags like {start_of_chorus} or {start_of_verse} * It uses the following mapping to determine the line type from directives: * - `start_of_abc` => {@link ABC} * - `start_of_bridge` => {@link BRIDGE} * - `start_of_chorus` => {@link CHORUS} * - `start_of_grid` => {@link GRID} * - `start_of_ly` => {@link LILYPOND} * - `start_of_tab` => {@link TAB} * - `start_of_verse` => {@link VERSE} * * There are two special cases: * - {@link INDETERMINATE} when the paragraph lines do not have a consistent type * - {@link NONE} when no type is derived * @type {string} */ type: string; currentChordLyricsPair: ChordLyricsPair; key: string | null; transposeKey: string | null; lineNumber: number | null; selector: string | null; selectorIsNegated: boolean; /** * The text font that applies to this line. Is derived from the directives: * `textfont`, `textsize` and `textcolour` * See: https://www.chordpro.org/chordpro/directives-props_text_legacy/ * @type {Font} */ textFont: Font; /** * The chord font that applies to this line. Is derived from the directives: * `chordfont`, `chordsize` and `chordcolour` * See: https://www.chordpro.org/chordpro/directives-props_chord_legacy/ * @type {Font} */ chordFont: Font; constructor({ type, items }?: { type: string; items: Item[]; }); /** * Indicates whether the line contains any items * @returns {boolean} */ isEmpty(): boolean; /** * Adds an item ({@link ChordLyricsPair} or {@link Tag}) to the line * @param {ChordLyricsPair|Tag} item The item to be added */ addItem(item: Item): void; /** * Indicates whether the line contains items that are renderable * @returns {boolean} */ hasRenderableItems(): boolean; /** * Returns a deep copy of the line and all of its items * @returns {Line} */ clone(): Line; mapItems(func: MapItemFunc | null): Line; /** * Indicates whether the line type is {@link BRIDGE} * @returns {boolean} */ isBridge(): boolean; /** * Indicates whether the line type is {@link CHORUS} * @returns {boolean} */ isChorus(): boolean; /** * Indicates whether the line type is {@link GRID} * @returns {boolean} */ isGrid(): boolean; /** * Indicates whether the line type is {@link TAB} * @returns {boolean} */ isTab(): boolean; /** * Indicates whether the line type is {@link VERSE} * @returns {boolean} */ isVerse(): boolean; /** * Indicates whether the line type is {@link PART} * @returns {boolean} */ isPart(): boolean; /** * Indicates whether the line contains items that are renderable. Please use {@link hasRenderableItems} * @deprecated * @returns {boolean} */ hasContent(): boolean; addChordLyricsPair(chords?: ChordLyricsPair | string | null, lyrics?: null): ChordLyricsPair; ensureChordLyricsPair(): void; chords(chr: string): void; lyrics(chr: string): void; addTag(nameOrTag: Tag | string, value?: string | null): Tag; addComment(content: Comment | string): Comment; set(properties: { type?: string; items?: Item[]; }): Line; get _tag(): Tag | null; isSectionStart(): boolean; isSectionEnd(): boolean; } /** * Represents a chord with the corresponding (partial) lyrics */ export class ChordLyricsPair { chords: string; lyrics: string | null; annotation: string | null; isRhythmSymbol: boolean; parentLine: Line | null; /** * Initialises a ChordLyricsPair * @param {string} chords The chords * @param {string | null} lyrics The lyrics * @param {string | null} annotation The annotation * @param {Chord | null} chordObj Optional pre-parsed Chord object * @param {boolean} isRhythmSymbol Whether this pair represents a rhythm symbol */ constructor(chords?: string, lyrics?: string | null, annotation?: string | null, chordObj?: Chord | null, isRhythmSymbol?: boolean); /** Returns the Chord object if available, otherwise parses from string */ get chord(): Chord | null; /** * Indicates whether a ChordLyricsPair should be visible in a formatted chord sheet (except for ChordPro sheets) * @returns {boolean} */ isRenderable(): boolean; /** * Indicates whether the ChordLyricsPair has non-empty lyrics. */ hasLyrics(): boolean; /** * Returns a deep copy of the ChordLyricsPair, useful when programmatically transforming a song * @returns {ChordLyricsPair} */ clone(): ChordLyricsPair; toString(): string; set({ chords, lyrics, annotation, chordObj, isRhythmSymbol, }: { chords?: string; lyrics?: string; annotation?: string; chordObj?: Chord | null; isRhythmSymbol?: boolean; }): ChordLyricsPair; setLyrics(lyrics: string): ChordLyricsPair; setAnnotation(annotation: string): ChordLyricsPair; transpose(delta: number, key?: string | Key | null, { normalizeChordSuffix }?: { normalizeChordSuffix: boolean; }): ChordLyricsPair; useAccidental(accidental: Accidental): ChordLyricsPair; /** * @deprecated Use useAccidental instead */ useModifier(accidental: Accidental): ChordLyricsPair; changeChord(func: (chord: Chord) => Chord): ChordLyricsPair; } declare function hasChordContents(line: Line): boolean; declare function isEvaluatable(item: Item): boolean; declare let mergeConfigs: (target: T, source: any) => T; /** * Utility type that creates a deep partial type * This makes all properties optional recursively through the entire object */ type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial; } : T; interface KeyProperties { grade?: number | null; number?: number | null; type?: ChordType; minor?: boolean; accidental?: Accidental | null; referenceKeyGrade?: number | null; referenceKeyMode?: string | null; preferredAccidental?: Accidental | null; explicitAccidental?: boolean; } interface ConstructorOptions { grade?: number | null; number?: number | null; minor: boolean; type: ChordType; accidental: Accidental | null; referenceKeyGrade?: number | null; referenceKeyMode?: string | null; originalKeyString?: string | null; preferredAccidental: Accidental | null; explicitAccidental?: boolean; } /** * Represents a key, such as Eb (symbol), #3 (numeric) or VII (numeral). * * The only function considered public API is `Key.distance` */ export class Key implements KeyProperties { grade: number | null; number: number | null; accidental: Accidental | null; type: ChordType; get unicodeAccidental(): string | null; /** @deprecated Use unicodeAccidental instead */ get unicodeModifier(): string | null; /** @deprecated Use accidental instead */ get modifier(): Accidental | null; /** @deprecated Use preferredAccidental instead */ get preferredModifier(): Accidental | null; minor: boolean; referenceKeyGrade: number | null; referenceKeyMode: string | null; originalKeyString: string | null; preferredAccidental: Accidental | null; explicitAccidental: boolean; static parse(keyString: string | null): null | Key; static parseAsType(trimmed: string, keyType: ChordType): Key | null; static resolve({ key, keyType, minor, accidental, }: { key: string | number; keyType: ChordType; minor: string | boolean; accidental: Accidental | null; }): Key | null; static getNumberFromKey(keyString: string, keyType: ChordType): number; static keyWithAccidental(key: string, accidental: Accidental | null, type: ChordType): string; /** @deprecated Use keyWithAccidental instead */ static keyWithModifier(key: string, accidental: Accidental | null, type: ChordType): string; static toGrade(key: string, accidental: AccidentalMaybe, type: ChordType, isMinor: boolean): number | null; static isMinor(key: string, keyType: ChordType, minor: string | undefined | boolean): boolean; static parseOrFail(keyString: string | null): Key; static wrap(keyStringOrObject: Key | string | null): Key | null; static wrapOrFail(keyStringOrObject?: Key | string | null): Key; static toString(keyStringOrObject: Key | string): string; /** * Calculates the distance in semitones between one key and another. * @param {Key | string} oneKey the key * @param {Key | string} otherKey the other key * @return {number} the distance in semitones */ static distance(oneKey: Key | string, otherKey: Key | string): number; constructor({ grade, number, minor, type, accidental, referenceKeyGrade, referenceKeyMode, originalKeyString, preferredAccidental, explicitAccidental, }: ConstructorOptions); distanceTo(otherKey: Key | string): number; get effectiveGrade(): number; isMinor(): boolean; makeMinor(): Key; get relativeMajor(): Key; get relativeMinor(): Key; toMajor(): Key; clone(): Key; toChordSymbol(key: Key | string | null, referenceKeyWasMinor?: boolean): Key; toChordSolfege(key: Key | string | null, referenceKeyWasMinor?: boolean): Key; toChordSymbolString(key: Key): string; toChordSolfegeString(key: Key): string; is(type: ChordType): boolean; isNumeric(): boolean; isChordSymbol(): boolean; isChordSolfege(): boolean; isNumeral(): boolean; equals(otherKey: Key): boolean; static equals(oneKey: Key | null, otherKey: Key | null): boolean; toNumeric(key?: Key | string | null): Key; toNumericString(key?: Key | null): string; toNumeral(key?: Key | string | null): Key; toNumeralString(key?: Key | null): string; toString({ showMinor, useUnicodeModifier }?: { showMinor?: boolean | undefined; useUnicodeModifier?: boolean | undefined; }): string; get note(): string; get minorSign(): "" | "m"; transpose(delta: number): Key; changeGrade(delta: any): Key; transposeUp(): Key; transposeDown(): Key; canBeFlat(): boolean; canBeSharp(): boolean; setGrade(newGrade: number): Key; static shiftGrade(grade: number): number; useAccidental(newAccidental: Accidental | null): Key; /** @deprecated Use useAccidental instead */ useModifier(newAccidental: Accidental | null): Key; normalize(): Key; normalizeEnharmonics(key: Key | string | null): Key; } interface ChordProperties { root?: Key | null; suffix?: string | null; quality?: string | null; extensions?: string | null; bass?: Key | null; optional?: boolean; } interface ChordConstructorOptions { base?: string | number | null; accidental?: Accidental | null; suffix?: string | null; quality?: string | null; extensions?: string | null; bassBase?: string | number | null; bassAccidental?: Accidental | null; root?: Key | null; bass?: Key | null; chordType?: ChordType | null; optional?: boolean; } /** * Represents a Chord, consisting of a root, suffix (quality) and bass */ export class Chord implements ChordProperties { bass: Key | null; root: Key | null; get suffix(): string | null; get quality(): string | null; get extensions(): string | null; optional: boolean; /** * Tries to parse a chord string into a chord * Any leading or trailing whitespace is removed first, so a chord like ` \n E/G# \r ` is valid. * @param chordString the chord string, eg `Esus4/G#` or `1sus4/#3`. * @returns {Chord|null} */ static parse(chordString: string): Chord | null; static parseOrFail(chordString: string): Chord; /** * Returns a deep copy of the chord * @returns {Chord} */ clone(): Chord; /** * Converts the chord to a chord symbol, using the supplied key as a reference. * For example, a numeric chord `#4` with reference key `E` will return the chord symbol `A#`. * When the chord is already a chord symbol, it will return a clone of the object. * @param {Key|string|null} [referenceKey=null] the reference key. The key is required when converting a * numeric or numeral. * @returns {Chord} the chord symbol */ toChordSymbol(referenceKey?: Key | string | null): Chord; /** * Converts the chord to a chord symbol string, using the supplied key as a reference. * For example, a numeric chord `#4` with reference key `E` will return the chord symbol `A#`. * When the chord is already a chord symbol, it will return a string version of the chord. * @param {Key|string|null} [referenceKey=null] the reference key. The key is required when converting a * numeric or numeral. * @returns {string} the chord symbol string * @see {toChordSymbol} */ toChordSymbolString(referenceKey?: Key | string | null): string; /** * Determines whether the chord is a chord symbol * @returns {boolean} */ isChordSymbol(): boolean; /** * Converts the chord to a chord solfege, using the supplied key as a reference. * For example, a numeric chord `#4` with reference key `Mi` will return the chord symbol `La#`. * When the chord is already a chord solfege, it will return a clone of the object. * @param {Key|string|null} [referenceKey=null] the reference key. The key is required when converting a * numeric or numeral. * @returns {Chord} the chord solfege */ toChordSolfege(referenceKey?: Key | string | null): Chord; /** * Converts the chord to a chord solfege string, using the supplied key as a reference. * For example, a numeric chord `#4` with reference key `E` will return the chord solfege `A#`. * When the chord is already a chord solfege, it will return a string version of the chord. * @param {Key|string|null} [referenceKey=null] the reference key. The key is required when converting a * numeric or numeral. * @returns {string} the chord solfege string * @see {toChordSolfege} */ toChordSolfegeString(referenceKey?: Key | string | null): string; /** * Determines whether the chord is a chord solfege * @returns {boolean} */ isChordSolfege(): boolean; /** * Converts the chord to a numeric chord, using the supplied key as a reference. * For example, a chord symbol A# with reference key E will return the numeric chord #4. * @param {Key|string|null} [referenceKey=null] the reference key. The key is required when converting a chord symbol * @returns {Chord} the numeric chord */ toNumeric(referenceKey?: Key | string | null): Chord; /** * Converts the chord to a numeral chord, using the supplied key as a reference. * For example, a chord symbol A# with reference key E will return the numeral chord #IV. * @param {Key|string|null} [referenceKey=null] the reference key. The key is required when converting a chord symbol * @returns {Chord} the numeral chord */ toNumeral(referenceKey?: Key | string | null): Chord; /** * Converts the chord to a numeral chord string, using the supplied kye as a reference. * For example, a chord symbol A# with reference key E will return the numeral chord #4. * @param {Key|string|null} [referenceKey=null] the reference key. The key is required when converting a chord symbol * @returns {string} the numeral chord string * @see {toNumeral} */ toNumeralString(referenceKey?: Key | string | null): string; /** * Determines whether the chord is numeric * @returns {boolean} */ isNumeric(): boolean; /** * Converts the chord to a numeric chord string, using the supplied kye as a reference. * For example, a chord symbol A# with reference key E will return the numeric chord #4. * @param {Key|string|null} [referenceKey=null] the reference key. The key is required when converting a chord symbol * @returns {string} the numeric chord string * @see {toNumeric} */ toNumericString(referenceKey?: Key | string | null): string; /** * Determines whether the chord is a numeral * @returns {boolean} */ isNumeral(): boolean; /** * Converts the chord to a string, eg `Esus4/G#` or `1sus4/#3` * @param {Object} [configuration={}] options * @param {boolean} [configuration.useUnicodeModifier=false] Whether or not to use unicode modifiers. * This will make `#` (sharp) look like `♯` and `b` (flat) look like `♭` * @returns {string} the chord string */ toString({ useUnicodeModifier }?: { useUnicodeModifier?: boolean | undefined; }): string; /** * Normalizes the chord root and bass notes: * - Fab becomes Mi * - Dob becomes Si * - Si# becomes Do * - Mi# becomes Fa * - Fb becomes E * - Cb becomes B * - B# becomes C * - E# becomes F * - 4b becomes 3 * - 1b becomes 7 * - 7# becomes 1 * - 3# becomes 4 * * Besides that it normalizes the suffix if `normalizeSuffix` is `true`. * For example, `sus2` becomes `2`, `sus4` becomes `sus`. * All suffix normalizations can be found in `src/normalize_mappings/suffix-mapping.txt`. * * When the chord is minor, bass notes are normalized off of the relative major * of the root note. For example, `Em/A#` becomes `Em/Bb`. * @param {Key|string} [key=null] the key to normalize to * @param {Object} [options={}] options * @param {boolean} [options.normalizeSuffix=true] whether to normalize the chord suffix after transposing * @returns {Chord} the normalized chord */ normalize(key?: Key | string | null, { normalizeSuffix }?: { normalizeSuffix?: boolean; }): Chord; /** * Switches to the specified accidental * @param newAccidental the accidental to use: `'#'` or `'b'` * @returns {Chord} the new, changed chord */ useAccidental(newAccidental: Accidental): Chord; /** * @deprecated Use useAccidental instead */ useModifier(newAccidental: Accidental): Chord; /** * Transposes the chord up by 1 semitone. Eg. A becomes A#, Eb becomes E * @returns {Chord} the new, transposed chord */ transposeUp(): Chord; /** * Transposes the chord down by 1 semitone. Eg. A# becomes A, E becomes Eb * @returns {Chord} the new, transposed chord */ transposeDown(): Chord; /** * Transposes the chord by the specified number of semitones * @param delta de number of semitones * @returns {Chord} the new, transposed chord */ transpose(delta: number): Chord; constructor(options: ChordConstructorOptions); equals(otherChord: Chord): boolean; static determineRoot(options: ChordConstructorOptions & { suffix?: string | null; }): Key | null; static determineBass(options: ChordConstructorOptions): Key | null; isMinor(): boolean; makeMinor(): Chord; set(properties: ChordProperties): Chord; private get normalizedSuffix(); } type Delegate = (_string: string) => string; interface MetadataRule { match: string | string[] | RegExp | ((key: string) => boolean); visible?: boolean; sortMethod?: 'preserve' | 'alphabetical' | 'custom'; customSort?: (a: string, b: string) => number; } interface MetadataConfiguration { separator: string; order: (string | MetadataRule)[]; } interface InstrumentConfiguration { type?: string; description?: string; tuning?: string; } interface UserConfigurationProperties { name?: string; fullname?: string; } interface DelegatesConfiguration { abc: Delegate; ly: Delegate; svg: Delegate; tab: Delegate; grid: Delegate; } interface BaseFormatterConfiguration { decapo: boolean; delegates: Partial>; evaluate: boolean; expandChorusDirective: boolean; instrument: InstrumentConfiguration | null; key: Key | null; metadata: MetadataConfiguration; normalizeChords: boolean; useUnicodeModifiers: boolean; user: UserConfigurationProperties | null; } type ConfigurationProperties = Record & Partial<{ decapo: boolean; delegates: Partial; evaluate: boolean; expandChorusDirective: boolean; instrument: Partial; key: Key | string | null; metadata: Partial; normalizeChords: boolean; useUnicodeModifiers: boolean; user: Partial; }>; export function stripPangoMarkup(text: string): string; export interface PangoRenderer { convert(text: string): string; } export function pangoToHtml(text: string): string; export const defaultPangoRenderer: PangoRenderer; type CSS = Record; interface HtmlTemplateCssClasses { annotation: string; chord: string; chordSheet: string; column: string; comment: string; emptyLine: string; image: string; label: string; labelWrapper: string; line: string; literal: string; literalContents: string; lyrics: string; paragraph: string; rhythmSymbol: string; row: string; subtitle: string; title: string; } interface HTMLFormatterConfiguration extends BaseFormatterConfiguration { cssClasses: HtmlTemplateCssClasses; customCSS?: CSS; pangoRenderer?: PangoRenderer; renderBlankLines?: boolean; } /** * Configuration options for rendering a chord diagram, controlling dimensions, colors, and visual styling. */ interface ChordDiagramRenderingConfig { /** Vertical position of the chord title. */ titleY: number; /** Width of the guitar neck area. */ neckWidth: number; /** Height of the guitar neck area. */ neckHeight: number; /** Thickness of the nut (top bar) at the first fret. */ nutThickness: number; /** Color of the nut. */ nutColor: number | string; /** Thickness of regular fret bars. */ fretThickness: number; /** Color of the fret lines. */ fretColor: number | string; /** Color of the strings. */ stringColor: number | string; /** Size of open/muted string indicators above the nut. */ stringIndicatorSize: number; /** Size of finger position markers on the fretboard. */ fingerIndicatorSize: number; /** Vertical offset adjustment for finger indicators. */ fingerIndicatorOffset: number; /** Thickness of the string lines. */ stringThickness: number; /** Thickness of the fret lines. */ fretLineThickness: number; /** Line thickness for open string (circle) indicators. */ openStringIndicatorThickness: number; /** Line thickness for muted string (X) indicators. */ unusedStringIndicatorThickness: number; /** Line thickness for finger position markers. */ markerThickness: number; /** Line thickness for barre indicators. */ barreThickness: number; /** Font size for the chord title. */ titleFontSize: number; /** Font size for the base fret number (when transposed). */ baseFretFontSize: number; /** Font size for finger numbers below the diagram. */ fingerNumberFontSize: number; /** Whether to display finger numbers below the diagram. */ showFingerNumbers: boolean; /** Horizontal spacing between multiple diagrams. */ diagramSpacing: number; /** Maximum number of diagrams per row (optional). */ maxDiagramsPerRow?: number | null; } interface Margins { top: number; bottom: number; left: number; right: number; } type FontSection = 'title' | 'subtitle' | 'metadata' | 'text' | 'chord' | 'comment' | 'annotation' | 'sectionLabel'; type Alignment = 'left' | 'center' | 'right' | number; type MeasurerType = 'canvas' | 'dom' | 'jspdf'; type ConditionRule = Partial<{ equals: any; not_equals: any; greater_than: number; greater_than_equal: number; less_than: number; less_than_equal: number; like: string; contains: string; in: any[]; not_in: any[]; all: any[]; exists: boolean; first: boolean; last: boolean; }>; type SingleCondition = Record; type ConditionalRule = Partial<{ and: SingleCondition[]; or: SingleCondition[]; }> | SingleCondition; interface Position { x: Alignment; y: number; width?: number; height?: number; offsetX?: number; clip?: boolean; ellipsis?: boolean; } interface Dimension { width: number; height: number; } interface FontConfiguration { name: string; style: string; weight?: string | number; size: number; lineHeight?: number; color: string | number; underline?: boolean; inherit?: string; textTransform?: string; textDecoration?: string; letterSpacing?: string; } type FontConfigurations = Record; type ChordDiagramFontConfigurations = Record<'title' | 'fingerings' | 'baseFret', FontConfiguration>; interface SectionDisplay { labelStyle?: 'uppercase'; showLabel?: boolean; lyricsOnly?: boolean; indent?: number; compact?: boolean; repeatedSections?: 'hide' | 'title_only' | 'lyrics_only' | 'full'; } interface SectionTypeConfig { fonts?: FontConfigurations; display?: SectionDisplay; overrides?: { condition: ConditionalRule; display: Partial; }[]; } interface ColumnConfig { columnCount?: number; columnSpacing: number; minColumnWidth?: number; maxColumnWidth?: number; } interface SectionsConfig { global: { columnWidth: number; spacingBottom?: number; spacingAfter?: number; chordLyricSpacing: number; linePadding: number; paragraphSpacing?: number; chordSpacing: number; } & ColumnConfig; base: SectionTypeConfig; types?: Record; } interface ILayoutContentItem { type: string; position: Position; condition?: ConditionalRule; } interface LayoutContentItemWithText extends ILayoutContentItem { type: 'text'; style: FontConfiguration; value?: string; template?: string; cssClass?: string; elementStyle?: Record; } interface LayoutContentItemWithValue extends LayoutContentItemWithText { value: string; } interface LayoutContentItemWithTemplate extends LayoutContentItemWithText { template: string; } interface LayoutContentItemWithImage extends ILayoutContentItem { type: 'image'; src: string; position: Position; compression: ImageCompression; size: Dimension; alias?: string; rotation?: number; } interface LineStyle { color: string; width: number; dash?: number[]; } interface LayoutContentItemWithLine { type: 'line'; style: LineStyle; position: { x?: number; y: number; width: number | 'auto'; height?: number; }; condition?: ConditionalRule; } type LayoutContentItem = LayoutContentItemWithValue | LayoutContentItemWithTemplate | LayoutContentItemWithImage | LayoutContentItemWithLine; interface LayoutItem { height: number; content: LayoutContentItem[]; } interface ChordDiagramOverrides { hide?: boolean; definition?: string; } interface ChordDiagramsConfig { enabled: boolean; renderingConfig?: ChordDiagramRenderingConfig; definitions?: { hiddenChords: string[]; }; overrides?: { global?: Record; byKey?: Record>; }; fonts: ChordDiagramFontConfigurations; } interface MeasurementBasedLayoutConfig { global: { margins: Margins; }; header: LayoutItem; footer: LayoutItem; sections?: SectionsConfig; chordDiagrams?: ChordDiagramsConfig; } interface MeasurementBasedFormatterConfiguration extends BaseFormatterConfiguration { fonts: FontConfigurations; measurer: MeasurerType; layout: MeasurementBasedLayoutConfig; } interface MeasuredHtmlLayoutConfig extends MeasurementBasedLayoutConfig { header: MeasurementBasedLayoutConfig['header']; footer: MeasurementBasedLayoutConfig['footer']; sections: SectionsConfig; } interface MeasuredHtmlFormatterConfiguration extends MeasurementBasedFormatterConfiguration { version: string; layout: MeasuredHtmlLayoutConfig; pageSize: { width: number; height: number; }; cssClassPrefix?: string; additionalCss?: string; cssClasses?: { container?: string; page?: string; chord?: string; lyrics?: string; sectionLabel?: string; comment?: string; header?: string; footer?: string; }; } interface PDFLayoutConfig extends MeasurementBasedLayoutConfig { header: MeasurementBasedLayoutConfig['header']; footer: MeasurementBasedLayoutConfig['footer']; sections: SectionsConfig; chordDiagrams: ChordDiagramsConfig; } interface PDFFormatterConfiguration extends MeasurementBasedFormatterConfiguration { version: string; layout: PDFLayoutConfig; } /** * Get the default configuration for a specific formatter type * This dynamically composes the full default configuration by merging * the defaults from all levels in the inheritance chain * @param formatterType The formatter type to get defaults for * @returns The fully composed default configuration */ declare const getDefaultConfig: (formatterType: string) => T; declare const getHTMLDefaultConfig: () => HTMLFormatterConfiguration; declare const getPDFDefaultConfig: () => PDFFormatterConfiguration; declare const getMeasuredHtmlDefaultConfig: () => MeasuredHtmlFormatterConfiguration; /** * Base formatter class that provides configuration handling for all formatters */ export class Formatter { configuration: T; /** * Instantiate * @param {DeepPartial} [configuration={}] options * @param {boolean} [configuration.evaluate=false] Whether or not to evaluate meta expressions. * For more info about meta expressions, see: https://bit.ly/2SC9c2u * @param {object} [configuration.metadata={}] * @param {string} [configuration.metadata.separator=", "] The separator to be used when rendering a * metadata value that has multiple values. See: https://bit.ly/2SC9c2u * @param {Key|string} [configuration.key=null] The key to use for rendering. The chord sheet will be * transposed from the song's original key (as indicated by the `{key}` directive) to the specified key. * Note that transposing will only work if the original song key is set. * @param {boolean} [configuration.expandChorusDirective=false] Whether or not to expand `{chorus}` directives * by rendering the last defined chorus inline after the directive. * @param {boolean} [configuration.useUnicodeModifiers=false] Whether or not to use unicode flat and sharp * symbols. * @param {boolean} [configuration.normalizeChords=true] Whether or not to automatically normalize chords */ constructor(configuration?: DeepPartial); /** * Configure the formatter with new options * @param {DeepPartial} config New configuration options * @returns {this} The formatter instance for chaining */ configure(config: DeepPartial): this; /** * Get the default configuration for this formatter type * Should be implemented by subclasses to return the appropriate default configuration */ protected getDefaultConfiguration(): T; } /** * Represents a soft line break in the lyrics, typically rendered as a space or optional break point. */ export class SoftLineBreak { /** * The content of the soft line break, defaults to a single space. */ content: string; constructor(content?: string); /** * Returns a copy of the SoftLineBreak. */ clone(): SoftLineBreak; } type DefinitionSet = Record; declare class ChordDefinitionSet { definitions: DefinitionSet; constructor(definitions?: DefinitionSet); get(chord: string): ChordDefinition | null; withDefaults(): ChordDefinitionSet; add(chord: string, definition: ChordDefinition): void; has(chord: string): boolean; clone(): ChordDefinitionSet; } type Configuration = BaseFormatterConfiguration; /** * Legacy configuration function for backward compatibility */ declare function configure(config: ConfigurationProperties): Configuration; interface FormattingContext { configuration: BaseFormatterConfiguration; metadata: Metadata; } /** * Represents a paragraph of lines in a chord sheet */ export class Paragraph { /** * The {@link Line} items of which the paragraph consists * @member * @type {Line[]} */ lines: Line[]; addLine(line: any): void; /** * Indicates whether the paragraph only contains literals. If true, {@link contents} can be used to retrieve * the paragraph contents as one string where lines are separated by newlines. * @see {@link contents} * @returns {boolean} */ isLiteral(): boolean; /** * Returns the paragraph contents as one string where lines are separated by newlines * @returns {string} */ get contents(): string; /** * Returns the label of the paragraph. The label is the value of the first section delimiter tag * in the first line. * @returns {string|null} */ get label(): string | null; /** * Tries to determine the common type for all lines. If the types for all lines are equal, it returns that type. * If not, it returns {@link INDETERMINATE} * For the possible values, see {@link Line.type} * @returns {string} */ get type(): string; get selector(): string | null; get selectorIsNegated(): boolean; /** * Indicates whether the paragraph contains lines with renderable items. * @see {@link Line.hasRenderableItems} * @returns {boolean} */ hasRenderableItems(): boolean; isEmpty(): boolean; } /** * Represents a parser warning, currently only used by ChordProParser. */ declare class ParserWarning { /** * The warning message * @member * @type {string} */ message: string; /** * The chord sheet line number on which the warning occurred * @member * @type {number} */ lineNumber: number | null; /** * The chord sheet column on which the warning occurred * @member * @type {number} */ column: number | null; /** * @hideconstructor */ constructor(message: string, lineNumber: number | null, column: number | null); /** * Returns a stringified version of the warning * @returns {string} The string warning */ toString(): string; } declare class FontStack { fontAndColourStacks: Record; sizeStacks: Record; textFont: Font; chordFont: Font; applyTag(tag: Tag): void; } declare class SongBuilder { currentKey: string | null; currentLine: Line | null; fontStack: FontStack; lines: Line[]; metadata: Metadata; sectionType: string; selector: string | null; selectorIsNegated: boolean; song: Song; transposeKey: string | null; warnings: ParserWarning[]; constructor(song: Song); get previousLine(): Line | null; addLine(line?: Line): Line; setCurrentProperties(sectionType: string, selector?: string | null, isNegated?: boolean): void; addItem(item: Item): void; chords(chr: string): void; lyrics(chr: string): void; addTag(tagContents: string | Tag): Tag; ensureLine(): void; setSectionTypeFromTag(tag: Tag): void; startSection(sectionType: string, tag: Tag): void; endSection(sectionType: string, tag: Tag): void; checkCurrentSectionType(sectionType: string, tag: Tag): void; addWarning(message: string, { line, column }: TraceInfo): void; } interface RenderChordOptions { renderKey?: Key | null; useUnicodeModifier?: boolean; normalizeChords?: boolean; decapo?: boolean; } /** * Renders a chord in the context of a line and song and taking into account some options * @param chordString The chord to render * @param line The line the chord is in * @param song The song the line is in * @param renderKey The key to render the chord in. If not provided, the line key will be used, * or the song key if the line key is not provided. * @param useUnicodeModifier Whether to use unicode modifiers ('\u266f'/'\u266d') or plain text ('#'/'b'). * Default `false`. * @param normalizeChords Whether to normalize the chord to the key (default `true`) * @param decapo Whether to transpose all chords to eliminate the capo (default `false`) */ declare function renderChord(chordString: string, line: Line, song: Song, { renderKey, useUnicodeModifier, normalizeChords, decapo, }?: RenderChordOptions): string; /** * Returns recommended capo positions for the provided key. * * The returned object maps capo fret numbers to the effective key when using * that capo position. * * @param {Key|string} key The key to get capo positions for. * @returns {Object.} The available capo positions, keyed by capo fret number. */ declare function getCapos(key: Key | string): Record; /** * Returns available transpose target keys for the provided key. * * The result uses symbol or solfege notation to match the input key, and major * or minor keys depending on the input mode. * * @param {Key|string} key The key to get transpose targets for. * @returns {Array} The available target keys. */ declare function getKeys(key: Key | string): string[]; type MapItemsCallback = (_item: Item) => Item | Item[] | null; /** * Represents a song in a chord sheet. Currently a chord sheet can only have one song. */ export class Song extends MetadataAccessors { /** * The {@link Line} items of which the song consists * @member {Line[]} */ lines: Line[]; _bodyLines: Line[] | null; _bodyParagraphs: Paragraph[] | null; _renderParagraphs: Paragraph[] | null; warnings: ParserWarning[]; _metadata: Metadata | null; /** * Creates a new {Song} instance * @param metadata {Record|Metadata} predefined metadata */ constructor(metadata?: Record | Metadata | null); /** Returns song lines, skipping leading empty/meta-only lines. @returns {Line[]} */ get bodyLines(): Line[]; /** Returns song paragraphs, skipping paragraphs with only empty lines. @returns {Paragraph[]} */ get bodyParagraphs(): Paragraph[]; get renderParagraphs(): Paragraph[]; set renderParagraphs(paragraphs: Paragraph[]); selectRenderableItems(items: (Line | Paragraph)[]): (Line | Paragraph)[]; /** The {@link Paragraph} items of which the song consists @member {Paragraph[]} */ get paragraphs(): Paragraph[]; /** The body paragraphs with any `{chorus}` tag expanded into the targeted chorus */ get expandedBodyParagraphs(): Paragraph[]; filterParagraphs(paragraphs: Paragraph[], configuration: Configuration): Paragraph[]; linesToParagraphs(lines: Line[]): Paragraph[]; /** Returns a deep clone of the song @returns {Song} */ clone(): Song; getMetadataValue(name: string): string | string[] | null; getSingleMetadataValue(name: string): string | null; /** * Returns a copy of the song with the key value set to the specified key. It changes: * - the value for `key` in the {@link metadata} set * - any existing `key` directive * @param {number|null} key the key. Passing `null` will: * - remove the current key from {@link metadata} * - remove any `key` directive * @returns {Song} The changed song */ setKey(key: string | number | null): Song; /** * Returns a copy of the song with the key value set to the specified capo. It changes: * - the value for `capo` in the {@link metadata} set * - any existing `capo` directive * @param {number|null} capo the capo. Passing `null` will: * - remove the current key from {@link metadata} * - remove any `capo` directive * @returns {Song} The changed song */ setCapo(capo: number | null): Song; /** * Transposes the song by the specified delta. It will: * - transpose all chords, see: {@link Chord#transpose} * - transpose the song key in {@link metadata} * - update any existing `key` directive * @param {number} delta The number of semitones (positive or negative) to transpose with * @param {Object} [options={}] options * @param {boolean} [options.normalizeChordSuffix=false] whether to normalize the chord suffixes after transposing * @returns {Song} The transposed song */ transpose(delta: number, { accidental, normalizeChordSuffix }?: { accidental?: Accidental | null; normalizeChordSuffix?: boolean; }): Song; /** * Transposes the song up by one semitone. It will: * - transpose all chords, see: {@link Chord#transpose} * - transpose the song key in {@link metadata} * - update any existing `key` directive * @param {Object} [options={}] options * @param {boolean} [options.normalizeChordSuffix=false] whether to normalize the chord suffixes after transposing * @returns {Song} The transposed song */ transposeUp({ normalizeChordSuffix }?: { normalizeChordSuffix?: boolean; }): Song; /** * Transposes the song down by one semitone. It will: * - transpose all chords, see: {@link Chord#transpose} * - transpose the song key in {@link metadata} * - update any existing `key` directive * @param {Object} [options={}] options * @param {boolean} [options.normalizeChordSuffix=false] whether to normalize the chord suffixes after transposing * @returns {Song} The transposed song */ transposeDown({ normalizeChordSuffix }?: { normalizeChordSuffix?: boolean; }): Song; /** * Returns a copy of the song with the key set to the specified key. It changes: * - the value for `key` in the {@link metadata} set * - any existing `key` directive * - all chords, those are transposed according to the distance between the current and the new key * @param {string} newKey The new key. * @returns {Song} The changed song */ changeKey(newKey: string | Key): Song; /** * Returns a copy of the song with all chords changed to the specified accidental. * * Examples: * * ```js * song.useAccidental('#'); * song.useAccidental('b'); * ``` * * @param {Accidental} accidental the new accidental * @returns {Song} the changed song */ useAccidental(accidental: Accidental): Song; /** * @deprecated Use useAccidental instead */ useModifier(accidental: Accidental): Song; /** * Returns a copy of the song with all chords normalized to the specified key. See {@link Chord#normalize}. * @param key the key to normalize to * @param options options * @param options.normalizeSuffix whether to normalize the chord suffixes */ normalizeChords(key?: Key | string | null, { normalizeSuffix }?: { normalizeSuffix?: boolean; }): Song; mapChordLyricsPairs(func: (pair: ChordLyricsPair) => ChordLyricsPair): Song; changeChords(func: (chord: Chord) => Chord): Song; get currentKey(): Key | null; requireCurrentKey(): Key; /** * Returns a copy of the song with the directive value(s) set to the specified value(s). * - when there is a matching directive in the song, it will update the directive * - when there is no matching directive, it will be inserted * If `value` is `null` it will act as a delete, any directive matching `name` will be removed. * * @example * ```javascript * song.changeMetadata('author', 'John'); * song.changeMetadata('composer', ['Jane', 'John']); * song.changeMetadata('key', null); // Remove key directive * ``` * @param name The directive name * @param {string | string[] | null} value The value to set, or `null` to remove the directive * @return {Song} The changed song */ changeMetadata(name: string, value: string | string[] | null): Song; /** * Returns a copy of the song with the metadata changed. It will: * - update the metadata * - update any existing directive matching the metadata key * - insert a new directive if it does not exist * @example * ```javascript * song.changeMetadata({ * author: 'John', * composer: ['Jane', 'John'], * key: null, // Remove key directive * }); * ``` * @param {Record} metadata The metadata to change */ changeMetadata(metadata: Record): Song; addLine(line: Line): void; /** * Change the song contents inline. Return a new {@link Item} to replace it. Return `null` to remove it. * @example * // transpose all chords: * song.mapItems((item) => { * if (item instanceof ChordLyricsPair) { * return item.transpose(2, 'D'); * } * * return item; * }); * @param {MapItemsCallback} func the callback function * @returns {Song} the changed song */ mapItems(func: MapItemsCallback): Song; foreachItem(func: (_item: Item) => void): void; /** * Returns all unique chords used in the song * @returns {string[]} the chords */ getChords(): string[]; /** * Returns all chord definitions from the song. * Definitions are made using the `{chord}` or `{define}` directive. * A chord definitions overrides a previous chord definition for the exact same chord. * @returns {Record} the chord definitions * @see https://chordpro.org/chordpro/directives-define/ * @see https://chordpro.org/chordpro/directives-chord/ */ getChordDefinitions(context?: FormattingContext): Record; /** * The song's metadata. When there is only one value for an entry, the value is a string. Else, the value is * an array containing all unique values for the entry. * @type {Metadata} */ get metadata(): Metadata; getMetadata(configuration?: Configuration): Metadata; get chordDefinitions(): ChordDefinitionSet; /** * Change the song contents inline. Return a new {@link Line} to replace it. Return `null` to remove it. * @example * // remove lines with only Tags: * song.mapLines((line) => { * if (line.items.every(item => item instanceof Tag)) { * return null; * } * * return line; * }); * @param {MapLinesCallback} func the callback function * @returns {Song} the changed song */ mapLines(func: (_line: Line) => Line | null): Song; } /** * Formats a song into a ChordPro chord sheet */ export class ChordProFormatter extends Formatter { /** * Formats a song into a ChordPro chord sheet. * @param {Song} song The song to be formatted * @returns {string} The ChordPro string */ format(song: Song): string; formatLine(line: Line, metadata: Metadata): string; formatItem(item: Item, metadata: Metadata): string; formatOrEvaluateItem(item: Evaluatable, metadata: Metadata): string; formatTernary(ternary: Ternary): string; formatValueTest(valueTest: string | null): string; formatExpressionRange(expressionRange: Evaluatable[]): string; formatExpression(expression: Evaluatable): string; formatTag(tag: Tag): string; formatTagAttributes(tag: Tag): string; formatChordLyricsPair(chordLyricsPair: ChordLyricsPair): string; formatChordLyricsPairChords(chordLyricsPair: ChordLyricsPair): string; formatChordLyricsPairLyrics(chordLyricsPair: ChordLyricsPair): string; formatComment(comment: Comment): string; } type AstType = ChordLyricsPair | Comment | Tag | Ternary | Evaluatable | Literal | SoftLineBreak; /** * Serializes a song into een plain object, and deserializes the serialized object back into a {@link Song} */ export class ChordSheetSerializer { song: Song; songBuilder: SongBuilder; /** * Serializes the chord sheet to a plain object, which can be converted to any format like JSON, XML etc * Can be deserialized using {@link deserialize} * @returns object A plain JS object containing all chord sheet data */ serialize(song: Song): SerializedSong; serializeLine(line: Line): SerializedLine; serializeItem(item: AstType): SerializedComponent; serializeChordDefinition(chordDefinition: ChordDefinition): SerializedChordDefinition; serializeTag(tag: Tag): SerializedTag; serializeChordLyricsPair(chordLyricsPair: ChordLyricsPair): SerializedChordLyricsPair; serializeTernary(ternary: Ternary): object; serializeLiteral(literal: Literal): string; serializeExpression(expression: AstType[]): SerializedComponent[]; serializeComment(comment: Comment): SerializedComment; /** * Deserializes a song that has been serialized using {@link serialize} * @param {object} serializedSong The serialized song * @returns {Song} The deserialized song */ deserialize(serializedSong: SerializedSong): Song; parseAstComponent(astComponent: SerializedComponent): null | ChordLyricsPair | Tag | Comment | Ternary | Literal | SoftLineBreak; parseChordSheet(astComponent: SerializedSong): void; parseLine(astComponent: SerializedLine): void; parseChordLyricsPair(astComponent: SerializedChordLyricsPair): ChordLyricsPair; parseTag(astComponent: SerializedTag): Tag; parseComment(astComponent: SerializedComment): Comment; parseTernary(astComponent: SerializedTernary): Ternary; parseExpression(expression: (SerializedLiteral | SerializedTernary)[]): (AstType | null)[]; } interface ParseOptions { filename?: string; startRule?: string; tracer?: any; [key: string]: any; } type ChordProParserOptions = ParseOptions & { softLineBreaks?: boolean; chopFirstWord?: boolean; }; /** * Parses a ChordPro chord sheet */ export class ChordProParser { song?: Song; /** * All warnings raised during parsing the chord sheet * @member * @type {ParserWarning[]} */ get warnings(): ParserWarning[]; /** * Parses a ChordPro chord sheet into a song * @param {string} chordSheet the ChordPro chord sheet * @param {ChordProParserOptions} options Parser options. * @param {ChordProParserOptions.softLineBreaks} options.softLineBreaks=false If true, a backslash * followed by * a space is treated as a soft line break * @param {ChordProParserOptions.chopFirstWord} options.chopFirstWord=true If true, only the first lyric * word is paired with the chord, the rest of the lyric is put in a separate chord lyric pair * @see https://peggyjs.org/documentation.html#using-the-parser * @returns {Song} The parsed song */ parse(chordSheet: string, options?: ChordProParserOptions): Song; } /** * Parses a normal chord sheet * * ChordSheetParser is deprecated, please use ChordsOverWordsParser. * * ChordsOverWordsParser aims to support any kind of chord, whereas ChordSheetParser lacks * support for many variations. Besides that, some chordpro feature have been ported back * to ChordsOverWordsParser, which adds some interesting functionality. */ export class ChordSheetParser { processingText: boolean; preserveWhitespace: boolean; song: Song; songBuilder: SongBuilder; songLine: Line | null; chordLyricsPair: ChordLyricsPair | null; lines: string[]; currentLine: number; lineCount: number; /** * Instantiate a chord sheet parser * ChordSheetParser is deprecated, please use ChordsOverWordsParser. * @param {Object} [options={}] options * @param {boolean} [options.preserveWhitespace=true] whether to preserve trailing whitespace for chords * @deprecated */ constructor({ preserveWhitespace }?: { preserveWhitespace?: boolean; }, showDeprecationWarning?: boolean); /** * Parses a chord sheet into a song * @param {string} chordSheet The ChordPro chord sheet * @param {Object} [options={}] Optional parser options * @param {Song} [options.song=null] The {@link Song} to store the song data in * @returns {Song} The parsed song */ parse(chordSheet: string, { song }?: { song?: Song; }): Song; endOfSong(): void; parseLine(line: any): void; parseNonEmptyLine(line: any): void; initialize(document: any, song?: Song | null): void; readLine(): string; hasNextLine(): boolean; parseLyricsWithChords(chordsLine: any, lyricsLine: any): void; processCharacters(chordsLine: any, lyricsLine: any): number; mapLyricsCharacter(columnMap: number[], column: number, lyricsLine: string, lastIndex: number): number; addCharacter(chr: any, nextChar: any): void; shouldAddCharacterToChords(nextChar: any): any; ensureChordLyricsPairInitialized(): void; } type WhenCallback = () => string; declare class WhenClause { condition: boolean; callback: WhenCallback; constructor(condition: any, callback: WhenCallback); evaluate(otherClauses: WhenClause[]): string; } declare class When { condition: boolean; clauses: WhenClause[]; constructor(condition: any, thenCallback?: WhenCallback); then(thenCallback: WhenCallback): When; elseWhen(condition: any, callback?: WhenCallback): When; else(callback: WhenCallback): When; toString(): string; } type EachCallback = (_item: any) => string; declare function isChordLyricsPair(item: Item): boolean; declare function lineHasContents(line: Line): boolean; declare function isTag(item: Item): boolean; declare function isLiteral(item: Item): boolean; declare function isComment(item: Tag): boolean; declare function isImage(item: Tag): boolean; declare function isColumnBreak(item: Item): boolean; declare function isSoftLineBreak(item: Item): boolean; declare function stripHTML(string: string): string; declare function each(collection: any[], callback: EachCallback): string; declare function when(condition: any, callback?: WhenCallback): When; declare function hasTextContents(line: Line): boolean; declare function lineClasses(line: Line, cssClasses?: HtmlTemplateCssClasses): string; declare function paragraphClasses(paragraph: Paragraph, cssClasses?: HtmlTemplateCssClasses): string; declare function evaluate(item: Evaluatable, metadata: Metadata, configuration: Configuration): string; declare function fontStyleTag(font: Font): string; declare function processMetadata(metadata: Record, config: MetadataConfiguration): [string, string | string[]][]; export const templateHelpers: { isLiteral: typeof isLiteral; isSoftLineBreak: typeof isSoftLineBreak; isEvaluatable: typeof isEvaluatable; isChordLyricsPair: typeof isChordLyricsPair; lineHasContents: typeof lineHasContents; isTag: typeof isTag; isComment: typeof isComment; isImage: typeof isImage; isColumnBreak: typeof isColumnBreak; stripHTML: typeof stripHTML; each: typeof each; when: typeof when; hasTextContents: typeof hasTextContents; lineClasses: typeof lineClasses; paragraphClasses: typeof paragraphClasses; evaluate: typeof evaluate; fontStyleTag: typeof fontStyleTag; renderChord: typeof renderChord; hasChordContents: typeof hasChordContents; pangoToHtml: typeof pangoToHtml; stripPangoMarkup: typeof stripPangoMarkup; processMetadata: typeof processMetadata; }; /** * Formats a song into a plain text chord sheet */ export class ChordsOverWordsFormatter extends Formatter { song: Song; /** * Formats a song into a plain text chord sheet * @param {Song} song The song to be formatted * @returns {string} the chord sheet */ format(song: Song): string; formatHeader(): string; formatParagraphs(): string; formatParagraph(paragraph: Paragraph, metadata: Metadata): string; formatLine(line: Line, metadata: Metadata): string; formatLineTop(line: Line, metadata: Metadata): string | null; chordLyricsPairLength(chordLyricsPair: ChordLyricsPair, line: Line): number; formatItemTop(item: Item, _metadata: Metadata, line: Line): string; renderChord(item: ChordLyricsPair, line: Line): string; formatLineBottom(line: any, metadata: any): string | null; formatLineWithFormatter(line: Line, formatter: (_item: Item, _metadata: Metadata, _line: Line) => string, metadata: Metadata): string; formatItemBottom(item: Item, metadata: Metadata, line: Line): string; } interface _ParseOptions1 { filename?: string; startRule?: string; tracer?: any; [key: string]: any; } type ChordsOverWordsParserOptions = _ParseOptions1 & { softLineBreaks?: boolean; chopFirstWord?: boolean; }; /** * Parses a chords over words sheet into a song * * It support "regular" chord sheets: * * Am C/G F C * Let it be, let it be, let it be, let it be * C G F C/E Dm C * Whisper words of wisdom, let it be * * Additionally, some chordpro features have been "ported back". For example, you can use chordpro directives: * * {title: Let it be} * {key: C} * Chorus 1: * Am * Let it be * * For convenience, you can leave out the brackets: * * title: Let it be * Chorus 1: * Am * Let it be * * You can even use a markdown style frontmatter separator to separate the header from the song: * * title: Let it be * key: C * --- * Chorus 1: * Am C/G F C * Let it be, let it be, let it be, let it be * C G F C/E Dm C * Whisper words of wisdom, let it be * * `ChordsOverWordsParser` is the better version of `ChordSheetParser`, which is deprecated. */ export class ChordsOverWordsParser { song?: Song; /** * All warnings raised during parsing the chord sheet * @member * @type {ParserWarning[]} */ get warnings(): ParserWarning[]; /** * Parses a chords over words sheet into a song * @param {string} chordSheet the chords over words sheet * @param {ChordsOverWordsParserOptions} options Parser options. * @param {ChordsOverWordsParserOptions.softLineBreaks} options.softLineBreaks=false If true, a backslash * followed by a space is treated as a soft line break * @param {ChordsOverWordsParserOptions.chopFirstWord} options.chopFirstWord=true If true, only the first lyric * word is paired with the chord, the rest of the lyric is put in a separate chord lyric pair * @see https://peggyjs.org/documentation.html#using-the-parser * @returns {Song} The parsed song */ parse(chordSheet: string, options?: ChordsOverWordsParserOptions): Song; } interface HtmlTemplateArgs { configuration: HTMLFormatterConfiguration; song: Song; metadata: Metadata; renderBlankLines?: boolean; bodyParagraphs: Paragraph[]; } type Template = (_args: HtmlTemplateArgs) => string; type _CSS1 = Record>; /** * Acts as a base class for HTML formatters */ export abstract class HtmlFormatter extends Formatter { /** * Get the default configuration for HTML formatter * Uses the HTML-specific default configuration from the configuration manager */ protected getDefaultConfiguration(): HTMLFormatterConfiguration; /** * Formats a song into HTML. * @param {Song} song The song to be formatted * @returns {string} The HTML string */ format(song: Song): string; /** * Generates basic CSS, optionally scoped within the provided selector, to use with the HTML output * * For example, execute cssString('.chordSheetViewer') will result in CSS like: * * .chordSheetViewer .paragraph { * margin-bottom: 1em; * } * * @param scope the CSS scope to use, for example `.chordSheetViewer` * @returns {string} the CSS string */ cssString(scope?: string): string; /** * Basic CSS, in object style à la useStyles, to use with the HTML output * For a CSS string see {@link cssString} * * Example: * * '.paragraph': { * marginBottom: '1em' * } * * @return {Object.>} the CSS object */ get cssObject(): _CSS1; abstract get defaultCss(): _CSS1; abstract get template(): Template; } /** * Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes it useful for responsive web pages. */ export class HtmlDivFormatter extends HtmlFormatter { get template(): Template; get defaultCss(): _CSS1; } /** * Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like * PDF conversion. */ export class HtmlTableFormatter extends HtmlFormatter { get template(): Template; get defaultCss(): _CSS1; } interface TextDimensions { width: number; height: number; } interface Measurer { /** * Measures the dimensions of text with the given font configuration * @param text The text to measure * @param fontConfig The font configuration to apply * @returns The dimensions of the text */ measureText(text: string, fontConfig: FontConfiguration): TextDimensions; /** * Measures the width of text with the given font configuration * @param text The text to measure * @param fontConfig The font configuration to apply * @returns The width of the text */ measureTextWidth(text: string, fontConfig: FontConfiguration): number; /** * Measures the height of text with the given font configuration * @param text The text to measure * @param fontConfig The font configuration to apply * @returns The height of the text */ measureTextHeight(text: string, fontConfig: FontConfiguration): number; /** * Splits text into lines that fit within the given width * @param text The text to split * @param maxWidth The maximum width of each line * @param fontConfig The font configuration to apply * @returns The lines of text */ splitTextToSize(text: string, maxWidth: number, fontConfig: FontConfiguration): string[]; } /** * Base class for implementing measurers with common functionality */ export abstract class BaseMeasurer implements Measurer { abstract measureText(text: string, fontConfig: FontConfiguration): TextDimensions; measureTextWidth(text: string, fontConfig: FontConfiguration): number; measureTextHeight(text: string, fontConfig: FontConfiguration): number; abstract splitTextToSize(text: string, maxWidth: number, fontConfig: FontConfiguration): string[]; protected splitTextWithMeasure(text: string, maxWidth: number, measure: (value: string) => number): string[]; protected wrapParagraph(paragraph: string, maxWidth: number, measure: (value: string) => number): string[]; protected splitWord(word: string, maxWidth: number, measure: (value: string) => number): { lines: string[]; remainder: string; }; } /** * Measures text using Canvas API */ export class CanvasMeasurer extends BaseMeasurer { constructor(); measureText(text: string, fontConfig: FontConfiguration): TextDimensions; splitTextToSize(text: string, maxWidth: number, fontConfig: FontConfiguration): string[]; } /** * Measures text using DOM elements */ export class DomMeasurer extends BaseMeasurer { constructor(); /** * Cleans up the DOM element when no longer needed */ dispose(): void; measureText(text: string, fontConfig: FontConfiguration): TextDimensions; splitTextToSize(text: string, maxWidth: number, fontConfig: FontConfiguration): string[]; } /** * Base formatter for formatters that need measurements to position elements */ declare abstract class MeasurementBasedFormatter extends Formatter { /** * Instantiate a measurement-based formatter. * @param configuration - The formatter configuration. */ constructor(configuration?: DeepPartial); /** * Get the default configuration for this formatter type * Uses the measurement-based default configuration */ protected getDefaultConfiguration(): T; } /** * Represents a measured chord-lyrics pair with position information */ interface MeasuredItem { item: ChordLyricsPair | Tag | SoftLineBreak | null; width: number; chordHeight?: number; chordLyricWidthDifference?: number; } /** * Represents a single line in the layout */ interface LineLayout { type: 'ChordLyricsPair' | 'Comment' | 'SectionLabel' | 'Tag' | 'Empty'; lineHeight: number; items: MeasuredItem[]; line: Line; } /** * Represents a paragraph in the layout */ /** * Complete layout for a song */ /** * Configuration for the layout engine */ interface LayoutConfig { width: number; fonts: { chord: FontConfiguration; lyrics: FontConfiguration; comment: FontConfiguration; sectionLabel: FontConfiguration; }; chordSpacing: number; chordLyricSpacing: number; linePadding: number; useUnicodeModifiers: boolean; normalizeChords: boolean; minY: number; columnWidth: number; columnCount?: number; columnSpacing: number; minColumnWidth?: number; maxColumnWidth?: number; paragraphSpacing: number; columnBottomY: number; displayLyricsOnly?: boolean; decapo: boolean; repeatedSections?: 'hide' | 'title_only' | 'lyrics_only' | 'full'; } interface ParagraphLayoutResult { units: LineLayout[][]; addSpacing: boolean; sectionType: string; } /** * Engine for layout calculations */ export class LayoutEngine { constructor(song: Song, measurer: Measurer, config: LayoutConfig); /** * Compute layouts for all paragraphs in the song */ computeParagraphLayouts(): ParagraphLayoutResult[]; } /** * Formats a song into a plain text chord sheet */ export class TextFormatter extends Formatter { song: Song; metadata: Metadata; /** * Formats a song into a plain text chord sheet * @param {Song} song The song to be formatted * @param {Metadata} metadata Optional override of metadata used for formatting * @returns {string} the chord sheet */ format(song: Song, metadata?: Metadata): string; formatHeader(): string; formatParagraphs(): string; formatParagraph(paragraph: Paragraph, metadata: Metadata): string; formatLine(line: Line, metadata: Metadata): string; formatTitle(title: string | null): string; formatSubTitle(subtitle: string | null): string; formatLineTop(line: Line, metadata: Metadata): string | null; chordLyricsPairLength(chordLyricsPair: ChordLyricsPair, line: Line): number; formatItemTop(item: Item, _metadata: Metadata, line: Line): string; formatLineBottom(line: Line, metadata: Metadata): string; formatLineWithFormatter(line: Line, formatter: (_item: Item, _metadata: Metadata, _line: Line) => string, metadata: Metadata): string; formatItemBottom(item: Item, metadata: Metadata, line: Line): string; } type HTMLElement = any; /** * MeasuredHtmlFormatter formats a song into HTML with absolute positioning. */ export class MeasuredHtmlFormatter extends MeasurementBasedFormatter { /** * Creates a new HTML formatter * @param container The HTML container element to render into */ constructor(container: HTMLElement); /** * Get the default configuration for HTML formatter */ protected getDefaultConfiguration(): MeasuredHtmlFormatterConfiguration; /** * Formats a song into HTML with absolute positioning. * @param song - The song to format. */ format(song: Song): void; /** * Gets the HTML output */ getHTML(): HTMLElement; /** * Generates HTML as a string */ getHTMLString(): string; /** * Clean up resources when the formatter is no longer needed */ dispose(): void; } /** * Parses an Ultimate Guitar chord sheet with metadata * Inherits from {@link ChordSheetParser} */ export class UltimateGuitarParser extends ChordSheetParser { currentSectionType: string | null; pendingRepeatNotation: string | null; /** * Instantiate a chord sheet parser * @param {Object} [options={}] options * @param {boolean} [options.preserveWhitespace=true] whether to preserve trailing whitespace for chords */ constructor({ preserveWhitespace }?: { preserveWhitespace?: boolean; }); parseLine(line: string): void; parseNonEmptyLine(line: string): void; parseLyricsWithChords(chordsLine: string, lyricsLine: string): void; processCharacters(chordsLine: string, lyricsLine: string): number; addCharacter(chr: string, nextChar: string): void; shouldAddCharacterToChords(nextChar: string): boolean; ensureChordLyricsPairInitialized(): void; parseUGMetadata(line: string): boolean; parseVerseDirective(line: string): boolean; parseChorusDirective(line: string): boolean; parseBridgeDirective(line: string): boolean; parsePartDirective(line: string): boolean; parseMetadata(line: string): boolean; isSectionEnd(): boolean; endOfSong(): void; startSection(sectionType: string, label: string): void; endSection({ addNewLine }?: { addNewLine?: boolean | undefined; }): void; startNewLine(): void; } export const version: "15.2.0"; interface FormatterConfigurationHelpers { configure: typeof configure; getDefaultConfig: typeof getDefaultConfig; getHTMLDefaultConfig: typeof getHTMLDefaultConfig; getMeasuredHtmlDefaultConfig: typeof getMeasuredHtmlDefaultConfig; getPDFDefaultConfig: typeof getPDFDefaultConfig; mergeConfigs: typeof mergeConfigs; } export const formatterConfiguration: FormatterConfigurationHelpers; interface KeyHelpers { getCapos: typeof getCapos; getKeys: typeof getKeys; } export const keyHelpers: KeyHelpers; declare const _default: { CHORUS: string; Chord: typeof Chord; ChordDefinition: typeof ChordDefinition; ChordLyricsPair: typeof ChordLyricsPair; ChordProFormatter: typeof ChordProFormatter; MeasuredHtmlFormatter: typeof MeasuredHtmlFormatter; ChordProParser: typeof ChordProParser; ChordSheetParser: typeof ChordSheetParser; ChordSheetSerializer: typeof ChordSheetSerializer; ChordsOverWordsFormatter: typeof ChordsOverWordsFormatter; ChordsOverWordsParser: typeof ChordsOverWordsParser; Comment: typeof Comment; Composite: typeof Composite; HtmlDivFormatter: typeof HtmlDivFormatter; HtmlTableFormatter: typeof HtmlTableFormatter; INDETERMINATE: string; Line: typeof Line; Literal: typeof Literal; Metadata: typeof Metadata; NONE: string; Paragraph: typeof Paragraph; PART: string; SoftLineBreak: typeof SoftLineBreak; Song: typeof Song; TAB: string; TEXTBLOCK: string; Tag: typeof Tag; Ternary: typeof Ternary; TextFormatter: typeof TextFormatter; UltimateGuitarParser: typeof UltimateGuitarParser; VERSE: string; BaseMeasurer: typeof BaseMeasurer; DomMeasurer: typeof DomMeasurer; CanvasMeasurer: typeof CanvasMeasurer; LayoutEngine: typeof LayoutEngine; formatterConfiguration: FormatterConfigurationHelpers; keyHelpers: KeyHelpers; version: string; templateHelpers: { isEvaluatable: typeof isEvaluatable; isChordLyricsPair: typeof isChordLyricsPair; lineHasContents: typeof lineHasContents; isTag: typeof isTag; isComment: typeof isComment; isImage: typeof isImage; stripHTML: typeof stripHTML; each: typeof each; when: typeof when; hasTextContents: typeof hasTextContents; lineClasses: typeof lineClasses; paragraphClasses: typeof paragraphClasses; evaluate: typeof evaluate; fontStyleTag: typeof fontStyleTag; renderChord: typeof renderChord; hasChordContents: typeof hasChordContents; pangoToHtml: typeof pangoToHtml; stripPangoMarkup: typeof stripPangoMarkup; }; }; export default _default; //# sourceMappingURL=main.d.ts.map