chordsheetjs 14.6.1 → 15.0.0
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/README.md +12 -3
- package/lib/bundle.js +25728 -66671
- package/lib/bundle.min.js +148 -7118
- package/lib/index.js +1 -7770
- package/lib/index.js.map +1 -1
- package/lib/main.d.ts +2 -131
- package/lib/main.d.ts.map +1 -1
- package/lib/module.js +2 -7769
- package/lib/module.js.map +1 -1
- package/lib/pdf/chord.d.ts +219 -0
- package/lib/pdf/chord_definition/chord_definition.d.ts +66 -0
- package/lib/pdf/chord_definition/chord_definition_set.d.ts +12 -0
- package/lib/pdf/chord_diagram/chord_diagram.d.ts +131 -0
- package/lib/pdf/chord_diagram/js_pdf_renderer.d.ts +40 -0
- package/lib/pdf/chord_diagram/renderer.d.ts +43 -0
- package/lib/pdf/chord_parsing_error.d.ts +2 -0
- package/lib/pdf/chord_sheet/ast_component.d.ts +11 -0
- package/lib/pdf/chord_sheet/ast_type.d.ts +9 -0
- package/lib/pdf/chord_sheet/chord_lyrics_pair.d.ts +60 -0
- package/lib/pdf/chord_sheet/chord_pro/composite.d.ts +11 -0
- package/lib/pdf/chord_sheet/chord_pro/evaluatable.d.ts +7 -0
- package/lib/pdf/chord_sheet/chord_pro/evaluation_error.d.ts +7 -0
- package/lib/pdf/chord_sheet/chord_pro/literal.d.ts +9 -0
- package/lib/pdf/chord_sheet/chord_pro/ternary.d.ts +29 -0
- package/lib/pdf/chord_sheet/comment.d.ts +21 -0
- package/lib/pdf/chord_sheet/font.d.ts +47 -0
- package/lib/pdf/chord_sheet/font_size.d.ts +33 -0
- package/lib/pdf/chord_sheet/font_stack.d.ts +13 -0
- package/lib/pdf/chord_sheet/item.d.ts +7 -0
- package/lib/pdf/chord_sheet/line.d.ts +130 -0
- package/lib/pdf/chord_sheet/line_expander.d.ts +12 -0
- package/lib/pdf/chord_sheet/metadata.d.ts +71 -0
- package/lib/pdf/chord_sheet/metadata_accessors.d.ts +18 -0
- package/lib/pdf/chord_sheet/paragraph.d.ts +48 -0
- package/lib/pdf/chord_sheet/soft_line_break.d.ts +15 -0
- package/lib/pdf/chord_sheet/song.d.ts +253 -0
- package/lib/pdf/chord_sheet/song_mapper.d.ts +15 -0
- package/lib/pdf/chord_sheet/standard_metadata_providers.d.ts +5 -0
- package/lib/pdf/chord_sheet/tag.d.ts +104 -0
- package/lib/pdf/chord_sheet/tag_interpreter.d.ts +14 -0
- package/lib/pdf/chord_sheet/tags.d.ts +259 -0
- package/lib/pdf/chord_sheet/trace_info.d.ts +6 -0
- package/lib/pdf/chord_sheet_serializer.d.ts +49 -0
- package/lib/pdf/constants.d.ts +117 -0
- package/lib/pdf/formatter/chord_pro_formatter.d.ts +39 -0
- package/lib/pdf/formatter/chord_renderer.d.ts +30 -0
- package/lib/pdf/formatter/chords_over_words_formatter.d.ts +33 -0
- package/lib/pdf/formatter/configuration/base_configuration.d.ts +58 -0
- package/lib/pdf/formatter/configuration/default_config_manager.d.ts +31 -0
- package/lib/pdf/formatter/configuration/html_configuration.d.ts +37 -0
- package/lib/pdf/formatter/configuration/index.d.ts +13 -0
- package/lib/pdf/formatter/configuration/measured_html_configuration.d.ts +38 -0
- package/lib/pdf/formatter/configuration/measurement_based_configuration.d.ts +204 -0
- package/lib/pdf/formatter/configuration/pdf_configuration.d.ts +16 -0
- package/lib/pdf/formatter/formatter.d.ts +38 -0
- package/lib/pdf/formatter/formatting_context.d.ts +7 -0
- package/lib/pdf/formatter/html_div_formatter.d.ts +9 -0
- package/lib/pdf/formatter/html_formatter.d.ts +60 -0
- package/lib/pdf/formatter/html_table_formatter.d.ts +10 -0
- package/lib/pdf/formatter/measured_html_formatter.d.ts +43 -0
- package/lib/pdf/formatter/measurement_based_formatter.d.ts +19 -0
- package/lib/pdf/formatter/pdf_formatter/doc_wrapper.d.ts +53 -0
- package/lib/pdf/formatter/pdf_formatter/fonts/NimbusSansLFonts.base64.d.ts +4 -0
- package/lib/pdf/formatter/pdf_formatter/types.d.ts +34 -0
- package/lib/pdf/formatter/pdf_formatter.d.ts +40 -0
- package/lib/pdf/formatter/templates/html_div_formatter.d.ts +3 -0
- package/lib/pdf/formatter/templates/html_table_formatter.d.ts +3 -0
- package/lib/pdf/formatter/text_formatter.d.ts +35 -0
- package/lib/pdf/helpers.d.ts +42 -0
- package/lib/pdf/index.d.ts +126 -0
- package/lib/pdf/index.js +24369 -0
- package/lib/pdf/key.d.ts +124 -0
- package/lib/pdf/key_config.d.ts +3 -0
- package/lib/pdf/layout/engine/condition.d.ts +25 -0
- package/lib/pdf/layout/engine/dimensions.d.ts +33 -0
- package/lib/pdf/layout/engine/index.d.ts +7 -0
- package/lib/pdf/layout/engine/item_processor.d.ts +70 -0
- package/lib/pdf/layout/engine/layout_engine.d.ts +67 -0
- package/lib/pdf/layout/engine/layout_factory.d.ts +22 -0
- package/lib/pdf/layout/engine/layout_helpers.d.ts +35 -0
- package/lib/pdf/layout/engine/line_breaker.d.ts +54 -0
- package/lib/pdf/layout/engine/paragraph_splitter/index.d.ts +5 -0
- package/lib/pdf/layout/engine/paragraph_splitter/paragraph_splitter.d.ts +5 -0
- package/lib/pdf/layout/engine/paragraph_splitter/strategies/five_or_more_lines_paragraph_split_strategy.d.ts +14 -0
- package/lib/pdf/layout/engine/paragraph_splitter/strategies/four_lines_paragraph_split_strategy.d.ts +8 -0
- package/lib/pdf/layout/engine/paragraph_splitter/strategies/three_or_less_lines_paragraph_split_strategy.d.ts +4 -0
- package/lib/pdf/layout/engine/title_separator_tag.d.ts +8 -0
- package/lib/pdf/layout/engine/types.d.ts +98 -0
- package/lib/pdf/layout/measurement/canvas_measurer.d.ts +18 -0
- package/lib/pdf/layout/measurement/dom_measurer.d.ts +21 -0
- package/lib/pdf/layout/measurement/index.d.ts +4 -0
- package/lib/pdf/layout/measurement/js_pdf_measurer.d.ts +12 -0
- package/lib/pdf/layout/measurement/measurer.d.ts +52 -0
- package/lib/pdf/module.js +24336 -0
- package/lib/pdf/normalize_mappings/enharmonic-normalize.d.ts +2 -0
- package/lib/pdf/normalize_mappings/suffix-normalize-mapping.d.ts +2 -0
- package/lib/pdf/pango/pango_helpers.d.ts +6 -0
- package/lib/pdf/parser/chord/peg_parser.d.ts +55 -0
- package/lib/pdf/parser/chord_definition/peg_parser.d.ts +55 -0
- package/lib/pdf/parser/chord_pro/helpers.d.ts +15 -0
- package/lib/pdf/parser/chord_pro/peg_parser.d.ts +55 -0
- package/lib/pdf/parser/chord_pro_parser.d.ts +32 -0
- package/lib/pdf/parser/chord_sheet_parser.d.ts +57 -0
- package/lib/pdf/parser/chords_over_words/helpers.d.ts +33 -0
- package/lib/pdf/parser/chords_over_words/peg_parser.d.ts +55 -0
- package/lib/pdf/parser/chords_over_words_parser.d.ts +67 -0
- package/lib/pdf/parser/null_tracer.d.ts +4 -0
- package/lib/pdf/parser/parser_helpers.d.ts +3 -0
- package/lib/pdf/parser/parser_warning.d.ts +33 -0
- package/lib/pdf/parser/ultimate_guitar_parser.d.ts +46 -0
- package/lib/pdf/pdf.d.ts +2 -0
- package/lib/pdf/rendering/html/html_doc_wrapper.d.ts +82 -0
- package/lib/pdf/rendering/html/html_element_styler.d.ts +58 -0
- package/lib/pdf/rendering/html/positioned_html_renderer.d.ts +85 -0
- package/lib/pdf/rendering/pdf/js_pdf_renderer.d.ts +46 -0
- package/lib/pdf/rendering/pdf/pdf_chord_diagram_renderer.d.ts +118 -0
- package/lib/pdf/rendering/renderer.d.ts +273 -0
- package/lib/pdf/rendering/shared/layout_section_renderer.d.ts +93 -0
- package/lib/pdf/scales.d.ts +3 -0
- package/lib/pdf/serialized_types.d.ts +76 -0
- package/lib/pdf/song_builder.d.ts +38 -0
- package/lib/pdf/template_helpers/metadata_processor.d.ts +14 -0
- package/lib/pdf/template_helpers/when.d.ts +13 -0
- package/lib/pdf/template_helpers/when_callback.d.ts +2 -0
- package/lib/pdf/template_helpers/when_clause.d.ts +8 -0
- package/lib/pdf/template_helpers.d.ts +64 -0
- package/lib/pdf/utilities.d.ts +35 -0
- package/lib/pdf/version.d.ts +2 -0
- package/package.json +20 -2
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { FontConfiguration } from '../../formatter/configuration';
|
|
2
|
+
export interface TextDimensions {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}
|
|
6
|
+
export interface Measurer {
|
|
7
|
+
/**
|
|
8
|
+
* Measures the dimensions of text with the given font configuration
|
|
9
|
+
* @param text The text to measure
|
|
10
|
+
* @param fontConfig The font configuration to apply
|
|
11
|
+
* @returns The dimensions of the text
|
|
12
|
+
*/
|
|
13
|
+
measureText(text: string, fontConfig: FontConfiguration): TextDimensions;
|
|
14
|
+
/**
|
|
15
|
+
* Measures the width of text with the given font configuration
|
|
16
|
+
* @param text The text to measure
|
|
17
|
+
* @param fontConfig The font configuration to apply
|
|
18
|
+
* @returns The width of the text
|
|
19
|
+
*/
|
|
20
|
+
measureTextWidth(text: string, fontConfig: FontConfiguration): number;
|
|
21
|
+
/**
|
|
22
|
+
* Measures the height of text with the given font configuration
|
|
23
|
+
* @param text The text to measure
|
|
24
|
+
* @param fontConfig The font configuration to apply
|
|
25
|
+
* @returns The height of the text
|
|
26
|
+
*/
|
|
27
|
+
measureTextHeight(text: string, fontConfig: FontConfiguration): number;
|
|
28
|
+
/**
|
|
29
|
+
* Splits text into lines that fit within the given width
|
|
30
|
+
* @param text The text to split
|
|
31
|
+
* @param maxWidth The maximum width of each line
|
|
32
|
+
* @param fontConfig The font configuration to apply
|
|
33
|
+
* @returns The lines of text
|
|
34
|
+
*/
|
|
35
|
+
splitTextToSize(text: string, maxWidth: number, fontConfig: FontConfiguration): string[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Base class for implementing measurers with common functionality
|
|
39
|
+
*/
|
|
40
|
+
export declare abstract class BaseMeasurer implements Measurer {
|
|
41
|
+
abstract measureText(text: string, fontConfig: FontConfiguration): TextDimensions;
|
|
42
|
+
measureTextWidth(text: string, fontConfig: FontConfiguration): number;
|
|
43
|
+
measureTextHeight(text: string, fontConfig: FontConfiguration): number;
|
|
44
|
+
abstract splitTextToSize(text: string, maxWidth: number, fontConfig: FontConfiguration): string[];
|
|
45
|
+
protected splitTextWithMeasure(text: string, maxWidth: number, measure: (value: string) => number): string[];
|
|
46
|
+
protected wrapParagraph(paragraph: string, maxWidth: number, measure: (value: string) => number): string[];
|
|
47
|
+
protected splitWord(word: string, maxWidth: number, measure: (value: string) => number): {
|
|
48
|
+
lines: string[];
|
|
49
|
+
remainder: string;
|
|
50
|
+
};
|
|
51
|
+
private accumulateWords;
|
|
52
|
+
}
|