@tspro/web-music-score 5.3.0 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/LICENSE +1 -1
- package/README.md +6 -4
- package/dist/audio/index.d.mts +1 -1
- package/dist/audio/index.d.ts +1 -1
- package/dist/audio/index.js +3 -3
- package/dist/audio/index.mjs +6 -6
- package/dist/audio-cg/index.js +1 -1
- package/dist/audio-cg/index.mjs +3 -3
- package/dist/audio-synth/index.js +1 -1
- package/dist/audio-synth/index.mjs +3 -3
- package/dist/{chunk-PMDIUO22.mjs → chunk-5I5KENEC.mjs} +2 -2
- package/dist/chunk-6P4ECBUH.mjs +37 -0
- package/dist/{chunk-ZBA5XLYR.mjs → chunk-A5SMODAT.mjs} +21 -21
- package/dist/{chunk-C6UQDKWU.mjs → chunk-U2ACCEHX.mjs} +2 -2
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +6 -31
- package/dist/{guitar-BsSayRsH.d.ts → guitar-CNOxM4ZK.d.ts} +1 -1
- package/dist/{guitar-DdexKdN6.d.mts → guitar-DXlB-9vK.d.mts} +1 -1
- package/dist/iife/audio-cg.global.js +1 -1
- package/dist/iife/index.global.js +18 -11
- package/dist/{music-objects-BGiRQIXW.d.mts → music-objects-DYMqx839.d.mts} +66 -260
- package/dist/{music-objects-Ih9vCl4p.d.ts → music-objects-DumXKWJp.d.ts} +66 -260
- package/dist/{note-eA2xPPiG.d.mts → note-RVXvpfyV.d.mts} +13 -1
- package/dist/{note-CgCIBwvR.d.ts → note-RVXvpfyV.d.ts} +14 -2
- package/dist/pieces/index.d.mts +3 -3
- package/dist/pieces/index.d.ts +3 -3
- package/dist/pieces/index.js +1 -1
- package/dist/pieces/index.mjs +2 -2
- package/dist/react-ui/index.d.mts +9 -9
- package/dist/react-ui/index.d.ts +9 -9
- package/dist/react-ui/index.js +12 -14
- package/dist/react-ui/index.mjs +14 -16
- package/dist/{scale-CBW4eTz7.d.ts → scale-C8gHC448.d.mts} +3 -3
- package/dist/{scale-DQP3b9Zx.d.mts → scale-CUYFBo-8.d.ts} +3 -3
- package/dist/score/index.d.mts +232 -6
- package/dist/score/index.d.ts +232 -6
- package/dist/score/index.js +1122 -975
- package/dist/score/index.mjs +978 -861
- package/dist/{tempo-dkctPkCS.d.mts → tempo-BlCGZuYg.d.mts} +14 -2
- package/dist/{tempo-DMt3iwz9.d.ts → tempo-DwuZsv2T.d.ts} +14 -2
- package/dist/theory/index.d.mts +6 -6
- package/dist/theory/index.d.ts +6 -6
- package/dist/theory/index.js +88 -86
- package/dist/theory/index.mjs +85 -81
- package/package.json +5 -4
|
@@ -1,207 +1,6 @@
|
|
|
1
|
-
import { N as Note, A as Accidental } from './note-
|
|
2
|
-
import { R as RhythmProps, N as NoteLength, i as NoteLengthStr,
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* DivRect class, left, top, right, bottom rectangle divided into four sections by centerX, centerY.
|
|
7
|
-
*/
|
|
8
|
-
declare class DivRect {
|
|
9
|
-
left: number;
|
|
10
|
-
centerX: number;
|
|
11
|
-
right: number;
|
|
12
|
-
top: number;
|
|
13
|
-
centerY: number;
|
|
14
|
-
bottom: number;
|
|
15
|
-
/**
|
|
16
|
-
* Create rectangle with all zero values.
|
|
17
|
-
*/
|
|
18
|
-
constructor();
|
|
19
|
-
/**
|
|
20
|
-
* Create rectangle with left, right, top, bottom.
|
|
21
|
-
* Properties centerX and centerY will be centered in the middle.
|
|
22
|
-
*
|
|
23
|
-
* @param left - Left coordinate.
|
|
24
|
-
* @param right - Right coordinate.
|
|
25
|
-
* @param top - Top coordinate.
|
|
26
|
-
* @param bottom - Bottom coordinate.
|
|
27
|
-
*/
|
|
28
|
-
constructor(left: number, right: number, top: number, bottom: number);
|
|
29
|
-
/**
|
|
30
|
-
* Create rectangle with full arguments.
|
|
31
|
-
*
|
|
32
|
-
* @param left - Left coordinate.
|
|
33
|
-
* @param centerX - Center x-coordinate.
|
|
34
|
-
* @param right - Right coordinate.
|
|
35
|
-
* @param top - Top coordinate.
|
|
36
|
-
* @param centerY - Center y-coordinate.
|
|
37
|
-
* @param bottom - Bottom coordinate.
|
|
38
|
-
*/
|
|
39
|
-
constructor(left: number, centerX: number, right: number, top: number, centerY: number, bottom: number);
|
|
40
|
-
/**
|
|
41
|
-
* Create rect from basic left, top, width and height arguments.
|
|
42
|
-
*
|
|
43
|
-
* @param left - Left coordinate.
|
|
44
|
-
* @param top - Top coordinate.
|
|
45
|
-
* @param width - With.
|
|
46
|
-
* @param height - Height.
|
|
47
|
-
* @returns - DivRect.
|
|
48
|
-
*/
|
|
49
|
-
static create(left: number, top: number, width: number, height: number): DivRect;
|
|
50
|
-
/**
|
|
51
|
-
* Create rect from centerX, centerY, width, height arguments.
|
|
52
|
-
*
|
|
53
|
-
* @param centerX - Center x-coordinate.
|
|
54
|
-
* @param centerY - Center y-coordinate.
|
|
55
|
-
* @param width - Width.
|
|
56
|
-
* @param height - Height.
|
|
57
|
-
* @returns - DivRect.
|
|
58
|
-
*/
|
|
59
|
-
static createCentered(centerX: number, centerY: number, width: number, height: number): DivRect;
|
|
60
|
-
/**
|
|
61
|
-
* Create rect from sections.
|
|
62
|
-
*
|
|
63
|
-
* @param leftw - Left section width.
|
|
64
|
-
* @param rightw - Right section width.
|
|
65
|
-
* @param toph - Top section height.
|
|
66
|
-
* @param bottomh - Bottomsection height.
|
|
67
|
-
* @returns - DivRect.
|
|
68
|
-
*/
|
|
69
|
-
static createSections(leftw: number, rightw: number, toph: number, bottomh: number): DivRect;
|
|
70
|
-
/**
|
|
71
|
-
* Width getter.
|
|
72
|
-
*/
|
|
73
|
-
get width(): number;
|
|
74
|
-
/**
|
|
75
|
-
* Height getter.
|
|
76
|
-
*/
|
|
77
|
-
get height(): number;
|
|
78
|
-
/**
|
|
79
|
-
* Left section width getter.
|
|
80
|
-
*/
|
|
81
|
-
get leftw(): number;
|
|
82
|
-
/**
|
|
83
|
-
* Right section width getter.
|
|
84
|
-
*/
|
|
85
|
-
get rightw(): number;
|
|
86
|
-
/**
|
|
87
|
-
* Top section height getter.
|
|
88
|
-
*/
|
|
89
|
-
get toph(): number;
|
|
90
|
-
/**
|
|
91
|
-
* Bottom section height getter.
|
|
92
|
-
*/
|
|
93
|
-
get bottomh(): number;
|
|
94
|
-
/**
|
|
95
|
-
* Does this Rect contain given (x, y)-point?
|
|
96
|
-
*
|
|
97
|
-
* @param x - X-coordinate.
|
|
98
|
-
* @param y - Y-coordinate.
|
|
99
|
-
* @returns - True/false.
|
|
100
|
-
*/
|
|
101
|
-
contains(x: number, y: number): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Do a and b rects overlap?
|
|
104
|
-
*
|
|
105
|
-
* @param a - DivRect a.
|
|
106
|
-
* @param b - DivRect b.
|
|
107
|
-
* @returns - True/false.
|
|
108
|
-
*/
|
|
109
|
-
static overlap(a: DivRect, b: DivRect): boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Do horizontal measures of a and b rects overlap?
|
|
112
|
-
*
|
|
113
|
-
* @param a - DivRect a.
|
|
114
|
-
* @param b - DivRect b.
|
|
115
|
-
* @returns - True/false.
|
|
116
|
-
*/
|
|
117
|
-
static overlapX(a: DivRect, b: DivRect): boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Check if this Rect equals with given Rect.
|
|
120
|
-
* @param a - DivRect a.
|
|
121
|
-
* @param b - DivRect b.
|
|
122
|
-
* @returns - True/false.
|
|
123
|
-
*/
|
|
124
|
-
static equals(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
125
|
-
/**
|
|
126
|
-
* Check if frame of this Rect equals with given Rect, ignoring center x- and center y-coordinates.
|
|
127
|
-
*
|
|
128
|
-
* @param a - DivRect a.
|
|
129
|
-
* @param b - DivRect b.
|
|
130
|
-
* @returns - True/false.
|
|
131
|
-
*/
|
|
132
|
-
static equalsFrame(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
133
|
-
/**
|
|
134
|
-
* Created duplicate of this Rect.
|
|
135
|
-
*
|
|
136
|
-
* @returns - Duplicate.
|
|
137
|
-
*/
|
|
138
|
-
copy(): DivRect;
|
|
139
|
-
/**
|
|
140
|
-
* Move this rect by (dx, dy). Modifies this Rect.
|
|
141
|
-
*
|
|
142
|
-
* @param dx - Offset amount in x-direction.
|
|
143
|
-
* @param dy - Offset amount in y-direction.
|
|
144
|
-
* @returns - This DivRect instance.
|
|
145
|
-
*/
|
|
146
|
-
offsetInPlace(dx: number, dy: number): DivRect;
|
|
147
|
-
/**
|
|
148
|
-
* Move this rect by (dx, dy). Immutable, returns modified copy.
|
|
149
|
-
*
|
|
150
|
-
* @param dx - Offset amount in x-direction.
|
|
151
|
-
* @param dy - Offset amount in y-direction.
|
|
152
|
-
* @returns - DivRect copy with applied offset.
|
|
153
|
-
*/
|
|
154
|
-
offsetCopy(dx: number, dy: number): DivRect;
|
|
155
|
-
/**
|
|
156
|
-
* Expand this Rect by given Rect. Modifies this Rect.
|
|
157
|
-
*
|
|
158
|
-
* @param rect - DivRect to expand this instance with.
|
|
159
|
-
* @returns - This DivRect instance.
|
|
160
|
-
*/
|
|
161
|
-
expandInPlace(rect: DivRect): DivRect;
|
|
162
|
-
/**
|
|
163
|
-
* Expand this Rect by given Rect. Immutable, returns modified copy.
|
|
164
|
-
*
|
|
165
|
-
* @param rect - DivRect to expand this instance with.
|
|
166
|
-
* @returns - Expanded copy of this DivRect.
|
|
167
|
-
*/
|
|
168
|
-
expandCopy(rect: DivRect): DivRect;
|
|
169
|
-
/**
|
|
170
|
-
* Clip this Rect by given Rect. Mmodifies this Rect.
|
|
171
|
-
*
|
|
172
|
-
* @param clipRect - DivRect to clip this instance with.
|
|
173
|
-
* @returns - This DivRect instance.
|
|
174
|
-
*/
|
|
175
|
-
clipInPlace(clipRect: DivRect): DivRect;
|
|
176
|
-
/**
|
|
177
|
-
* Clip this Rect by given Rect. Immutable, return modified copy.
|
|
178
|
-
*
|
|
179
|
-
* @param clipRect - DivRecto to clip this instance with.
|
|
180
|
-
* @returns - Clipped DivRect copy.
|
|
181
|
-
*/
|
|
182
|
-
clipCopy(clipRect: DivRect): DivRect;
|
|
183
|
-
/**
|
|
184
|
-
* Scale Rect. Anchor pos is (centerX, centerY). Modifies this Rect.
|
|
185
|
-
*
|
|
186
|
-
* @param scaleX - Scale x-amount.
|
|
187
|
-
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
188
|
-
* @returns This DivRect instance.
|
|
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 - Scale x-amount.
|
|
195
|
-
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
196
|
-
* @returns Scaled copy of this DivRect.
|
|
197
|
-
*/
|
|
198
|
-
scaleCopy(scaleX: number, scaleY?: number): DivRect;
|
|
199
|
-
/**
|
|
200
|
-
* Get this DivRect instance.
|
|
201
|
-
* @returns - This DivRect instance.
|
|
202
|
-
*/
|
|
203
|
-
getRect(): DivRect;
|
|
204
|
-
}
|
|
1
|
+
import { N as Note, A as Accidental } from './note-RVXvpfyV.mjs';
|
|
2
|
+
import { R as RhythmProps, N as NoteLength, i as NoteLengthStr, l as TupletRatio, d as Tempo, K as KeySignature, b as TimeSignature } from './tempo-BlCGZuYg.mjs';
|
|
3
|
+
import { AnchoredRect, Rect, Vec } from '@tspro/ts-utils-lib';
|
|
205
4
|
|
|
206
5
|
/** Staff preset values for score configuration. */
|
|
207
6
|
declare enum StaffPreset {
|
|
@@ -269,14 +68,20 @@ type ScoreConfiguration = StaffConfig | TabConfig | (StaffConfig | TabConfig)[];
|
|
|
269
68
|
type VoiceId = 0 | 1 | 2 | 3;
|
|
270
69
|
/** Get supported voice ids. Returns [0, 1, 2, 3]. */
|
|
271
70
|
declare function getVoiceIds(): ReadonlyArray<VoiceId>;
|
|
71
|
+
declare function isVoiceId(voiceId: unknown): voiceId is VoiceId;
|
|
72
|
+
declare function validateVoiceId(voiceId: unknown): VoiceId;
|
|
272
73
|
/** Strng number. */
|
|
273
74
|
type StringNumber = 1 | 2 | 3 | 4 | 5 | 6;
|
|
274
75
|
/** Get string numbers. Returns [0, 1, 2, 3, 4, 5]. */
|
|
275
76
|
declare function getStringNumbers(): ReadonlyArray<StringNumber>;
|
|
77
|
+
declare function isStringNumber(stringNum: unknown): stringNum is VerseNumber;
|
|
78
|
+
declare function validateStringNumber(stringNum: unknown): VerseNumber;
|
|
276
79
|
/** Verse number. */
|
|
277
80
|
type VerseNumber = 1 | 2 | 3;
|
|
278
81
|
/** Get supported verse numbers. Returns [1, 2, 3]. */
|
|
279
82
|
declare function getVerseNumbers(): ReadonlyArray<VerseNumber>;
|
|
83
|
+
declare function isVerseNumber(verse: unknown): verse is VerseNumber;
|
|
84
|
+
declare function validateVerseNumber(verseNum: unknown): VerseNumber;
|
|
280
85
|
/** Stem direction enum. */
|
|
281
86
|
declare enum Stem {
|
|
282
87
|
/** Auto stem direction. */
|
|
@@ -566,7 +371,7 @@ declare class ObjText extends MusicObject {
|
|
|
566
371
|
}
|
|
567
372
|
|
|
568
373
|
type NotationLineObject = {
|
|
569
|
-
getRect: () =>
|
|
374
|
+
getRect: () => AnchoredRect;
|
|
570
375
|
offset?: (dx: number, dy: number) => void;
|
|
571
376
|
offsetInPlace?: (dx: number, dy: number) => void;
|
|
572
377
|
};
|
|
@@ -675,12 +480,12 @@ declare class ObjTab extends ObjNotationLine {
|
|
|
675
480
|
declare class ObjStaffNoteGroup extends MusicObject {
|
|
676
481
|
readonly staff: ObjStaff;
|
|
677
482
|
readonly noteGroup: ObjNoteGroup;
|
|
678
|
-
noteHeadRects:
|
|
679
|
-
dotRects:
|
|
483
|
+
noteHeadRects: AnchoredRect[];
|
|
484
|
+
dotRects: AnchoredRect[];
|
|
680
485
|
accidentals: ObjAccidental[];
|
|
681
|
-
stemTip?:
|
|
682
|
-
stemBase?:
|
|
683
|
-
flagRects:
|
|
486
|
+
stemTip?: AnchoredRect;
|
|
487
|
+
stemBase?: AnchoredRect;
|
|
488
|
+
flagRects: AnchoredRect[];
|
|
684
489
|
private prevTopNoteY;
|
|
685
490
|
private prevBottomNoteY;
|
|
686
491
|
readonly mi: MStaffNoteGroup;
|
|
@@ -688,7 +493,7 @@ declare class ObjStaffNoteGroup extends MusicObject {
|
|
|
688
493
|
getMusicInterface(): MusicInterface;
|
|
689
494
|
pick(x: number, y: number): MusicObject[];
|
|
690
495
|
updateRect(): void;
|
|
691
|
-
getRect():
|
|
496
|
+
getRect(): AnchoredRect;
|
|
692
497
|
offset(dx: number, dy: number): void;
|
|
693
498
|
}
|
|
694
499
|
declare class ObjTabNoteGroup extends MusicObject {
|
|
@@ -725,6 +530,7 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
725
530
|
private beamGroup?;
|
|
726
531
|
private readonly staffObjects;
|
|
727
532
|
private readonly tabObjects;
|
|
533
|
+
private isNoteDisplaced;
|
|
728
534
|
readonly mi: MNoteGroup;
|
|
729
535
|
constructor(col: ObjRhythmColumn, voiceId: VoiceId, notes: ReadonlyArray<Note>, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions | undefined, tupletRatio?: TupletRatio);
|
|
730
536
|
getMusicInterface(): MNoteGroup;
|
|
@@ -735,10 +541,10 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
735
541
|
get maxDiatonicId(): number;
|
|
736
542
|
getDiatonicId(staff?: ObjStaff): number;
|
|
737
543
|
get stemDir(): Stem.Up | Stem.Down;
|
|
544
|
+
setNoteDisplacement(note: Note, isDisplaced: boolean): void;
|
|
738
545
|
enableConnective(line: ObjNotationLine): boolean;
|
|
739
546
|
startConnective(connectiveProps: ConnectiveProps): void;
|
|
740
547
|
updateRunningArguments(diatonicId: number, stemDir: Stem.Up | Stem.Down, stringNumbers: StringNumber[]): void;
|
|
741
|
-
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
742
548
|
pick(x: number, y: number): MusicObject[];
|
|
743
549
|
getTopNote(): Note;
|
|
744
550
|
getBottomNote(): Note;
|
|
@@ -777,7 +583,7 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
777
583
|
setStemTipY(staff: ObjStaff, stemTipY: number): void;
|
|
778
584
|
offset(dx: number, dy: number): void;
|
|
779
585
|
draw(ctx: RenderContext): void;
|
|
780
|
-
getDotVerticalDisplacement(staff: ObjStaff, diatonicId: number, stemDir: Stem):
|
|
586
|
+
getDotVerticalDisplacement(staff: ObjStaff, diatonicId: number, stemDir: Stem): 0 | 1 | -1;
|
|
781
587
|
static hasSameNotes(ng1: ObjNoteGroup, ng2: ObjNoteGroup): boolean;
|
|
782
588
|
}
|
|
783
589
|
|
|
@@ -796,7 +602,7 @@ declare class BeamPoint {
|
|
|
796
602
|
bottomBeamsHeight: number;
|
|
797
603
|
constructor(staff: ObjStaff, beamGroup: ObjBeamGroup, symbol: RhythmSymbol, x: number, y: number);
|
|
798
604
|
offset(dx: number, dy: number): void;
|
|
799
|
-
getRect():
|
|
605
|
+
getRect(): AnchoredRect;
|
|
800
606
|
}
|
|
801
607
|
declare class ObjStaffBeamGroup extends MusicObject {
|
|
802
608
|
readonly staff: ObjStaff;
|
|
@@ -846,8 +652,8 @@ declare class ObjBeamGroup extends MusicObject {
|
|
|
846
652
|
declare class ObjStaffRest extends MusicObject {
|
|
847
653
|
readonly staff: ObjStaff;
|
|
848
654
|
readonly rest: ObjRest;
|
|
849
|
-
restRect:
|
|
850
|
-
dotRects:
|
|
655
|
+
restRect: AnchoredRect;
|
|
656
|
+
dotRects: AnchoredRect[];
|
|
851
657
|
readonly mi: MStaffRest;
|
|
852
658
|
constructor(staff: ObjStaff, rest: ObjRest);
|
|
853
659
|
getMusicInterface(): MusicInterface;
|
|
@@ -941,7 +747,6 @@ declare class ObjRhythmColumn extends MusicObject {
|
|
|
941
747
|
private staffMaxDiatonicId;
|
|
942
748
|
private arpeggioDir;
|
|
943
749
|
private arpeggios;
|
|
944
|
-
private noteHeadDisplacements;
|
|
945
750
|
private readonly playerProps;
|
|
946
751
|
private needLayout;
|
|
947
752
|
private shapeRects;
|
|
@@ -961,8 +766,7 @@ declare class ObjRhythmColumn extends MusicObject {
|
|
|
961
766
|
*/
|
|
962
767
|
getNextColumn(): ObjRhythmColumn | undefined;
|
|
963
768
|
getTicksToNextColumn(): number;
|
|
964
|
-
getShapeRects():
|
|
965
|
-
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
769
|
+
getShapeRects(): AnchoredRect[];
|
|
966
770
|
get doc(): ObjDocument;
|
|
967
771
|
get row(): ObjScoreRow;
|
|
968
772
|
pick(x: number, y: number): MusicObject[];
|
|
@@ -972,13 +776,12 @@ declare class ObjRhythmColumn extends MusicObject {
|
|
|
972
776
|
getVoiceSymbol(voiceId: VoiceId): RhythmSymbol | undefined;
|
|
973
777
|
getLyricsObject(verse: VerseNumber, line: ObjNotationLine, vpos: VerticalPos): ObjLyrics | undefined;
|
|
974
778
|
addLyricsObject(lyricsObj: ObjLyrics): void;
|
|
975
|
-
|
|
976
|
-
setupNoteHeadDisplacements(): void;
|
|
977
|
-
getNoteHeadDisplacement(noteGroup: ObjNoteGroup, note: Note): -1 | 0 | 1;
|
|
779
|
+
updateNoteDisplacements(): void;
|
|
978
780
|
isEmpty(): boolean;
|
|
979
781
|
getPlayerNotes(): ScorePlayerNote[];
|
|
980
782
|
requestLayout(): void;
|
|
981
783
|
layout(ctx: RenderContext, accState: AccidentalState): void;
|
|
784
|
+
layoutReserveSpace(ctx: RenderContext): void;
|
|
982
785
|
layoutDone(): void;
|
|
983
786
|
updateRect(): void;
|
|
984
787
|
offset(dx: number, dy: number): void;
|
|
@@ -1027,7 +830,7 @@ declare class ObjStaffTabBarLine extends MusicObject {
|
|
|
1027
830
|
constructor(barLine: ObjBarLine, line: ObjNotationLine);
|
|
1028
831
|
getMusicInterface(): MusicInterface;
|
|
1029
832
|
pick(x: number, y: number): MusicObject[];
|
|
1030
|
-
setRect(r:
|
|
833
|
+
setRect(r: AnchoredRect): void;
|
|
1031
834
|
offset(dx: number, dy: number): void;
|
|
1032
835
|
}
|
|
1033
836
|
declare abstract class ObjBarLine extends MusicObject {
|
|
@@ -1090,7 +893,6 @@ declare class ObjConnective extends MusicObject {
|
|
|
1090
893
|
declare class ObjMeasure extends MusicObject {
|
|
1091
894
|
readonly row: ObjScoreRow;
|
|
1092
895
|
private readonly options;
|
|
1093
|
-
static readonly MinFlexContentWidth = 10;
|
|
1094
896
|
private prevMeasure;
|
|
1095
897
|
private nextMeasure;
|
|
1096
898
|
private keySignature;
|
|
@@ -1106,12 +908,9 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1106
908
|
private barLineRight;
|
|
1107
909
|
private connectives;
|
|
1108
910
|
private beamGroups;
|
|
1109
|
-
private tabStringNotesWidth;
|
|
1110
911
|
private measureId;
|
|
912
|
+
private regions;
|
|
1111
913
|
private needLayout;
|
|
1112
|
-
private leftSolidAreaWidth;
|
|
1113
|
-
private minColumnsAreaWidth;
|
|
1114
|
-
private rightSolidAreaWidth;
|
|
1115
914
|
private voiceSymbols;
|
|
1116
915
|
private lastAddedRhythmColumn?;
|
|
1117
916
|
private lastAddedRhythmSymbol?;
|
|
@@ -1194,17 +993,17 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1194
993
|
private getRhythmColumn;
|
|
1195
994
|
getMeasureTicks(): number;
|
|
1196
995
|
getConsumedTicks(voiceId?: VoiceId): number;
|
|
1197
|
-
getColumnsContentRect():
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
996
|
+
getColumnsContentRect(): AnchoredRect;
|
|
997
|
+
getLeftSolidWidth(): number;
|
|
998
|
+
getMinColumnsWidth(): number;
|
|
999
|
+
getRightSolidWidth(): number;
|
|
1000
|
+
getTotalSolidWidth(): number;
|
|
1202
1001
|
getMinWidth(): number;
|
|
1203
1002
|
getStaffLineLeft(): number;
|
|
1204
1003
|
getStaffLineRight(): number;
|
|
1205
|
-
private getLyricsObjects;
|
|
1206
1004
|
getPrevLyricsObject(lyricsObj: ObjLyrics): ObjLyrics | undefined;
|
|
1207
1005
|
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
1006
|
+
addStaticObject(line: ObjNotationLine, staticObj: MusicObject): void;
|
|
1208
1007
|
removeLayoutObjects(musicObj: MusicObject): void;
|
|
1209
1008
|
addConnectiveObject(connective: ObjConnective): void;
|
|
1210
1009
|
removeConnectiveObjects(): void;
|
|
@@ -1260,7 +1059,7 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1260
1059
|
resetLayoutGroups(ctx: RenderContext): void;
|
|
1261
1060
|
layoutLayoutGroups(ctx: RenderContext): void;
|
|
1262
1061
|
pick(x: number, y: number): MusicObject[];
|
|
1263
|
-
getConnectivesContentRect():
|
|
1062
|
+
getConnectivesContentRect(): AnchoredRect;
|
|
1264
1063
|
getDiatonicIdAt(y: number): number | undefined;
|
|
1265
1064
|
addMeasure(m: ObjMeasure): void;
|
|
1266
1065
|
getMeasures(): ReadonlyArray<ObjMeasure>;
|
|
@@ -1285,6 +1084,15 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1285
1084
|
draw(ctx: RenderContext): void;
|
|
1286
1085
|
}
|
|
1287
1086
|
|
|
1087
|
+
declare class InstrumentGroupRegions {
|
|
1088
|
+
nameLeft: number;
|
|
1089
|
+
nameRight: number;
|
|
1090
|
+
braceLeft: number;
|
|
1091
|
+
braceRight: number;
|
|
1092
|
+
get left(): number;
|
|
1093
|
+
get right(): number;
|
|
1094
|
+
get width(): number;
|
|
1095
|
+
}
|
|
1288
1096
|
declare class ObjDocument extends MusicObject {
|
|
1289
1097
|
private needLayout;
|
|
1290
1098
|
private ctx?;
|
|
@@ -1296,6 +1104,7 @@ declare class ObjDocument extends MusicObject {
|
|
|
1296
1104
|
private newRowRequested;
|
|
1297
1105
|
private allConnectiveProps;
|
|
1298
1106
|
private staffGroups;
|
|
1107
|
+
private instrumentGroupRegions;
|
|
1299
1108
|
private readonly mi;
|
|
1300
1109
|
constructor();
|
|
1301
1110
|
getMusicInterface(): MDocument;
|
|
@@ -1323,13 +1132,8 @@ declare class ObjDocument extends MusicObject {
|
|
|
1323
1132
|
removeLayoutObjects(musicObj: MusicObject): void;
|
|
1324
1133
|
private forEachMeasure;
|
|
1325
1134
|
resetMeasures(): void;
|
|
1326
|
-
updateCursorRect(cursorRect?:
|
|
1327
|
-
|
|
1328
|
-
nameLeft: number;
|
|
1329
|
-
nameRight: number;
|
|
1330
|
-
braceLeft: number;
|
|
1331
|
-
braceRight: number;
|
|
1332
|
-
};
|
|
1135
|
+
updateCursorRect(cursorRect?: Rect): void;
|
|
1136
|
+
getInstrumentGroupRegions(ctx: RenderContext): InstrumentGroupRegions;
|
|
1333
1137
|
requestLayout(): void;
|
|
1334
1138
|
requestFullLayout(): void;
|
|
1335
1139
|
layout(): void;
|
|
@@ -1375,7 +1179,7 @@ declare class RenderContext {
|
|
|
1375
1179
|
setCanvas(canvas: HTMLCanvasElement): void;
|
|
1376
1180
|
setScoreEventListener(fn: ScoreEventListener): void;
|
|
1377
1181
|
needMouseInput(): boolean;
|
|
1378
|
-
getMousePos(e: MouseEvent):
|
|
1182
|
+
getMousePos(e: MouseEvent): Vec;
|
|
1379
1183
|
private updateCurStaffPos;
|
|
1380
1184
|
private updateCurObjects;
|
|
1381
1185
|
onClick(e: MouseEvent): void;
|
|
@@ -1388,20 +1192,20 @@ declare class RenderContext {
|
|
|
1388
1192
|
scoreRow: ObjScoreRow;
|
|
1389
1193
|
diatonicId: number;
|
|
1390
1194
|
}): void;
|
|
1391
|
-
updateCursorRect(cursorRect:
|
|
1195
|
+
updateCursorRect(cursorRect: Rect | undefined): void;
|
|
1392
1196
|
updateCanvasSize(): void;
|
|
1393
1197
|
draw(): void;
|
|
1394
1198
|
drawHilightStaffPosRect(): void;
|
|
1395
1199
|
drawHilightObjectRect(): void;
|
|
1396
1200
|
drawPlayCursor(): void;
|
|
1397
|
-
txFromScreenCoord(screenCoord:
|
|
1398
|
-
txToScreenCoord(coord:
|
|
1201
|
+
txFromScreenCoord(screenCoord: Vec): Vec;
|
|
1202
|
+
txToScreenCoord(coord: Vec): Vec;
|
|
1399
1203
|
clearCanvas(): void;
|
|
1400
|
-
drawDebugRect(r:
|
|
1204
|
+
drawDebugRect(r: AnchoredRect | Rect): void;
|
|
1401
1205
|
drawLedgerLines(staff: ObjStaff, diatonicId: number, x: number): void;
|
|
1402
|
-
getRestRect(restSize: number):
|
|
1206
|
+
getRestRect(restSize: number): AnchoredRect;
|
|
1403
1207
|
drawRest(restSize: number, x: number, y: number): void;
|
|
1404
|
-
drawFlag(rect:
|
|
1208
|
+
drawFlag(rect: Rect | AnchoredRect, dir: "up" | "down"): void;
|
|
1405
1209
|
color(color: string): RenderContext;
|
|
1406
1210
|
lineColor(color: string): RenderContext;
|
|
1407
1211
|
fillColor(color: string): RenderContext;
|
|
@@ -1430,7 +1234,7 @@ declare class RenderContext {
|
|
|
1430
1234
|
fillCircle(x: number, y: number, radius: number): void;
|
|
1431
1235
|
strokeLine(startX: number, startY: number, endX: number, endY: number): void;
|
|
1432
1236
|
strokePartialLine(startX: number, startY: number, endX: number, endY: number, startT: number, endT: number): void;
|
|
1433
|
-
drawBrace(rect:
|
|
1237
|
+
drawBrace(rect: AnchoredRect, side: "left" | "right"): void;
|
|
1434
1238
|
}
|
|
1435
1239
|
|
|
1436
1240
|
declare class ObjEnding extends MusicObject {
|
|
@@ -1441,7 +1245,7 @@ declare class ObjEnding extends MusicObject {
|
|
|
1441
1245
|
readonly mi: MEnding;
|
|
1442
1246
|
constructor(measure: ObjMeasure, passages: number[]);
|
|
1443
1247
|
getMusicInterface(): MEnding;
|
|
1444
|
-
getShapeRects():
|
|
1248
|
+
getShapeRects(): AnchoredRect[];
|
|
1445
1249
|
isSingleMeasureEnding(): boolean;
|
|
1446
1250
|
hasPassage(pass: number): boolean;
|
|
1447
1251
|
getHighestPassage(): number;
|
|
@@ -1576,25 +1380,27 @@ declare class LayoutObjectWrapper {
|
|
|
1576
1380
|
readonly layoutGroup: LayoutGroup;
|
|
1577
1381
|
private positionResolved;
|
|
1578
1382
|
constructor(musicObj: LayoutableMusicObject, line: ObjNotationLine, layoutGroupId: LayoutGroupId, verticalPos: VerticalPos);
|
|
1579
|
-
|
|
1383
|
+
resetPositionResolved(): void;
|
|
1580
1384
|
setPositionResolved(): void;
|
|
1581
1385
|
isPositionResolved(): boolean;
|
|
1582
1386
|
resolveClosestToStaffY(ctx: RenderContext): number;
|
|
1583
1387
|
getTextContent(): string | undefined;
|
|
1584
1388
|
layout(ctx: RenderContext): void;
|
|
1585
1389
|
offset(dx: number, dy: number): void;
|
|
1586
|
-
getRect():
|
|
1390
|
+
getRect(): AnchoredRect;
|
|
1587
1391
|
}
|
|
1588
1392
|
declare class LayoutGroup {
|
|
1589
1393
|
readonly layoutGroupId: number;
|
|
1590
|
-
private readonly
|
|
1394
|
+
private readonly layoutObject;
|
|
1591
1395
|
readonly rowAlign: boolean;
|
|
1592
|
-
readonly
|
|
1396
|
+
readonly reserveSpace: boolean;
|
|
1397
|
+
readonly padding: number;
|
|
1593
1398
|
constructor(layoutGroupId: number);
|
|
1594
1399
|
getLayoutObjects(verticalPos: VerticalPos): Readonly<LayoutObjectWrapper[]>;
|
|
1595
1400
|
add(layoutObj: LayoutObjectWrapper): void;
|
|
1596
1401
|
remove(layoutObj: LayoutObjectWrapper): void;
|
|
1597
|
-
|
|
1402
|
+
layout(ctx: RenderContext): void;
|
|
1403
|
+
getPadding(ctx: RenderContext): number;
|
|
1598
1404
|
}
|
|
1599
1405
|
|
|
1600
1406
|
declare class MusicObjectLink {
|
|
@@ -1613,11 +1419,11 @@ declare abstract class MusicObject {
|
|
|
1613
1419
|
constructor(parent: MusicObject | undefined);
|
|
1614
1420
|
abstract getMusicInterface(): MusicInterface;
|
|
1615
1421
|
getParent(): MusicObject | undefined;
|
|
1616
|
-
protected rect:
|
|
1422
|
+
protected rect: AnchoredRect;
|
|
1617
1423
|
private needRectUpdate;
|
|
1618
1424
|
requestRectUpdate(): void;
|
|
1619
1425
|
updateRect(): void;
|
|
1620
|
-
getRect():
|
|
1426
|
+
getRect(): AnchoredRect;
|
|
1621
1427
|
/**
|
|
1622
1428
|
* Most objects are simple rects in shape.
|
|
1623
1429
|
* Some objects might be more complex consisting of multiple rects.
|
|
@@ -1625,7 +1431,7 @@ declare abstract class MusicObject {
|
|
|
1625
1431
|
*
|
|
1626
1432
|
* @returns Array of rects.
|
|
1627
1433
|
*/
|
|
1628
|
-
getShapeRects():
|
|
1434
|
+
getShapeRects(): AnchoredRect[];
|
|
1629
1435
|
/**
|
|
1630
1436
|
* Pick objects.
|
|
1631
1437
|
*
|
|
@@ -2543,4 +2349,4 @@ declare class MExtensionLine extends MusicInterface {
|
|
|
2543
2349
|
getMusicObject(): ObjExtensionLine;
|
|
2544
2350
|
}
|
|
2545
2351
|
|
|
2546
|
-
export {
|
|
2352
|
+
export { MTabSignature as $, type AnnotationText as A, MFermata as B, Connective as C, MHeader as D, MImage as E, Fermata as F, MMeasure as G, MBarLineRight as H, MBarLineLeft as I, MStaffTabBarLine as J, MNoteGroup as K, type LyricsOptions as L, MDocument as M, type NoteOptions as N, MStaffNoteGroup as O, MTabNoteGroup as P, MRest as Q, type RestOptions as R, StaffPreset as S, type TupletOptions as T, MStaffRest as U, type VoiceId as V, MRhythmColumn as W, MScoreRow as X, MStaff as Y, MTab as Z, MStaffSignature as _, type ScoreConfiguration as a, MTabRhythm as a0, MSpecialText as a1, MText as a2, MLyrics as a3, MExtensionLine as a4, Clef as a5, type BaseConfig as a6, type StaffConfig as a7, type TabConfig as a8, getVoiceIds as a9, isVoiceId as aa, validateVoiceId as ab, type StringNumber as ac, getStringNumbers as ad, isStringNumber as ae, validateStringNumber as af, getVerseNumbers as ag, isVerseNumber as ah, validateVerseNumber as ai, Stem as aj, Arpeggio as ak, type StaffTabOrGroup as al, LyricsAlign as am, LyricsHyphen as an, DynamicsAnnotation as ao, TempoAnnotation as ap, PlayState as aq, type PlayStateChangeListener as ar, type MeasureOptions as b, type VerseNumber as c, type StaffTabOrGroups as d, Navigation as e, Annotation as f, Label as g, TieType as h, NoteAnchor as i, VerticalPosition as j, type ScoreEventType as k, ScoreEvent as l, ScoreStaffPosEvent as m, ScoreObjectEvent as n, type ScoreEventListener as o, MPlayer as p, MRenderContext as q, MRenderer as r, MPlaybackButtons as s, MusicInterface as t, MAccidental as u, MConnective as v, MArpeggio as w, MBeamGroup as x, MStaffBeamGroup as y, MEnding as z };
|