vexflow 4.0.1-beta.0 → 4.0.1-beta.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 (328) hide show
  1. package/build/cjs/vexflow-bravura.js +2 -2
  2. package/build/cjs/vexflow-bravura.js.map +1 -1
  3. package/build/cjs/vexflow-core.js +2 -2
  4. package/build/cjs/vexflow-core.js.map +1 -1
  5. package/build/cjs/vexflow-debug-with-tests.js +126 -26
  6. package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
  7. package/build/cjs/vexflow-debug.js +94 -26
  8. package/build/cjs/vexflow-debug.js.map +1 -1
  9. package/build/cjs/vexflow-gonville.js +2 -2
  10. package/build/cjs/vexflow-gonville.js.map +1 -1
  11. package/build/cjs/vexflow-petaluma.js +2 -2
  12. package/build/cjs/vexflow-petaluma.js.map +1 -1
  13. package/build/cjs/vexflow.js +2 -2
  14. package/build/cjs/vexflow.js.map +1 -1
  15. package/build/esm/src/version.js +3 -3
  16. package/package.json +1 -1
  17. package/src/note.ts +2 -2
  18. package/src/stavenote.ts +80 -16
  19. package/build/esm/entry/vexflow-bravura.js +0 -11
  20. package/build/esm/entry/vexflow-core.js +0 -54
  21. package/build/esm/entry/vexflow-debug-with-tests.js +0 -4
  22. package/build/esm/entry/vexflow-debug.js +0 -3
  23. package/build/esm/entry/vexflow-font-bravura.js +0 -7
  24. package/build/esm/entry/vexflow-font-custom.js +0 -7
  25. package/build/esm/entry/vexflow-font-gonville.js +0 -7
  26. package/build/esm/entry/vexflow-font-petaluma.js +0 -7
  27. package/build/esm/entry/vexflow-gonville.js +0 -11
  28. package/build/esm/entry/vexflow-petaluma.js +0 -11
  29. package/build/esm/entry/vexflow.js +0 -9
  30. package/build/esm/src/accidental.js +0 -348
  31. package/build/esm/src/annotation.js +0 -213
  32. package/build/esm/src/articulation.js +0 -264
  33. package/build/esm/src/barnote.js +0 -58
  34. package/build/esm/src/beam.js +0 -632
  35. package/build/esm/src/bend.js +0 -202
  36. package/build/esm/src/boundingbox.js +0 -59
  37. package/build/esm/src/boundingboxcomputation.js +0 -107
  38. package/build/esm/src/canvascontext.js +0 -202
  39. package/build/esm/src/chordsymbol.js +0 -578
  40. package/build/esm/src/clef.js +0 -153
  41. package/build/esm/src/clefnote.js +0 -65
  42. package/build/esm/src/crescendo.js +0 -77
  43. package/build/esm/src/curve.js +0 -118
  44. package/build/esm/src/dot.js +0 -137
  45. package/build/esm/src/easyscore.js +0 -374
  46. package/build/esm/src/element.js +0 -216
  47. package/build/esm/src/factory.js +0 -440
  48. package/build/esm/src/flow.js +0 -275
  49. package/build/esm/src/font.js +0 -264
  50. package/build/esm/src/fonts/bravura_glyphs.js +0 -3239
  51. package/build/esm/src/fonts/bravura_metrics.js +0 -507
  52. package/build/esm/src/fonts/custom_glyphs.js +0 -78
  53. package/build/esm/src/fonts/custom_metrics.js +0 -5
  54. package/build/esm/src/fonts/gonville_glyphs.js +0 -828
  55. package/build/esm/src/fonts/gonville_metrics.js +0 -421
  56. package/build/esm/src/fonts/load_all.js +0 -10
  57. package/build/esm/src/fonts/load_bravura.js +0 -6
  58. package/build/esm/src/fonts/load_custom.js +0 -6
  59. package/build/esm/src/fonts/load_gonville.js +0 -6
  60. package/build/esm/src/fonts/load_petaluma.js +0 -6
  61. package/build/esm/src/fonts/petaluma_glyphs.js +0 -1335
  62. package/build/esm/src/fonts/petaluma_metrics.js +0 -536
  63. package/build/esm/src/fonts/petalumascript_glyphs.js +0 -863
  64. package/build/esm/src/fonts/robotoslab_glyphs.js +0 -863
  65. package/build/esm/src/fonts/textfonts.js +0 -44
  66. package/build/esm/src/formatter.js +0 -568
  67. package/build/esm/src/fraction.js +0 -171
  68. package/build/esm/src/frethandfinger.js +0 -156
  69. package/build/esm/src/ghostnote.js +0 -50
  70. package/build/esm/src/glyph.js +0 -331
  71. package/build/esm/src/glyphnote.js +0 -55
  72. package/build/esm/src/gracenote.js +0 -133
  73. package/build/esm/src/gracenotegroup.js +0 -128
  74. package/build/esm/src/gracetabnote.js +0 -12
  75. package/build/esm/src/index.js +0 -91
  76. package/build/esm/src/keymanager.js +0 -99
  77. package/build/esm/src/keysignature.js +0 -250
  78. package/build/esm/src/keysignote.js +0 -28
  79. package/build/esm/src/modifier.js +0 -128
  80. package/build/esm/src/modifiercontext.js +0 -110
  81. package/build/esm/src/multimeasurerest.js +0 -173
  82. package/build/esm/src/music.js +0 -322
  83. package/build/esm/src/note.js +0 -371
  84. package/build/esm/src/notehead.js +0 -169
  85. package/build/esm/src/notesubgroup.js +0 -59
  86. package/build/esm/src/ornament.js +0 -206
  87. package/build/esm/src/parenthesis.js +0 -76
  88. package/build/esm/src/parser.js +0 -164
  89. package/build/esm/src/pedalmarking.js +0 -192
  90. package/build/esm/src/registry.js +0 -81
  91. package/build/esm/src/rendercontext.js +0 -24
  92. package/build/esm/src/renderer.js +0 -112
  93. package/build/esm/src/repeatnote.js +0 -22
  94. package/build/esm/src/stave.js +0 -547
  95. package/build/esm/src/stavebarline.js +0 -182
  96. package/build/esm/src/staveconnector.js +0 -196
  97. package/build/esm/src/stavehairpin.js +0 -120
  98. package/build/esm/src/staveline.js +0 -218
  99. package/build/esm/src/stavemodifier.js +0 -77
  100. package/build/esm/src/stavenote.js +0 -799
  101. package/build/esm/src/staverepetition.js +0 -155
  102. package/build/esm/src/stavesection.js +0 -58
  103. package/build/esm/src/stavetempo.js +0 -91
  104. package/build/esm/src/stavetext.js +0 -82
  105. package/build/esm/src/stavetie.js +0 -141
  106. package/build/esm/src/stavevolta.js +0 -67
  107. package/build/esm/src/stem.js +0 -131
  108. package/build/esm/src/stemmablenote.js +0 -193
  109. package/build/esm/src/stringnumber.js +0 -231
  110. package/build/esm/src/strokes.js +0 -200
  111. package/build/esm/src/svgcontext.js +0 -414
  112. package/build/esm/src/system.js +0 -116
  113. package/build/esm/src/tables.js +0 -1102
  114. package/build/esm/src/tabnote.js +0 -299
  115. package/build/esm/src/tabslide.js +0 -76
  116. package/build/esm/src/tabstave.js +0 -17
  117. package/build/esm/src/tabtie.js +0 -19
  118. package/build/esm/src/textbracket.js +0 -144
  119. package/build/esm/src/textdynamics.js +0 -81
  120. package/build/esm/src/textformatter.js +0 -177
  121. package/build/esm/src/textnote.js +0 -176
  122. package/build/esm/src/tickable.js +0 -214
  123. package/build/esm/src/tickcontext.js +0 -170
  124. package/build/esm/src/timesigglyph.js +0 -85
  125. package/build/esm/src/timesignature.js +0 -89
  126. package/build/esm/src/timesignote.js +0 -32
  127. package/build/esm/src/tremolo.js +0 -47
  128. package/build/esm/src/tuning.js +0 -54
  129. package/build/esm/src/tuplet.js +0 -240
  130. package/build/esm/src/typeguard.js +0 -30
  131. package/build/esm/src/util.js +0 -58
  132. package/build/esm/src/vex.js +0 -51
  133. package/build/esm/src/vibrato.js +0 -100
  134. package/build/esm/src/vibratobracket.js +0 -50
  135. package/build/esm/src/voice.js +0 -187
  136. package/build/esm/src/web.js +0 -15
  137. package/build/esm/tests/accidental_tests.js +0 -974
  138. package/build/esm/tests/annotation_tests.js +0 -377
  139. package/build/esm/tests/articulation_tests.js +0 -365
  140. package/build/esm/tests/auto_beam_formatting_tests.js +0 -548
  141. package/build/esm/tests/bach_tests.js +0 -335
  142. package/build/esm/tests/barline_tests.js +0 -52
  143. package/build/esm/tests/beam_tests.js +0 -595
  144. package/build/esm/tests/bend_tests.js +0 -215
  145. package/build/esm/tests/boundingbox_tests.js +0 -53
  146. package/build/esm/tests/boundingboxcomputation_tests.js +0 -183
  147. package/build/esm/tests/chordsymbol_tests.js +0 -320
  148. package/build/esm/tests/clef_tests.js +0 -131
  149. package/build/esm/tests/curve_tests.js +0 -118
  150. package/build/esm/tests/dot_tests.js +0 -123
  151. package/build/esm/tests/easyscore_tests.js +0 -459
  152. package/build/esm/tests/factory_tests.js +0 -44
  153. package/build/esm/tests/font_tests.js +0 -135
  154. package/build/esm/tests/formatter/framestack.js +0 -61
  155. package/build/esm/tests/formatter/tests.js +0 -203
  156. package/build/esm/tests/formatter_tests.js +0 -669
  157. package/build/esm/tests/fraction_tests.js +0 -72
  158. package/build/esm/tests/ghostnote_tests.js +0 -77
  159. package/build/esm/tests/glyphnote_tests.js +0 -113
  160. package/build/esm/tests/gracenote_tests.js +0 -370
  161. package/build/esm/tests/gracetabnote_tests.js +0 -79
  162. package/build/esm/tests/index.js +0 -68
  163. package/build/esm/tests/key_clef_tests.js +0 -103
  164. package/build/esm/tests/keymanager_tests.js +0 -68
  165. package/build/esm/tests/keysignature_tests.js +0 -308
  166. package/build/esm/tests/mocks.js +0 -71
  167. package/build/esm/tests/modifier_tests.js +0 -24
  168. package/build/esm/tests/multimeasurerest_tests.js +0 -141
  169. package/build/esm/tests/music_tests.js +0 -161
  170. package/build/esm/tests/notehead_tests.js +0 -137
  171. package/build/esm/tests/notesubgroup_tests.js +0 -149
  172. package/build/esm/tests/offscreencanvas_tests.js +0 -47
  173. package/build/esm/tests/ornament_tests.js +0 -298
  174. package/build/esm/tests/parser_tests.js +0 -122
  175. package/build/esm/tests/pedalmarking_tests.js +0 -64
  176. package/build/esm/tests/percussion_tests.js +0 -180
  177. package/build/esm/tests/registry_tests.js +0 -64
  178. package/build/esm/tests/renderer_tests.js +0 -113
  179. package/build/esm/tests/rests_tests.js +0 -248
  180. package/build/esm/tests/rhythm_tests.js +0 -357
  181. package/build/esm/tests/stave_tests.js +0 -560
  182. package/build/esm/tests/staveconnector_tests.js +0 -402
  183. package/build/esm/tests/stavehairpin_tests.js +0 -90
  184. package/build/esm/tests/staveline_tests.js +0 -122
  185. package/build/esm/tests/stavemodifier_tests.js +0 -51
  186. package/build/esm/tests/stavenote_tests.js +0 -835
  187. package/build/esm/tests/stavetie_tests.js +0 -108
  188. package/build/esm/tests/stringnumber_tests.js +0 -259
  189. package/build/esm/tests/strokes_tests.js +0 -275
  190. package/build/esm/tests/style_tests.js +0 -98
  191. package/build/esm/tests/support/qunit.js +0 -2765
  192. package/build/esm/tests/tabnote_tests.js +0 -474
  193. package/build/esm/tests/tabslide_tests.js +0 -135
  194. package/build/esm/tests/tabstave_tests.js +0 -23
  195. package/build/esm/tests/tabtie_tests.js +0 -173
  196. package/build/esm/tests/textbracket_tests.js +0 -100
  197. package/build/esm/tests/textformatter_tests.js +0 -24
  198. package/build/esm/tests/textnote_tests.js +0 -215
  199. package/build/esm/tests/threevoice_tests.js +0 -132
  200. package/build/esm/tests/tickcontext_tests.js +0 -36
  201. package/build/esm/tests/timesignature_tests.js +0 -134
  202. package/build/esm/tests/tremolo_tests.js +0 -75
  203. package/build/esm/tests/tuning_tests.js +0 -56
  204. package/build/esm/tests/tuplet_tests.js +0 -450
  205. package/build/esm/tests/typeguard_tests.js +0 -82
  206. package/build/esm/tests/vexflow_test_helpers.js +0 -266
  207. package/build/esm/tests/vf_prefix_tests.js +0 -115
  208. package/build/esm/tests/vibrato_tests.js +0 -92
  209. package/build/esm/tests/vibratobracket_tests.js +0 -45
  210. package/build/esm/tests/voice_tests.js +0 -69
  211. package/build/types/entry/vexflow-bravura.d.ts +0 -3
  212. package/build/types/entry/vexflow-core.d.ts +0 -3
  213. package/build/types/entry/vexflow-debug.d.ts +0 -3
  214. package/build/types/entry/vexflow-font-bravura.d.ts +0 -3771
  215. package/build/types/entry/vexflow-font-custom.d.ts +0 -86
  216. package/build/types/entry/vexflow-font-gonville.d.ts +0 -1267
  217. package/build/types/entry/vexflow-font-petaluma.d.ts +0 -1896
  218. package/build/types/entry/vexflow-gonville.d.ts +0 -3
  219. package/build/types/entry/vexflow-petaluma.d.ts +0 -3
  220. package/build/types/entry/vexflow.d.ts +0 -3
  221. package/build/types/src/accidental.d.ts +0 -66
  222. package/build/types/src/annotation.d.ts +0 -60
  223. package/build/types/src/articulation.d.ts +0 -62
  224. package/build/types/src/barnote.d.ts +0 -29
  225. package/build/types/src/beam.d.ts +0 -124
  226. package/build/types/src/bend.d.ts +0 -73
  227. package/build/types/src/boundingbox.d.ts +0 -42
  228. package/build/types/src/boundingboxcomputation.d.ts +0 -33
  229. package/build/types/src/canvascontext.d.ts +0 -89
  230. package/build/types/src/chordsymbol.d.ts +0 -149
  231. package/build/types/src/clef.d.ts +0 -48
  232. package/build/types/src/clefnote.d.ts +0 -25
  233. package/build/types/src/crescendo.d.ts +0 -27
  234. package/build/types/src/curve.d.ts +0 -41
  235. package/build/types/src/dot.d.ts +0 -20
  236. package/build/types/src/easyscore.d.ts +0 -148
  237. package/build/types/src/element.d.ts +0 -202
  238. package/build/types/src/factory.d.ts +0 -271
  239. package/build/types/src/flow.d.ts +0 -245
  240. package/build/types/src/font.d.ts +0 -181
  241. package/build/types/src/fonts/bravura_glyphs.d.ts +0 -3239
  242. package/build/types/src/fonts/bravura_metrics.d.ts +0 -533
  243. package/build/types/src/fonts/custom_glyphs.d.ts +0 -78
  244. package/build/types/src/fonts/custom_metrics.d.ts +0 -5
  245. package/build/types/src/fonts/gonville_glyphs.d.ts +0 -828
  246. package/build/types/src/fonts/gonville_metrics.d.ts +0 -440
  247. package/build/types/src/fonts/load_all.d.ts +0 -1
  248. package/build/types/src/fonts/load_bravura.d.ts +0 -1
  249. package/build/types/src/fonts/load_custom.d.ts +0 -1
  250. package/build/types/src/fonts/load_gonville.d.ts +0 -1
  251. package/build/types/src/fonts/load_petaluma.d.ts +0 -1
  252. package/build/types/src/fonts/petaluma_glyphs.d.ts +0 -1335
  253. package/build/types/src/fonts/petaluma_metrics.d.ts +0 -562
  254. package/build/types/src/fonts/petalumascript_glyphs.d.ts +0 -863
  255. package/build/types/src/fonts/robotoslab_glyphs.d.ts +0 -863
  256. package/build/types/src/fonts/textfonts.d.ts +0 -1
  257. package/build/types/src/formatter.d.ts +0 -203
  258. package/build/types/src/fraction.d.ts +0 -62
  259. package/build/types/src/frethandfinger.d.ts +0 -22
  260. package/build/types/src/ghostnote.d.ts +0 -16
  261. package/build/types/src/glyph.d.ts +0 -139
  262. package/build/types/src/glyphnote.d.ts +0 -17
  263. package/build/types/src/gracenote.d.ts +0 -19
  264. package/build/types/src/gracenotegroup.d.ts +0 -33
  265. package/build/types/src/gracetabnote.d.ts +0 -5
  266. package/build/types/src/index.d.ts +0 -91
  267. package/build/types/src/keymanager.d.ts +0 -25
  268. package/build/types/src/keysignature.d.ts +0 -50
  269. package/build/types/src/keysignote.d.ts +0 -11
  270. package/build/types/src/modifier.d.ts +0 -97
  271. package/build/types/src/modifiercontext.d.ts +0 -45
  272. package/build/types/src/multimeasurerest.d.ts +0 -61
  273. package/build/types/src/music.d.ts +0 -91
  274. package/build/types/src/note.d.ts +0 -230
  275. package/build/types/src/notehead.d.ts +0 -70
  276. package/build/types/src/notesubgroup.d.ts +0 -18
  277. package/build/types/src/ornament.d.ts +0 -76
  278. package/build/types/src/parenthesis.d.ts +0 -22
  279. package/build/types/src/parser.d.ts +0 -45
  280. package/build/types/src/pedalmarking.d.ts +0 -69
  281. package/build/types/src/registry.d.ts +0 -40
  282. package/build/types/src/rendercontext.d.ts +0 -64
  283. package/build/types/src/renderer.d.ts +0 -35
  284. package/build/types/src/repeatnote.d.ts +0 -6
  285. package/build/types/src/stave.d.ts +0 -186
  286. package/build/types/src/stavebarline.d.ts +0 -28
  287. package/build/types/src/staveconnector.d.ts +0 -67
  288. package/build/types/src/stavehairpin.d.ts +0 -56
  289. package/build/types/src/staveline.d.ts +0 -57
  290. package/build/types/src/stavemodifier.d.ts +0 -44
  291. package/build/types/src/stavenote.d.ts +0 -154
  292. package/build/types/src/staverepetition.d.ts +0 -32
  293. package/build/types/src/stavesection.d.ts +0 -15
  294. package/build/types/src/stavetempo.d.ts +0 -25
  295. package/build/types/src/stavetext.d.ts +0 -25
  296. package/build/types/src/stavetie.d.ts +0 -59
  297. package/build/types/src/stavevolta.d.ts +0 -21
  298. package/build/types/src/stem.d.ts +0 -58
  299. package/build/types/src/stemmablenote.d.ts +0 -39
  300. package/build/types/src/stringnumber.d.ts +0 -27
  301. package/build/types/src/strokes.d.ts +0 -33
  302. package/build/types/src/svgcontext.d.ts +0 -131
  303. package/build/types/src/system.d.ts +0 -92
  304. package/build/types/src/tables.d.ts +0 -96
  305. package/build/types/src/tabnote.d.ts +0 -44
  306. package/build/types/src/tabslide.d.ts +0 -34
  307. package/build/types/src/tabstave.d.ts +0 -7
  308. package/build/types/src/tabtie.d.ts +0 -18
  309. package/build/types/src/textbracket.d.ts +0 -55
  310. package/build/types/src/textdynamics.d.ts +0 -39
  311. package/build/types/src/textformatter.d.ts +0 -109
  312. package/build/types/src/textnote.d.ts +0 -49
  313. package/build/types/src/tickable.d.ts +0 -140
  314. package/build/types/src/tickcontext.d.ts +0 -82
  315. package/build/types/src/timesigglyph.d.ts +0 -14
  316. package/build/types/src/timesignature.d.ts +0 -26
  317. package/build/types/src/timesignote.d.ts +0 -11
  318. package/build/types/src/tremolo.d.ts +0 -17
  319. package/build/types/src/tuning.d.ts +0 -23
  320. package/build/types/src/tuplet.d.ts +0 -105
  321. package/build/types/src/typeguard.d.ts +0 -99
  322. package/build/types/src/util.d.ts +0 -27
  323. package/build/types/src/version.d.ts +0 -3
  324. package/build/types/src/vex.d.ts +0 -18
  325. package/build/types/src/vibrato.d.ts +0 -29
  326. package/build/types/src/vibratobracket.d.ts +0 -33
  327. package/build/types/src/voice.d.ts +0 -108
  328. package/build/types/src/web.d.ts +0 -2
