@tspro/web-music-score 2.0.0 → 3.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +144 -63
  3. package/dist/audio/index.d.mts +1 -1
  4. package/dist/audio/index.js +1 -1
  5. package/dist/audio/index.mjs +2 -2
  6. package/dist/audio-cg/index.js +1 -1
  7. package/dist/audio-cg/index.mjs +2 -2
  8. package/dist/{chunk-2EPWQZKJ.mjs → chunk-ZWFAOHYM.mjs} +2 -2
  9. package/dist/core/index.js +2 -2
  10. package/dist/core/index.mjs +3 -3
  11. package/dist/{guitar-kbJYu3Am.d.mts → guitar-zASF7B1g.d.mts} +1 -1
  12. package/dist/iife/index.global.js +11 -12
  13. package/dist/interface-CLb7xa7_.d.mts +1768 -0
  14. package/dist/interface-DXyXwLBB.d.ts +1768 -0
  15. package/dist/{note-CraqEy8x.d.mts → note-B5ZtlHc8.d.mts} +1 -1
  16. package/dist/pieces/index.d.mts +3 -3
  17. package/dist/pieces/index.d.ts +2 -2
  18. package/dist/pieces/index.js +4 -52
  19. package/dist/pieces/index.mjs +8 -56
  20. package/dist/react-ui/index.d.mts +5 -4
  21. package/dist/react-ui/index.d.ts +3 -2
  22. package/dist/react-ui/index.js +1 -1
  23. package/dist/react-ui/index.mjs +2 -2
  24. package/dist/scale-B_2MZaT9.d.ts +87 -0
  25. package/dist/scale-C-YS5iVG.d.mts +87 -0
  26. package/dist/score/index.d.mts +42 -1557
  27. package/dist/score/index.d.ts +42 -1557
  28. package/dist/score/index.js +2845 -2029
  29. package/dist/score/index.mjs +2813 -2007
  30. package/dist/tempo-DoJd-UYT.d.ts +120 -0
  31. package/dist/tempo-TjQKn46X.d.mts +120 -0
  32. package/dist/theory/index.d.mts +6 -5
  33. package/dist/theory/index.d.ts +3 -2
  34. package/dist/theory/index.js +1 -1
  35. package/dist/theory/index.mjs +2 -2
  36. package/package.json +1 -1
  37. package/dist/tempo--588tdcv.d.ts +0 -203
  38. package/dist/tempo-BEJBHZ5I.d.mts +0 -203
