chordsheetjs 15.0.0 → 15.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/lib/bundle.js +1 -1
  2. package/lib/bundle.min.js +1 -1
  3. package/lib/index.js +1 -1
  4. package/lib/index.js.map +1 -1
  5. package/lib/main.d.ts +1 -1
  6. package/lib/module.js +1 -1
  7. package/lib/module.js.map +1 -1
  8. package/lib/pdf/index.js +30933 -17401
  9. package/lib/pdf/index.js.map +1 -0
  10. package/lib/pdf/main.d.ts +1696 -0
  11. package/lib/pdf/main.d.ts.map +1 -0
  12. package/lib/pdf/module.js +30891 -17332
  13. package/lib/pdf/module.js.map +1 -0
  14. package/package.json +2 -2
  15. package/lib/pdf/chord.d.ts +0 -219
  16. package/lib/pdf/chord_definition/chord_definition.d.ts +0 -66
  17. package/lib/pdf/chord_definition/chord_definition_set.d.ts +0 -12
  18. package/lib/pdf/chord_diagram/chord_diagram.d.ts +0 -131
  19. package/lib/pdf/chord_diagram/js_pdf_renderer.d.ts +0 -40
  20. package/lib/pdf/chord_diagram/renderer.d.ts +0 -43
  21. package/lib/pdf/chord_parsing_error.d.ts +0 -2
  22. package/lib/pdf/chord_sheet/ast_component.d.ts +0 -11
  23. package/lib/pdf/chord_sheet/ast_type.d.ts +0 -9
  24. package/lib/pdf/chord_sheet/chord_lyrics_pair.d.ts +0 -60
  25. package/lib/pdf/chord_sheet/chord_pro/composite.d.ts +0 -11
  26. package/lib/pdf/chord_sheet/chord_pro/evaluatable.d.ts +0 -7
  27. package/lib/pdf/chord_sheet/chord_pro/evaluation_error.d.ts +0 -7
  28. package/lib/pdf/chord_sheet/chord_pro/literal.d.ts +0 -9
  29. package/lib/pdf/chord_sheet/chord_pro/ternary.d.ts +0 -29
  30. package/lib/pdf/chord_sheet/comment.d.ts +0 -21
  31. package/lib/pdf/chord_sheet/font.d.ts +0 -47
  32. package/lib/pdf/chord_sheet/font_size.d.ts +0 -33
  33. package/lib/pdf/chord_sheet/font_stack.d.ts +0 -13
  34. package/lib/pdf/chord_sheet/item.d.ts +0 -7
  35. package/lib/pdf/chord_sheet/line.d.ts +0 -130
  36. package/lib/pdf/chord_sheet/line_expander.d.ts +0 -12
  37. package/lib/pdf/chord_sheet/metadata.d.ts +0 -71
  38. package/lib/pdf/chord_sheet/metadata_accessors.d.ts +0 -18
  39. package/lib/pdf/chord_sheet/paragraph.d.ts +0 -48
  40. package/lib/pdf/chord_sheet/soft_line_break.d.ts +0 -15
  41. package/lib/pdf/chord_sheet/song.d.ts +0 -253
  42. package/lib/pdf/chord_sheet/song_mapper.d.ts +0 -15
  43. package/lib/pdf/chord_sheet/standard_metadata_providers.d.ts +0 -5
  44. package/lib/pdf/chord_sheet/tag.d.ts +0 -104
  45. package/lib/pdf/chord_sheet/tag_interpreter.d.ts +0 -14
  46. package/lib/pdf/chord_sheet/tags.d.ts +0 -259
  47. package/lib/pdf/chord_sheet/trace_info.d.ts +0 -6
  48. package/lib/pdf/chord_sheet_serializer.d.ts +0 -49
  49. package/lib/pdf/constants.d.ts +0 -117
  50. package/lib/pdf/formatter/chord_pro_formatter.d.ts +0 -39
  51. package/lib/pdf/formatter/chord_renderer.d.ts +0 -30
  52. package/lib/pdf/formatter/chords_over_words_formatter.d.ts +0 -33
  53. package/lib/pdf/formatter/configuration/base_configuration.d.ts +0 -58
  54. package/lib/pdf/formatter/configuration/default_config_manager.d.ts +0 -31
  55. package/lib/pdf/formatter/configuration/html_configuration.d.ts +0 -37
  56. package/lib/pdf/formatter/configuration/index.d.ts +0 -13
  57. package/lib/pdf/formatter/configuration/measured_html_configuration.d.ts +0 -38
  58. package/lib/pdf/formatter/configuration/measurement_based_configuration.d.ts +0 -204
  59. package/lib/pdf/formatter/configuration/pdf_configuration.d.ts +0 -16
  60. package/lib/pdf/formatter/formatter.d.ts +0 -38
  61. package/lib/pdf/formatter/formatting_context.d.ts +0 -7
  62. package/lib/pdf/formatter/html_div_formatter.d.ts +0 -9
  63. package/lib/pdf/formatter/html_formatter.d.ts +0 -60
  64. package/lib/pdf/formatter/html_table_formatter.d.ts +0 -10
  65. package/lib/pdf/formatter/measured_html_formatter.d.ts +0 -43
  66. package/lib/pdf/formatter/measurement_based_formatter.d.ts +0 -19
  67. package/lib/pdf/formatter/pdf_formatter/doc_wrapper.d.ts +0 -53
  68. package/lib/pdf/formatter/pdf_formatter/fonts/NimbusSansLFonts.base64.d.ts +0 -4
  69. package/lib/pdf/formatter/pdf_formatter/types.d.ts +0 -34
  70. package/lib/pdf/formatter/pdf_formatter.d.ts +0 -40
  71. package/lib/pdf/formatter/templates/html_div_formatter.d.ts +0 -3
  72. package/lib/pdf/formatter/templates/html_table_formatter.d.ts +0 -3
  73. package/lib/pdf/formatter/text_formatter.d.ts +0 -35
  74. package/lib/pdf/helpers.d.ts +0 -42
  75. package/lib/pdf/index.d.ts +0 -126
  76. package/lib/pdf/key.d.ts +0 -124
  77. package/lib/pdf/key_config.d.ts +0 -3
  78. package/lib/pdf/layout/engine/condition.d.ts +0 -25
  79. package/lib/pdf/layout/engine/dimensions.d.ts +0 -33
  80. package/lib/pdf/layout/engine/index.d.ts +0 -7
  81. package/lib/pdf/layout/engine/item_processor.d.ts +0 -70
  82. package/lib/pdf/layout/engine/layout_engine.d.ts +0 -67
  83. package/lib/pdf/layout/engine/layout_factory.d.ts +0 -22
  84. package/lib/pdf/layout/engine/layout_helpers.d.ts +0 -35
  85. package/lib/pdf/layout/engine/line_breaker.d.ts +0 -54
  86. package/lib/pdf/layout/engine/paragraph_splitter/index.d.ts +0 -5
  87. package/lib/pdf/layout/engine/paragraph_splitter/paragraph_splitter.d.ts +0 -5
  88. package/lib/pdf/layout/engine/paragraph_splitter/strategies/five_or_more_lines_paragraph_split_strategy.d.ts +0 -14
  89. package/lib/pdf/layout/engine/paragraph_splitter/strategies/four_lines_paragraph_split_strategy.d.ts +0 -8
  90. package/lib/pdf/layout/engine/paragraph_splitter/strategies/three_or_less_lines_paragraph_split_strategy.d.ts +0 -4
  91. package/lib/pdf/layout/engine/title_separator_tag.d.ts +0 -8
  92. package/lib/pdf/layout/engine/types.d.ts +0 -98
  93. package/lib/pdf/layout/measurement/canvas_measurer.d.ts +0 -18
  94. package/lib/pdf/layout/measurement/dom_measurer.d.ts +0 -21
  95. package/lib/pdf/layout/measurement/index.d.ts +0 -4
  96. package/lib/pdf/layout/measurement/js_pdf_measurer.d.ts +0 -12
  97. package/lib/pdf/layout/measurement/measurer.d.ts +0 -52
  98. package/lib/pdf/normalize_mappings/enharmonic-normalize.d.ts +0 -2
  99. package/lib/pdf/normalize_mappings/suffix-normalize-mapping.d.ts +0 -2
  100. package/lib/pdf/pango/pango_helpers.d.ts +0 -6
  101. package/lib/pdf/parser/chord/peg_parser.d.ts +0 -55
  102. package/lib/pdf/parser/chord_definition/peg_parser.d.ts +0 -55
  103. package/lib/pdf/parser/chord_pro/helpers.d.ts +0 -15
  104. package/lib/pdf/parser/chord_pro/peg_parser.d.ts +0 -55
  105. package/lib/pdf/parser/chord_pro_parser.d.ts +0 -32
  106. package/lib/pdf/parser/chord_sheet_parser.d.ts +0 -57
  107. package/lib/pdf/parser/chords_over_words/helpers.d.ts +0 -33
  108. package/lib/pdf/parser/chords_over_words/peg_parser.d.ts +0 -55
  109. package/lib/pdf/parser/chords_over_words_parser.d.ts +0 -67
  110. package/lib/pdf/parser/null_tracer.d.ts +0 -4
  111. package/lib/pdf/parser/parser_helpers.d.ts +0 -3
  112. package/lib/pdf/parser/parser_warning.d.ts +0 -33
  113. package/lib/pdf/parser/ultimate_guitar_parser.d.ts +0 -46
  114. package/lib/pdf/pdf.d.ts +0 -2
  115. package/lib/pdf/rendering/html/html_doc_wrapper.d.ts +0 -82
  116. package/lib/pdf/rendering/html/html_element_styler.d.ts +0 -58
  117. package/lib/pdf/rendering/html/positioned_html_renderer.d.ts +0 -85
  118. package/lib/pdf/rendering/pdf/js_pdf_renderer.d.ts +0 -46
  119. package/lib/pdf/rendering/pdf/pdf_chord_diagram_renderer.d.ts +0 -118
  120. package/lib/pdf/rendering/renderer.d.ts +0 -273
  121. package/lib/pdf/rendering/shared/layout_section_renderer.d.ts +0 -93
  122. package/lib/pdf/scales.d.ts +0 -3
  123. package/lib/pdf/serialized_types.d.ts +0 -76
  124. package/lib/pdf/song_builder.d.ts +0 -38
  125. package/lib/pdf/template_helpers/metadata_processor.d.ts +0 -14
  126. package/lib/pdf/template_helpers/when.d.ts +0 -13
  127. package/lib/pdf/template_helpers/when_callback.d.ts +0 -2
  128. package/lib/pdf/template_helpers/when_clause.d.ts +0 -8
  129. package/lib/pdf/template_helpers.d.ts +0 -64
  130. package/lib/pdf/utilities.d.ts +0 -35
  131. package/lib/pdf/version.d.ts +0 -2
