chordsheetjs
    Preparing search index...

    Class Formatter<T>

    Base formatter class that provides configuration handling for all formatters

    Type Parameters

    • T extends BaseFormatterConfiguration = BaseFormatterConfiguration

    Hierarchy (View Summary)

    Index

    Constructors

    • Instantiate

      Type Parameters

      • T extends BaseFormatterConfiguration = BaseFormatterConfiguration

      Parameters

      • Optionalconfiguration: DeepPartial<T> = ...

        options

        • evaluate

          Whether or not to evaluate meta expressions. For more info about meta expressions, see: https://bit.ly/2SC9c2u

        • metadata
        • metadata.separator

          The separator to be used when rendering a metadata value that has multiple values. See: https://bit.ly/2SC9c2u

        • key

          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.

        • expandChorusDirective

          Whether or not to expand {chorus} directives by rendering the last defined chorus inline after the directive.

        • useUnicodeModifiers

          Whether or not to use unicode flat and sharp symbols.

        • normalizeChords

          Whether or not to automatically normalize chords

      Returns Formatter<T>

    Methods

    • Configure the formatter with new options

      Parameters

      • config: DeepPartial<T>

        New configuration options

      Returns this

      The formatter instance for chaining

    • Get the default configuration for this formatter type Should be implemented by subclasses to return the appropriate default configuration

      Returns T