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,29 +0,0 @@
|
|
|
1
|
-
import Evaluatable from './evaluatable';
|
|
2
|
-
import Metadata from '../metadata';
|
|
3
|
-
import TraceInfo from '../trace_info';
|
|
4
|
-
export type TernaryProperties = TraceInfo & {
|
|
5
|
-
variable?: string | null;
|
|
6
|
-
valueTest?: string | null;
|
|
7
|
-
trueExpression?: Evaluatable[];
|
|
8
|
-
falseExpression?: Evaluatable[];
|
|
9
|
-
};
|
|
10
|
-
declare class Ternary extends Evaluatable {
|
|
11
|
-
variable: string | null;
|
|
12
|
-
valueTest: string | null;
|
|
13
|
-
trueExpression: Evaluatable[];
|
|
14
|
-
falseExpression: Evaluatable[];
|
|
15
|
-
constructor({ variable, valueTest, trueExpression, falseExpression, line, column, offset, }: TernaryProperties);
|
|
16
|
-
/**
|
|
17
|
-
* Evaluate the meta expression
|
|
18
|
-
* @param {Metadata} metadata The metadata object to use for evaluating the expression
|
|
19
|
-
* @param {string} [metadataSeparator=null] The metadata separator to use if necessary
|
|
20
|
-
* @returns {string} The evaluated expression
|
|
21
|
-
*/
|
|
22
|
-
evaluate(metadata: Metadata, metadataSeparator: string, upperContext?: string | null): string;
|
|
23
|
-
evaluateToString(value: string[] | string, metadataSeparator: string): string;
|
|
24
|
-
evaluateWithVariable(metadata: Metadata, metadataSeparator: string): string;
|
|
25
|
-
evaluateForTruthyValue(metadata: Metadata, metadataSeparator: string, value: string | string[]): string;
|
|
26
|
-
isRenderable(): boolean;
|
|
27
|
-
clone(): Ternary;
|
|
28
|
-
}
|
|
29
|
-
export default Ternary;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type Line from './line';
|
|
2
|
-
/**
|
|
3
|
-
* Represents a comment. See https://www.chordpro.org/chordpro/chordpro-file-format-specification/#overview
|
|
4
|
-
*/
|
|
5
|
-
declare class Comment {
|
|
6
|
-
content: string;
|
|
7
|
-
parentLine: Line | null;
|
|
8
|
-
constructor(content: string);
|
|
9
|
-
/**
|
|
10
|
-
* Indicates whether a Comment should be visible in a formatted chord sheet (except for ChordPro sheets)
|
|
11
|
-
* @returns {boolean}
|
|
12
|
-
*/
|
|
13
|
-
isRenderable(): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Returns a deep copy of the Comment, useful when programmatically transforming a song
|
|
16
|
-
* @returns {Comment}
|
|
17
|
-
*/
|
|
18
|
-
clone(): Comment;
|
|
19
|
-
toString(): string;
|
|
20
|
-
}
|
|
21
|
-
export default Comment;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import FontSize from './font_size';
|
|
2
|
-
interface FontProperties {
|
|
3
|
-
font?: string | null;
|
|
4
|
-
size?: FontSize | null;
|
|
5
|
-
colour?: string | null;
|
|
6
|
-
}
|
|
7
|
-
declare class Font {
|
|
8
|
-
/**
|
|
9
|
-
* The font
|
|
10
|
-
* @member {string | null}
|
|
11
|
-
*/
|
|
12
|
-
font: string | null;
|
|
13
|
-
/**
|
|
14
|
-
* The font size, expressed in either pixels or percentage.
|
|
15
|
-
* @member {FontSize | null}
|
|
16
|
-
*/
|
|
17
|
-
size: FontSize | null;
|
|
18
|
-
/**
|
|
19
|
-
* The font color
|
|
20
|
-
* @member {string | null}
|
|
21
|
-
*/
|
|
22
|
-
colour: string | null;
|
|
23
|
-
constructor({ font, size, colour }?: FontProperties);
|
|
24
|
-
clone(): Font;
|
|
25
|
-
/**
|
|
26
|
-
* Converts the font, size and color to a CSS string.
|
|
27
|
-
* If possible, font and size are combined to the `font` shorthand.
|
|
28
|
-
* If `font` contains double quotes (`"`) those will be converted to single quotes (`'`).
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* // Returns "font-family: 'Times New Roman'"
|
|
32
|
-
* new Font({ font: '"Times New Roman"' }).toCssString()
|
|
33
|
-
* @example
|
|
34
|
-
* // Returns "color: red; font-family: Verdana"
|
|
35
|
-
* new Font({ font: 'Verdana', colour: 'red' }).toCssString()
|
|
36
|
-
* @example
|
|
37
|
-
* // Returns "font: 30px Verdana"
|
|
38
|
-
* new Font({ font: 'Verdana', size: '30' }).toCssString()
|
|
39
|
-
* @example
|
|
40
|
-
* // Returns "color: blue; font: 30% Verdana"
|
|
41
|
-
* new Font({ font: 'Verdana', size: '30%', colour: 'blue' }).toCssString()
|
|
42
|
-
*
|
|
43
|
-
* @return {string} The CSS string
|
|
44
|
-
*/
|
|
45
|
-
toCssString(): string;
|
|
46
|
-
}
|
|
47
|
-
export default Font;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
type Size = 'px' | '%';
|
|
2
|
-
declare class FontSize {
|
|
3
|
-
/**
|
|
4
|
-
* The size unit, either `"px"` or `"%"`
|
|
5
|
-
* @member {string}
|
|
6
|
-
*/
|
|
7
|
-
unit: Size;
|
|
8
|
-
/**
|
|
9
|
-
* The font size
|
|
10
|
-
* @member {number}
|
|
11
|
-
*/
|
|
12
|
-
fontSize: number;
|
|
13
|
-
constructor(fontSize: number, kind: Size);
|
|
14
|
-
clone(): FontSize;
|
|
15
|
-
multiply(percentage: any): FontSize;
|
|
16
|
-
/**
|
|
17
|
-
* Stringifies the font size by concatenating size and unit
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* // Returns "30px"
|
|
21
|
-
* new FontSize(30, 'px').toString()
|
|
22
|
-
* @example
|
|
23
|
-
* // Returns "120%"
|
|
24
|
-
* new FontSize(120, '%').toString()
|
|
25
|
-
*
|
|
26
|
-
* @return {string} The font size
|
|
27
|
-
*/
|
|
28
|
-
toString(): string;
|
|
29
|
-
static parse(fontSize: string, parent: FontSize | null): FontSize;
|
|
30
|
-
static parseNotANumber(parent: FontSize | null): FontSize;
|
|
31
|
-
static parsePercentage(parsedFontSize: number, parent: FontSize | null): FontSize;
|
|
32
|
-
}
|
|
33
|
-
export default FontSize;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Font from './font';
|
|
2
|
-
import FontSize from './font_size';
|
|
3
|
-
import Tag from './tag';
|
|
4
|
-
declare class FontStack {
|
|
5
|
-
fontAndColourStacks: Record<string, string[]>;
|
|
6
|
-
sizeStacks: Record<string, FontSize[]>;
|
|
7
|
-
textFont: Font;
|
|
8
|
-
chordFont: Font;
|
|
9
|
-
applyTag(tag: Tag): void;
|
|
10
|
-
private pushOrPopTag;
|
|
11
|
-
private pushOrPopSizeTag;
|
|
12
|
-
}
|
|
13
|
-
export default FontStack;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import ChordLyricsPair from './chord_lyrics_pair';
|
|
2
|
-
import Comment from './comment';
|
|
3
|
-
import Literal from './chord_pro/literal';
|
|
4
|
-
import Tag from './tag';
|
|
5
|
-
import Ternary from './chord_pro/ternary';
|
|
6
|
-
type Item = ChordLyricsPair | Comment | Tag | Ternary | Literal;
|
|
7
|
-
export default Item;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import ChordLyricsPair from './chord_lyrics_pair';
|
|
2
|
-
import Comment from './comment';
|
|
3
|
-
import Font from './font';
|
|
4
|
-
import Item from './item';
|
|
5
|
-
import Tag from './tag';
|
|
6
|
-
import { ContentType, PartTypes } from '../serialized_types';
|
|
7
|
-
type MapItemFunc = (_item: Item) => Item | null;
|
|
8
|
-
export type LineType = 'bridge' | 'chorus' | 'none' | 'tab' | 'verse' | ContentType | 'indeterminate' | PartTypes;
|
|
9
|
-
/**
|
|
10
|
-
* Represents a line in a chord sheet, consisting of items of type ChordLyricsPair or Tag
|
|
11
|
-
*/
|
|
12
|
-
declare class Line {
|
|
13
|
-
/**
|
|
14
|
-
* The items ({@link ChordLyricsPair} or {@link Tag} or {@link Comment}) of which the line consists
|
|
15
|
-
* @type {Array.<(ChordLyricsPair|Tag|Comment)>}
|
|
16
|
-
*/
|
|
17
|
-
items: Item[];
|
|
18
|
-
/**
|
|
19
|
-
* The line type, This is set by the ChordProParser when it read tags like {start_of_chorus} or {start_of_verse}
|
|
20
|
-
* It uses the following mapping to determine the line type from directives:
|
|
21
|
-
* - `start_of_abc` => {@link ABC}
|
|
22
|
-
* - `start_of_bridge` => {@link BRIDGE}
|
|
23
|
-
* - `start_of_chorus` => {@link CHORUS}
|
|
24
|
-
* - `start_of_grid` => {@link GRID}
|
|
25
|
-
* - `start_of_ly` => {@link LILYPOND}
|
|
26
|
-
* - `start_of_tab` => {@link TAB}
|
|
27
|
-
* - `start_of_verse` => {@link VERSE}
|
|
28
|
-
*
|
|
29
|
-
* There are two special cases:
|
|
30
|
-
* - {@link INDETERMINATE} when the paragraph lines do not have a consistent type
|
|
31
|
-
* - {@link NONE} when no type is derived
|
|
32
|
-
* @type {string}
|
|
33
|
-
*/
|
|
34
|
-
type: string;
|
|
35
|
-
currentChordLyricsPair: ChordLyricsPair;
|
|
36
|
-
key: string | null;
|
|
37
|
-
transposeKey: string | null;
|
|
38
|
-
lineNumber: number | null;
|
|
39
|
-
selector: string | null;
|
|
40
|
-
selectorIsNegated: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* The text font that applies to this line. Is derived from the directives:
|
|
43
|
-
* `textfont`, `textsize` and `textcolour`
|
|
44
|
-
* See: https://www.chordpro.org/chordpro/directives-props_text_legacy/
|
|
45
|
-
* @type {Font}
|
|
46
|
-
*/
|
|
47
|
-
textFont: Font;
|
|
48
|
-
/**
|
|
49
|
-
* The chord font that applies to this line. Is derived from the directives:
|
|
50
|
-
* `chordfont`, `chordsize` and `chordcolour`
|
|
51
|
-
* See: https://www.chordpro.org/chordpro/directives-props_chord_legacy/
|
|
52
|
-
* @type {Font}
|
|
53
|
-
*/
|
|
54
|
-
chordFont: Font;
|
|
55
|
-
constructor({ type, items }?: {
|
|
56
|
-
type: string;
|
|
57
|
-
items: Item[];
|
|
58
|
-
});
|
|
59
|
-
/**
|
|
60
|
-
* Indicates whether the line contains any items
|
|
61
|
-
* @returns {boolean}
|
|
62
|
-
*/
|
|
63
|
-
isEmpty(): boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Adds an item ({@link ChordLyricsPair} or {@link Tag}) to the line
|
|
66
|
-
* @param {ChordLyricsPair|Tag} item The item to be added
|
|
67
|
-
*/
|
|
68
|
-
addItem(item: Item): void;
|
|
69
|
-
/**
|
|
70
|
-
* Indicates whether the line contains items that are renderable
|
|
71
|
-
* @returns {boolean}
|
|
72
|
-
*/
|
|
73
|
-
hasRenderableItems(): boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Returns a deep copy of the line and all of its items
|
|
76
|
-
* @returns {Line}
|
|
77
|
-
*/
|
|
78
|
-
clone(): Line;
|
|
79
|
-
mapItems(func: MapItemFunc | null): Line;
|
|
80
|
-
/**
|
|
81
|
-
* Indicates whether the line type is {@link BRIDGE}
|
|
82
|
-
* @returns {boolean}
|
|
83
|
-
*/
|
|
84
|
-
isBridge(): boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Indicates whether the line type is {@link CHORUS}
|
|
87
|
-
* @returns {boolean}
|
|
88
|
-
*/
|
|
89
|
-
isChorus(): boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Indicates whether the line type is {@link GRID}
|
|
92
|
-
* @returns {boolean}
|
|
93
|
-
*/
|
|
94
|
-
isGrid(): boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Indicates whether the line type is {@link TAB}
|
|
97
|
-
* @returns {boolean}
|
|
98
|
-
*/
|
|
99
|
-
isTab(): boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Indicates whether the line type is {@link VERSE}
|
|
102
|
-
* @returns {boolean}
|
|
103
|
-
*/
|
|
104
|
-
isVerse(): boolean;
|
|
105
|
-
/**
|
|
106
|
-
* Indicates whether the line type is {@link PART}
|
|
107
|
-
* @returns {boolean}
|
|
108
|
-
*/
|
|
109
|
-
isPart(): boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Indicates whether the line contains items that are renderable. Please use {@link hasRenderableItems}
|
|
112
|
-
* @deprecated
|
|
113
|
-
* @returns {boolean}
|
|
114
|
-
*/
|
|
115
|
-
hasContent(): boolean;
|
|
116
|
-
addChordLyricsPair(chords?: ChordLyricsPair | string | null, lyrics?: null): ChordLyricsPair;
|
|
117
|
-
ensureChordLyricsPair(): void;
|
|
118
|
-
chords(chr: string): void;
|
|
119
|
-
lyrics(chr: string): void;
|
|
120
|
-
addTag(nameOrTag: Tag | string, value?: string | null): Tag;
|
|
121
|
-
addComment(content: Comment | string): Comment;
|
|
122
|
-
set(properties: {
|
|
123
|
-
type?: string;
|
|
124
|
-
items?: Item[];
|
|
125
|
-
}): Line;
|
|
126
|
-
get _tag(): Tag | null;
|
|
127
|
-
isSectionStart(): boolean;
|
|
128
|
-
isSectionEnd(): boolean;
|
|
129
|
-
}
|
|
130
|
-
export default Line;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import Line from './line';
|
|
2
|
-
import Song from './song';
|
|
3
|
-
declare class LineExpander {
|
|
4
|
-
line: Line;
|
|
5
|
-
song: Song;
|
|
6
|
-
static expand(line: Line, song: Song): Line[];
|
|
7
|
-
constructor(line: Line, song: Song);
|
|
8
|
-
expand(): Line[];
|
|
9
|
-
private getLastChorusBefore;
|
|
10
|
-
private lineHasMoreThanChorusDirectives;
|
|
11
|
-
}
|
|
12
|
-
export default LineExpander;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import MetadataAccessors from './metadata_accessors';
|
|
2
|
-
type MetadataProvider = () => string | null;
|
|
3
|
-
/**
|
|
4
|
-
* Stores song metadata. Properties can be accessed using the get() method:
|
|
5
|
-
*
|
|
6
|
-
* const metadata = new Metadata({ author: 'John' });
|
|
7
|
-
* metadata.get('author') // => 'John'
|
|
8
|
-
*
|
|
9
|
-
* See {@link Metadata#get}
|
|
10
|
-
*/
|
|
11
|
-
declare class Metadata extends MetadataAccessors implements Iterable<[string, string | string[]]> {
|
|
12
|
-
metadata: Record<string, string | string[]>;
|
|
13
|
-
providers: Map<string, MetadataProvider>;
|
|
14
|
-
constructor(metadata?: Record<string, string | string[]> | Metadata);
|
|
15
|
-
merge(metadata?: Record<string, string | string[]> | Metadata): Metadata;
|
|
16
|
-
contains(key: string): boolean;
|
|
17
|
-
add(key: string, value: string): void;
|
|
18
|
-
appendValue(key: string, value: string): void;
|
|
19
|
-
setProvider(key: string, provider: MetadataProvider): void;
|
|
20
|
-
set(key: string, value: string | null): void;
|
|
21
|
-
getMetadataValue(name: string): string | string[] | null;
|
|
22
|
-
getSingleMetadataValue(name: string): string | null;
|
|
23
|
-
/**
|
|
24
|
-
* Reads a metadata value by key. This method supports simple value lookup, as well as fetching single array values.
|
|
25
|
-
*
|
|
26
|
-
* This method deprecates direct property access, eg: metadata['author']
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* const metadata = new Metadata({ lyricist: 'Pete', author: ['John', 'Mary'] });
|
|
30
|
-
* metadata.get('lyricist') // => 'Pete'
|
|
31
|
-
* metadata.get('author') // => ['John', 'Mary']
|
|
32
|
-
* metadata.get('author.1') // => 'John'
|
|
33
|
-
* metadata.get('author.2') // => 'Mary'
|
|
34
|
-
*
|
|
35
|
-
* Using a negative index will start counting at the end of the list:
|
|
36
|
-
*
|
|
37
|
-
* const metadata = new Metadata({ lyricist: 'Pete', author: ['John', 'Mary'] });
|
|
38
|
-
* metadata.get('author.-1') // => 'Mary'
|
|
39
|
-
* metadata.get('author.-2') // => 'John'
|
|
40
|
-
*
|
|
41
|
-
* @param prop the property name
|
|
42
|
-
* @returns {Array<String>|String} the metadata value(s). If there is only one value, it will return a String,
|
|
43
|
-
* else it returns an array of strings.
|
|
44
|
-
*/
|
|
45
|
-
get(prop: string): string | string[] | null;
|
|
46
|
-
/**
|
|
47
|
-
* Returns all metadata values, including provider values and generated values like `_key`.
|
|
48
|
-
* @returns {Object.<string, string|string[]>} the metadata values
|
|
49
|
-
*/
|
|
50
|
-
all(): Record<string, string | string[]>;
|
|
51
|
-
ownMetadata(): Record<string, string | string[]>;
|
|
52
|
-
[Symbol.iterator](): IterableIterator<[string, string | string[]]>;
|
|
53
|
-
/**
|
|
54
|
-
* Returns a single metadata value. If the actual value is an array, it returns the first value. Else, it returns
|
|
55
|
-
* the value.
|
|
56
|
-
* @ignore
|
|
57
|
-
* @param {string} prop the property name
|
|
58
|
-
* @returns {String} The metadata value
|
|
59
|
-
*/
|
|
60
|
-
getSingle(prop: string): string | null;
|
|
61
|
-
parseArrayKey(prop: string): [string, number] | null;
|
|
62
|
-
getArrayItem(prop: string): string | null;
|
|
63
|
-
/**
|
|
64
|
-
* Returns a deep clone of this Metadata object
|
|
65
|
-
* @returns {Metadata} the cloned Metadata object
|
|
66
|
-
*/
|
|
67
|
-
clone(): Metadata;
|
|
68
|
-
calculateKeyFromCapo(): string | null;
|
|
69
|
-
assign(metadata: Record<string, string | string[] | null>): void;
|
|
70
|
-
}
|
|
71
|
-
export default Metadata;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare abstract class MetadataAccessors {
|
|
2
|
-
abstract getMetadataValue(_name: string): string | string[] | null;
|
|
3
|
-
abstract getSingleMetadataValue(_name: string): string | null;
|
|
4
|
-
get key(): string | null;
|
|
5
|
-
get title(): string | null;
|
|
6
|
-
get subtitle(): string | null;
|
|
7
|
-
get capo(): string | string[] | null;
|
|
8
|
-
get duration(): string | null;
|
|
9
|
-
get tempo(): string | null;
|
|
10
|
-
get time(): string | string[] | null;
|
|
11
|
-
get year(): string | null;
|
|
12
|
-
get album(): string | string[] | null;
|
|
13
|
-
get copyright(): string | null;
|
|
14
|
-
get lyricist(): string | string[] | null;
|
|
15
|
-
get artist(): string | string[] | null;
|
|
16
|
-
get composer(): string | string[] | null;
|
|
17
|
-
}
|
|
18
|
-
export default MetadataAccessors;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import Line from './line';
|
|
2
|
-
/**
|
|
3
|
-
* Represents a paragraph of lines in a chord sheet
|
|
4
|
-
*/
|
|
5
|
-
declare class Paragraph {
|
|
6
|
-
/**
|
|
7
|
-
* The {@link Line} items of which the paragraph consists
|
|
8
|
-
* @member
|
|
9
|
-
* @type {Line[]}
|
|
10
|
-
*/
|
|
11
|
-
lines: Line[];
|
|
12
|
-
addLine(line: any): void;
|
|
13
|
-
/**
|
|
14
|
-
* Indicates whether the paragraph only contains literals. If true, {@link contents} can be used to retrieve
|
|
15
|
-
* the paragraph contents as one string where lines are separated by newlines.
|
|
16
|
-
* @see {@link contents}
|
|
17
|
-
* @returns {boolean}
|
|
18
|
-
*/
|
|
19
|
-
isLiteral(): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Returns the paragraph contents as one string where lines are separated by newlines
|
|
22
|
-
* @returns {string}
|
|
23
|
-
*/
|
|
24
|
-
get contents(): string;
|
|
25
|
-
/**
|
|
26
|
-
* Returns the label of the paragraph. The label is the value of the first section delimiter tag
|
|
27
|
-
* in the first line.
|
|
28
|
-
* @returns {string|null}
|
|
29
|
-
*/
|
|
30
|
-
get label(): string | null;
|
|
31
|
-
/**
|
|
32
|
-
* Tries to determine the common type for all lines. If the types for all lines are equal, it returns that type.
|
|
33
|
-
* If not, it returns {@link INDETERMINATE}
|
|
34
|
-
* For the possible values, see {@link Line.type}
|
|
35
|
-
* @returns {string}
|
|
36
|
-
*/
|
|
37
|
-
get type(): string;
|
|
38
|
-
get selector(): string | null;
|
|
39
|
-
get selectorIsNegated(): boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Indicates whether the paragraph contains lines with renderable items.
|
|
42
|
-
* @see {@link Line.hasRenderableItems}
|
|
43
|
-
* @returns {boolean}
|
|
44
|
-
*/
|
|
45
|
-
hasRenderableItems(): boolean;
|
|
46
|
-
isEmpty(): boolean;
|
|
47
|
-
}
|
|
48
|
-
export default Paragraph;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a soft line break in the lyrics, typically rendered as a space or optional break point.
|
|
3
|
-
*/
|
|
4
|
-
declare class SoftLineBreak {
|
|
5
|
-
/**
|
|
6
|
-
* The content of the soft line break, defaults to a single space.
|
|
7
|
-
*/
|
|
8
|
-
content: string;
|
|
9
|
-
constructor(content?: string);
|
|
10
|
-
/**
|
|
11
|
-
* Returns a copy of the SoftLineBreak.
|
|
12
|
-
*/
|
|
13
|
-
clone(): SoftLineBreak;
|
|
14
|
-
}
|
|
15
|
-
export default SoftLineBreak;
|