@@ -1,49 +0,0 @@
1
- import AstType from './chord_sheet/ast_type';
2
- import ChordDefinition from './chord_definition/chord_definition';
3
- import ChordLyricsPair from './chord_sheet/chord_lyrics_pair';
4
- import Comment from './chord_sheet/comment';
5
- import Line from './chord_sheet/line';
6
- import Literal from './chord_sheet/chord_pro/literal';
7
- import SoftLineBreak from './chord_sheet/soft_line_break';
8
- import Song from './chord_sheet/song';
9
- import SongBuilder from './song_builder';
10
- import Tag from './chord_sheet/tag';
11
- import Ternary from './chord_sheet/chord_pro/ternary';
12
- import { SerializedChordDefinition, SerializedChordLyricsPair, SerializedComment, SerializedComponent, SerializedLine, SerializedLiteral, SerializedSong, SerializedTag, SerializedTernary } from './serialized_types';
13
- /**
14
- * Serializes a song into een plain object, and deserializes the serialized object back into a {@link Song}
15
- */
16
- declare class ChordSheetSerializer {
17
- song: Song;
18
- songBuilder: SongBuilder;
19
- /**
20
- * Serializes the chord sheet to a plain object, which can be converted to any format like JSON, XML etc
21
- * Can be deserialized using {@link deserialize}
22
- * @returns object A plain JS object containing all chord sheet data
23
- */
24
- serialize(song: Song): SerializedSong;
25
- serializeLine(line: Line): SerializedLine;
26
- serializeItem(item: AstType): SerializedComponent;
27
- serializeChordDefinition(chordDefinition: ChordDefinition): SerializedChordDefinition;
28
- serializeTag(tag: Tag): SerializedTag;
29
- serializeChordLyricsPair(chordLyricsPair: ChordLyricsPair): SerializedChordLyricsPair;
30
- serializeTernary(ternary: Ternary): object;
31
- serializeLiteral(literal: Literal): string;
32
- serializeExpression(expression: AstType[]): SerializedComponent[];
33
- serializeComment(comment: Comment): SerializedComment;
34
- /**
35
- * Deserializes a song that has been serialized using {@link serialize}
36
- * @param {object} serializedSong The serialized song
37
- * @returns {Song} The deserialized song
38
- */
39
- deserialize(serializedSong: SerializedSong): Song;
40
- parseAstComponent(astComponent: SerializedComponent): null | ChordLyricsPair | Tag | Comment | Ternary | Literal | SoftLineBreak;
41
- parseChordSheet(astComponent: SerializedSong): void;
42
- parseLine(astComponent: SerializedLine): void;
43
- parseChordLyricsPair(astComponent: SerializedChordLyricsPair): ChordLyricsPair;
44
- parseTag(astComponent: SerializedTag): Tag;
45
- parseComment(astComponent: SerializedComment): Comment;
46
- parseTernary(astComponent: SerializedTernary): Ternary;
47
- parseExpression(expression: (SerializedLiteral | SerializedTernary)[]): (AstType | null)[];
48
- }
49
- export default ChordSheetSerializer;
@@ -1,117 +0,0 @@
1
- /**
2
- * Used to mark a paragraph as bridge
3
- * @constant
4
- * @type {string}
5
- */
6
- export declare const BRIDGE = "bridge";
7
- /**
8
- * Used to mark a paragraph as chorus
9
- * @constant
10
- * @type {string}
11
- */
12
- export declare const CHORUS = "chorus";
13
- /**
14
- * Used to mark a paragraph as grid
15
- * @constant
16
- * @type {string}
17
- */
18
- export declare const GRID = "grid";
19
- /**
20
- * Used to mark a paragraph as containing lines with both verse and chorus type
21
- * @constant
22
- * @type {string}
23
- */
24
- export declare const INDETERMINATE = "indeterminate";
25
- /**
26
- * Used to mark a paragraph as not containing a line marked with a type
27
- * @constant
28
- * @type {string}
29
- */
30
- export declare const NONE = "none";
31
- /**
32
- * Used to mark a paragraph as tab
33
- * @constant
34
- * @type {string}
35
- */
36
- export declare const TAB = "tab";
37
- /**
38
- * Used to mark a paragraph as verse
39
- * @constant
40
- * @type {string}
41
- */
42
- export declare const VERSE = "verse";
43
- /**
44
- * Used to mark a paragraph as part
45
- * @constant
46
- * @type {string}
47
- */
48
- export declare const PART = "part";
49
- /**
50
- * Used to mark a section as Lilypond notation
51
- * @constant
52
- * @type {string}
53
- */
54
- export declare const LILYPOND = "ly";
55
- /**
56
- * Used to mark a section as ABC music notation
57
- * @constant
58
- * @type {string}
59
- */
60
- export declare const ABC = "abc";
61
- /**
62
- * Used to mark a section as SVG image
63
- * @constant
64
- * @type {string}
65
- */
66
- export declare const SVG = "svg";
67
- /**
68
- * Used to mark a paragraph as textblock
69
- * @constant
70
- * @type {string}
71
- */
72
- export declare const TEXTBLOCK = "textblock";
73
- export type ParagraphType = 'abc' | 'bridge' | 'chorus' | 'grid' | 'indeterminate' | 'ly' | 'none' | 'svg' | 'tab' | 'textblock' | 'verse' | 'part' | string;
74
- export declare const SYMBOL = "symbol";
75
- export declare const NUMERIC = "numeric";
76
- export declare const NUMERAL = "numeral";
77
- export declare const SOLFEGE = "solfege";
78
- export declare const ROMAN_NUMERALS: string[];
79
- export declare const FLAT = "b";
80
- export declare const SHARP = "#";
81
- export type Accidental = '#' | 'b';
82
- export declare const NO_ACCIDENTAL = "NM";
83
- export type NoAccidental = 'NM';
84
- export type AccidentalMaybe = Accidental | NoAccidental;
85
- /**
86
- * @deprecated Use Accidental instead
87
- */
88
- export type Modifier = Accidental;
89
- /**
90
- * @deprecated Use NO_ACCIDENTAL instead
91
- */
92
- export declare const NO_MODIFIER = "NM";
93
- /**
94
- * @deprecated Use NoAccidental instead
95
- */
96
- export type NoModifier = NoAccidental;
97
- /**
98
- * @deprecated Use AccidentalMaybe instead
99
- */
100
- export type ModifierMaybe = AccidentalMaybe;
101
- export type ChordType = 'symbol' | 'solfege' | 'numeric' | 'numeral';
102
- export type ChordStyle = 'symbol' | 'solfege' | 'number' | 'numeral';
103
- export type NullableChordStyle = ChordStyle | null;
104
- export declare const MINOR = "m";
105
- export declare const MAJOR = "M";
106
- export type Mode = 'M' | 'm';
107
- export type FretNumber = number;
108
- export type OpenFret = 0;
109
- export type NonSoundingString = '-1' | 'N' | 'x';
110
- export type StringNumber = 1 | 2 | 3 | 4 | 5 | 6;
111
- export type FingerNumber = 1 | 2 | 3 | 4 | 5 | OpenFret;
112
- export declare const nonSoundingString: NonSoundingString[];
113
- export declare const openFret: OpenFret;
114
- export type Fret = FretNumber | OpenFret | NonSoundingString;
115
- export declare const START_TAG = "start_tag";
116
- export declare const END_TAG = "end_tag";
117
- export declare const AUTO = "auto";
@@ -1,39 +0,0 @@
1
- import ChordLyricsPair from '../chord_sheet/chord_lyrics_pair';
2
- import Comment from '../chord_sheet/comment';
3
- import Evaluatable from '../chord_sheet/chord_pro/evaluatable';
4
- import Formatter from './formatter';
5
- import Item from '../chord_sheet/item';
6
- import Line from '../chord_sheet/line';
7
- import Metadata from '../chord_sheet/metadata';
8
- import Song from '../chord_sheet/song';
9
- import Tag from '../chord_sheet/tag';
10
- import Ternary from '../chord_sheet/chord_pro/ternary';
11
- /**
12
- * Formats a song into a ChordPro chord sheet
13
- */
14
- declare class ChordProFormatter extends Formatter {
15
- /**
16
- * Formats a song into a ChordPro chord sheet.
17
- * @param {Song} song The song to be formatted
18
- * @returns {string} The ChordPro string
19
- */
20
- format(song: Song): string;
21
- private separateMetadataFromContent;
22
- private formatMetadataSection;
23
- private formatContentSection;
24
- private combineMetadataAndContent;
25
- formatLine(line: Line, metadata: Metadata): string;
26
- formatItem(item: Item, metadata: Metadata): string;
27
- formatOrEvaluateItem(item: Evaluatable, metadata: Metadata): string;
28
- formatTernary(ternary: Ternary): string;
29
- formatValueTest(valueTest: string | null): string;
30
- formatExpressionRange(expressionRange: Evaluatable[]): string;
31
- formatExpression(expression: Evaluatable): string;
32
- formatTag(tag: Tag): string;
33
- formatTagAttributes(tag: Tag): string;
34
- formatChordLyricsPair(chordLyricsPair: ChordLyricsPair): string;
35
- formatChordLyricsPairChords(chordLyricsPair: ChordLyricsPair): string;
36
- formatChordLyricsPairLyrics(chordLyricsPair: ChordLyricsPair): string;
37
- formatComment(comment: Comment): string;
38
- }
39
- export default ChordProFormatter;
@@ -1,30 +0,0 @@
1
- import Key from '../key';
2
- import { NullableChordStyle } from '../constants';
3
- interface ConstructorOptions {
4
- capo: number;
5
- contextKey: Key | null;
6
- decapo: boolean;
7
- normalizeChords: boolean;
8
- renderKey: Key | null;
9
- songKey: Key | null;
10
- style: NullableChordStyle;
11
- transposeKey: string | null;
12
- useUnicodeModifier: boolean;
13
- }
14
- declare class ChordRenderer {
15
- capo: number;
16
- contextKey: Key | null;
17
- normalizeChords: boolean;
18
- renderKey: Key | null;
19
- songKey: Key | null;
20
- style: NullableChordStyle;
21
- transposeKey: string | null;
22
- useUnicodeModifier: boolean;
23
- constructor(options?: Partial<ConstructorOptions>);
24
- render(chordString: string): string;
25
- private changeChordType;
26
- private get accidental();
27
- private get effectiveKey();
28
- private get effectiveTransposeDistance();
29
- }
30
- export default ChordRenderer;
@@ -1,33 +0,0 @@
1
- import ChordLyricsPair from '../chord_sheet/chord_lyrics_pair';
2
- import Formatter from './formatter';
3
- import Item from '../chord_sheet/item';
4
- import Line from '../chord_sheet/line';
5
- import Metadata from '../chord_sheet/metadata';
6
- import Paragraph from '../chord_sheet/paragraph';
7
- import Song from '../chord_sheet/song';
8
- /**
9
- * Formats a song into a plain text chord sheet
10
- */
11
- declare class ChordsOverWordsFormatter extends Formatter {
12
- song: Song;
13
- /**
14
- * Formats a song into a plain text chord sheet
15
- * @param {Song} song The song to be formatted
16
- * @returns {string} the chord sheet
17
- */
18
- format(song: Song): string;
19
- formatHeader(): string;
20
- formatParagraphs(): string;
21
- formatParagraph(paragraph: Paragraph, metadata: Metadata): string;
22
- formatLine(line: Line, metadata: Metadata): string;
23
- formatLineTop(line: Line, metadata: Metadata): string | null;
24
- chordLyricsPairLength(chordLyricsPair: ChordLyricsPair, line: Line): number;
25
- formatItemTop(item: Item, _metadata: Metadata, line: Line): string;
26
- renderChord(item: ChordLyricsPair, line: Line): string;
27
- formatLineBottom(line: any, metadata: any): string | null;
28
- formatLineWithFormatter(line: Line, formatter: (_item: Item, _metadata: Metadata, _line: Line) => string, metadata: Metadata): string;
29
- formatItemBottom(item: Item, metadata: Metadata, line: Line): string;
30
- private formatEvaluatable;
31
- private formatChordLyricsPair;
32
- }
33
- export default ChordsOverWordsFormatter;
@@ -1,58 +0,0 @@
1
- import { ContentType } from '../../serialized_types';
2
- import Key from '../../key';
3
- export type Delegate = (_string: string) => string;
4
- export declare const defaultDelegate: Delegate;
5
- export interface MetadataRule {
6
- match: string | string[] | RegExp | ((key: string) => boolean);
7
- visible?: boolean;
8
- sortMethod?: 'preserve' | 'alphabetical' | 'custom';
9
- customSort?: (a: string, b: string) => number;
10
- }
11
- export interface MetadataConfiguration {
12
- separator: string;
13
- order: (string | MetadataRule)[];
14
- }
15
- export interface InstrumentConfiguration {
16
- type?: string;
17
- description?: string;
18
- tuning?: string;
19
- }
20
- export interface UserConfigurationProperties {
21
- name?: string;
22
- fullname?: string;
23
- }
24
- export declare const defaultMetadataConfiguration: MetadataConfiguration;
25
- export interface DelegatesConfiguration {
26
- abc: Delegate;
27
- ly: Delegate;
28
- svg: Delegate;
29
- tab: Delegate;
30
- grid: Delegate;
31
- }
32
- export declare const defaultDelegatesConfiguration: DelegatesConfiguration;
33
- export interface BaseFormatterConfiguration {
34
- decapo: boolean;
35
- delegates: Partial<Record<ContentType, Delegate>>;
36
- evaluate: boolean;
37
- expandChorusDirective: boolean;
38
- instrument: InstrumentConfiguration | null;
39
- key: Key | null;
40
- metadata: MetadataConfiguration;
41
- normalizeChords: boolean;
42
- useUnicodeModifiers: boolean;
43
- user: UserConfigurationProperties | null;
44
- }
45
- export type ConfigurationProperties = Record<string, any> & Partial<{
46
- decapo: boolean;
47
- delegates: Partial<DelegatesConfiguration>;
48
- evaluate: boolean;
49
- expandChorusDirective: boolean;
50
- instrument: Partial<InstrumentConfiguration>;
51
- key: Key | string | null;
52
- metadata: Partial<MetadataConfiguration>;
53
- normalizeChords: boolean;
54
- useUnicodeModifiers: boolean;
55
- user: Partial<UserConfigurationProperties>;
56
- }>;
57
- export declare const defaultBaseConfiguration: BaseFormatterConfiguration;
58
- export default BaseFormatterConfiguration;
@@ -1,31 +0,0 @@
1
- import { BaseFormatterConfiguration } from './base_configuration';
2
- import { HTMLFormatterConfiguration } from './html_configuration';
3
- import { MeasuredHtmlFormatterConfiguration } from './measured_html_configuration';
4
- import { MeasurementBasedFormatterConfiguration } from './measurement_based_configuration';
5
- import { PDFFormatterConfiguration } from './pdf_configuration';
6
- /**
7
- * Build the inheritance chain for a formatter type
8
- * @param formatterType The formatter type to build the chain for
9
- * @returns Array of formatter types in inheritance order (base first)
10
- */
11
- export declare const buildInheritanceChain: (formatterType: string) => string[];
12
- /**
13
- * Get the default configuration for a specific formatter type
14
- * This dynamically composes the full default configuration by merging
15
- * the defaults from all levels in the inheritance chain
16
- * @param formatterType The formatter type to get defaults for
17
- * @returns The fully composed default configuration
18
- */
19
- export declare const getDefaultConfig: <T extends BaseFormatterConfiguration>(formatterType: string) => T;
20
- export declare const getBaseDefaultConfig: () => BaseFormatterConfiguration;
21
- export declare const getHTMLDefaultConfig: () => HTMLFormatterConfiguration;
22
- export declare const getMeasurementDefaultConfig: () => MeasurementBasedFormatterConfiguration;
23
- export declare const getPDFDefaultConfig: () => PDFFormatterConfiguration;
24
- export declare const getMeasuredHtmlDefaultConfig: () => MeasuredHtmlFormatterConfiguration;
25
- /**
26
- * Register a new formatter type with its specific defaults and inheritance chain
27
- * @param formatterType The formatter type to register
28
- * @param specificDefaults The formatter-specific default settings
29
- * @param inheritsFrom Array of formatter types this one inherits from (in order)
30
- */
31
- export declare const registerFormatterType: (formatterType: string, specificDefaults?: Record<string, any>, inheritsFrom?: string[]) => void;
@@ -1,37 +0,0 @@
1
- import { BaseFormatterConfiguration, ConfigurationProperties } from './base_configuration';
2
- import { PangoRenderer } from '../../pango/pango_helpers';
3
- export type CSS = Record<string, string | number>;
4
- export interface HtmlTemplateCssClasses {
5
- annotation: string;
6
- chord: string;
7
- chordSheet: string;
8
- column: string;
9
- comment: string;
10
- emptyLine: string;
11
- image: string;
12
- label: string;
13
- labelWrapper: string;
14
- line: string;
15
- literal: string;
16
- literalContents: string;
17
- lyrics: string;
18
- paragraph: string;
19
- rhythmSymbol: string;
20
- row: string;
21
- subtitle: string;
22
- title: string;
23
- }
24
- export interface HTMLFormatterConfiguration extends BaseFormatterConfiguration {
25
- cssClasses: HtmlTemplateCssClasses;
26
- customCSS?: CSS;
27
- pangoRenderer?: PangoRenderer;
28
- renderBlankLines?: boolean;
29
- }
30
- export declare const defaultCssClasses: HtmlTemplateCssClasses;
31
- export interface HTMLConfigurationProperties extends ConfigurationProperties {
32
- cssClasses?: Partial<HtmlTemplateCssClasses>;
33
- customCSS?: CSS;
34
- pangoRenderer?: PangoRenderer;
35
- renderBlankLines?: boolean;
36
- }
37
- export declare const htmlSpecificDefaults: Partial<HTMLFormatterConfiguration>;
@@ -1,13 +0,0 @@
1
- import { BaseFormatterConfiguration, ConfigurationProperties, Delegate, DelegatesConfiguration, InstrumentConfiguration, MetadataConfiguration, UserConfigurationProperties, defaultBaseConfiguration, defaultDelegate, defaultDelegatesConfiguration, defaultMetadataConfiguration } from './base_configuration';
2
- import { CSS, HTMLConfigurationProperties, HTMLFormatterConfiguration, HtmlTemplateCssClasses, defaultCssClasses, htmlSpecificDefaults } from './html_configuration';
3
- import { Alignment, ChordDiagramFontConfigurations, ChordDiagramOverrides, ChordDiagramsConfig, ColumnConfig, ConditionRule, ConditionalRule, Dimension, FontConfiguration, FontConfigurations, FontSection, ILayoutContentItem, LayoutContentItem, LayoutContentItemWithImage, LayoutContentItemWithLine, LayoutContentItemWithTemplate, LayoutContentItemWithText, LayoutContentItemWithValue, LayoutItem, LayoutSection, LineLayout, LineStyle, Margins, MeasuredItem, MeasurementBasedFormatterConfiguration, MeasurementBasedLayoutConfig, MeasurerType, Position, SectionDisplay, SectionTypeConfig, SectionsConfig, SingleCondition, defaultFontConfigurations, defaultMeasurementBasedLayout, measurementSpecificDefaults } from './measurement_based_configuration';
4
- import { MeasuredHtmlConfigurationProperties, MeasuredHtmlFormatterConfiguration, MeasuredHtmlLayoutConfig, measuredHtmlSpecificDefaults } from './measured_html_configuration';
5
- import { PDFConfigurationProperties, PDFFormatterConfiguration, PDFLayoutConfig, pdfSpecificDefaults } from './pdf_configuration';
6
- import { getDefaultConfig, getHTMLDefaultConfig, getMeasuredHtmlDefaultConfig, getPDFDefaultConfig } from './default_config_manager';
7
- type Configuration = BaseFormatterConfiguration;
8
- /**
9
- * Legacy configuration function for backward compatibility
10
- */
11
- export declare function configure(config: ConfigurationProperties): Configuration;
12
- export { Delegate, defaultDelegate, MetadataConfiguration, InstrumentConfiguration, UserConfigurationProperties, defaultMetadataConfiguration, DelegatesConfiguration, defaultDelegatesConfiguration, ConfigurationProperties, defaultBaseConfiguration, Margins, FontSection, LayoutSection, Alignment, MeasurerType, ConditionRule, SingleCondition, ConditionalRule, Position, Dimension, FontConfiguration, FontConfigurations, ChordDiagramFontConfigurations, defaultFontConfigurations, SectionDisplay, SectionTypeConfig, ColumnConfig, SectionsConfig, ILayoutContentItem, LayoutContentItem, LayoutContentItemWithText, LayoutContentItemWithValue, LayoutContentItemWithTemplate, LayoutContentItemWithImage, LineStyle, LayoutContentItemWithLine, LayoutItem, ChordDiagramOverrides, ChordDiagramsConfig, MeasuredItem, LineLayout, MeasurementBasedLayoutConfig, defaultMeasurementBasedLayout, measurementSpecificDefaults, MeasurementBasedFormatterConfiguration, MeasuredHtmlLayoutConfig, MeasuredHtmlFormatterConfiguration, MeasuredHtmlConfigurationProperties, measuredHtmlSpecificDefaults, CSS, HtmlTemplateCssClasses, HTMLFormatterConfiguration, defaultCssClasses, HTMLConfigurationProperties, htmlSpecificDefaults, PDFLayoutConfig, PDFFormatterConfiguration, PDFConfigurationProperties, pdfSpecificDefaults, BaseFormatterConfiguration, Configuration, getDefaultConfig, getHTMLDefaultConfig, getMeasuredHtmlDefaultConfig, getPDFDefaultConfig, };
13
- export default Configuration;
@@ -1,38 +0,0 @@
1
- import { MeasurementBasedConfigurationProperties, MeasurementBasedFormatterConfiguration, MeasurementBasedLayoutConfig, SectionsConfig } from './measurement_based_configuration';
2
- export interface MeasuredHtmlLayoutConfig extends MeasurementBasedLayoutConfig {
3
- header: MeasurementBasedLayoutConfig['header'];
4
- footer: MeasurementBasedLayoutConfig['footer'];
5
- sections: SectionsConfig;
6
- }
7
- export interface MeasuredHtmlFormatterConfiguration extends MeasurementBasedFormatterConfiguration {
8
- version: string;
9
- layout: MeasuredHtmlLayoutConfig;
10
- pageSize: {
11
- width: number;
12
- height: number;
13
- };
14
- cssClassPrefix?: string;
15
- additionalCss?: string;
16
- cssClasses?: {
17
- container?: string;
18
- page?: string;
19
- chord?: string;
20
- lyrics?: string;
21
- sectionLabel?: string;
22
- comment?: string;
23
- header?: string;
24
- footer?: string;
25
- };
26
- }
27
- export interface MeasuredHtmlConfigurationProperties extends MeasurementBasedConfigurationProperties {
28
- version?: string;
29
- layout?: Partial<MeasuredHtmlLayoutConfig>;
30
- pageSize?: {
31
- width?: number;
32
- height?: number;
33
- };
34
- cssClassPrefix?: string;
35
- additionalCss?: string;
36
- cssClasses?: Record<string, string>;
37
- }
38
- export declare const measuredHtmlSpecificDefaults: Partial<MeasuredHtmlFormatterConfiguration>;
@@ -1,204 +0,0 @@
1
- import type { ImageCompression } from 'jspdf';
2
- import { ChordDiagramRenderingConfig } from '../../chord_diagram/chord_diagram';
3
- import Item from '../../chord_sheet/item';
4
- import { ParagraphType } from '../../constants';
5
- import { BaseFormatterConfiguration, ConfigurationProperties } from './base_configuration';
6
- import { ChordLyricsPair, Comment, Line, SoftLineBreak, Tag } from '../../index';
7
- export interface Margins {
8
- top: number;
9
- bottom: number;
10
- left: number;
11
- right: number;
12
- }
13
- export type FontSection = 'title' | 'subtitle' | 'metadata' | 'text' | 'chord' | 'comment' | 'annotation' | 'sectionLabel';
14
- export type LayoutSection = 'header' | 'footer';
15
- export type Alignment = 'left' | 'center' | 'right' | number;
16
- export type MeasurerType = 'canvas' | 'dom' | 'jspdf';
17
- export type ConditionRule = Partial<{
18
- equals: any;
19
- not_equals: any;
20
- greater_than: number;
21
- greater_than_equal: number;
22
- less_than: number;
23
- less_than_equal: number;
24
- like: string;
25
- contains: string;
26
- in: any[];
27
- not_in: any[];
28
- all: any[];
29
- exists: boolean;
30
- first: boolean;
31
- last: boolean;
32
- }>;
33
- export type SingleCondition = Record<string, ConditionRule>;
34
- export type ConditionalRule = Partial<{
35
- and: SingleCondition[];
36
- or: SingleCondition[];
37
- }> | SingleCondition;
38
- export interface Position {
39
- x: Alignment;
40
- y: number;
41
- width?: number;
42
- height?: number;
43
- offsetX?: number;
44
- clip?: boolean;
45
- ellipsis?: boolean;
46
- }
47
- export interface Dimension {
48
- width: number;
49
- height: number;
50
- }
51
- export interface FontConfiguration {
52
- name: string;
53
- style: string;
54
- weight?: string | number;
55
- size: number;
56
- lineHeight?: number;
57
- color: string | number;
58
- underline?: boolean;
59
- inherit?: string;
60
- textTransform?: string;
61
- textDecoration?: string;
62
- letterSpacing?: string;
63
- }
64
- export type FontConfigurations = Record<FontSection, FontConfiguration>;
65
- export type ChordDiagramFontConfigurations = Record<'title' | 'fingerings' | 'baseFret', FontConfiguration>;
66
- export declare const defaultFontConfigurations: FontConfigurations;
67
- export interface SectionDisplay {
68
- labelStyle?: 'uppercase';
69
- showLabel?: boolean;
70
- lyricsOnly?: boolean;
71
- indent?: number;
72
- compact?: boolean;
73
- repeatedSections?: 'hide' | 'title_only' | 'lyrics_only' | 'full';
74
- }
75
- export interface SectionTypeConfig {
76
- fonts?: FontConfigurations;
77
- display?: SectionDisplay;
78
- overrides?: {
79
- condition: ConditionalRule;
80
- display: Partial<SectionDisplay>;
81
- }[];
82
- }
83
- export interface ColumnConfig {
84
- columnCount?: number;
85
- columnSpacing: number;
86
- minColumnWidth?: number;
87
- maxColumnWidth?: number;
88
- }
89
- export interface SectionsConfig {
90
- global: {
91
- columnWidth: number;
92
- spacingBottom?: number;
93
- spacingAfter?: number;
94
- chordLyricSpacing: number;
95
- linePadding: number;
96
- paragraphSpacing?: number;
97
- chordSpacing: number;
98
- } & ColumnConfig;
99
- base: SectionTypeConfig;
100
- types?: Record<ParagraphType, SectionTypeConfig | undefined>;
101
- }
102
- export interface ILayoutContentItem {
103
- type: string;
104
- position: Position;
105
- condition?: ConditionalRule;
106
- }
107
- export interface LayoutContentItemWithText extends ILayoutContentItem {
108
- type: 'text';
109
- style: FontConfiguration;
110
- value?: string;
111
- template?: string;
112
- cssClass?: string;
113
- elementStyle?: Record<string, string>;
114
- }
115
- export interface LayoutContentItemWithValue extends LayoutContentItemWithText {
116
- value: string;
117
- }
118
- export interface LayoutContentItemWithTemplate extends LayoutContentItemWithText {
119
- template: string;
120
- }
121
- export interface LayoutContentItemWithImage extends ILayoutContentItem {
122
- type: 'image';
123
- src: string;
124
- position: Position;
125
- compression: ImageCompression;
126
- size: Dimension;
127
- alias?: string;
128
- rotation?: number;
129
- }
130
- export interface LineStyle {
131
- color: string;
132
- width: number;
133
- dash?: number[];
134
- }
135
- export interface LayoutContentItemWithLine {
136
- type: 'line';
137
- style: LineStyle;
138
- position: {
139
- x?: number;
140
- y: number;
141
- width: number | 'auto';
142
- height?: number;
143
- };
144
- condition?: ConditionalRule;
145
- }
146
- export type LayoutContentItem = LayoutContentItemWithValue | LayoutContentItemWithTemplate | LayoutContentItemWithImage | LayoutContentItemWithLine;
147
- export interface LayoutItem {
148
- height: number;
149
- content: LayoutContentItem[];
150
- }
151
- export interface ChordDiagramOverrides {
152
- hide?: boolean;
153
- definition?: string;
154
- }
155
- export interface ChordDiagramsConfig {
156
- enabled: boolean;
157
- renderingConfig?: ChordDiagramRenderingConfig;
158
- definitions?: {
159
- hiddenChords: string[];
160
- };
161
- overrides?: {
162
- global?: Record<string, ChordDiagramOverrides>;
163
- byKey?: Record<string, Record<string, ChordDiagramOverrides>>;
164
- };
165
- fonts: ChordDiagramFontConfigurations;
166
- }
167
- export interface MeasuredItem {
168
- item: ChordLyricsPair | Comment | SoftLineBreak | Tag | Item | null;
169
- width: number;
170
- chordLyricWidthDifference?: number;
171
- chordHeight?: number;
172
- adjustedChord?: string;
173
- }
174
- export interface LineLayout {
175
- type: 'ChordLyricsPair' | 'Comment' | 'Tag' | 'ColumnBreak' | 'SectionLabel';
176
- items: MeasuredItem[];
177
- lineHeight: number;
178
- line?: Line;
179
- }
180
- export interface MeasurementBasedLayoutConfig {
181
- global: {
182
- margins: Margins;
183
- };
184
- header: LayoutItem;
185
- footer: LayoutItem;
186
- sections?: SectionsConfig;
187
- chordDiagrams?: ChordDiagramsConfig;
188
- }
189
- export declare const defaultMeasurementBasedLayout: MeasurementBasedLayoutConfig;
190
- export declare const measurementSpecificDefaults: {
191
- fonts: FontConfigurations;
192
- measurer: string;
193
- layout: MeasurementBasedLayoutConfig;
194
- };
195
- export interface MeasurementBasedFormatterConfiguration extends BaseFormatterConfiguration {
196
- fonts: FontConfigurations;
197
- measurer: MeasurerType;
198
- layout: MeasurementBasedLayoutConfig;
199
- }
200
- export interface MeasurementBasedConfigurationProperties extends ConfigurationProperties {
201
- fonts?: Partial<FontConfigurations>;
202
- measurer?: MeasurerType;
203
- layout?: Partial<MeasurementBasedLayoutConfig>;
204
- }
@@ -1,16 +0,0 @@
1
- import { ChordDiagramsConfig, MeasurementBasedConfigurationProperties, MeasurementBasedFormatterConfiguration, MeasurementBasedLayoutConfig, SectionsConfig } from './measurement_based_configuration';
2
- export interface PDFLayoutConfig extends MeasurementBasedLayoutConfig {
3
- header: MeasurementBasedLayoutConfig['header'];
4
- footer: MeasurementBasedLayoutConfig['footer'];
5
- sections: SectionsConfig;
6
- chordDiagrams: ChordDiagramsConfig;
7
- }
8
- export interface PDFFormatterConfiguration extends MeasurementBasedFormatterConfiguration {
9
- version: string;
10
- layout: PDFLayoutConfig;
11
- }
12
- export interface PDFConfigurationProperties extends MeasurementBasedConfigurationProperties {
13
- version?: string;
14
- layout?: Partial<PDFLayoutConfig>;
15
- }
16
- export declare const pdfSpecificDefaults: Partial<PDFFormatterConfiguration>;