@@ -0,0 +1,1768 @@
1
+ import { N as Note, A as Accidental } from './note-B5ZtlHc8.js';
2
+ import { R as RhythmProps, N as NoteLength, c as Tempo, K as KeySignature, a as TimeSignature, T as TimeSignatureString } from './tempo-DoJd-UYT.js';
3
+ import { Vec2 } from '@tspro/ts-utils-lib';
4
+
5
+ /**
6
+ * @public
7
+ *
8
+ * DivRect class, left, top, right, bottom rectangle divided into four sections by centerX, centerY.
9
+ */
10
+ declare class DivRect {
11
+ left: number;
12
+ centerX: number;
13
+ right: number;
14
+ top: number;
15
+ centerY: number;
16
+ bottom: number;
17
+ /**
18
+ * Create rectangle with all zero values.
19
+ */
20
+ constructor();
21
+ /**
22
+ * Create rectangle with left, right, top, bottom.
23
+ * Properties centerX and centerY will be centered in the middle.
24
+ *
25
+ * @param left -
26
+ * @param right -
27
+ * @param top -
28
+ * @param bottom -
29
+ */
30
+ constructor(left: number, right: number, top: number, bottom: number);
31
+ /**
32
+ * Create rectangle with full arguments.
33
+ *
34
+ * @param left -
35
+ * @param centerX -
36
+ * @param right -
37
+ * @param top -
38
+ * @param centerY -
39
+ * @param bottom -
40
+ */
41
+ constructor(left: number, centerX: number, right: number, top: number, centerY: number, bottom: number);
42
+ /**
43
+ * Create rect from basic left, top, width and height arguments.
44
+ *
45
+ * @param left -
46
+ * @param top -
47
+ * @param width -
48
+ * @param height -
49
+ * @returns
50
+ */
51
+ static create(left: number, top: number, width: number, height: number): DivRect;
52
+ /**
53
+ * Create rect from centerX, centerY, width, height arguments.
54
+ *
55
+ * @param centerX - Center x-coordinate.
56
+ * @param centerY - Center y-coordinate.
57
+ * @param width -
58
+ * @param height -
59
+ * @returns
60
+ */
61
+ static createCentered(centerX: number, centerY: number, width: number, height: number): DivRect;
62
+ /**
63
+ * Create rect from sections.
64
+ *
65
+ * @param leftw - Left section width.
66
+ * @param rightw - Right section width.
67
+ * @param toph - Top section height.
68
+ * @param bottomh - Bottomsection height.
69
+ * @returns
70
+ */
71
+ static createSections(leftw: number, rightw: number, toph: number, bottomh: number): DivRect;
72
+ /**
73
+ * Width.
74
+ */
75
+ get width(): number;
76
+ /**
77
+ * Height.
78
+ */
79
+ get height(): number;
80
+ /**
81
+ * Left section width.
82
+ */
83
+ get leftw(): number;
84
+ /**
85
+ * Right section width.
86
+ */
87
+ get rightw(): number;
88
+ /**
89
+ * Top section height.
90
+ */
91
+ get toph(): number;
92
+ /**
93
+ * Bottom section height.
94
+ */
95
+ get bottomh(): number;
96
+ /**
97
+ * Does this Rect contain given (x, y)-point?
98
+ *
99
+ * @param x -
100
+ * @param y -
101
+ * @returns
102
+ */
103
+ contains(x: number, y: number): boolean;
104
+ /**
105
+ * Do a and b rects overlap?
106
+ *
107
+ * @param a -
108
+ * @param b -
109
+ * @returns
110
+ */
111
+ static overlap(a: DivRect, b: DivRect): boolean;
112
+ /**
113
+ * Do horizontal measures of a and b rects overlap?
114
+ *
115
+ * @param a -
116
+ * @param b -
117
+ * @returns
118
+ */
119
+ static overlapX(a: DivRect, b: DivRect): boolean;
120
+ /**
121
+ * Check if this Rect equals with given Rect.
122
+ * @param b -
123
+ * @returns
124
+ */
125
+ static equals(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
126
+ /**
127
+ * Check if frame (ignoring centerX/Y) of this Rect equals with given Rect, ignoring centerX and centerY.
128
+ *
129
+ * @param b -
130
+ * @returns
131
+ */
132
+ static equalsFrame(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
133
+ /**
134
+ * Created duplicate of this Rect.
135
+ *
136
+ * @returns
137
+ */
138
+ copy(): DivRect;
139
+ /**
140
+ * Move this rect by (dx, dy). Modifies this Rect.
141
+ *
142
+ * @param dx -
143
+ * @param dy -
144
+ * @returns
145
+ */
146
+ offsetInPlace(dx: number, dy: number): DivRect;
147
+ /**
148
+ * Move this rect by (dx, dy). Immutable, returns modified copy.
149
+ *
150
+ * @param dx -
151
+ * @param dy -
152
+ * @returns
153
+ */
154
+ offsetCopy(dx: number, dy: number): DivRect;
155
+ /**
156
+ * Expand this Rect by given Rect. Modifies this Rect.
157
+ *
158
+ * @param rect -
159
+ * @returns
160
+ */
161
+ expandInPlace(rect: DivRect): DivRect;
162
+ /**
163
+ * Expand this Rect by given Rect. Immutable, returns modified copy.
164
+ *
165
+ * @param rect -
166
+ * @returns
167
+ */
168
+ expandCopy(rect: DivRect): DivRect;
169
+ /**
170
+ * Clip this Rect by given Rect. Mmodifies this Rect.
171
+ *
172
+ * @param clipRect -
173
+ * @returns
174
+ */
175
+ clipInPlace(clipRect: DivRect): DivRect;
176
+ /**
177
+ * Clip this Rect by given Rect. Immutable, return modified copy.
178
+ *
179
+ * @param clipRect -
180
+ * @returns
181
+ */
182
+ clipCopy(clipRect: DivRect): DivRect;
183
+ /**
184
+ * Scale Rect. Anchor pos is (centerX, centerY). Modifies this Rect.
185
+ *
186
+ * @param scaleX -
187
+ * @param scaleY -
188
+ * @returns Copy of scaled Rect.
189
+ */
190
+ scaleInPlace(scaleX: number, scaleY?: number): DivRect;
191
+ /**
192
+ * Scale Rect. Anchor pos is (centerX, centerY). Immutable, returns modified copy.
193
+ *
194
+ * @param scaleX -
195
+ * @param scaleY -
196
+ * @returns Copy of scaled Rect.
197
+ */
198
+ scaleCopy(scaleX: number, scaleY?: number): DivRect;
199
+ getRect(): DivRect;
200
+ }
201
+
202
+ /** @public */
203
+ declare enum StaffPreset {
204
+ /** Treble staff has treble (G-) clef. */
205
+ Treble = 1,
206
+ /** Bass staff has bass (F-) clef. */
207
+ Bass = 2,
208
+ /** Grand staff has both treble and bass clefs. */
209
+ Grand = 3,
210
+ /** GuitarTreble has treble clef but is one octave lower. */
211
+ GuitarTreble = 4,
212
+ GuitarTab = 8,
213
+ GuitarCombined = 12
214
+ }
215
+ /** @public */
216
+ declare enum Clef {
217
+ G = "G",
218
+ F = "F"
219
+ }
220
+ /** @public */
221
+ type StaffConfig = {
222
+ type: "staff";
223
+ clef: Clef;
224
+ isOctaveDown?: boolean;
225
+ minNote?: string;
226
+ maxNote?: string;
227
+ voiceIds?: number[];
228
+ isGrand?: boolean;
229
+ };
230
+ /** @public */
231
+ type TabConfig = {
232
+ type: "tab";
233
+ tuning?: string | string[];
234
+ voiceIds?: number[];
235
+ };
236
+ /** @public */
237
+ type ScoreConfiguration = StaffConfig | TabConfig | (StaffConfig | TabConfig)[];
238
+ /** @public */
239
+ type VoiceId = 0 | 1 | 2 | 3;
240
+ /** @public */
241
+ declare function getVoiceIds(): ReadonlyArray<VoiceId>;
242
+ /** @public */
243
+ type StringNumber = 1 | 2 | 3 | 4 | 5 | 6;
244
+ /** @public */
245
+ declare function getStringNumbers(): ReadonlyArray<StringNumber>;
246
+ /** @public */
247
+ declare enum Stem {
248
+ Auto = 0,
249
+ Up = 1,
250
+ Down = 2
251
+ }
252
+ /** @public */
253
+ declare enum Arpeggio {
254
+ Up = 0,
255
+ Down = 1
256
+ }
257
+ /** @public */
258
+ declare enum TieType {
259
+ Stub = -1,
260
+ ToMeasureEnd = -2
261
+ }
262
+ /** @public */
263
+ declare enum NoteAnchor {
264
+ Auto = 0,
265
+ Above = 1,
266
+ Center = 2,
267
+ Below = 3,
268
+ StemTip = 4
269
+ }
270
+ /** @public */
271
+ declare enum Connective {
272
+ Tie = 0,
273
+ Slur = 1,
274
+ Slide = 2
275
+ }
276
+ /** @public */
277
+ type ConnectiveSpan = number | TieType;
278
+ /** @public */
279
+ type NoteOptions = {
280
+ dotted?: boolean;
281
+ stem?: Stem;
282
+ color?: string;
283
+ arpeggio?: Arpeggio | boolean;
284
+ staccato?: boolean;
285
+ diamond?: boolean;
286
+ triplet?: boolean;
287
+ string?: StringNumber | StringNumber[];
288
+ };
289
+ /** @public */
290
+ type RestOptions = {
291
+ dotted?: boolean;
292
+ staffPos?: Note | string | number;
293
+ color?: string;
294
+ hide?: boolean;
295
+ triplet?: boolean;
296
+ };
297
+ /** @public */
298
+ declare enum PlayState {
299
+ Playing = 0,
300
+ Paused = 1,
301
+ Stopped = 2
302
+ }
303
+ /** @public */
304
+ type PlayStateChangeListener = (playState: PlayState) => void;
305
+ /** @public */
306
+ declare enum Fermata {
307
+ AtNote = 0,
308
+ AtMeasureEnd = 1
309
+ }
310
+ /** @public */
311
+ declare enum Navigation {
312
+ /** Repeat back to beginning and play to the "Fine" marking. */
313
+ DC_al_Fine = 0,
314
+ /** Repeat back to beginning and play to the "to Coda 𝄌", then jump to the "𝄌 Coda". */
315
+ DC_al_Coda = 1,
316
+ /** Repeat back to Segno sign (𝄋) and play to the "Fine" marking. */
317
+ DS_al_Fine = 2,
318
+ /** Repeat back to Segno sign (𝄋) and play to the "to Coda 𝄌", then jump to the "𝄌 Coda". */
319
+ DS_al_Coda = 3,
320
+ /** "𝄌 Coda" section. */
321
+ Coda = 4,
322
+ /** From "toCoda 𝄌" jump to the "𝄌 Coda" section. */
323
+ toCoda = 5,
324
+ /** Jump here from D.S. al Fine or D.S. al Coda. */
325
+ Segno = 6,
326
+ /** Stop playing after D.C. al Fine or D.S. al Fine. */
327
+ Fine = 7,
328
+ /** Start of repeat section. */
329
+ StartRepeat = 8,
330
+ /** End of repeat section. Jump to start of repeat section. */
331
+ EndRepeat = 9,
332
+ /** Jump to ending with correct passage number. */
333
+ Ending = 10
334
+ }
335
+ /** @public */
336
+ declare enum Annotation {
337
+ /** "ppp", "pp", "p", "mp", "m", "mf", "f", "ff", "fff", "cresc.", "decresc.", "dim." */
338
+ Dynamics = 0,
339
+ /** "accel.", "rit.", "a tempo" */
340
+ Tempo = 1
341
+ }
342
+ /** @public */
343
+ declare enum Label {
344
+ /** "C", "C#", "Db", "D", etc. */
345
+ Note = 0,
346
+ /** "C", "Am", "G7", etc. */
347
+ Chord = 1
348
+ }
349
+
350
+ declare class AccidentalState {
351
+ readonly measure: ObjMeasure;
352
+ private readonly accidentalByDiatonicId;
353
+ constructor(measure: ObjMeasure);
354
+ getAccidentalFromKeySignature(diatonicId: number): Accidental | undefined;
355
+ setAccidental(note: Note): void;
356
+ needAccidental(note: Note): boolean;
357
+ }
358
+
359
+ declare class ConnectiveProps {
360
+ readonly connective: Connective;
361
+ readonly span: ConnectiveSpan;
362
+ noteAnchor: NoteAnchor;
363
+ noteGroups: ObjNoteGroup[];
364
+ arcDir: "up" | "down";
365
+ constructor(connective: Connective, span: ConnectiveSpan, noteAnchor: NoteAnchor, startNoteGroup: ObjNoteGroup);
366
+ getStartNoteGroup(): ObjNoteGroup;
367
+ startsWith(noteGroup: ObjNoteGroup): boolean;
368
+ /**
369
+ *
370
+ * @param noteGroup -
371
+ * @returns true if noteGroup was added, false if not.
372
+ */
373
+ addNoteGroup(noteGroup: ObjNoteGroup): boolean;
374
+ private computeParams;
375
+ removeConnectives(): void;
376
+ createConnectives(): void;
377
+ private createObjConnectiveWithTieType;
378
+ private createObjConnective;
379
+ }
380
+
381
+ declare class ObjAccidental extends MusicObject {
382
+ readonly diatonicId: number;
383
+ readonly accidental: Accidental;
384
+ readonly color: string;
385
+ readonly mi: MAccidental;
386
+ constructor(parent: MusicObject, diatonicId: number, accidental: Accidental, color?: string);
387
+ getMusicInterface(): MAccidental;
388
+ pick(x: number, y: number): MusicObject[];
389
+ layout(renderer: Renderer): void;
390
+ offset(dx: number, dy: number): void;
391
+ draw(renderer: Renderer): void;
392
+ }
393
+
394
+ type BoxType = "square" | "rectangle" | "circle" | "ellipse";
395
+ type TextProps = string | {
396
+ text: string;
397
+ scale?: number;
398
+ color?: string;
399
+ bold?: boolean;
400
+ italic?: boolean;
401
+ boxed?: BoxType;
402
+ padding?: number;
403
+ bgcolor?: string;
404
+ };
405
+ declare class ObjText extends MusicObject {
406
+ private anchorX;
407
+ private anchorY;
408
+ private readonly text;
409
+ private readonly scale;
410
+ private readonly color;
411
+ private readonly bold;
412
+ private readonly italic;
413
+ private readonly boxed;
414
+ private readonly padding;
415
+ private readonly bgcolor?;
416
+ private font;
417
+ private textLines;
418
+ private lineWidths;
419
+ private lineHeight;
420
+ readonly mi: MText;
421
+ constructor(parent: MusicObject, text: TextProps, anchorX: number, anchorY: number);
422
+ getMusicInterface(): MText;
423
+ getText(): string;
424
+ updateAnchorX(anchorX: number): void;
425
+ updateAnchorY(anchorY: number): void;
426
+ pick(x: number, y: number): MusicObject[];
427
+ layout(renderer: Renderer): void;
428
+ offset(dx: number, dy: number): void;
429
+ draw(renderer: Renderer): void;
430
+ }
431
+
432
+ type NotationLineObject = {
433
+ getRect: () => DivRect;
434
+ offset?: (dx: number, dy: number) => void;
435
+ offsetInPlace?: (dx: number, dy: number) => void;
436
+ };
437
+ declare class ObjStaff extends MusicObject {
438
+ readonly row: ObjScoreRow;
439
+ readonly staffConfig: StaffConfig;
440
+ readonly clefImageAsset: ImageAsset;
441
+ readonly clefLineDiatonicId: number;
442
+ readonly topLineDiatonicId: number;
443
+ readonly middleLineDiatonicId: number;
444
+ readonly bottomLineDiatonicId: number;
445
+ readonly minDiatonicId?: number;
446
+ readonly maxDiatonicId?: number;
447
+ private joinedGrandStaff?;
448
+ private topLineY;
449
+ private bottomLineY;
450
+ private readonly objects;
451
+ readonly mi: MStaff;
452
+ constructor(row: ObjScoreRow, staffConfig: StaffConfig);
453
+ getMusicInterface(): MStaff;
454
+ get isOctaveDown(): boolean;
455
+ getTopLineY(): number;
456
+ getMiddleLineY(): number;
457
+ getBottomLineY(): number;
458
+ joinGrandStaff(staff: ObjStaff): void;
459
+ getLineSpacing(): number;
460
+ getDiatonicSpacing(): number;
461
+ containsDiatonicId(diatonicId: number): boolean;
462
+ getDiatonicIdY(diatonicId: number): number;
463
+ getActualStaff(diatonicId: number): ObjStaff | undefined;
464
+ getDiatonicIdAt(y: number): number | undefined;
465
+ isLine(diatonicId: number): boolean;
466
+ isSpace(diatonicId: number): boolean;
467
+ containsVoiceId(voiceId: number): boolean;
468
+ isGrand(): boolean;
469
+ calcTop(): number;
470
+ calcBottom(): number;
471
+ addObject(o: NotationLineObject): void;
472
+ removeObjects(): void;
473
+ pick(x: number, y: number): MusicObject[];
474
+ layoutHeight(renderer: Renderer): void;
475
+ layoutWidth(renderer: Renderer): void;
476
+ offset(dx: number, dy: number): void;
477
+ draw(renderer: Renderer): void;
478
+ }
479
+ declare class ObjTab extends MusicObject {
480
+ readonly row: ObjScoreRow;
481
+ readonly tabConfig: TabConfig;
482
+ private top;
483
+ private bottom;
484
+ private readonly objects;
485
+ private readonly tuningName?;
486
+ private readonly tuningStrings;
487
+ readonly mi: MTab;
488
+ constructor(row: ObjScoreRow, tabConfig: TabConfig);
489
+ getMusicInterface(): MTab;
490
+ getTuningName(): string | undefined;
491
+ getTuningStrings(): ReadonlyArray<Note>;
492
+ /** Return Y coordinate of string. */
493
+ getStringY(stringId: number): number;
494
+ getTopStringY(): number;
495
+ getBottomStringY(): number;
496
+ getTop(): number;
497
+ getBottom(): number;
498
+ containsVoiceId(voiceId: number): boolean;
499
+ calcTop(): number;
500
+ calcBottom(): number;
501
+ addObject(o: NotationLineObject): void;
502
+ removeObjects(): void;
503
+ pick(x: number, y: number): MusicObject[];
504
+ layoutHeight(renderer: Renderer): void;
505
+ layoutWidth(renderer: Renderer): void;
506
+ offset(dx: number, dy: number): void;
507
+ draw(renderer: Renderer): void;
508
+ }
509
+
510
+ declare class ObjStaffNoteGroup extends MusicObject {
511
+ readonly staff: ObjStaff;
512
+ readonly noteGroup: ObjNoteGroup;
513
+ noteHeadRects: DivRect[];
514
+ dotRects: DivRect[];
515
+ accidentals: ObjAccidental[];
516
+ stemTip?: DivRect;
517
+ stemBase?: DivRect;
518
+ flagRects: DivRect[];
519
+ private prevTopNoteY;
520
+ private prevBottomNoteY;
521
+ readonly mi: MStaffNoteGroup;
522
+ constructor(staff: ObjStaff, noteGroup: ObjNoteGroup);
523
+ getMusicInterface(): MusicInterface;
524
+ pick(x: number, y: number): MusicObject[];
525
+ updateRect(): void;
526
+ getRect(): DivRect;
527
+ offset(dx: number, dy: number): void;
528
+ }
529
+ declare class ObjTabNoteGroup extends MusicObject {
530
+ readonly tab: ObjTab;
531
+ readonly noteGroup: ObjNoteGroup;
532
+ fretNumbers: ObjText[];
533
+ readonly mi: MTabNoteGroup;
534
+ constructor(tab: ObjTab, noteGroup: ObjNoteGroup);
535
+ getMusicInterface(): MusicInterface;
536
+ pick(x: number, y: number): MusicObject[];
537
+ updateRect(): void;
538
+ offset(dx: number, dy: number): void;
539
+ }
540
+ declare class ObjNoteGroup extends MusicObject {
541
+ readonly col: ObjRhythmColumn;
542
+ readonly voiceId: number;
543
+ readonly notes: ReadonlyArray<Note>;
544
+ readonly minDiatonicId: number;
545
+ readonly maxDiatonicId: number;
546
+ readonly ownDiatonicId: number;
547
+ readonly ownStemDir: Stem.Up | Stem.Down;
548
+ readonly ownString: StringNumber[];
549
+ readonly color: string;
550
+ readonly staccato: boolean;
551
+ readonly diamond: boolean;
552
+ readonly arpeggio: Arpeggio | undefined;
553
+ readonly rhythmProps: RhythmProps;
554
+ private startConnnectives;
555
+ private runningConnectives;
556
+ private leftBeamCount;
557
+ private rightBeamCount;
558
+ private beamGroup?;
559
+ private readonly staffObjects;
560
+ private readonly tabObjects;
561
+ readonly mi: MNoteGroup;
562
+ constructor(col: ObjRhythmColumn, voiceId: number, notes: ReadonlyArray<Note>, noteLength: NoteLength, options?: NoteOptions);
563
+ getMusicInterface(): MNoteGroup;
564
+ get doc(): ObjDocument;
565
+ get measure(): ObjMeasure;
566
+ get row(): ObjScoreRow;
567
+ get stemDir(): Stem.Up | Stem.Down;
568
+ get triplet(): boolean;
569
+ enableConnective(line: ObjStaff | ObjTab): boolean;
570
+ startConnective(connectiveProps: ConnectiveProps): void;
571
+ pick(x: number, y: number): MusicObject[];
572
+ getTopNote(): Note;
573
+ getBottomNote(): Note;
574
+ getConnectiveAnchorPoint(connectiveProps: ConnectiveProps, line: ObjStaff | ObjTab, noteIndex: number, noteAnchor: NoteAnchor, side: "left" | "right"): {
575
+ x: number;
576
+ y: number;
577
+ };
578
+ getFretNumberString(noteIndex: number): number | undefined;
579
+ getFretNumber(tabObj: ObjTabNoteGroup, noteIndex: number): number | undefined;
580
+ private getNextNoteGroup;
581
+ collectConnectiveProps(): void;
582
+ removeConnectiveProps(): void;
583
+ getPlaySlur(): "first" | "slurred" | undefined;
584
+ getBeamGroup(): ObjBeamGroup | undefined;
585
+ setBeamGroup(beam: ObjBeamGroup): void;
586
+ resetBeamGroup(): void;
587
+ getBeamCoords(): ({
588
+ staff: ObjStaff;
589
+ x: number;
590
+ y: number;
591
+ stemHeight: number;
592
+ } | undefined)[];
593
+ getStemHeight(renderer: Renderer): number;
594
+ hasBeamCount(): boolean;
595
+ getLeftBeamCount(): number;
596
+ getRightBeamCount(): number;
597
+ isEmpty(): boolean;
598
+ visibleInStaff(staff: ObjStaff): boolean;
599
+ getPlayTicks(note: Note): number;
600
+ updateAccidentalState(accState: AccidentalState): void;
601
+ layout(renderer: Renderer, accState: AccidentalState): void;
602
+ updateRect(): void;
603
+ setStemTipY(staff: ObjStaff, stemTipY: number): void;
604
+ offset(dx: number, dy: number): void;
605
+ draw(renderer: Renderer): void;
606
+ static setBeamCounts(groupNotes: (ObjNoteGroup | undefined)[]): void;
607
+ static setTripletBeamCounts(triplet: ObjBeamGroup): void;
608
+ getDotVerticalDisplacement(staff: ObjStaff, diatonicId: number, stemDir: Stem): 1 | 0 | -1;
609
+ static hasSameNotes(ng1: ObjNoteGroup, ng2: ObjNoteGroup): boolean;
610
+ }
611
+
612
+ declare enum BeamGroupType {
613
+ RegularBeam = 0,
614
+ TripletBeam = 1,
615
+ TripletGroup = 2
616
+ }
617
+ declare class BeamPoint {
618
+ staff: ObjStaff;
619
+ beamGroup: ObjBeamGroup;
620
+ symbol: RhythmSymbol;
621
+ x: number;
622
+ y: number;
623
+ topBeamsHeight: number;
624
+ bottomBeamsHeight: number;
625
+ constructor(staff: ObjStaff, beamGroup: ObjBeamGroup, symbol: RhythmSymbol, x: number, y: number);
626
+ offset(dx: number, dy: number): void;
627
+ getRect(): DivRect;
628
+ }
629
+ declare class ObjStaffBeamGroup extends MusicObject {
630
+ readonly staff: ObjStaff;
631
+ readonly beamGroup: ObjBeamGroup;
632
+ tripletNumber?: ObjText;
633
+ tripletNumberOffsetY: number;
634
+ points: BeamPoint[];
635
+ readonly mi: MStaffBeamGroup;
636
+ constructor(staff: ObjStaff, beamGroup: ObjBeamGroup);
637
+ getMusicInterface(): MusicInterface;
638
+ pick(x: number, y: number): MusicObject[];
639
+ offset(dx: number, dy: number): void;
640
+ updateRect(): void;
641
+ }
642
+ declare class ObjBeamGroup extends MusicObject {
643
+ private readonly symbols;
644
+ readonly mi: MBeamGroup;
645
+ private readonly type;
646
+ private readonly staffObjects;
647
+ private constructor();
648
+ static createBeam(noteGroups: ObjNoteGroup[]): void;
649
+ static createTriplet(symbols: RhythmSymbol[]): boolean;
650
+ getMusicInterface(): MBeamGroup;
651
+ detach(): void;
652
+ isEmpty(): boolean;
653
+ pick(x: number, y: number): MusicObject[];
654
+ getType(): BeamGroupType;
655
+ isTriplet(): boolean;
656
+ getSymbols(): ReadonlyArray<RhythmSymbol>;
657
+ getFirstSymbol(): RhythmSymbol | undefined;
658
+ getLastSymbol(): RhythmSymbol | undefined;
659
+ get stemDir(): Stem.Up | Stem.Down;
660
+ layout(renderer: Renderer): void;
661
+ updateRect(): void;
662
+ updateStemTips(): void;
663
+ offset(dx: number, dy: number): void;
664
+ draw(renderer: Renderer): void;
665
+ }
666
+
667
+ declare class ObjStaffRest extends MusicObject {
668
+ readonly staff: ObjStaff;
669
+ readonly rest: ObjRest;
670
+ restRect: DivRect;
671
+ dotRect?: DivRect;
672
+ readonly mi: MStaffRest;
673
+ constructor(staff: ObjStaff, rest: ObjRest);
674
+ getMusicInterface(): MusicInterface;
675
+ pick(x: number, y: number): MusicObject[];
676
+ offset(dx: number, dy: number): void;
677
+ updateRect(): void;
678
+ }
679
+ declare class ObjRest extends MusicObject {
680
+ readonly col: ObjRhythmColumn;
681
+ readonly voiceId: number;
682
+ readonly ownStemDir: Stem.Up | Stem.Down;
683
+ readonly ownDiatonicId: number;
684
+ readonly color: string;
685
+ readonly hide: boolean;
686
+ readonly rhythmProps: RhythmProps;
687
+ private beamGroup?;
688
+ readonly staffObjects: ObjStaffRest[];
689
+ readonly mi: MRest;
690
+ constructor(col: ObjRhythmColumn, voiceId: number, noteLength: NoteLength, options?: RestOptions);
691
+ getMusicInterface(): MRest;
692
+ get doc(): ObjDocument;
693
+ get measure(): ObjMeasure;
694
+ get row(): ObjScoreRow;
695
+ get noteLength(): NoteLength;
696
+ get dotted(): boolean;
697
+ get stemDir(): Stem.Up | Stem.Down;
698
+ get triplet(): boolean;
699
+ pick(x: number, y: number): MusicObject[];
700
+ getBeamGroup(): ObjBeamGroup | undefined;
701
+ setBeamGroup(beam: ObjBeamGroup): void;
702
+ resetBeamGroup(): void;
703
+ getBeamCoords(): ({
704
+ staff: ObjStaff;
705
+ x: number;
706
+ y: number;
707
+ stemHeight: number;
708
+ } | undefined)[];
709
+ isEmpty(): boolean;
710
+ visibleInStaff(staff: ObjStaff): boolean;
711
+ private getRestDotVerticalDisplacement;
712
+ updateAccidentalState(accState: AccidentalState): void;
713
+ layout(renderer: Renderer, accState: AccidentalState): void;
714
+ updateRect(): void;
715
+ offset(dx: number, dy: number): void;
716
+ draw(renderer: Renderer): void;
717
+ }
718
+
719
+ type ScorePlayerNote = {
720
+ note: Note;
721
+ ticks: number;
722
+ staccato: boolean;
723
+ slur: undefined | "first" | "slurred";
724
+ };
725
+ type RhythmSymbol = ObjNoteGroup | ObjRest;
726
+ declare class ObjRhythmColumn extends MusicObject {
727
+ readonly measure: ObjMeasure;
728
+ readonly positionTicks: number;
729
+ private readonly voiceSymbol;
730
+ private minDiatonicId?;
731
+ private maxDiatonicId?;
732
+ private staffMinDiatonicId;
733
+ private staffMaxDiatonicId;
734
+ private arpeggioDir;
735
+ private arpeggios;
736
+ private noteHeadDisplacements;
737
+ private readonly playerProps;
738
+ private needLayout;
739
+ private shapeRects;
740
+ readonly mi: MRhythmColumn;
741
+ constructor(measure: ObjMeasure, positionTicks: number);
742
+ getMusicInterface(): MRhythmColumn;
743
+ getPlayerProps(): PlayerColumnProps;
744
+ /**
745
+ * Get next column in column's measure.
746
+ * @returns
747
+ */
748
+ getNextColumnInMeasure(): ObjRhythmColumn | undefined;
749
+ /**
750
+ * Get next column. Goes into next measure if necessary.
751
+ * Does not care navigation elements: repeats, endings, etc.
752
+ * @returns
753
+ */
754
+ getNextColumn(): ObjRhythmColumn | undefined;
755
+ getTicksToNextColumn(): number;
756
+ getShapeRects(): DivRect[];
757
+ get doc(): ObjDocument;
758
+ get row(): ObjScoreRow;
759
+ pick(x: number, y: number): MusicObject[];
760
+ hasArpeggio(): boolean;
761
+ getArpeggioDir(): Arpeggio;
762
+ setVoiceSymbol(voiceId: number, symbol: RhythmSymbol): void;
763
+ getVoiceSymbol(voiceId: number): RhythmSymbol | undefined;
764
+ getMinWidth(): number;
765
+ setupNoteHeadDisplacements(): void;
766
+ getNoteHeadDisplacement(noteGroup: ObjNoteGroup, note: Note): -1 | 0 | 1;
767
+ isEmpty(): boolean;
768
+ getPlayerNotes(): ScorePlayerNote[];
769
+ requestLayout(): void;
770
+ layout(renderer: Renderer, accState: AccidentalState): void;
771
+ layoutDone(): void;
772
+ updateRect(): void;
773
+ offset(dx: number, dy: number): void;
774
+ draw(renderer: Renderer): void;
775
+ }
776
+
777
+ type PlayerColumn = ObjRhythmColumn | ObjBarLineRight;
778
+ declare class PlayerColumnProps {
779
+ readonly col: PlayerColumn;
780
+ private speed;
781
+ private volume;
782
+ constructor(col: PlayerColumn);
783
+ get measure(): ObjMeasure;
784
+ reset(): void;
785
+ setSpeed(speed: number): void;
786
+ getSpeed(): number;
787
+ getTempo(): Tempo;
788
+ setVolume(volume: number): void;
789
+ getVolume(): number;
790
+ hasFermata(): boolean;
791
+ getFermataHoldTicks(): number;
792
+ }
793
+
794
+ declare enum BarLineType {
795
+ None = 0,
796
+ Single = 1,
797
+ Double = 2,
798
+ EndSong = 3,
799
+ StartRepeat = 4,
800
+ EndRepeat = 5,
801
+ EndStartRepeat = 6
802
+ }
803
+ declare class ObjStaffTabBarLine extends MusicObject {
804
+ readonly line: ObjStaff | ObjTab;
805
+ lineRects: DivRect[];
806
+ dotRects: DivRect[];
807
+ readonly mi: MStaffTabBarLine;
808
+ constructor(line: ObjStaff | ObjTab);
809
+ getMusicInterface(): MusicInterface;
810
+ pick(x: number, y: number): MusicObject[];
811
+ setRect(r: DivRect): void;
812
+ offset(dx: number, dy: number): void;
813
+ }
814
+ declare abstract class ObjBarLine extends MusicObject {
815
+ readonly measure: ObjMeasure;
816
+ protected staffTabObjects: ObjStaffTabBarLine[];
817
+ protected barLineType: BarLineType;
818
+ constructor(measure: ObjMeasure);
819
+ abstract solveBarLineType(): BarLineType;
820
+ pick(x: number, y: number): MusicObject[];
821
+ layout(renderer: Renderer): void;
822
+ updateRect(): void;
823
+ offset(dx: number, dy: number): void;
824
+ draw(renderer: Renderer): void;
825
+ }
826
+ declare class ObjBarLineLeft extends ObjBarLine {
827
+ readonly mi: MBarLineLeft;
828
+ constructor(measure: ObjMeasure);
829
+ getMusicInterface(): MBarLineLeft;
830
+ solveBarLineType(): BarLineType;
831
+ }
832
+ declare class ObjBarLineRight extends ObjBarLine {
833
+ private readonly playerProps;
834
+ readonly mi: MBarLineRight;
835
+ constructor(measure: ObjMeasure);
836
+ getMusicInterface(): MBarLineRight;
837
+ getPlayerProps(): PlayerColumnProps;
838
+ solveBarLineType(): BarLineType;
839
+ }
840
+
841
+ declare class ObjConnective extends MusicObject {
842
+ readonly connectiveProps: ConnectiveProps;
843
+ readonly line: ObjStaff | ObjTab;
844
+ readonly measure: ObjMeasure;
845
+ private lx;
846
+ private ly;
847
+ private rx;
848
+ private ry;
849
+ private cp1x;
850
+ private cp1y;
851
+ private cp2x;
852
+ private cp2y;
853
+ private arcHeight;
854
+ private readonly leftNoteGroup;
855
+ private readonly leftNoteId;
856
+ private readonly rightNoteGroup?;
857
+ private readonly rightNoteId?;
858
+ private readonly tieType?;
859
+ readonly mi: MConnective;
860
+ constructor(connectiveProps: ConnectiveProps, line: ObjStaff | ObjTab, measure: ObjMeasure, leftNoteGroup: ObjNoteGroup, leftNoteId: number, rightNoteGroup: ObjNoteGroup, rightNoteId: number);
861
+ constructor(connectiveProps: ConnectiveProps, line: ObjStaff | ObjTab, measure: ObjMeasure, leftNoteGroup: ObjNoteGroup, leftNoteId: number, tie: TieType);
862
+ getMusicInterface(): MConnective;
863
+ isInsideMeasure(): boolean;
864
+ pick(x: number, y: number): MusicObject[];
865
+ layout(renderer: Renderer): void;
866
+ offset(dx: number, dy: number): void;
867
+ draw(renderer: Renderer): void;
868
+ }
869
+
870
+ declare class ObjMeasure extends MusicObject {
871
+ readonly row: ObjScoreRow;
872
+ static readonly MinFlexContentWidth = 10;
873
+ private prevMeasure;
874
+ private nextMeasure;
875
+ private keySignature;
876
+ private timeSignature;
877
+ private tempo;
878
+ private alterKeySignature?;
879
+ private alterTimeSignature?;
880
+ private alterTempo?;
881
+ private signatures;
882
+ private tabStringNotes;
883
+ private barLineLeft;
884
+ private columns;
885
+ private barLineRight;
886
+ private connectives;
887
+ private beamGroups;
888
+ private tabStringNotesWidth;
889
+ private measureId;
890
+ private needLayout;
891
+ private leftSolidAreaWidth;
892
+ private minColumnsAreaWidth;
893
+ private rightSolidAreaWidth;
894
+ private useDiatonicId;
895
+ private useStemDir;
896
+ private useString;
897
+ private voiceSymbols;
898
+ private lastAddedRhythmColumn?;
899
+ private lastAddedRhythmSymbol?;
900
+ private addExtensionToMusicObject?;
901
+ private layoutObjects;
902
+ private postMeasureBreakWidth;
903
+ private passCount;
904
+ private needBeamsUpdate;
905
+ private navigationSet;
906
+ private isEndSong;
907
+ private isEndSection;
908
+ private endRepeatPlayCount;
909
+ private endRepeatPlayCountText?;
910
+ readonly mi: MMeasure;
911
+ constructor(row: ObjScoreRow);
912
+ getMusicInterface(): MMeasure;
913
+ get doc(): ObjDocument;
914
+ isPartialMeasure(): boolean;
915
+ isUpBeat(): boolean;
916
+ resetPassCount(): void;
917
+ incPassCount(): void;
918
+ getPassCount(): number;
919
+ updateOwnDiatonicId(voiceId: number, setDiatonicId?: number): number;
920
+ updateOwnStemDir(symbol: RhythmSymbol, setStemDir?: Stem): Stem.Up | Stem.Down;
921
+ updateOwnString(symbol: RhythmSymbol, setString?: StringNumber[]): StringNumber[];
922
+ pick(x: number, y: number): MusicObject[];
923
+ getMeasureNumber(): number;
924
+ getColumns(): ReadonlyArray<ObjRhythmColumn>;
925
+ getColumnCount(): number;
926
+ getColumn(columnId: number): ObjRhythmColumn | undefined;
927
+ isFirstMeasure(): boolean;
928
+ isLastMeasure(): boolean;
929
+ getNextMeasure(): ObjMeasure | undefined;
930
+ getPrevMeasure(): ObjMeasure | undefined;
931
+ getKeySignature(): KeySignature;
932
+ setKeySignature(...args: unknown[]): void;
933
+ updateKeySignature(): void;
934
+ getTimeSignature(): TimeSignature;
935
+ setTimeSignature(timeSignature: TimeSignature | TimeSignatureString): void;
936
+ updateTimeSignature(): void;
937
+ getTempo(): Tempo;
938
+ setTempo(beatsPerMinute: number, beatLength?: NoteLength, dotted?: boolean): void;
939
+ updateTempo(): void;
940
+ hasPostMeasureBreak(): boolean;
941
+ getPostMeasureBreakWidth(): number;
942
+ private addLayoutObject;
943
+ addFermata(fermata: Fermata): void;
944
+ hasFermata(anchor: ObjRhythmColumn | ObjBarLineRight): boolean;
945
+ addNavigation(navigation: Navigation, ...args: unknown[]): void;
946
+ hasNavigation(n: Navigation): boolean;
947
+ getEnding(): ObjEnding | undefined;
948
+ getEndRepeatPlayCount(): number;
949
+ addConnective(connective: Connective.Tie, tieSpan?: number | TieType, notAnchor?: NoteAnchor): void;
950
+ addConnective(connective: Connective.Slur, slurSpan?: number, notAnchor?: NoteAnchor): void;
951
+ addConnective(connective: Connective.Slide, notAnchor?: NoteAnchor): void;
952
+ addLabel(label: Label, text: string): void;
953
+ addAnnotation(annotation: Annotation, text: string): void;
954
+ endSong(): void;
955
+ hasEndSong(): boolean;
956
+ endSection(): void;
957
+ hasEndSection(): boolean;
958
+ endRow(): void;
959
+ private enableExtension;
960
+ private disableExtension;
961
+ addExtension(extensionLength: number, extensionVisible: boolean): void;
962
+ private addRhythmSymbol;
963
+ addNoteGroup(voiceId: number, notes: (Note | string)[], noteLength: NoteLength, options?: NoteOptions): void;
964
+ addRest(voiceId: number, restLength: NoteLength, options?: RestOptions): void;
965
+ /**
966
+ *
967
+ * @param positionTicks - get ObjRhythmColumn with positionTicks. Insert new if necessary.
968
+ * @returns
969
+ */
970
+ private getRhythmColumn;
971
+ getMeasureTicks(): number;
972
+ getConsumedTicks(voiceId?: number): number;
973
+ getColumnsContentRect(): DivRect;
974
+ getLeftSolidAreaWidth(): number;
975
+ getMinColumnsAreaWidth(): number;
976
+ getRightSolidAreaWidth(): number;
977
+ getSolidAreaWidth(): number;
978
+ getMinWidth(): number;
979
+ getStaffLineLeft(): number;
980
+ getStaffLineRight(): number;
981
+ getStaticObjects(): ReadonlyArray<ObjRhythmColumn | LayoutableMusicObject>;
982
+ removeLayoutObjects(musicObj: MusicObject): void;
983
+ addConnectiveObject(connective: ObjConnective): void;
984
+ removeConnectiveObjects(): void;
985
+ createExtensions(): void;
986
+ addBeamGroup(beam: ObjBeamGroup): void;
987
+ requestBeamsUpdate(): void;
988
+ createBeams(): void;
989
+ private static setupBeamGroup;
990
+ getBarLineLeft(): ObjBarLineLeft;
991
+ getBarLineRight(): ObjBarLineRight;
992
+ getVoiceSymbols(voiceId: number): ReadonlyArray<RhythmSymbol>;
993
+ completeRests(voiceId?: number): void;
994
+ requestLayout(): void;
995
+ layout(renderer: Renderer): void;
996
+ layoutWidth(renderer: Renderer, width: number): void;
997
+ layoutConnectives(renderer: Renderer): void;
998
+ layoutBeams(renderer: Renderer): void;
999
+ alignStemsToBeams(): void;
1000
+ layoutDone(): void;
1001
+ updateRect(): void;
1002
+ offset(dx: number, dy: number): void;
1003
+ draw(renderer: Renderer): void;
1004
+ }
1005
+
1006
+ declare class ObjScoreRow extends MusicObject {
1007
+ readonly doc: ObjDocument;
1008
+ private readonly prevRow;
1009
+ private readonly scoreConfig;
1010
+ private nextRow?;
1011
+ private minWidth;
1012
+ private readonly notationLines;
1013
+ private readonly staves;
1014
+ private readonly tabs;
1015
+ private readonly measures;
1016
+ private needLayout;
1017
+ readonly mi: MScoreRow;
1018
+ constructor(doc: ObjDocument, prevRow: ObjScoreRow | undefined, scoreConfig: (StaffConfig | TabConfig)[]);
1019
+ getMusicInterface(): MScoreRow;
1020
+ private createNotationLines;
1021
+ getNotationLines(): ReadonlyArray<ObjStaff | ObjTab>;
1022
+ getStaves(): ReadonlyArray<ObjStaff>;
1023
+ getTabs(): ReadonlyArray<ObjTab>;
1024
+ get hasStaff(): boolean;
1025
+ get hasTab(): boolean;
1026
+ getTopStaff(): ObjStaff;
1027
+ getBottomStaff(): ObjStaff;
1028
+ getStaff(diatonicId: number): ObjStaff | undefined;
1029
+ pick(x: number, y: number): MusicObject[];
1030
+ getConnectivesContentRect(): DivRect;
1031
+ getDiatonicIdAt(y: number): number | undefined;
1032
+ addMeasure(m: ObjMeasure): void;
1033
+ getMeasures(): ReadonlyArray<ObjMeasure>;
1034
+ isFirstRow(): boolean;
1035
+ isLastRow(): boolean;
1036
+ getPrevRow(): ObjScoreRow | undefined;
1037
+ getNextRow(): ObjScoreRow | undefined;
1038
+ getFirstMeasure(): ObjMeasure | undefined;
1039
+ getLastMeasure(): ObjMeasure | undefined;
1040
+ getMinWidth(): number;
1041
+ requestLayout(): void;
1042
+ layout(renderer: Renderer): void;
1043
+ layoutWidth(renderer: Renderer, width: number): void;
1044
+ alignStemsToBeams(): void;
1045
+ layoutPositionLines(renderer: Renderer): void;
1046
+ updateRect(): void;
1047
+ private setObjectY;
1048
+ private alignObjectsY;
1049
+ layoutLayoutGroup(renderer: Renderer, layoutGroup: LayoutGroup, verticalPos: VerticalPos): void;
1050
+ layoutPadding(renderer: Renderer): void;
1051
+ layoutDone(): void;
1052
+ offset(dx: number, dy: number): void;
1053
+ draw(renderer: Renderer): void;
1054
+ }
1055
+
1056
+ declare class ObjDocument extends MusicObject {
1057
+ private needLayout;
1058
+ private renderer?;
1059
+ private readonly rows;
1060
+ private readonly measures;
1061
+ private measuresPerRow;
1062
+ private curScoreConfig;
1063
+ private header?;
1064
+ private layoutGroups;
1065
+ private newRowRequested;
1066
+ private allConnectiveProps;
1067
+ private readonly mi;
1068
+ constructor();
1069
+ getMusicInterface(): MDocument;
1070
+ setScoreConfiguration(config: StaffPreset | ScoreConfiguration): void;
1071
+ setMeasuresPerRow(measuresPerRow: number): void;
1072
+ addConnectiveProps(connectiveProps: ConnectiveProps): void;
1073
+ getLayoutGroup(lauoutGroupId: LayoutGroupId): LayoutGroup;
1074
+ setRenderer(renderer?: Renderer): void;
1075
+ setHeader(title?: string, composer?: string, arranger?: string): void;
1076
+ getTitle(): string | undefined;
1077
+ getComposer(): string | undefined;
1078
+ getArranger(): string | undefined;
1079
+ hasSingleMeasure(): boolean;
1080
+ getFirstMeasure(): ObjMeasure | undefined;
1081
+ getLastMeasure(): ObjMeasure | undefined;
1082
+ private addNewRow;
1083
+ getFirstRow(): ObjScoreRow;
1084
+ getLastRow(): ObjScoreRow;
1085
+ requestNewRow(): void;
1086
+ addMeasure(): ObjMeasure;
1087
+ getVoiceSymbols(voiceId: number): ReadonlyArray<RhythmSymbol>;
1088
+ removeLayoutObjects(musicObj: MusicObject): void;
1089
+ private forEachMeasure;
1090
+ resetMeasures(): void;
1091
+ updateCursorRect(cursorRect?: DivRect): void;
1092
+ requestLayout(): void;
1093
+ requestFullLayout(): void;
1094
+ layout(): void;
1095
+ drawContent(): void;
1096
+ pickStaffPosAt(x: number, y: number): {
1097
+ scoreRow: ObjScoreRow;
1098
+ diatonicId: number;
1099
+ } | undefined;
1100
+ pick(x: number, y: number): MusicObject[];
1101
+ }
1102
+
1103
+ declare enum ImageAsset {
1104
+ TrebleClefPng = 0,
1105
+ BassClefPng = 1
1106
+ }
1107
+ declare class Renderer {
1108
+ private readonly mi;
1109
+ readonly devicePixelRatio: number;
1110
+ readonly fontSize: number;
1111
+ readonly unitSize: number;
1112
+ readonly lineWidth: number;
1113
+ readonly beamThickness: number;
1114
+ private scoreEventListener?;
1115
+ private canvas?;
1116
+ private ctx?;
1117
+ private mdoc?;
1118
+ private cursorRect?;
1119
+ private mousePos?;
1120
+ private curStaffPos?;
1121
+ private curObjects?;
1122
+ private hilightedStaffPos?;
1123
+ private hilightedObj?;
1124
+ private usingTouch;
1125
+ private onClickFn;
1126
+ private onMouseMoveFn;
1127
+ private onMouseLeaveFn;
1128
+ private onTouchEndFn;
1129
+ constructor(mi: MRenderer);
1130
+ getMusicInterface(): MRenderer;
1131
+ get doc(): ObjDocument | undefined;
1132
+ private finishImageAsset;
1133
+ getImageAsset(imageAsset: ImageAsset): HTMLImageElement | undefined;
1134
+ setDocument(mdoc?: MDocument): void;
1135
+ setCanvas(canvas: HTMLCanvasElement): void;
1136
+ setScoreEventListener(fn: ScoreEventListener): void;
1137
+ needMouseInput(): boolean;
1138
+ getMousePos(e: MouseEvent): Vec2;
1139
+ private updateCurStaffPos;
1140
+ private updateCurObjects;
1141
+ onClick(e: MouseEvent): void;
1142
+ onMouseMove(e: MouseEvent): void;
1143
+ onMouseLeave(e: MouseEvent): void;
1144
+ onTouchEnd(e: TouchEvent): void;
1145
+ onLoad(): void;
1146
+ hilightObject(obj?: MusicObject): void;
1147
+ hilightStaffPos(staffPos?: {
1148
+ scoreRow: ObjScoreRow;
1149
+ diatonicId: number;
1150
+ }): void;
1151
+ updateCursorRect(cursorRect: DivRect | undefined): void;
1152
+ updateCanvasSize(): void;
1153
+ draw(): void;
1154
+ drawHilightStaffPosRect(): void;
1155
+ drawHilightObjectRect(): void;
1156
+ drawPlayCursor(): void;
1157
+ txFromScreenCoord(screenCoord: Vec2): Vec2;
1158
+ txToScreenCoord(coord: Vec2): Vec2;
1159
+ getCanvasContext(): CanvasRenderingContext2D | undefined;
1160
+ clearCanvas(): void;
1161
+ getTextWidth(text: string, font: string): number;
1162
+ drawDebugRect(r: DivRect): void;
1163
+ fillCircle(x: number, y: number, radius: number, color?: string): void;
1164
+ drawLine(startX: number, startY: number, endX: number, endY: number, color?: string, lineWidth?: number): void;
1165
+ drawPartialLine(startX: number, startY: number, endX: number, endY: number, startT: number, endT: number, color?: string, lineWidth?: number): void;
1166
+ drawLedgerLines(staff: ObjStaff, diatonicId: number, x: number): void;
1167
+ }
1168
+
1169
+ declare class ObjEnding extends MusicObject {
1170
+ readonly measure: ObjMeasure;
1171
+ readonly passages: number[];
1172
+ private endingText;
1173
+ private shapeRects;
1174
+ readonly mi: MEnding;
1175
+ constructor(measure: ObjMeasure, passages: number[]);
1176
+ getMusicInterface(): MEnding;
1177
+ getShapeRects(): DivRect[];
1178
+ isSingleMeasureEnding(): boolean;
1179
+ hasPassage(pass: number): boolean;
1180
+ getHighestPassage(): number;
1181
+ pick(x: number, y: number): MusicObject[];
1182
+ layout(renderer: Renderer): void;
1183
+ layoutFitToMeasure(renderer: Renderer): void;
1184
+ offset(dx: number, dy: number): void;
1185
+ draw(renderer: Renderer): void;
1186
+ }
1187
+
1188
+ declare class ObjFermata extends MusicObject {
1189
+ readonly pos: VerticalPos;
1190
+ private color;
1191
+ readonly mi: MFermata;
1192
+ constructor(parent: ObjRhythmColumn | ObjBarLineRight, pos: VerticalPos);
1193
+ getMusicInterface(): MFermata;
1194
+ static getFermataPositions(anchor: ObjRhythmColumn | ObjBarLineRight): VerticalPos[];
1195
+ pick(x: number, y: number): MusicObject[];
1196
+ layout(renderer: Renderer): void;
1197
+ offset(dx: number, dy: number): void;
1198
+ draw(renderer: Renderer): void;
1199
+ }
1200
+
1201
+ declare class ObjSpecialText extends MusicObject {
1202
+ readonly text: string;
1203
+ static toCoda: string;
1204
+ static Coda: string;
1205
+ static Segno: string;
1206
+ private components;
1207
+ readonly mi: MSpecialText;
1208
+ constructor(parent: MusicObject, text: string);
1209
+ getMusicInterface(): MSpecialText;
1210
+ getText(): string;
1211
+ pick(x: number, y: number): MusicObject[];
1212
+ layout(renderer: Renderer): void;
1213
+ offset(dx: number, dy: number): void;
1214
+ draw(renderer: Renderer): void;
1215
+ }
1216
+
1217
+ type ExtensionLineStyle = "solid" | "dashed";
1218
+ type ExtensionLinePos = "bottom" | "middle";
1219
+ type ExtensionRangeInfo = {
1220
+ startColumn: ObjRhythmColumn;
1221
+ endColumn: ObjRhythmColumn;
1222
+ columnRange: ObjRhythmColumn[];
1223
+ extensionBreakText?: string;
1224
+ };
1225
+ declare class Extension extends MusicObjectLink {
1226
+ private readonly length;
1227
+ private readonly visible;
1228
+ private readonly lineStyle;
1229
+ private readonly linePos;
1230
+ private readonly startColumn;
1231
+ private readonly context;
1232
+ constructor(head: MusicObject, startColumn: ObjRhythmColumn, length: number, visible: boolean, lineStyle: ExtensionLineStyle, linePos: ExtensionLinePos);
1233
+ isVisible(): boolean;
1234
+ getLineStyle(): ExtensionLineStyle;
1235
+ getLinePos(): ExtensionLinePos;
1236
+ private getSpanBreakText;
1237
+ getExtensionRangeInfo(): ExtensionRangeInfo;
1238
+ }
1239
+
1240
+ type ExtensionLineLeftObj = ObjBarLineLeft | MusicObject;
1241
+ type ExtensionLineRightObj = ObjRhythmColumn | ObjBarLineRight;
1242
+ declare class ObjExtensionLine extends MusicObject {
1243
+ readonly measure: ObjMeasure;
1244
+ readonly extension: Extension;
1245
+ readonly leftObj: ExtensionLineLeftObj;
1246
+ readonly rightObj: ExtensionLineRightObj;
1247
+ readonly mi: MExtensionLine;
1248
+ constructor(measure: ObjMeasure, extension: Extension, leftObj: ExtensionLineLeftObj, rightObj: ExtensionLineRightObj);
1249
+ get row(): ObjScoreRow;
1250
+ getMusicInterface(): MExtensionLine;
1251
+ private getLineLeft;
1252
+ private getLineRight;
1253
+ layoutFitToMeasure(renderer: Renderer): void;
1254
+ pick(x: number, y: number): MusicObject[];
1255
+ layout(renderer: Renderer): void;
1256
+ offset(dx: number, dy: number): void;
1257
+ draw(renderer: Renderer): void;
1258
+ }
1259
+
1260
+ declare enum LayoutGroupId {
1261
+ Fermata = 0,
1262
+ NoteLabel = 1,
1263
+ Navigation = 2,
1264
+ Ending = 3,
1265
+ TempoAnnotation = 4,
1266
+ DynamicsAnnotation = 5,
1267
+ ChordLabel = 6
1268
+ }
1269
+ declare enum VerticalPos {
1270
+ AboveStaff = 0,
1271
+ BelowStaff = 1
1272
+ }
1273
+ type LayoutableMusicObject = ObjText | ObjSpecialText | ObjExtensionLine | ObjFermata | ObjEnding;
1274
+ declare class LayoutObjectWrapper {
1275
+ readonly musicObj: LayoutableMusicObject;
1276
+ readonly layoutGroupId: LayoutGroupId;
1277
+ readonly verticalPos: VerticalPos;
1278
+ readonly anchor: MusicObject;
1279
+ readonly measure: ObjMeasure;
1280
+ readonly row: ObjScoreRow;
1281
+ readonly layoutGroup: LayoutGroup;
1282
+ private positionResolved;
1283
+ constructor(musicObj: LayoutableMusicObject, layoutGroupId: LayoutGroupId, verticalPos: VerticalPos);
1284
+ clearPositionResolved(): void;
1285
+ setPositionResolved(): void;
1286
+ isPositionResolved(): boolean;
1287
+ resolveClosestToStaffY(renderer: Renderer): number;
1288
+ getTextContent(): string | undefined;
1289
+ }
1290
+ declare class LayoutGroup {
1291
+ readonly layoutGroupId: number;
1292
+ private readonly layoutObjectTable;
1293
+ readonly rowAlign: boolean;
1294
+ readonly widensColumn: boolean;
1295
+ constructor(layoutGroupId: number);
1296
+ getLayoutObjects(verticalPos: VerticalPos): Readonly<LayoutObjectWrapper[]>;
1297
+ add(layoutObj: LayoutObjectWrapper): void;
1298
+ remove(layoutObj: LayoutObjectWrapper): void;
1299
+ clearPositionAndLayout(renderer: Renderer): void;
1300
+ }
1301
+
1302
+ declare class MusicObjectLink {
1303
+ private head;
1304
+ private tail;
1305
+ constructor(head: MusicObject);
1306
+ getHead(): MusicObject;
1307
+ getTails(): ReadonlyArray<MusicObject>;
1308
+ addTail(obj: MusicObject): void;
1309
+ detachTail(obj: MusicObject): void;
1310
+ }
1311
+ declare abstract class MusicObject {
1312
+ protected readonly parent: MusicObject | undefined;
1313
+ private anchoredLayoutObjects;
1314
+ private link?;
1315
+ constructor(parent: MusicObject | undefined);
1316
+ abstract getMusicInterface(): MusicInterface;
1317
+ getParent(): MusicObject | undefined;
1318
+ protected rect: DivRect;
1319
+ private needRectUpdate;
1320
+ requestRectUpdate(): void;
1321
+ updateRect(): void;
1322
+ getRect(): DivRect;
1323
+ /**
1324
+ * Most objects are simple rects in shape.
1325
+ * Some objects might be more complex consisting of multiple rects.
1326
+ * These rects are used to dodge overlapping objects.
1327
+ *
1328
+ * @returns Array of rects.
1329
+ */
1330
+ getShapeRects(): DivRect[];
1331
+ /**
1332
+ * Pick objects.
1333
+ *
1334
+ * @param x - X-coordinate.
1335
+ * @param y - Y-coordinate.
1336
+ * @returns Array of objects under (x, y)-coordinate in hierarchical order. Last object in array is the top-most object.
1337
+ */
1338
+ abstract pick(x: number, y: number): MusicObject[];
1339
+ addAnchoredLayoutObject(layoutObj: LayoutObjectWrapper): void;
1340
+ getAnchoredLayoutObjects(): ReadonlyArray<LayoutObjectWrapper>;
1341
+ setLink(link: MusicObjectLink): void;
1342
+ getLink(): MusicObjectLink | undefined;
1343
+ isLinked(): boolean;
1344
+ }
1345
+
1346
+ declare class ObjArpeggio extends MusicObject {
1347
+ readonly col: ObjRhythmColumn;
1348
+ readonly arpeggioDir: Arpeggio;
1349
+ private topArrowHeight;
1350
+ private bottomArrowHeight;
1351
+ private static NumCycles;
1352
+ private cycleHeight;
1353
+ private color;
1354
+ readonly mi: MArpeggio;
1355
+ constructor(col: ObjRhythmColumn, arpeggioDir: Arpeggio);
1356
+ getMusicInterface(): MArpeggio;
1357
+ pick(x: number, y: number): MusicObject[];
1358
+ layout(renderer: Renderer): void;
1359
+ offset(dx: number, dy: number): void;
1360
+ draw(renderer: Renderer): void;
1361
+ }
1362
+
1363
+ declare class ObjHeader extends MusicObject {
1364
+ readonly title?: string | undefined;
1365
+ readonly composer?: string | undefined;
1366
+ readonly arranger?: string | undefined;
1367
+ private titleText?;
1368
+ private composerText?;
1369
+ private arrangerText?;
1370
+ readonly mi: MHeader;
1371
+ constructor(doc: ObjDocument, title?: string | undefined, composer?: string | undefined, arranger?: string | undefined);
1372
+ getMusicInterface(): MHeader;
1373
+ pick(x: number, y: number): MusicObject[];
1374
+ layoutWidth(renderer: Renderer, width: number): void;
1375
+ offset(dx: number, dy: number): void;
1376
+ draw(renderer: Renderer): void;
1377
+ }
1378
+
1379
+ declare class ObjImage extends MusicObject {
1380
+ readonly image: HTMLImageElement;
1381
+ readonly anchorX: number;
1382
+ readonly anchorY: number;
1383
+ readonly imageScale: number;
1384
+ readonly mi: MImage;
1385
+ constructor(parent: MusicObject, image: HTMLImageElement, anchorX: number, anchorY: number, imageScale: number);
1386
+ getMusicInterface(): MImage;
1387
+ pick(x: number, y: number): MusicObject[];
1388
+ layout(renderer: Renderer): void;
1389
+ offset(dx: number, dy: number): void;
1390
+ draw(renderer: Renderer): void;
1391
+ }
1392
+
1393
+ declare class ObjSignature extends MusicObject {
1394
+ readonly measure: ObjMeasure;
1395
+ readonly staff: ObjStaff;
1396
+ private clefImage?;
1397
+ private eightBelowClef?;
1398
+ private measureNumber?;
1399
+ private ksNeutralizeAccidentals;
1400
+ private ksNewAccidentals;
1401
+ private beatCountText?;
1402
+ private beatSizeText?;
1403
+ private tempoText?;
1404
+ readonly mi: MSignature;
1405
+ constructor(measure: ObjMeasure, staff: ObjStaff);
1406
+ getMusicInterface(): MSignature;
1407
+ updateClefImage(renderer: Renderer, showClef: boolean): void;
1408
+ updateMeasureNumber(showMeasureNumber: boolean): void;
1409
+ updateKeySignature(showKeySignature: boolean): void;
1410
+ updateTimeSignature(showTimeSignature: boolean): void;
1411
+ updateTempo(showTempo: boolean): void;
1412
+ private getAccidentalDiatonicId;
1413
+ pick(x: number, y: number): MusicObject[];
1414
+ layout(renderer: Renderer): void;
1415
+ offset(dx: number, dy: number): void;
1416
+ draw(renderer: Renderer): void;
1417
+ }
1418
+
1419
+ /** @public */
1420
+ type ScoreEventType = "enter" | "leave" | "click";
1421
+ /** @public */
1422
+ declare abstract class ScoreEvent {
1423
+ readonly type: ScoreEventType;
1424
+ constructor(type: ScoreEventType);
1425
+ }
1426
+ /** @public */
1427
+ declare class ScoreStaffPosEvent extends ScoreEvent {
1428
+ readonly renderer: MRenderer;
1429
+ readonly scoreRow: MScoreRow;
1430
+ readonly diatonicId: number;
1431
+ constructor(type: ScoreEventType, renderer: MRenderer, scoreRow: MScoreRow, diatonicId: number);
1432
+ }
1433
+ /** @public */
1434
+ declare class ScoreObjectEvent extends ScoreEvent {
1435
+ readonly renderer: MRenderer;
1436
+ readonly objects: MusicInterface[];
1437
+ constructor(type: ScoreEventType, renderer: MRenderer, objects: MusicInterface[]);
1438
+ get topObject(): MusicInterface;
1439
+ findObject(fn: (obj: MusicInterface) => boolean): MusicInterface | undefined;
1440
+ }
1441
+ /** @public */
1442
+ type ScoreEventListener = (event: ScoreEvent) => void;
1443
+
1444
+ /** @public */
1445
+ declare abstract class MusicInterface {
1446
+ readonly name: string;
1447
+ constructor(name: string);
1448
+ /** @internal */
1449
+ abstract getMusicObject(): MusicObject;
1450
+ getParent(): MusicInterface | undefined;
1451
+ }
1452
+ /** @public */
1453
+ declare class MAccidental extends MusicInterface {
1454
+ private readonly obj;
1455
+ static readonly Name = "Accidental";
1456
+ /** @internal */
1457
+ constructor(obj: ObjAccidental);
1458
+ /** @internal */
1459
+ getMusicObject(): ObjAccidental;
1460
+ getAccidental(): Accidental;
1461
+ }
1462
+ /** @public */
1463
+ declare class MConnective extends MusicInterface {
1464
+ private readonly obj;
1465
+ static readonly Name = "Connective";
1466
+ /** @internal */
1467
+ constructor(obj: ObjConnective);
1468
+ /** @internal */
1469
+ getMusicObject(): ObjConnective;
1470
+ }
1471
+ /** @public */
1472
+ declare class MArpeggio extends MusicInterface {
1473
+ private readonly obj;
1474
+ static readonly Name = "Arpeggio";
1475
+ /** @internal */
1476
+ constructor(obj: ObjArpeggio);
1477
+ /** @internal */
1478
+ getMusicObject(): ObjArpeggio;
1479
+ }
1480
+ /** @public */
1481
+ declare class MBeamGroup extends MusicInterface {
1482
+ private readonly obj;
1483
+ static readonly Name = "BeamGroup";
1484
+ /** @internal */
1485
+ constructor(obj: ObjBeamGroup);
1486
+ /** @internal */
1487
+ getMusicObject(): ObjBeamGroup;
1488
+ }
1489
+ /** @public */
1490
+ declare class MStaffBeamGroup extends MusicInterface {
1491
+ private readonly obj;
1492
+ static readonly Name = "StaffBeamGroup";
1493
+ /** @internal */
1494
+ constructor(obj: ObjStaffBeamGroup);
1495
+ /** @internal */
1496
+ getMusicObject(): ObjStaffBeamGroup;
1497
+ }
1498
+ /** @public */
1499
+ declare class MDocument extends MusicInterface {
1500
+ private readonly obj;
1501
+ static readonly Name = "Document";
1502
+ /** @internal */
1503
+ constructor(obj: ObjDocument);
1504
+ /** @internal */
1505
+ getMusicObject(): ObjDocument;
1506
+ getTitle(): string | undefined;
1507
+ getComposer(): string | undefined;
1508
+ getArranger(): string | undefined;
1509
+ play(fn?: PlayStateChangeListener): MPlayer;
1510
+ }
1511
+ /** @public */
1512
+ declare class MEnding extends MusicInterface {
1513
+ private readonly obj;
1514
+ static readonly Name = "Ending";
1515
+ /** @internal */
1516
+ constructor(obj: ObjEnding);
1517
+ /** @internal */
1518
+ getMusicObject(): ObjEnding;
1519
+ getPassages(): ReadonlyArray<number>;
1520
+ hasPassage(passage: number): boolean;
1521
+ }
1522
+ /** @public */
1523
+ declare class MFermata extends MusicInterface {
1524
+ private readonly obj;
1525
+ static readonly Name = "Fermata";
1526
+ /** @internal */
1527
+ constructor(obj: ObjFermata);
1528
+ /** @internal */
1529
+ getMusicObject(): ObjFermata;
1530
+ }
1531
+ /** @public */
1532
+ declare class MHeader extends MusicInterface {
1533
+ private readonly obj;
1534
+ static readonly Name = "Header";
1535
+ /** @internal */
1536
+ constructor(obj: ObjHeader);
1537
+ /** @internal */
1538
+ getMusicObject(): ObjHeader;
1539
+ getTitle(): string | undefined;
1540
+ getComposer(): string | undefined;
1541
+ getArranger(): string | undefined;
1542
+ }
1543
+ /** @public */
1544
+ declare class MImage extends MusicInterface {
1545
+ private readonly obj;
1546
+ static readonly Name = "Image";
1547
+ /** @internal */
1548
+ constructor(obj: ObjImage);
1549
+ /** @internal */
1550
+ getMusicObject(): ObjImage;
1551
+ }
1552
+ /** @public */
1553
+ declare class MMeasure extends MusicInterface {
1554
+ private readonly obj;
1555
+ static readonly Name = "Measure";
1556
+ /** @internal */
1557
+ constructor(obj: ObjMeasure);
1558
+ /** @internal */
1559
+ getMusicObject(): ObjMeasure;
1560
+ getMeasureNumber(): number;
1561
+ getRhythmColumns(): ReadonlyArray<MRhythmColumn>;
1562
+ }
1563
+ /** @public */
1564
+ declare class MBarLineRight extends MusicInterface {
1565
+ private readonly obj;
1566
+ static readonly Name = "BarLineRight";
1567
+ /** @internal */
1568
+ constructor(obj: ObjBarLineRight);
1569
+ /** @internal */
1570
+ getMusicObject(): ObjBarLineRight;
1571
+ }
1572
+ /** @public */
1573
+ declare class MBarLineLeft extends MusicInterface {
1574
+ private readonly obj;
1575
+ static readonly Name = "BarLineLeft";
1576
+ /** @internal */
1577
+ constructor(obj: ObjBarLineLeft);
1578
+ /** @internal */
1579
+ getMusicObject(): ObjBarLineLeft;
1580
+ }
1581
+ /** @public */
1582
+ declare class MStaffTabBarLine extends MusicInterface {
1583
+ private readonly obj;
1584
+ static readonly Name = "StaffTabBarLine";
1585
+ /** @internal */
1586
+ constructor(obj: ObjStaffTabBarLine);
1587
+ /** @internal */
1588
+ getMusicObject(): ObjStaffTabBarLine;
1589
+ }
1590
+ /** @public */
1591
+ declare class MNoteGroup extends MusicInterface {
1592
+ private readonly obj;
1593
+ static readonly Name = "NoteGroup";
1594
+ /** @internal */
1595
+ constructor(obj: ObjNoteGroup);
1596
+ /** @internal */
1597
+ getMusicObject(): ObjNoteGroup;
1598
+ getNotes(): ReadonlyArray<Note>;
1599
+ getRhythmProps(): RhythmProps;
1600
+ }
1601
+ /** @public */
1602
+ declare class MStaffNoteGroup extends MusicInterface {
1603
+ private readonly obj;
1604
+ static readonly Name = "StaffNoteGroup";
1605
+ /** @internal */
1606
+ constructor(obj: ObjStaffNoteGroup);
1607
+ /** @internal */
1608
+ getMusicObject(): ObjStaffNoteGroup;
1609
+ getNoteGroup(): MNoteGroup;
1610
+ }
1611
+ /** @public */
1612
+ declare class MTabNoteGroup extends MusicInterface {
1613
+ private readonly obj;
1614
+ static readonly Name = "TabNoteGroup";
1615
+ /** @internal */
1616
+ constructor(obj: ObjTabNoteGroup);
1617
+ /** @internal */
1618
+ getMusicObject(): ObjTabNoteGroup;
1619
+ getNoteGroup(): MNoteGroup;
1620
+ }
1621
+ /** @public */
1622
+ declare class MRest extends MusicInterface {
1623
+ private readonly obj;
1624
+ static readonly Name = "Rest";
1625
+ /** @internal */
1626
+ constructor(obj: ObjRest);
1627
+ /** @internal */
1628
+ getMusicObject(): ObjRest;
1629
+ getRhythmProps(): RhythmProps;
1630
+ }
1631
+ /** @public */
1632
+ declare class MStaffRest extends MusicInterface {
1633
+ private readonly obj;
1634
+ static readonly Name = "StaffRest";
1635
+ /** @internal */
1636
+ constructor(obj: ObjStaffRest);
1637
+ /** @internal */
1638
+ getMusicObject(): ObjStaffRest;
1639
+ getRest(): MRest;
1640
+ }
1641
+ /** @public */
1642
+ declare class MRhythmColumn extends MusicInterface {
1643
+ private readonly obj;
1644
+ static readonly Name = "RhythmColumn";
1645
+ /** @internal */
1646
+ constructor(obj: ObjRhythmColumn);
1647
+ /** @internal */
1648
+ getMusicObject(): ObjRhythmColumn;
1649
+ getRhythmSymbol(voiceId: number): MNoteGroup | MRest | undefined;
1650
+ }
1651
+ /** @public */
1652
+ declare class MScoreRow extends MusicInterface {
1653
+ private readonly obj;
1654
+ static readonly Name = "ScoreRow";
1655
+ /** @internal */
1656
+ constructor(obj: ObjScoreRow);
1657
+ /** @internal */
1658
+ getMusicObject(): ObjScoreRow;
1659
+ getMeasures(): ReadonlyArray<MMeasure>;
1660
+ }
1661
+ /** @public */
1662
+ declare class MStaff extends MusicInterface {
1663
+ private readonly obj;
1664
+ static readonly Name = "Staff";
1665
+ /** @internal */
1666
+ constructor(obj: ObjStaff);
1667
+ /** @internal */
1668
+ getMusicObject(): ObjStaff;
1669
+ }
1670
+ /** @public */
1671
+ declare class MTab extends MusicInterface {
1672
+ private readonly obj;
1673
+ static readonly Name = "Tab";
1674
+ /** @internal */
1675
+ constructor(obj: ObjTab);
1676
+ /** @internal */
1677
+ getMusicObject(): ObjTab;
1678
+ }
1679
+ /** @public */
1680
+ declare class MSignature extends MusicInterface {
1681
+ private readonly obj;
1682
+ static readonly Name = "Signature";
1683
+ /** @internal */
1684
+ constructor(obj: ObjSignature);
1685
+ /** @internal */
1686
+ getMusicObject(): ObjSignature;
1687
+ }
1688
+ /** @public */
1689
+ declare class MSpecialText extends MusicInterface {
1690
+ private readonly obj;
1691
+ static readonly Name = "SpecialText";
1692
+ /** @internal */
1693
+ constructor(obj: ObjSpecialText);
1694
+ /** @internal */
1695
+ getMusicObject(): ObjSpecialText;
1696
+ }
1697
+ /** @public */
1698
+ declare class MText extends MusicInterface {
1699
+ private readonly obj;
1700
+ static readonly Name = "Text";
1701
+ /** @internal */
1702
+ constructor(obj: ObjText);
1703
+ /** @internal */
1704
+ getMusicObject(): ObjText;
1705
+ getText(): string;
1706
+ }
1707
+ /** @public */
1708
+ declare class MExtensionLine extends MusicInterface {
1709
+ private readonly obj;
1710
+ static readonly Name = "ExtensionLine";
1711
+ /** @internal */
1712
+ constructor(obj: ObjExtensionLine);
1713
+ /** @internal */
1714
+ getMusicObject(): ObjExtensionLine;
1715
+ }
1716
+ /** @public */
1717
+ declare class MPlayer {
1718
+ private static currentlyPlaying;
1719
+ private readonly player;
1720
+ constructor(doc: MDocument, fn?: PlayStateChangeListener);
1721
+ static stopAll(): void;
1722
+ play(): this;
1723
+ pause(): this;
1724
+ stop(): this;
1725
+ }
1726
+ /** @public */
1727
+ declare class MRenderer {
1728
+ private readonly renderer;
1729
+ constructor();
1730
+ setDocument(doc?: MDocument): this;
1731
+ setCanvas(canvas: HTMLCanvasElement | string): this;
1732
+ setScoreEventListener(fn: ScoreEventListener): void;
1733
+ hilightObject(obj?: MusicInterface): void;
1734
+ hilightStaffPos(staffPos?: {
1735
+ scoreRow: MScoreRow;
1736
+ diatonicId: number;
1737
+ }): void;
1738
+ draw(): void;
1739
+ }
1740
+ /** @public */
1741
+ declare class MPlaybackButtons {
1742
+ private playButton?;
1743
+ private stopButton?;
1744
+ private playStopButton?;
1745
+ private pauseButton?;
1746
+ private onPlay;
1747
+ private onStop;
1748
+ private onPlayStop;
1749
+ private onPause;
1750
+ private playLabel;
1751
+ private stopLabel;
1752
+ private pauseLabel;
1753
+ private playState;
1754
+ private player?;
1755
+ constructor();
1756
+ setDocument(doc?: MDocument): this;
1757
+ detachDocument(): void;
1758
+ private updateButtons;
1759
+ setPlayButton(btn: HTMLButtonElement | string, btnLabel?: string): this;
1760
+ setStopButton(btn: HTMLButtonElement | string, btnLabel?: string): this;
1761
+ setPlayStopButton(btn: HTMLButtonElement | string, playLabel?: string, stopLabel?: string): this;
1762
+ setPauseButton(btn: HTMLButtonElement | string, btnLabel?: string): this;
1763
+ private static savedOnClickListeners;
1764
+ private static removeOnClickListeners;
1765
+ private static addOnClickListener;
1766
+ }
1767
+
1768
+ export { getVoiceIds as $, Annotation as A, MStaffRest as B, Connective as C, DivRect as D, MRhythmColumn as E, Fermata as F, MScoreRow as G, MStaff as H, MTab as I, MSignature as J, MSpecialText as K, Label as L, MDocument as M, type NoteOptions as N, ObjMeasure as O, MText as P, MExtensionLine as Q, type RestOptions as R, StaffPreset as S, TieType as T, MPlayer as U, MRenderer as V, MPlaybackButtons as W, Clef as X, type StaffConfig as Y, type TabConfig as Z, type VoiceId as _, type ScoreConfiguration as a, type StringNumber as a0, getStringNumbers as a1, Stem as a2, Arpeggio as a3, type ConnectiveSpan as a4, PlayState as a5, type PlayStateChangeListener as a6, Navigation as b, NoteAnchor as c, type ScoreEventType as d, ScoreEvent as e, ScoreStaffPosEvent as f, ScoreObjectEvent as g, type ScoreEventListener as h, MusicInterface as i, MAccidental as j, MConnective as k, MArpeggio as l, MBeamGroup as m, MStaffBeamGroup as n, MEnding as o, MFermata as p, MHeader as q, MImage as r, MMeasure as s, MBarLineRight as t, MBarLineLeft as u, MStaffTabBarLine as v, MNoteGroup as w, MStaffNoteGroup as x, MTabNoteGroup as y, MRest as z };