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.
- package/lib/bundle.js +1 -1
- package/lib/bundle.min.js +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/main.d.ts +1 -1
- package/lib/module.js +1 -1
- package/lib/module.js.map +1 -1
- package/lib/pdf/index.js +30933 -17401
- package/lib/pdf/index.js.map +1 -0
- package/lib/pdf/main.d.ts +1696 -0
- package/lib/pdf/main.d.ts.map +1 -0
- package/lib/pdf/module.js +30891 -17332
- package/lib/pdf/module.js.map +1 -0
- package/package.json +2 -2
- package/lib/pdf/chord.d.ts +0 -219
- package/lib/pdf/chord_definition/chord_definition.d.ts +0 -66
- package/lib/pdf/chord_definition/chord_definition_set.d.ts +0 -12
- package/lib/pdf/chord_diagram/chord_diagram.d.ts +0 -131
- package/lib/pdf/chord_diagram/js_pdf_renderer.d.ts +0 -40
- package/lib/pdf/chord_diagram/renderer.d.ts +0 -43
- package/lib/pdf/chord_parsing_error.d.ts +0 -2
- package/lib/pdf/chord_sheet/ast_component.d.ts +0 -11
- package/lib/pdf/chord_sheet/ast_type.d.ts +0 -9
- package/lib/pdf/chord_sheet/chord_lyrics_pair.d.ts +0 -60
- package/lib/pdf/chord_sheet/chord_pro/composite.d.ts +0 -11
- package/lib/pdf/chord_sheet/chord_pro/evaluatable.d.ts +0 -7
- package/lib/pdf/chord_sheet/chord_pro/evaluation_error.d.ts +0 -7
- package/lib/pdf/chord_sheet/chord_pro/literal.d.ts +0 -9
- package/lib/pdf/chord_sheet/chord_pro/ternary.d.ts +0 -29
- package/lib/pdf/chord_sheet/comment.d.ts +0 -21
- package/lib/pdf/chord_sheet/font.d.ts +0 -47
- package/lib/pdf/chord_sheet/font_size.d.ts +0 -33
- package/lib/pdf/chord_sheet/font_stack.d.ts +0 -13
- package/lib/pdf/chord_sheet/item.d.ts +0 -7
- package/lib/pdf/chord_sheet/line.d.ts +0 -130
- package/lib/pdf/chord_sheet/line_expander.d.ts +0 -12
- package/lib/pdf/chord_sheet/metadata.d.ts +0 -71
- package/lib/pdf/chord_sheet/metadata_accessors.d.ts +0 -18
- package/lib/pdf/chord_sheet/paragraph.d.ts +0 -48
- package/lib/pdf/chord_sheet/soft_line_break.d.ts +0 -15
- package/lib/pdf/chord_sheet/song.d.ts +0 -253
- package/lib/pdf/chord_sheet/song_mapper.d.ts +0 -15
- package/lib/pdf/chord_sheet/standard_metadata_providers.d.ts +0 -5
- package/lib/pdf/chord_sheet/tag.d.ts +0 -104
- package/lib/pdf/chord_sheet/tag_interpreter.d.ts +0 -14
- package/lib/pdf/chord_sheet/tags.d.ts +0 -259
- package/lib/pdf/chord_sheet/trace_info.d.ts +0 -6
- package/lib/pdf/chord_sheet_serializer.d.ts +0 -49
- package/lib/pdf/constants.d.ts +0 -117
- package/lib/pdf/formatter/chord_pro_formatter.d.ts +0 -39
- package/lib/pdf/formatter/chord_renderer.d.ts +0 -30
- package/lib/pdf/formatter/chords_over_words_formatter.d.ts +0 -33
- package/lib/pdf/formatter/configuration/base_configuration.d.ts +0 -58
- package/lib/pdf/formatter/configuration/default_config_manager.d.ts +0 -31
- package/lib/pdf/formatter/configuration/html_configuration.d.ts +0 -37
- package/lib/pdf/formatter/configuration/index.d.ts +0 -13
- package/lib/pdf/formatter/configuration/measured_html_configuration.d.ts +0 -38
- package/lib/pdf/formatter/configuration/measurement_based_configuration.d.ts +0 -204
- package/lib/pdf/formatter/configuration/pdf_configuration.d.ts +0 -16
- package/lib/pdf/formatter/formatter.d.ts +0 -38
- package/lib/pdf/formatter/formatting_context.d.ts +0 -7
- package/lib/pdf/formatter/html_div_formatter.d.ts +0 -9
- package/lib/pdf/formatter/html_formatter.d.ts +0 -60
- package/lib/pdf/formatter/html_table_formatter.d.ts +0 -10
- package/lib/pdf/formatter/measured_html_formatter.d.ts +0 -43
- package/lib/pdf/formatter/measurement_based_formatter.d.ts +0 -19
- package/lib/pdf/formatter/pdf_formatter/doc_wrapper.d.ts +0 -53
- package/lib/pdf/formatter/pdf_formatter/fonts/NimbusSansLFonts.base64.d.ts +0 -4
- package/lib/pdf/formatter/pdf_formatter/types.d.ts +0 -34
- package/lib/pdf/formatter/pdf_formatter.d.ts +0 -40
- package/lib/pdf/formatter/templates/html_div_formatter.d.ts +0 -3
- package/lib/pdf/formatter/templates/html_table_formatter.d.ts +0 -3
- package/lib/pdf/formatter/text_formatter.d.ts +0 -35
- package/lib/pdf/helpers.d.ts +0 -42
- package/lib/pdf/index.d.ts +0 -126
- package/lib/pdf/key.d.ts +0 -124
- package/lib/pdf/key_config.d.ts +0 -3
- package/lib/pdf/layout/engine/condition.d.ts +0 -25
- package/lib/pdf/layout/engine/dimensions.d.ts +0 -33
- package/lib/pdf/layout/engine/index.d.ts +0 -7
- package/lib/pdf/layout/engine/item_processor.d.ts +0 -70
- package/lib/pdf/layout/engine/layout_engine.d.ts +0 -67
- package/lib/pdf/layout/engine/layout_factory.d.ts +0 -22
- package/lib/pdf/layout/engine/layout_helpers.d.ts +0 -35
- package/lib/pdf/layout/engine/line_breaker.d.ts +0 -54
- package/lib/pdf/layout/engine/paragraph_splitter/index.d.ts +0 -5
- package/lib/pdf/layout/engine/paragraph_splitter/paragraph_splitter.d.ts +0 -5
- package/lib/pdf/layout/engine/paragraph_splitter/strategies/five_or_more_lines_paragraph_split_strategy.d.ts +0 -14
- package/lib/pdf/layout/engine/paragraph_splitter/strategies/four_lines_paragraph_split_strategy.d.ts +0 -8
- package/lib/pdf/layout/engine/paragraph_splitter/strategies/three_or_less_lines_paragraph_split_strategy.d.ts +0 -4
- package/lib/pdf/layout/engine/title_separator_tag.d.ts +0 -8
- package/lib/pdf/layout/engine/types.d.ts +0 -98
- package/lib/pdf/layout/measurement/canvas_measurer.d.ts +0 -18
- package/lib/pdf/layout/measurement/dom_measurer.d.ts +0 -21
- package/lib/pdf/layout/measurement/index.d.ts +0 -4
- package/lib/pdf/layout/measurement/js_pdf_measurer.d.ts +0 -12
- package/lib/pdf/layout/measurement/measurer.d.ts +0 -52
- package/lib/pdf/normalize_mappings/enharmonic-normalize.d.ts +0 -2
- package/lib/pdf/normalize_mappings/suffix-normalize-mapping.d.ts +0 -2
- package/lib/pdf/pango/pango_helpers.d.ts +0 -6
- package/lib/pdf/parser/chord/peg_parser.d.ts +0 -55
- package/lib/pdf/parser/chord_definition/peg_parser.d.ts +0 -55
- package/lib/pdf/parser/chord_pro/helpers.d.ts +0 -15
- package/lib/pdf/parser/chord_pro/peg_parser.d.ts +0 -55
- package/lib/pdf/parser/chord_pro_parser.d.ts +0 -32
- package/lib/pdf/parser/chord_sheet_parser.d.ts +0 -57
- package/lib/pdf/parser/chords_over_words/helpers.d.ts +0 -33
- package/lib/pdf/parser/chords_over_words/peg_parser.d.ts +0 -55
- package/lib/pdf/parser/chords_over_words_parser.d.ts +0 -67
- package/lib/pdf/parser/null_tracer.d.ts +0 -4
- package/lib/pdf/parser/parser_helpers.d.ts +0 -3
- package/lib/pdf/parser/parser_warning.d.ts +0 -33
- package/lib/pdf/parser/ultimate_guitar_parser.d.ts +0 -46
- package/lib/pdf/pdf.d.ts +0 -2
- package/lib/pdf/rendering/html/html_doc_wrapper.d.ts +0 -82
- package/lib/pdf/rendering/html/html_element_styler.d.ts +0 -58
- package/lib/pdf/rendering/html/positioned_html_renderer.d.ts +0 -85
- package/lib/pdf/rendering/pdf/js_pdf_renderer.d.ts +0 -46
- package/lib/pdf/rendering/pdf/pdf_chord_diagram_renderer.d.ts +0 -118
- package/lib/pdf/rendering/renderer.d.ts +0 -273
- package/lib/pdf/rendering/shared/layout_section_renderer.d.ts +0 -93
- package/lib/pdf/scales.d.ts +0 -3
- package/lib/pdf/serialized_types.d.ts +0 -76
- package/lib/pdf/song_builder.d.ts +0 -38
- package/lib/pdf/template_helpers/metadata_processor.d.ts +0 -14
- package/lib/pdf/template_helpers/when.d.ts +0 -13
- package/lib/pdf/template_helpers/when_callback.d.ts +0 -2
- package/lib/pdf/template_helpers/when_clause.d.ts +0 -8
- package/lib/pdf/template_helpers.d.ts +0 -64
- package/lib/pdf/utilities.d.ts +0 -35
- package/lib/pdf/version.d.ts +0 -2
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import Chord from '../chord';
|
|
2
|
-
import ChordDefinition from '../chord_definition/chord_definition';
|
|
3
|
-
import ChordDefinitionSet from '../chord_definition/chord_definition_set';
|
|
4
|
-
import ChordLyricsPair from './chord_lyrics_pair';
|
|
5
|
-
import Configuration from '../formatter/configuration';
|
|
6
|
-
import FormattingContext from '../formatter/formatting_context';
|
|
7
|
-
import Item from './item';
|
|
8
|
-
import Key from '../key';
|
|
9
|
-
import Line from './line';
|
|
10
|
-
import Metadata from './metadata';
|
|
11
|
-
import MetadataAccessors from './metadata_accessors';
|
|
12
|
-
import Paragraph from './paragraph';
|
|
13
|
-
import ParserWarning from '../parser/parser_warning';
|
|
14
|
-
import { Accidental } from '../constants';
|
|
15
|
-
type MapItemsCallback = (_item: Item) => Item | Item[] | null;
|
|
16
|
-
/**
|
|
17
|
-
* Represents a song in a chord sheet. Currently a chord sheet can only have one song.
|
|
18
|
-
*/
|
|
19
|
-
declare class Song extends MetadataAccessors {
|
|
20
|
-
/**
|
|
21
|
-
* The {@link Line} items of which the song consists
|
|
22
|
-
* @member {Line[]}
|
|
23
|
-
*/
|
|
24
|
-
lines: Line[];
|
|
25
|
-
_bodyLines: Line[] | null;
|
|
26
|
-
_bodyParagraphs: Paragraph[] | null;
|
|
27
|
-
_renderParagraphs: Paragraph[] | null;
|
|
28
|
-
warnings: ParserWarning[];
|
|
29
|
-
_metadata: Metadata | null;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a new {Song} instance
|
|
32
|
-
* @param metadata {Record<string, string | string[]>|Metadata} predefined metadata
|
|
33
|
-
*/
|
|
34
|
-
constructor(metadata?: Record<string, string | string[]> | Metadata | null);
|
|
35
|
-
/** Returns song lines, skipping leading empty/meta-only lines. @returns {Line[]} */
|
|
36
|
-
get bodyLines(): Line[];
|
|
37
|
-
/** Returns song paragraphs, skipping paragraphs with only empty lines. @returns {Paragraph[]} */
|
|
38
|
-
get bodyParagraphs(): Paragraph[];
|
|
39
|
-
get renderParagraphs(): Paragraph[];
|
|
40
|
-
set renderParagraphs(paragraphs: Paragraph[]);
|
|
41
|
-
selectRenderableItems(items: (Line | Paragraph)[]): (Line | Paragraph)[];
|
|
42
|
-
/** The {@link Paragraph} items of which the song consists @member {Paragraph[]} */
|
|
43
|
-
get paragraphs(): Paragraph[];
|
|
44
|
-
/** The body paragraphs with any `{chorus}` tag expanded into the targeted chorus */
|
|
45
|
-
get expandedBodyParagraphs(): Paragraph[];
|
|
46
|
-
filterParagraphs(paragraphs: Paragraph[], configuration: Configuration): Paragraph[];
|
|
47
|
-
linesToParagraphs(lines: Line[]): Paragraph[];
|
|
48
|
-
/** Returns a deep clone of the song @returns {Song} */
|
|
49
|
-
clone(): Song;
|
|
50
|
-
getMetadataValue(name: string): string | string[] | null;
|
|
51
|
-
getSingleMetadataValue(name: string): string | null;
|
|
52
|
-
/**
|
|
53
|
-
* Returns a copy of the song with the key value set to the specified key. It changes:
|
|
54
|
-
* - the value for `key` in the {@link metadata} set
|
|
55
|
-
* - any existing `key` directive
|
|
56
|
-
* @param {number|null} key the key. Passing `null` will:
|
|
57
|
-
* - remove the current key from {@link metadata}
|
|
58
|
-
* - remove any `key` directive
|
|
59
|
-
* @returns {Song} The changed song
|
|
60
|
-
*/
|
|
61
|
-
setKey(key: string | number | null): Song;
|
|
62
|
-
/**
|
|
63
|
-
* Returns a copy of the song with the key value set to the specified capo. It changes:
|
|
64
|
-
* - the value for `capo` in the {@link metadata} set
|
|
65
|
-
* - any existing `capo` directive
|
|
66
|
-
* @param {number|null} capo the capo. Passing `null` will:
|
|
67
|
-
* - remove the current key from {@link metadata}
|
|
68
|
-
* - remove any `capo` directive
|
|
69
|
-
* @returns {Song} The changed song
|
|
70
|
-
*/
|
|
71
|
-
setCapo(capo: number | null): Song;
|
|
72
|
-
private updateDirectives;
|
|
73
|
-
private changeOrDeleteDirectives;
|
|
74
|
-
private insertDirectives;
|
|
75
|
-
private findInsertIndex;
|
|
76
|
-
private isInsertionPoint;
|
|
77
|
-
private adjustInsertIndex;
|
|
78
|
-
private createMetadataLines;
|
|
79
|
-
private prepareLinesToInsert;
|
|
80
|
-
private spliceLines;
|
|
81
|
-
/**
|
|
82
|
-
* Transposes the song by the specified delta. It will:
|
|
83
|
-
* - transpose all chords, see: {@link Chord#transpose}
|
|
84
|
-
* - transpose the song key in {@link metadata}
|
|
85
|
-
* - update any existing `key` directive
|
|
86
|
-
* @param {number} delta The number of semitones (positive or negative) to transpose with
|
|
87
|
-
* @param {Object} [options={}] options
|
|
88
|
-
* @param {boolean} [options.normalizeChordSuffix=false] whether to normalize the chord suffixes after transposing
|
|
89
|
-
* @returns {Song} The transposed song
|
|
90
|
-
*/
|
|
91
|
-
transpose(delta: number, { accidental, normalizeChordSuffix }?: {
|
|
92
|
-
accidental?: Accidental | null;
|
|
93
|
-
normalizeChordSuffix?: boolean;
|
|
94
|
-
}): Song;
|
|
95
|
-
private static transposeChordLyricsPair;
|
|
96
|
-
private static transposeLiteral;
|
|
97
|
-
/**
|
|
98
|
-
* Transposes the song up by one semitone. It will:
|
|
99
|
-
* - transpose all chords, see: {@link Chord#transpose}
|
|
100
|
-
* - transpose the song key in {@link metadata}
|
|
101
|
-
* - update any existing `key` directive
|
|
102
|
-
* @param {Object} [options={}] options
|
|
103
|
-
* @param {boolean} [options.normalizeChordSuffix=false] whether to normalize the chord suffixes after transposing
|
|
104
|
-
* @returns {Song} The transposed song
|
|
105
|
-
*/
|
|
106
|
-
transposeUp({ normalizeChordSuffix }?: {
|
|
107
|
-
normalizeChordSuffix?: boolean;
|
|
108
|
-
}): Song;
|
|
109
|
-
/**
|
|
110
|
-
* Transposes the song down by one semitone. It will:
|
|
111
|
-
* - transpose all chords, see: {@link Chord#transpose}
|
|
112
|
-
* - transpose the song key in {@link metadata}
|
|
113
|
-
* - update any existing `key` directive
|
|
114
|
-
* @param {Object} [options={}] options
|
|
115
|
-
* @param {boolean} [options.normalizeChordSuffix=false] whether to normalize the chord suffixes after transposing
|
|
116
|
-
* @returns {Song} The transposed song
|
|
117
|
-
*/
|
|
118
|
-
transposeDown({ normalizeChordSuffix }?: {
|
|
119
|
-
normalizeChordSuffix?: boolean;
|
|
120
|
-
}): Song;
|
|
121
|
-
/**
|
|
122
|
-
* Returns a copy of the song with the key set to the specified key. It changes:
|
|
123
|
-
* - the value for `key` in the {@link metadata} set
|
|
124
|
-
* - any existing `key` directive
|
|
125
|
-
* - all chords, those are transposed according to the distance between the current and the new key
|
|
126
|
-
* @param {string} newKey The new key.
|
|
127
|
-
* @returns {Song} The changed song
|
|
128
|
-
*/
|
|
129
|
-
changeKey(newKey: string | Key): Song;
|
|
130
|
-
/**
|
|
131
|
-
* Returns a copy of the song with all chords changed to the specified accidental.
|
|
132
|
-
*
|
|
133
|
-
* Examples:
|
|
134
|
-
*
|
|
135
|
-
* ```js
|
|
136
|
-
* song.useAccidental('#');
|
|
137
|
-
* song.useAccidental('b');
|
|
138
|
-
* ```
|
|
139
|
-
*
|
|
140
|
-
* @param {Accidental} accidental the new accidental
|
|
141
|
-
* @returns {Song} the changed song
|
|
142
|
-
*/
|
|
143
|
-
useAccidental(accidental: Accidental): Song;
|
|
144
|
-
/**
|
|
145
|
-
* @deprecated Use useAccidental instead
|
|
146
|
-
*/
|
|
147
|
-
useModifier(accidental: Accidental): Song;
|
|
148
|
-
/**
|
|
149
|
-
* Returns a copy of the song with all chords normalized to the specified key. See {@link Chord#normalize}.
|
|
150
|
-
* @param key the key to normalize to
|
|
151
|
-
* @param options options
|
|
152
|
-
* @param options.normalizeSuffix whether to normalize the chord suffixes
|
|
153
|
-
*/
|
|
154
|
-
normalizeChords(key?: Key | string | null, { normalizeSuffix }?: {
|
|
155
|
-
normalizeSuffix?: boolean;
|
|
156
|
-
}): Song;
|
|
157
|
-
mapChordLyricsPairs(func: (pair: ChordLyricsPair) => ChordLyricsPair): Song;
|
|
158
|
-
changeChords(func: (chord: Chord) => Chord): Song;
|
|
159
|
-
private static isMusicalSection;
|
|
160
|
-
private static mapChordsInLiteral;
|
|
161
|
-
get currentKey(): Key | null;
|
|
162
|
-
requireCurrentKey(): Key;
|
|
163
|
-
/**
|
|
164
|
-
* Returns a copy of the song with the directive value(s) set to the specified value(s).
|
|
165
|
-
* - when there is a matching directive in the song, it will update the directive
|
|
166
|
-
* - when there is no matching directive, it will be inserted
|
|
167
|
-
* If `value` is `null` it will act as a delete, any directive matching `name` will be removed.
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* ```javascript
|
|
171
|
-
* song.changeMetadata('author', 'John');
|
|
172
|
-
* song.changeMetadata('composer', ['Jane', 'John']);
|
|
173
|
-
* song.changeMetadata('key', null); // Remove key directive
|
|
174
|
-
* ```
|
|
175
|
-
* @param name The directive name
|
|
176
|
-
* @param {string | string[] | null} value The value to set, or `null` to remove the directive
|
|
177
|
-
* @return {Song} The changed song
|
|
178
|
-
*/
|
|
179
|
-
changeMetadata(name: string, value: string | string[] | null): Song;
|
|
180
|
-
/**
|
|
181
|
-
* Returns a copy of the song with the metadata changed. It will:
|
|
182
|
-
* - update the metadata
|
|
183
|
-
* - update any existing directive matching the metadata key
|
|
184
|
-
* - insert a new directive if it does not exist
|
|
185
|
-
* @example
|
|
186
|
-
* ```javascript
|
|
187
|
-
* song.changeMetadata({
|
|
188
|
-
* author: 'John',
|
|
189
|
-
* composer: ['Jane', 'John'],
|
|
190
|
-
* key: null, // Remove key directive
|
|
191
|
-
* });
|
|
192
|
-
* ```
|
|
193
|
-
* @param {Record<string, string | string[] | null>} metadata The metadata to change
|
|
194
|
-
*/
|
|
195
|
-
changeMetadata(metadata: Record<string, string | string[] | null>): Song;
|
|
196
|
-
addLine(line: Line): void;
|
|
197
|
-
/**
|
|
198
|
-
* Change the song contents inline. Return a new {@link Item} to replace it. Return `null` to remove it.
|
|
199
|
-
* @example
|
|
200
|
-
* // transpose all chords:
|
|
201
|
-
* song.mapItems((item) => {
|
|
202
|
-
* if (item instanceof ChordLyricsPair) {
|
|
203
|
-
* return item.transpose(2, 'D');
|
|
204
|
-
* }
|
|
205
|
-
*
|
|
206
|
-
* return item;
|
|
207
|
-
* });
|
|
208
|
-
* @param {MapItemsCallback} func the callback function
|
|
209
|
-
* @returns {Song} the changed song
|
|
210
|
-
*/
|
|
211
|
-
mapItems(func: MapItemsCallback): Song;
|
|
212
|
-
foreachItem(func: (_item: Item) => void): void;
|
|
213
|
-
/**
|
|
214
|
-
* Returns all unique chords used in the song
|
|
215
|
-
* @returns {string[]} the chords
|
|
216
|
-
*/
|
|
217
|
-
getChords(): string[];
|
|
218
|
-
/**
|
|
219
|
-
* Returns all chord definitions from the song.
|
|
220
|
-
* Definitions are made using the `{chord}` or `{define}` directive.
|
|
221
|
-
* A chord definitions overrides a previous chord definition for the exact same chord.
|
|
222
|
-
* @returns {Record<string, ChordDefinition>} the chord definitions
|
|
223
|
-
* @see https://chordpro.org/chordpro/directives-define/
|
|
224
|
-
* @see https://chordpro.org/chordpro/directives-chord/
|
|
225
|
-
*/
|
|
226
|
-
getChordDefinitions(context?: FormattingContext): Record<string, ChordDefinition>;
|
|
227
|
-
/**
|
|
228
|
-
* The song's metadata. When there is only one value for an entry, the value is a string. Else, the value is
|
|
229
|
-
* an array containing all unique values for the entry.
|
|
230
|
-
* @type {Metadata}
|
|
231
|
-
*/
|
|
232
|
-
get metadata(): Metadata;
|
|
233
|
-
getMetadata(configuration?: Configuration): Metadata;
|
|
234
|
-
get chordDefinitions(): ChordDefinitionSet;
|
|
235
|
-
/**
|
|
236
|
-
* Change the song contents inline. Return a new {@link Line} to replace it. Return `null` to remove it.
|
|
237
|
-
* @example
|
|
238
|
-
* // remove lines with only Tags:
|
|
239
|
-
* song.mapLines((line) => {
|
|
240
|
-
* if (line.items.every(item => item instanceof Tag)) {
|
|
241
|
-
* return null;
|
|
242
|
-
* }
|
|
243
|
-
*
|
|
244
|
-
* return line;
|
|
245
|
-
* });
|
|
246
|
-
* @param {MapLinesCallback} func the callback function
|
|
247
|
-
* @returns {Song} the changed song
|
|
248
|
-
*/
|
|
249
|
-
mapLines(func: (_line: Line) => Line | null): Song;
|
|
250
|
-
private updateItem;
|
|
251
|
-
private removeItem;
|
|
252
|
-
}
|
|
253
|
-
export default Song;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import Item from './item';
|
|
2
|
-
import Song from './song';
|
|
3
|
-
export type MapItemsCallback = (_item: Item) => Item | Item[] | null;
|
|
4
|
-
declare class SongMapper {
|
|
5
|
-
private song;
|
|
6
|
-
private clonedSong;
|
|
7
|
-
private builder;
|
|
8
|
-
private addedLine;
|
|
9
|
-
constructor(song: Song);
|
|
10
|
-
mapItems(func: MapItemsCallback): Song;
|
|
11
|
-
private mapLineItems;
|
|
12
|
-
private mapItem;
|
|
13
|
-
ensureLine(): void;
|
|
14
|
-
}
|
|
15
|
-
export default SongMapper;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import Configuration from '../formatter/configuration';
|
|
2
|
-
type Provider = () => string | null;
|
|
3
|
-
export declare function staticProviders(): Map<string, Provider>;
|
|
4
|
-
export declare function configurationProviders(configuration: Configuration): Map<string, Provider>;
|
|
5
|
-
export {};
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import AstComponent from './ast_component';
|
|
2
|
-
import ChordDefinition from '../chord_definition/chord_definition';
|
|
3
|
-
import TraceInfo from './trace_info';
|
|
4
|
-
export declare const META_TAGS: string[];
|
|
5
|
-
export declare const READ_ONLY_TAGS: string[];
|
|
6
|
-
export declare function isReadonlyTag(tagName: string): boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Represents a tag/directive. See https://www.chordpro.org/chordpro/chordpro-directives/
|
|
9
|
-
*/
|
|
10
|
-
declare class Tag extends AstComponent {
|
|
11
|
-
_isMetaTag: boolean;
|
|
12
|
-
_originalName: string;
|
|
13
|
-
_name: string;
|
|
14
|
-
_value: string;
|
|
15
|
-
chordDefinition?: ChordDefinition;
|
|
16
|
-
selector: string | null;
|
|
17
|
-
isNegated: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* The tag attributes. For example, section related tags can have a label:
|
|
20
|
-
* `{start_of_verse: label="Verse 1"}`
|
|
21
|
-
* @type {Record<string, string>}
|
|
22
|
-
*/
|
|
23
|
-
attributes: Record<string, string>;
|
|
24
|
-
constructor(name: string, value?: string | null, traceInfo?: TraceInfo | null, attributes?: Record<string, string>, selector?: string | null, isNegated?: boolean);
|
|
25
|
-
private parseNameValue;
|
|
26
|
-
private parseMetaTag;
|
|
27
|
-
static parse(tag: string | Tag): Tag | null;
|
|
28
|
-
static parseWithRegex(tag: string, regex: RegExp): Tag | null;
|
|
29
|
-
static parseOrFail(tag: string | Tag): Tag;
|
|
30
|
-
get label(): string;
|
|
31
|
-
isSectionDelimiter(): boolean;
|
|
32
|
-
isSectionStart(): boolean;
|
|
33
|
-
isSectionEnd(): boolean;
|
|
34
|
-
isInlineFontTag(): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Checks whether the tag is a comment tag ({comment} or {c}).
|
|
37
|
-
*/
|
|
38
|
-
isComment(): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Checks whether the tag is an image tag ({image}).
|
|
41
|
-
*/
|
|
42
|
-
isImage(): boolean;
|
|
43
|
-
set name(name: string);
|
|
44
|
-
/**
|
|
45
|
-
* The tag full name. When the original tag used the short name, `name` will return the full name.
|
|
46
|
-
* @member
|
|
47
|
-
* @type {string}
|
|
48
|
-
*/
|
|
49
|
-
get name(): string;
|
|
50
|
-
/**
|
|
51
|
-
* The original tag name that was used to construct the tag.
|
|
52
|
-
* @member
|
|
53
|
-
* @type {string}
|
|
54
|
-
*/
|
|
55
|
-
get originalName(): string;
|
|
56
|
-
set value(value: string);
|
|
57
|
-
/**
|
|
58
|
-
* The tag value
|
|
59
|
-
* @member
|
|
60
|
-
* @type {string}
|
|
61
|
-
*/
|
|
62
|
-
get value(): string;
|
|
63
|
-
/**
|
|
64
|
-
* Checks whether the tag value is a non-empty string.
|
|
65
|
-
* @returns {boolean}
|
|
66
|
-
*/
|
|
67
|
-
hasValue(): boolean;
|
|
68
|
-
hasAttributes(): boolean;
|
|
69
|
-
hasLabel(): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Checks whether the tag is usually rendered inline. It currently only applies to comment tags.
|
|
72
|
-
* @returns {boolean}
|
|
73
|
-
*/
|
|
74
|
-
isRenderable(): boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Check whether this tag's label (if any) should be rendered, as applicable to tags like
|
|
77
|
-
* `start_of_verse` and `start_of_chorus`.
|
|
78
|
-
* See https://chordpro.org/chordpro/directives-env_chorus/, https://chordpro.org/chordpro/directives-env_verse/,
|
|
79
|
-
* https://chordpro.org/chordpro/directives-env_bridge/, https://chordpro.org/chordpro/directives-env_tab/
|
|
80
|
-
*/
|
|
81
|
-
hasRenderableLabel(): boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Checks whether the tag is a standard meta tag, a custom meta directive (`{x_some_name}`)
|
|
84
|
-
* or a non-standard meta tag (`{meta: name value}`)
|
|
85
|
-
* @returns {boolean}
|
|
86
|
-
*/
|
|
87
|
-
isMetaTag(): boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Checks whether this tag is a standard meta tag or a custom meta directive (`{x_some_name}`)
|
|
90
|
-
* @returns {boolean}
|
|
91
|
-
*/
|
|
92
|
-
isStandardOrCustomMetaTag(): boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Returns a clone of the tag.
|
|
95
|
-
* @returns {Tag} The cloned tag
|
|
96
|
-
*/
|
|
97
|
-
clone(): Tag;
|
|
98
|
-
toString(): string;
|
|
99
|
-
set({ value }: {
|
|
100
|
-
value: string;
|
|
101
|
-
}): Tag;
|
|
102
|
-
setAttribute(name: string, value: string): Tag;
|
|
103
|
-
}
|
|
104
|
-
export default Tag;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare class TagInterpreter {
|
|
2
|
-
tagName: string;
|
|
3
|
-
tagValue: string;
|
|
4
|
-
static interpret(tagName: string, tagValue: string): [string | null, string | null];
|
|
5
|
-
constructor(tagName: string, tagValue: string);
|
|
6
|
-
interpret(): [string | null, string | null];
|
|
7
|
-
startOfPart(): [string, string] | null;
|
|
8
|
-
endOfPart(): [string, string] | null;
|
|
9
|
-
sectionStart(): [string, string] | null;
|
|
10
|
-
sectionEnd(): [string, string] | null;
|
|
11
|
-
startOfSection(): [string, string] | null;
|
|
12
|
-
endOfSection(): [string, string] | null;
|
|
13
|
-
}
|
|
14
|
-
export default TagInterpreter;
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Album meta directive. See https://www.chordpro.org/chordpro/directives-album/
|
|
3
|
-
* @type {string}
|
|
4
|
-
*/
|
|
5
|
-
export declare const ALBUM = "album";
|
|
6
|
-
/**
|
|
7
|
-
* Arranger meta directive. See https://chordpro.org/chordpro/directives-arranger/
|
|
8
|
-
* @type {string}
|
|
9
|
-
*/
|
|
10
|
-
export declare const ARRANGER = "arranger";
|
|
11
|
-
/**
|
|
12
|
-
* Artist meta directive. See https://www.chordpro.org/chordpro/directives-artist/
|
|
13
|
-
* @type {string}
|
|
14
|
-
*/
|
|
15
|
-
export declare const ARTIST = "artist";
|
|
16
|
-
/**
|
|
17
|
-
* Capo meta directive. See https://www.chordpro.org/chordpro/directives-capo/
|
|
18
|
-
* @type {string}
|
|
19
|
-
*/
|
|
20
|
-
export declare const CAPO = "capo";
|
|
21
|
-
/**
|
|
22
|
-
* Comment directive. See https://www.chordpro.org/chordpro/directives-comment/
|
|
23
|
-
* @type {string}
|
|
24
|
-
*/
|
|
25
|
-
export declare const COMMENT = "comment";
|
|
26
|
-
/**
|
|
27
|
-
* Composer meta directive. See https://www.chordpro.org/chordpro/directives-composer/
|
|
28
|
-
* @type {string}
|
|
29
|
-
*/
|
|
30
|
-
export declare const COMPOSER = "composer";
|
|
31
|
-
/**
|
|
32
|
-
* Copyright meta directive. See https://www.chordpro.org/chordpro/directives-copyright/
|
|
33
|
-
* @type {string}
|
|
34
|
-
*/
|
|
35
|
-
export declare const COPYRIGHT = "copyright";
|
|
36
|
-
/**
|
|
37
|
-
* Duration meta directive. See https://www.chordpro.org/chordpro/directives-duration/
|
|
38
|
-
* @type {string}
|
|
39
|
-
*/
|
|
40
|
-
export declare const DURATION = "duration";
|
|
41
|
-
/**
|
|
42
|
-
* Image directive. See https://www.chordpro.org/chordpro/directives-image/
|
|
43
|
-
* @type {string}
|
|
44
|
-
*/
|
|
45
|
-
export declare const IMAGE = "image";
|
|
46
|
-
/**
|
|
47
|
-
* End of ABC music notation section See https://chordpro.org/chordpro/directives-env_abc/
|
|
48
|
-
* @type {string}
|
|
49
|
-
*/
|
|
50
|
-
export declare const END_OF_ABC = "end_of_abc";
|
|
51
|
-
/**
|
|
52
|
-
* End of bridge directive. See https://chordpro.org/chordpro/directives-env_bridge/
|
|
53
|
-
* @type {string}
|
|
54
|
-
*/
|
|
55
|
-
export declare const END_OF_BRIDGE = "end_of_bridge";
|
|
56
|
-
/**
|
|
57
|
-
* End of chorus directive. See https://www.chordpro.org/chordpro/directives-env_chorus/
|
|
58
|
-
* @type {string}
|
|
59
|
-
*/
|
|
60
|
-
export declare const END_OF_CHORUS = "end_of_chorus";
|
|
61
|
-
/**
|
|
62
|
-
* End of grid directive. See https://www.chordpro.org/chordpro/directives-env_grid/
|
|
63
|
-
* @type {string}
|
|
64
|
-
*/
|
|
65
|
-
export declare const END_OF_GRID = "end_of_grid";
|
|
66
|
-
/**
|
|
67
|
-
* End of Lilypond music notation section See https://chordpro.org/chordpro/directives-env_ly/
|
|
68
|
-
* @type {string}
|
|
69
|
-
*/
|
|
70
|
-
export declare const END_OF_LY = "end_of_ly";
|
|
71
|
-
/**
|
|
72
|
-
* End of tab directive. See https://www.chordpro.org/chordpro/directives-env_tab/
|
|
73
|
-
* @type {string}
|
|
74
|
-
*/
|
|
75
|
-
export declare const END_OF_TAB = "end_of_tab";
|
|
76
|
-
/**
|
|
77
|
-
* End of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/
|
|
78
|
-
* @type {string}
|
|
79
|
-
*/
|
|
80
|
-
export declare const END_OF_VERSE = "end_of_verse";
|
|
81
|
-
/**
|
|
82
|
-
* End of part directive.
|
|
83
|
-
* @type {string}
|
|
84
|
-
*/
|
|
85
|
-
export declare const END_OF_PART = "end_of_part";
|
|
86
|
-
/**
|
|
87
|
-
* Key meta directive. See https://www.chordpro.org/chordpro/directives-key/
|
|
88
|
-
* @type {string}
|
|
89
|
-
*/
|
|
90
|
-
export declare const KEY = "key";
|
|
91
|
-
/**
|
|
92
|
-
* _Key meta directive. Reflects the key as transposed by the capo value
|
|
93
|
-
* See https://www.chordpro.org/chordpro/directives-key/
|
|
94
|
-
* @type {string}
|
|
95
|
-
*/
|
|
96
|
-
export declare const _KEY = "_key";
|
|
97
|
-
/**
|
|
98
|
-
* Lyricist meta directive. See https://www.chordpro.org/chordpro/directives-lyricist/
|
|
99
|
-
* @type {string}
|
|
100
|
-
*/
|
|
101
|
-
export declare const LYRICIST = "lyricist";
|
|
102
|
-
/**
|
|
103
|
-
* Sorttitle meta directive. See https://chordpro.org/chordpro/directives-sorttitle/
|
|
104
|
-
* @type {string}
|
|
105
|
-
*/
|
|
106
|
-
export declare const SORTTITLE = "sorttitle";
|
|
107
|
-
/**
|
|
108
|
-
* Start of ABC music notation section See https://chordpro.org/chordpro/directives-env_abc/
|
|
109
|
-
* @type {string}
|
|
110
|
-
*/
|
|
111
|
-
export declare const START_OF_ABC = "start_of_abc";
|
|
112
|
-
/**
|
|
113
|
-
* Start of bridge directive. See https://chordpro.org/chordpro/directives-env_bridge/
|
|
114
|
-
* @type {string}
|
|
115
|
-
*/
|
|
116
|
-
export declare const START_OF_BRIDGE = "start_of_bridge";
|
|
117
|
-
/**
|
|
118
|
-
* Start of chorus directive. See https://www.chordpro.org/chordpro/directives-env_chorus/
|
|
119
|
-
* @type {string}
|
|
120
|
-
*/
|
|
121
|
-
export declare const START_OF_CHORUS = "start_of_chorus";
|
|
122
|
-
/**
|
|
123
|
-
* Start of grid directive. See https://www.chordpro.org/chordpro/directives-env_grid/
|
|
124
|
-
* @type {string}
|
|
125
|
-
*/
|
|
126
|
-
export declare const START_OF_GRID = "start_of_grid";
|
|
127
|
-
/**
|
|
128
|
-
* Start of Lilypond music notation section See https://chordpro.org/chordpro/directives-env_ly/
|
|
129
|
-
* @type {string}
|
|
130
|
-
*/
|
|
131
|
-
export declare const START_OF_LY = "start_of_ly";
|
|
132
|
-
/**
|
|
133
|
-
* Start of tab directive. See https://www.chordpro.org/chordpro/directives-env_tab/
|
|
134
|
-
* @type {string}
|
|
135
|
-
*/
|
|
136
|
-
export declare const START_OF_TAB = "start_of_tab";
|
|
137
|
-
/**
|
|
138
|
-
* Start of SVG section. See https://www.chordpro.org/chordpro/directives-env_svg/
|
|
139
|
-
* @type {string}
|
|
140
|
-
*/
|
|
141
|
-
export declare const START_OF_SVG = "start_of_svg";
|
|
142
|
-
/**
|
|
143
|
-
* End of SVG section. See https://www.chordpro.org/chordpro/directives-env_svg/
|
|
144
|
-
* @type {string}
|
|
145
|
-
*/
|
|
146
|
-
export declare const END_OF_SVG = "end_of_svg";
|
|
147
|
-
/**
|
|
148
|
-
* Start of textblock directive. See https://chordpro.org/chordpro/directives-env_textblock/
|
|
149
|
-
* @type {string}
|
|
150
|
-
*/
|
|
151
|
-
export declare const START_OF_TEXTBLOCK = "start_of_textblock";
|
|
152
|
-
/**
|
|
153
|
-
* End of textblock directive. See https://chordpro.org/chordpro/directives-env_textblock/
|
|
154
|
-
* @type {string}
|
|
155
|
-
*/
|
|
156
|
-
export declare const END_OF_TEXTBLOCK = "end_of_textblock";
|
|
157
|
-
/**
|
|
158
|
-
* Start of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/
|
|
159
|
-
* @type {string}
|
|
160
|
-
*/
|
|
161
|
-
export declare const START_OF_VERSE = "start_of_verse";
|
|
162
|
-
/**
|
|
163
|
-
* Start of part
|
|
164
|
-
* @type {string}
|
|
165
|
-
*/
|
|
166
|
-
export declare const START_OF_PART = "start_of_part";
|
|
167
|
-
/**
|
|
168
|
-
* Subtitle meta directive. See https://www.chordpro.org/chordpro/directives-subtitle/
|
|
169
|
-
* @type {string}
|
|
170
|
-
*/
|
|
171
|
-
export declare const SUBTITLE = "subtitle";
|
|
172
|
-
/**
|
|
173
|
-
* Tempo meta directive. See https://www.chordpro.org/chordpro/directives-tempo/
|
|
174
|
-
* @type {string}
|
|
175
|
-
*/
|
|
176
|
-
export declare const TEMPO = "tempo";
|
|
177
|
-
/**
|
|
178
|
-
* Time meta directive. See https://www.chordpro.org/chordpro/directives-time/
|
|
179
|
-
* @type {string}
|
|
180
|
-
*/
|
|
181
|
-
export declare const TIME = "time";
|
|
182
|
-
/**
|
|
183
|
-
* Title meta directive. See https://www.chordpro.org/chordpro/directives-title/
|
|
184
|
-
* @type {string}
|
|
185
|
-
*/
|
|
186
|
-
export declare const TITLE = "title";
|
|
187
|
-
/**
|
|
188
|
-
* Transpose meta directive. See: https://www.chordpro.org/chordpro/directives-transpose/
|
|
189
|
-
* @type {string}
|
|
190
|
-
*/
|
|
191
|
-
export declare const TRANSPOSE = "transpose";
|
|
192
|
-
/**
|
|
193
|
-
* New Key meta directive. See: https://github.com/BetterMusic/ChordSheetJS/issues/53
|
|
194
|
-
* @type {string}
|
|
195
|
-
*/
|
|
196
|
-
export declare const NEW_KEY = "new_key";
|
|
197
|
-
/**
|
|
198
|
-
* Year meta directive. See https://www.chordpro.org/chordpro/directives-year/
|
|
199
|
-
* @type {string}
|
|
200
|
-
*/
|
|
201
|
-
export declare const YEAR = "year";
|
|
202
|
-
/**
|
|
203
|
-
* Chordfont directive. See https://www.chordpro.org/chordpro/directives-props_chord_legacy/
|
|
204
|
-
* @type {string}
|
|
205
|
-
*/
|
|
206
|
-
export declare const CHORDFONT = "chordfont";
|
|
207
|
-
/**
|
|
208
|
-
* Chordfont directive. See https://www.chordpro.org/chordpro/directives-props_chord_legacy/
|
|
209
|
-
* @type {string}
|
|
210
|
-
*/
|
|
211
|
-
export declare const CHORDSIZE = "chordsize";
|
|
212
|
-
/**
|
|
213
|
-
* Chordfont directive. See https://www.chordpro.org/chordpro/directives-props_chord_legacy/
|
|
214
|
-
* @type {string}
|
|
215
|
-
*/
|
|
216
|
-
export declare const CHORDCOLOUR = "chordcolour";
|
|
217
|
-
/**
|
|
218
|
-
* Chordfont directive. See https://www.chordpro.org/chordpro/directives-props_text_legacy/
|
|
219
|
-
* @type {string}
|
|
220
|
-
*/
|
|
221
|
-
export declare const TEXTFONT = "textfont";
|
|
222
|
-
/**
|
|
223
|
-
* Chordfont directive. See https://www.chordpro.org/chordpro/directives-props_text_legacy/
|
|
224
|
-
* @type {string}
|
|
225
|
-
*/
|
|
226
|
-
export declare const TEXTSIZE = "textsize";
|
|
227
|
-
/**
|
|
228
|
-
* Chordfont directive. See https://www.chordpro.org/chordpro/directives-props_text_legacy/
|
|
229
|
-
* @type {string}
|
|
230
|
-
*/
|
|
231
|
-
export declare const TEXTCOLOUR = "textcolour";
|
|
232
|
-
/**
|
|
233
|
-
* Chordfont directive. See https://www.chordpro.org/chordpro/directives-props_title_legacy/
|
|
234
|
-
* @type {string}
|
|
235
|
-
*/
|
|
236
|
-
export declare const TITLEFONT = "titlefont";
|
|
237
|
-
/**
|
|
238
|
-
* Chordfont directive. See https://www.chordpro.org/chordpro/directives-props_title_legacy/
|
|
239
|
-
* @type {string}
|
|
240
|
-
*/
|
|
241
|
-
export declare const TITLESIZE = "titlesize";
|
|
242
|
-
/**
|
|
243
|
-
* Chordfont directive. See https://www.chordpro.org/chordpro/directives-props_title_legacy/
|
|
244
|
-
* @type {string}
|
|
245
|
-
*/
|
|
246
|
-
export declare const TITLECOLOUR = "titlecolour";
|
|
247
|
-
/**
|
|
248
|
-
* Chorus directive. Support repeating an earlier defined section.
|
|
249
|
-
* See https://www.chordpro.org/chordpro/directives-env_chorus/
|
|
250
|
-
* @type {string}
|
|
251
|
-
*/
|
|
252
|
-
export declare const CHORUS = "chorus";
|
|
253
|
-
/**
|
|
254
|
-
* Chord type directive. Determines the type of chords used in the rendered chord sheet.
|
|
255
|
-
* Possible values are 'solfege', 'symbol', 'numeral' and 'number'
|
|
256
|
-
* @see https://github.com/bettermusic/ChordSheetJS/issues/352
|
|
257
|
-
* @type {string}
|
|
258
|
-
*/
|
|
259
|
-
export declare const CHORD_STYLE = "chord_style";
|