@@ -1,149 +0,0 @@
1
- import { FontInfo } from './font';
2
- import { Glyph } from './glyph';
3
- import { Modifier } from './modifier';
4
- import { ModifierContextState } from './modifiercontext';
5
- import { TextFormatter } from './textformatter';
6
- export interface ChordSymbolBlock {
7
- text: string;
8
- symbolType: SymbolTypes;
9
- symbolModifier: SymbolModifiers;
10
- xShift: number;
11
- yShift: number;
12
- vAlign: boolean;
13
- width: number;
14
- glyph?: Glyph;
15
- }
16
- export declare enum ChordSymbolHorizontalJustify {
17
- LEFT = 1,
18
- CENTER = 2,
19
- RIGHT = 3,
20
- CENTER_STEM = 4
21
- }
22
- export declare enum ChordSymbolVerticalJustify {
23
- TOP = 1,
24
- BOTTOM = 2
25
- }
26
- export declare enum SymbolTypes {
27
- GLYPH = 1,
28
- TEXT = 2,
29
- LINE = 3
30
- }
31
- export declare enum SymbolModifiers {
32
- NONE = 1,
33
- SUBSCRIPT = 2,
34
- SUPERSCRIPT = 3
35
- }
36
- /**
37
- * ChordSymbol is a modifier that creates a chord symbol above/below a chord.
38
- * As a modifier, it is attached to an existing note.
39
- */
40
- export declare class ChordSymbol extends Modifier {
41
- static DEBUG: boolean;
42
- static get CATEGORY(): string;
43
- static readonly HorizontalJustify: typeof ChordSymbolHorizontalJustify;
44
- static readonly HorizontalJustifyString: Record<string, ChordSymbolHorizontalJustify>;
45
- static readonly VerticalJustify: typeof ChordSymbolVerticalJustify;
46
- static readonly VerticalJustifyString: Record<string, ChordSymbolVerticalJustify>;
47
- static get superSubRatio(): number;
48
- /** Currently unused: Globally turn off text formatting, if the built-in formatting does not work for your font. */
49
- static set NO_TEXT_FORMAT(val: boolean);
50
- static get NO_TEXT_FORMAT(): boolean;
51
- static getMetricForGlyph(glyphCode: string): any;
52
- static get engravingFontResolution(): number;
53
- static get spacingBetweenBlocks(): number;
54
- static getWidthForGlyph(glyph: Glyph): number;
55
- static getYShiftForGlyph(glyph: Glyph): number;
56
- static getXShiftForGlyph(glyph: Glyph): number;
57
- static get superscriptOffset(): number;
58
- static get subscriptOffset(): number;
59
- static get kerningOffset(): number;
60
- static readonly glyphs: Record<string, {
61
- code: string;
62
- }>;
63
- static readonly symbolTypes: typeof SymbolTypes;
64
- static readonly symbolModifiers: typeof SymbolModifiers;
65
- static get metrics(): any;
66
- static get lowerKerningText(): string[];
67
- static get upperKerningText(): string[];
68
- static isSuperscript(block: ChordSymbolBlock): boolean;
69
- static isSubscript(block: ChordSymbolBlock): boolean;
70
- /**
71
- * Estimate the width of the whole chord symbol, based on the sum of the widths of the individual blocks.
72
- * Estimate how many lines above/below the staff we need.
73
- */
74
- static format(symbols: ChordSymbol[], state: ModifierContextState): boolean;
75
- /** Currently unused. */
76
- protected static noFormat: boolean;
77
- protected symbolBlocks: ChordSymbolBlock[];
78
- protected horizontal: number;
79
- protected vertical: number;
80
- protected useKerning: boolean;
81
- protected reportWidth: boolean;
82
- protected textFormatter: TextFormatter;
83
- constructor();
84
- /**
85
- * Default text font.
86
- * Choose a font family that works well with the current music engraving font.
87
- * @override `Element.TEXT_FONT`.
88
- */
89
- static get TEXT_FONT(): Required<FontInfo>;
90
- /**
91
- * The offset is specified in `em`. Scale this value by the font size in pixels.
92
- */
93
- get superscriptOffset(): number;
94
- get subscriptOffset(): number;
95
- setReportWidth(value: boolean): this;
96
- getReportWidth(): boolean;
97
- updateOverBarAdjustments(): void;
98
- updateKerningAdjustments(): void;
99
- /** Do some basic kerning so that letter chords like 'A' don't have the extensions hanging off to the right. */
100
- getKerningAdjustment(j: number): number;
101
- /**
102
- * ChordSymbol allows multiple blocks so we can mix glyphs and font text.
103
- * Each block can have its own vertical orientation.
104
- */
105
- getSymbolBlock(params?: any): ChordSymbolBlock;
106
- /** Add a symbol to this chord, could be text, glyph or line. */
107
- addSymbolBlock(parameters: any): this;
108
- /** Add a text block. */
109
- addText(text: string, parameters?: any): this;
110
- /** Add a text block with superscript modifier. */
111
- addTextSuperscript(text: string): this;
112
- /** Add a text block with subscript modifier. */
113
- addTextSubscript(text: string): this;
114
- /** Add a glyph block with superscript modifier. */
115
- addGlyphSuperscript(glyph: string): this;
116
- /** Add a glyph block. */
117
- addGlyph(glyph: string, params?: any): this;
118
- /**
119
- * Add a glyph for each character in 'text'. If the glyph is not available, use text from the font.
120
- * e.g. `addGlyphOrText('(+5#11)')` will use text for the '5' and '11', and glyphs for everything else.
121
- */
122
- addGlyphOrText(text: string, params?: any): this;
123
- /** Add a line of the given width, used as a continuation of the previous symbol in analysis, or lyrics, etc. */
124
- addLine(width: number, params?: any): this;
125
- /**
126
- * Set the chord symbol's font family, size, weight, style (e.g., `Arial`, `10pt`, `bold`, `italic`).
127
- *
128
- * @param f is 1) a `FontInfo` object or
129
- * 2) a string formatted as CSS font shorthand (e.g., 'bold 10pt Arial') or
130
- * 3) a string representing the font family (one of `size`, `weight`, or `style` must also be provided).
131
- * @param size a string specifying the font size and unit (e.g., '16pt'), or a number (the unit is assumed to be 'pt').
132
- * @param weight is a string (e.g., 'bold', 'normal') or a number (100, 200, ... 900).
133
- * @param style is a string (e.g., 'italic', 'normal').
134
- *
135
- * @override See: Element.
136
- */
137
- setFont(f?: string | FontInfo, size?: string | number, weight?: string | number, style?: string): this;
138
- setEnableKerning(val: boolean): this;
139
- /** Set vertical position of text (above or below stave). */
140
- setVertical(vj: ChordSymbolVerticalJustify | string | number): this;
141
- getVertical(): number;
142
- /** Set horizontal justification. */
143
- setHorizontal(hj: ChordSymbolHorizontalJustify | string | number): this;
144
- getHorizontal(): number;
145
- getWidth(): number;
146
- getYOffsetForText(text: string): number;
147
- /** Render text and glyphs above/below the note. */
148
- draw(): void;
149
- }
@@ -1,48 +0,0 @@
1
- import { Glyph } from './glyph';
2
- import { Stave } from './stave';
3
- import { StaveModifier } from './stavemodifier';
4
- export interface ClefType {
5
- point: number;
6
- code: string;
7
- line?: number;
8
- }
9
- /**
10
- * Clef implements various types of clefs that can be rendered on a stave.
11
- *
12
- * See `tests/clef_tests.ts` for usage examples.
13
- */
14
- export declare class Clef extends StaveModifier {
15
- /** To enable logging for this class, set `Vex.Flow.Clef.DEBUG` to `true`. */
16
- static DEBUG: boolean;
17
- static get CATEGORY(): string;
18
- annotation?: {
19
- code: string;
20
- line: number;
21
- x_shift: number;
22
- point: number;
23
- };
24
- /**
25
- * The attribute `clef` must be a key from
26
- * `Clef.types`
27
- */
28
- clef: ClefType;
29
- protected glyph?: Glyph;
30
- protected attachment?: Glyph;
31
- protected size?: string;
32
- protected type?: string;
33
- /**
34
- * Every clef name is associated with a glyph code from the font file
35
- * and a default stave line number.
36
- */
37
- static get types(): Record<string, ClefType>;
38
- /** Create a new clef. */
39
- constructor(type: string, size?: string, annotation?: string);
40
- /** Set clef type, size and annotation. */
41
- setType(type: string, size?: string, annotation?: string): this;
42
- /** Get clef width. */
43
- getWidth(): number;
44
- /** Set associated stave. */
45
- setStave(stave: Stave): this;
46
- /** Render clef. */
47
- draw(): void;
48
- }
@@ -1,25 +0,0 @@
1
- import { BoundingBox } from './boundingbox';
2
- import { Clef, ClefType } from './clef';
3
- import { ModifierContext } from './modifiercontext';
4
- import { Note } from './note';
5
- import { RenderContext } from './rendercontext';
6
- /** ClefNote implements clef annotations in measures. */
7
- export declare class ClefNote extends Note {
8
- static get CATEGORY(): string;
9
- protected clef_obj: Clef;
10
- protected type: string;
11
- protected clef: ClefType;
12
- constructor(type: string, size?: string, annotation?: string);
13
- /** Set clef type, size and annotation. */
14
- setType(type: string, size: string, annotation: string): this;
15
- /** Get associated clef. */
16
- getClef(): ClefType;
17
- /** Set associated context. */
18
- setContext(context: RenderContext): this;
19
- /** Get bounding box. */
20
- getBoundingBox(): BoundingBox | undefined;
21
- addToModifierContext(mc: ModifierContext): this;
22
- preFormat(): this;
23
- /** Render clef note. */
24
- draw(): void;
25
- }
@@ -1,27 +0,0 @@
1
- import { Note, NoteStruct } from './note';
2
- export interface CrescendoParams {
3
- reverse: boolean;
4
- height: number;
5
- y: number;
6
- end_x: number;
7
- begin_x: number;
8
- }
9
- export declare class Crescendo extends Note {
10
- static DEBUG: boolean;
11
- /** Crescendo category string. */
12
- static get CATEGORY(): string;
13
- protected decrescendo: boolean;
14
- protected height: number;
15
- protected line: number;
16
- protected options: {
17
- extend_left: number;
18
- extend_right: number;
19
- y_shift: number;
20
- };
21
- constructor(noteStruct: NoteStruct);
22
- setLine(line: number): this;
23
- setHeight(height: number): this;
24
- setDecrescendo(decresc: boolean): this;
25
- preFormat(): this;
26
- draw(): void;
27
- }
@@ -1,41 +0,0 @@
1
- import { Element } from './element';
2
- import { Note } from './note';
3
- export interface CurveOptions {
4
- /** Two control points for the bezier curves. */
5
- cps?: {
6
- x: number;
7
- y: number;
8
- }[];
9
- thickness?: number;
10
- x_shift?: number;
11
- y_shift?: number;
12
- position?: string | number;
13
- position_end?: string | number;
14
- invert?: boolean;
15
- }
16
- export declare enum CurvePosition {
17
- NEAR_HEAD = 1,
18
- NEAR_TOP = 2
19
- }
20
- export declare class Curve extends Element {
21
- static get CATEGORY(): string;
22
- render_options: Required<CurveOptions>;
23
- protected from: Note;
24
- protected to: Note;
25
- static get Position(): typeof CurvePosition;
26
- static get PositionString(): Record<string, number>;
27
- constructor(from: Note, to: Note, options: CurveOptions);
28
- setNotes(from: Note, to: Note): this;
29
- /**
30
- * @return {boolean} Returns true if this is a partial bar.
31
- */
32
- isPartial(): boolean;
33
- renderCurve(params: {
34
- last_y: number;
35
- last_x: number;
36
- first_y: number;
37
- first_x: number;
38
- direction: number;
39
- }): void;
40
- draw(): boolean;
41
- }
@@ -1,20 +0,0 @@
1
- import { Modifier } from './modifier';
2
- import { ModifierContextState } from './modifiercontext';
3
- import { Note } from './note';
4
- export declare class Dot extends Modifier {
5
- static get CATEGORY(): string;
6
- protected radius: number;
7
- protected dot_shiftY: number;
8
- /** Returns the dots associated to a Note. */
9
- static getDots(note: Note): Dot[];
10
- /** Add a dot on the specified keys to the notes. */
11
- static buildAndAttach(notes: Note[], options?: {
12
- index?: number;
13
- all?: boolean;
14
- }): void;
15
- static format(dots: Dot[], state: ModifierContextState): boolean;
16
- constructor();
17
- setNote(note: Note): this;
18
- setDotShiftY(y: number): this;
19
- draw(): void;
20
- }
@@ -1,148 +0,0 @@
1
- import { Accidental } from './accidental';
2
- import { Factory } from './factory';
3
- import { Note } from './note';
4
- import { Grammar, Match, Parser, Result, Rule, RuleFunction } from './parser';
5
- import { RenderContext } from './rendercontext';
6
- import { StemmableNote } from './stemmablenote';
7
- import { TupletOptions } from './tuplet';
8
- import { Voice } from './voice';
9
- export declare type CommitHook = (obj: any, note: StemmableNote, builder: Builder) => void;
10
- export declare class EasyScoreGrammar implements Grammar {
11
- builder: Builder;
12
- constructor(builder: Builder);
13
- begin(): RuleFunction;
14
- LINE(): Rule;
15
- PIECE(): Rule;
16
- PIECES(): Rule;
17
- PARAMS(): Rule;
18
- CHORDORNOTE(): Rule;
19
- CHORD(): Rule;
20
- NOTES(): Rule;
21
- NOTE(): Rule;
22
- SINGLENOTE(): Rule;
23
- ACCIDENTAL(): Rule;
24
- DOTS(): Rule;
25
- TYPE(): Rule;
26
- DURATION(): Rule;
27
- OPTS(): Rule;
28
- KEYVALS(): Rule;
29
- KEYVAL(): Rule;
30
- VAL(): Rule;
31
- KEY(): Rule;
32
- DVAL(): Rule;
33
- SVAL(): Rule;
34
- NOTENAME(): Rule;
35
- OCTAVE(): Rule;
36
- ACCIDENTALS(): Rule;
37
- MICROTONES(): Rule;
38
- DURATIONS(): Rule;
39
- TYPES(): Rule;
40
- LPAREN(): Rule;
41
- RPAREN(): Rule;
42
- COMMA(): Rule;
43
- DOT(): Rule;
44
- SLASH(): Rule;
45
- MAYBESLASH(): Rule;
46
- EQUALS(): Rule;
47
- LBRACKET(): Rule;
48
- RBRACKET(): Rule;
49
- EOL(): Rule;
50
- }
51
- export interface NotePiece {
52
- key: string;
53
- accid?: string | null;
54
- octave?: string;
55
- }
56
- export declare class Piece {
57
- chord: NotePiece[];
58
- duration: string;
59
- dots: number;
60
- type?: string;
61
- options: {
62
- [x: string]: string;
63
- };
64
- constructor(duration: string);
65
- }
66
- export interface BuilderElements {
67
- notes: StemmableNote[];
68
- accidentals: (Accidental | undefined)[][];
69
- }
70
- export interface BuilderOptions extends Record<string, any> {
71
- stem?: string;
72
- clef?: string;
73
- }
74
- export declare class Builder {
75
- factory: Factory;
76
- elements: BuilderElements;
77
- options: BuilderOptions;
78
- piece: Piece;
79
- commitHooks: CommitHook[];
80
- rollingDuration: string;
81
- constructor(factory: Factory);
82
- reset(options?: BuilderOptions): void;
83
- getFactory(): Factory;
84
- getElements(): BuilderElements;
85
- addCommitHook(commitHook: CommitHook): void;
86
- resetPiece(): void;
87
- setNoteDots(dots: Match[]): void;
88
- setNoteDuration(duration?: string): void;
89
- setNoteType(type?: string): void;
90
- addNoteOption(key: string, value: string): void;
91
- addNote(key?: string, accid?: string | null, octave?: string): void;
92
- addSingleNote(key: string, accid?: string | null, octave?: string): void;
93
- addChord(notes: Match[]): void;
94
- commitPiece(): void;
95
- }
96
- export interface EasyScoreOptions {
97
- factory?: Factory;
98
- builder?: Builder;
99
- commitHooks?: CommitHook[];
100
- throwOnError?: boolean;
101
- }
102
- export interface EasyScoreDefaults extends Record<string, any> {
103
- clef?: string;
104
- time?: string;
105
- stem?: string;
106
- }
107
- /**
108
- * EasyScore implements a parser for a simple language to generate VexFlow objects.
109
- */
110
- export declare class EasyScore {
111
- static DEBUG: boolean;
112
- defaults: EasyScoreDefaults;
113
- options: EasyScoreOptions;
114
- factory: Factory;
115
- builder: Builder;
116
- grammar: EasyScoreGrammar;
117
- parser: Parser;
118
- constructor(options?: EasyScoreOptions);
119
- /**
120
- * Set the score defaults.
121
- * clef must be set appropriately to avoid errors when adding Staves.
122
- * @param defaults.clef default clef ( treble | bass ...) see {@link Clef.types}
123
- * @param defaults.time default time signature ( 4/4 | 9/8 ...)
124
- * @param defaults.stem default stem arrangement (auto | up | down)
125
- * @returns this
126
- */
127
- set(defaults: EasyScoreDefaults): this;
128
- /**
129
- * @param options.factory is required.
130
- * @returns this
131
- */
132
- setOptions(options: EasyScoreOptions): this;
133
- setContext(context: RenderContext): this;
134
- parse(line: string, options?: BuilderOptions): Result;
135
- beam(notes: StemmableNote[], options?: {
136
- autoStem?: boolean;
137
- secondaryBeamBreaks?: number[];
138
- }): StemmableNote[];
139
- tuplet(notes: StemmableNote[], options?: TupletOptions): StemmableNote[];
140
- notes(line: string, options?: BuilderOptions): StemmableNote[];
141
- voice(notes: Note[], options?: {
142
- time?: string;
143
- options?: {
144
- softmaxFactor: number;
145
- };
146
- }): Voice;
147
- addCommitHook(commitHook: CommitHook): void;
148
- }
@@ -1,202 +0,0 @@
1
- import { BoundingBox } from './boundingbox';
2
- import { FontInfo } from './font';
3
- import { Registry } from './registry';
4
- import { RenderContext } from './rendercontext';
5
- /** Element attributes. */
6
- export interface ElementAttributes {
7
- [name: string]: any;
8
- id: string;
9
- el?: any;
10
- type: string;
11
- classes: Record<string, boolean>;
12
- }
13
- /** Element style */
14
- export interface ElementStyle {
15
- /**
16
- * CSS color used for the shadow.
17
- *
18
- * Examples: 'red', '#ff0000', '#ff000010', 'rgb(255,0,0)'
19
- *
20
- * See [CSS Legal Color Values](https://www.w3schools.com/cssref/css_colors_legal.asp)
21
- */
22
- shadowColor?: string;
23
- /**
24
- * Level of blur applied to shadows.
25
- *
26
- * Values that are not finite numbers greater than or equal to zero are ignored.
27
- */
28
- shadowBlur?: number;
29
- /**
30
- * CSS color used with context fill command.
31
- *
32
- * Examples: 'red', '#ff0000', '#ff000010', 'rgb(255,0,0)'
33
- *
34
- * See [CSS Legal Color Values](https://www.w3schools.com/cssref/css_colors_legal.asp)
35
- */
36
- fillStyle?: string;
37
- /**
38
- * CSS color used with context stroke command.
39
- *
40
- * Examples: 'red', '#ff0000', '#ff000010', 'rgb(255,0,0)'
41
- *
42
- * See [CSS Legal Color Values](https://www.w3schools.com/cssref/css_colors_legal.asp)
43
- */
44
- strokeStyle?: string;
45
- /**
46
- * Line width, 1.0 by default.
47
- */
48
- lineWidth?: number;
49
- }
50
- /**
51
- * Element implements a generic base class for VexFlow, with implementations
52
- * of general functions and properties that can be inherited by all VexFlow elements.
53
- */
54
- export declare abstract class Element {
55
- static get CATEGORY(): string;
56
- protected static ID: number;
57
- protected static newID(): string;
58
- /**
59
- * Default font for text. This is not related to music engraving. Instead, see `Flow.setMusicFont(...fontNames)`
60
- * to customize the font for musical symbols placed on the score.
61
- */
62
- static TEXT_FONT: Required<FontInfo>;
63
- private context?;
64
- protected rendered: boolean;
65
- protected style?: ElementStyle;
66
- private attrs;
67
- protected boundingBox?: BoundingBox;
68
- protected registry?: Registry;
69
- /**
70
- * Some elements include text.
71
- * The `textFont` property contains information required to style the text (i.e., font family, size, weight, and style).
72
- * It is undefined by default, and can be set using `setFont(...)` or `resetFont()`.
73
- */
74
- protected textFont?: Required<FontInfo>;
75
- constructor();
76
- /** Get element category string. */
77
- getCategory(): string;
78
- /**
79
- * Set the element style used to render.
80
- *
81
- * Example:
82
- * ```typescript
83
- * element.setStyle({ fillStyle: 'red', strokeStyle: 'red' });
84
- * element.draw();
85
- * ```
86
- * Note: If the element draws additional sub-elements (ie.: Modifiers in a Stave),
87
- * the style can be applied to all of them by means of the context:
88
- * ```typescript
89
- * element.setStyle({ fillStyle: 'red', strokeStyle: 'red' });
90
- * element.getContext().setFillStyle('red');
91
- * element.getContext().setStrokeStyle('red');
92
- * element.draw();
93
- * ```
94
- * or using drawWithStyle:
95
- * ```typescript
96
- * element.setStyle({ fillStyle: 'red', strokeStyle: 'red' });
97
- * element.drawWithStyle();
98
- * ```
99
- */
100
- setStyle(style: ElementStyle): this;
101
- /** Get the element style used for rendering. */
102
- getStyle(): ElementStyle | undefined;
103
- /** Apply the element style to `context`. */
104
- applyStyle(context?: RenderContext | undefined, style?: ElementStyle | undefined): this;
105
- /** Restore the style of `context`. */
106
- restoreStyle(context?: RenderContext | undefined, style?: ElementStyle | undefined): this;
107
- /**
108
- * Draw the element and all its sub-elements (ie.: Modifiers in a Stave)
109
- * with the element style.
110
- */
111
- drawWithStyle(): void;
112
- /** Draw an element. */
113
- abstract draw(...args: any[]): void;
114
- /** Check if it has a class label (An element can have multiple class labels). */
115
- hasClass(className: string): boolean;
116
- /** Add a class label (An element can have multiple class labels). */
117
- addClass(className: string): this;
118
- /** Remove a class label (An element can have multiple class labels). */
119
- removeClass(className: string): this;
120
- /** Call back from registry after the element is registered. */
121
- onRegister(registry: Registry): this;
122
- /** Return the rendered status. */
123
- isRendered(): boolean;
124
- /** Set the rendered status. */
125
- setRendered(rendered?: boolean): this;
126
- /** Return the element attributes. */
127
- getAttributes(): ElementAttributes;
128
- /** Return an attribute. */
129
- getAttribute(name: string): any;
130
- /** Set an attribute. */
131
- setAttribute(name: string, value: any): this;
132
- /** Get the boundingBox. */
133
- getBoundingBox(): BoundingBox | undefined;
134
- /** Return the context. */
135
- getContext(): RenderContext | undefined;
136
- /** Set the context. */
137
- setContext(context?: RenderContext): this;
138
- /** Validate and return the context. */
139
- checkContext(): RenderContext;
140
- /**
141
- * Provide a CSS compatible font string (e.g., 'bold 16px Arial').
142
- */
143
- set font(f: string);
144
- /** Returns the CSS compatible font string. */
145
- get font(): string;
146
- /**
147
- * Set the element's font family, size, weight, style (e.g., `Arial`, `10pt`, `bold`, `italic`).
148
- * @param font is 1) a `FontInfo` object or
149
- * 2) a string formatted as CSS font shorthand (e.g., 'bold 10pt Arial') or
150
- * 3) a string representing the font family (at least one of `size`, `weight`, or `style` must also be provided).
151
- * @param size a string specifying the font size and unit (e.g., '16pt'), or a number (the unit is assumed to be 'pt').
152
- * @param weight is a string (e.g., 'bold', 'normal') or a number (100, 200, ... 900).
153
- * @param style is a string (e.g., 'italic', 'normal').
154
- * If no arguments are provided, then the font is set to the default font.
155
- * Each Element subclass may specify its own default by overriding the static `TEXT_FONT` property.
156
- */
157
- setFont(font?: string | FontInfo, size?: string | number, weight?: string | number, style?: string): this;
158
- getFont(): string;
159
- /**
160
- * Reset the text font to the style indicated by the static `TEXT_FONT` property.
161
- * Subclasses can call this to initialize `textFont` for the first time.
162
- */
163
- resetFont(): void;
164
- /** Return a copy of the current FontInfo object. */
165
- get fontInfo(): Required<FontInfo>;
166
- set fontInfo(fontInfo: FontInfo);
167
- /** Change the font size, while keeping everything else the same. */
168
- setFontSize(size?: string | number): this;
169
- /**
170
- * @returns a CSS font-size string (e.g., '18pt', '12px', '1em').
171
- * See Element.fontSizeInPixels or Element.fontSizeInPoints if you need to get a number for calculation purposes.
172
- */
173
- getFontSize(): string;
174
- /**
175
- * The size is 1) a string of the form '10pt' or '16px', compatible with the CSS font-size property.
176
- * or 2) a number, which is interpreted as a point size (i.e. 12 == '12pt').
177
- */
178
- set fontSize(size: string | number);
179
- /**
180
- * @returns a CSS font-size string (e.g., '18pt', '12px', '1em').
181
- */
182
- get fontSize(): string;
183
- /**
184
- * @returns the font size in `pt`.
185
- */
186
- get fontSizeInPoints(): number;
187
- /**
188
- * @returns the font size in `px`.
189
- */
190
- get fontSizeInPixels(): number;
191
- /**
192
- * @returns a CSS font-style string (e.g., 'italic').
193
- */
194
- get fontStyle(): string;
195
- set fontStyle(style: string);
196
- /**
197
- * @returns a CSS font-weight string (e.g., 'bold').
198
- * As in CSS, font-weight is always returned as a string, even if it was set as a number.
199
- */
200
- get fontWeight(): string;
201
- set fontWeight(weight: string | number);
202
- }