@tspro/web-music-score 3.2.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +38 -10
  2. package/README.md +189 -331
  3. package/dist/audio/index.d.mts +40 -1
  4. package/dist/audio/index.d.ts +40 -1
  5. package/dist/audio/index.js +1 -1
  6. package/dist/audio/index.mjs +2 -2
  7. package/dist/audio-cg/index.d.mts +3 -0
  8. package/dist/audio-cg/index.d.ts +3 -0
  9. package/dist/audio-cg/index.js +1 -1
  10. package/dist/audio-cg/index.mjs +2 -2
  11. package/dist/{chunk-LCTM7BID.mjs → chunk-YFPLOHP2.mjs} +2 -2
  12. package/dist/core/index.d.mts +12 -0
  13. package/dist/core/index.d.ts +12 -0
  14. package/dist/core/index.js +3 -2
  15. package/dist/core/index.mjs +4 -3
  16. package/dist/guitar-CaZJDA05.d.ts +35 -0
  17. package/dist/guitar-DdexKdN6.d.mts +35 -0
  18. package/dist/iife/index.global.js +11 -11
  19. package/dist/{interface-Bn5HFt_U.d.mts → music-objects-DJQ4d2OA.d.mts} +640 -136
  20. package/dist/{interface-BlNl69uT.d.ts → music-objects-Dc3kR-XF.d.ts} +640 -136
  21. package/dist/note-eA2xPPiG.d.mts +294 -0
  22. package/dist/note-eA2xPPiG.d.ts +294 -0
  23. package/dist/pieces/index.d.mts +22 -3
  24. package/dist/pieces/index.d.ts +22 -3
  25. package/dist/pieces/index.js +7 -7
  26. package/dist/pieces/index.mjs +11 -11
  27. package/dist/react-ui/index.d.mts +166 -17
  28. package/dist/react-ui/index.d.ts +166 -17
  29. package/dist/react-ui/index.js +78 -1
  30. package/dist/react-ui/index.mjs +79 -2
  31. package/dist/scale-B2Icbetz.d.ts +230 -0
  32. package/dist/scale-BbDJTbrG.d.mts +230 -0
  33. package/dist/score/index.d.mts +359 -39
  34. package/dist/score/index.d.ts +359 -39
  35. package/dist/score/index.js +1252 -594
  36. package/dist/score/index.mjs +1255 -599
  37. package/dist/tempo-CtUhvJbr.d.mts +369 -0
  38. package/dist/tempo-Dt8aHpol.d.ts +369 -0
  39. package/dist/theory/index.d.mts +29 -13
  40. package/dist/theory/index.d.ts +29 -13
  41. package/dist/theory/index.js +583 -96
  42. package/dist/theory/index.mjs +580 -94
  43. package/package.json +2 -2
  44. package/dist/guitar-C2Cp71NZ.d.ts +0 -17
  45. package/dist/guitar-DggbM2UL.d.mts +0 -17
  46. package/dist/note-BFa43I86.d.mts +0 -85
  47. package/dist/note-BFa43I86.d.ts +0 -85
  48. package/dist/scale-DRR-t4Kr.d.mts +0 -74
  49. package/dist/scale-ebJm37q1.d.ts +0 -74
  50. package/dist/tempo-B4h5Ktob.d.mts +0 -104
  51. package/dist/tempo-DgqDEsn0.d.ts +0 -104
@@ -1,67 +1,387 @@
1
- import { S as StaffPreset, a as ScoreConfiguration, M as MDocument, N as NoteOptions, R as RestOptions, F as Fermata, b as StaffTabOrGroups, c as Navigation, L as Label, A as Annotation, C as Connective, T as TieType, d as NoteAnchor, V as VerticalPosition } from '../interface-Bn5HFt_U.mjs';
2
- export { a4 as Arpeggio, Y as Clef, a5 as ConnectiveSpan, D as DivRect, k as MAccidental, m as MArpeggio, v as MBarLineLeft, u as MBarLineRight, n as MBeamGroup, l as MConnective, p as MEnding, Q as MExtensionLine, q as MFermata, r as MHeader, s as MImage, t as MMeasure, x as MNoteGroup, X as MPlaybackButtons, U as MPlayer, W as MRenderer, B as MRest, G as MRhythmColumn, H as MScoreRow, K as MSignature, O as MSpecialText, I as MStaff, o as MStaffBeamGroup, y as MStaffNoteGroup, E as MStaffRest, w as MStaffTabBarLine, J as MTab, z as MTabNoteGroup, P as MText, j as MusicInterface, a7 as PlayState, a8 as PlayStateChangeListener, f as ScoreEvent, i as ScoreEventListener, e as ScoreEventType, h as ScoreObjectEvent, g as ScoreStaffPosEvent, Z as StaffConfig, a6 as StaffTabOrGroup, a3 as Stem, a1 as StringNumber, _ as TabConfig, $ as VoiceId, a2 as getStringNumbers, a0 as getVoiceIds } from '../interface-Bn5HFt_U.mjs';
3
- import { N as Note } from '../note-BFa43I86.mjs';
4
- import { S as ScaleType, c as Scale } from '../scale-DRR-t4Kr.mjs';
5
- import { K as KeySignature, a as TimeSignature, T as TimeSignatureString, N as NoteLength } from '../tempo-B4h5Ktob.mjs';
1
+ import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, V as VoiceId, T as TupletOptions, F as Fermata, b as StaffTabOrGroups, c as Navigation, A as AnnotationText, d as Annotation, L as Label, C as Connective, e as TieType, f as NoteAnchor, g as VerticalPosition } from '../music-objects-DJQ4d2OA.mjs';
2
+ export { a6 as Arpeggio, $ as Clef, D as DivRect, a8 as DynamicsAnnotation, q as MAccidental, s as MArpeggio, E as MBarLineLeft, B as MBarLineRight, t as MBeamGroup, r as MConnective, v as MEnding, _ as MExtensionLine, w as MFermata, x as MHeader, y as MImage, z as MMeasure, H as MNoteGroup, o as MPlaybackButtons, m as MPlayer, n as MRenderer, K as MRest, P as MRhythmColumn, Q as MScoreRow, X as MSignature, Y as MSpecialText, U as MStaff, u as MStaffBeamGroup, I as MStaffNoteGroup, O as MStaffRest, G as MStaffTabBarLine, W as MTab, J as MTabNoteGroup, Z as MText, p as MusicInterface, aa as PlayState, ab as PlayStateChangeListener, i as ScoreEvent, l as ScoreEventListener, h as ScoreEventType, k as ScoreObjectEvent, j as ScoreStaffPosEvent, a0 as StaffConfig, a7 as StaffTabOrGroup, a5 as Stem, a3 as StringNumber, a1 as TabConfig, a9 as TempoAnnotation, a4 as getStringNumbers, a2 as getVoiceIds } from '../music-objects-DJQ4d2OA.mjs';
3
+ import { N as Note } from '../note-eA2xPPiG.mjs';
4
+ import { S as ScaleType, c as Scale } from '../scale-BbDJTbrG.mjs';
5
+ import { N as NoteLength, h as NoteLengthStr, K as KeySignature, a as TimeSignature, T as TimeSignatureString, j as TupletRatio } from '../tempo-CtUhvJbr.mjs';
6
6
  import '@tspro/ts-utils-lib';
7
7
 
8
+ /** Tuplet builder type. */
9
+ type TupletBuilder = {
10
+ /**
11
+ * Add note to a tuplet.
12
+ * @param note - Note instance of Note or string (e.g. "D4").
13
+ * @param noteLength - Note length (e.g. "4n").
14
+ * @param options - Note options.
15
+ * @returns - This tuplet builder object.
16
+ */
17
+ addNote: (note: Note | string, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions) => TupletBuilder;
18
+ /**
19
+ * Add chord to a tuplet.
20
+ * @param notes - Array of notes, each instance of Note or string (e.g. "D4").
21
+ * @param noteLength - Note length (e.g. "4n").
22
+ * @param options - Note options.
23
+ * @returns - This tuplet builder object.
24
+ */
25
+ addChord: (notes: (Note | string)[], noteLength: NoteLength | NoteLengthStr, options?: NoteOptions) => TupletBuilder;
26
+ /**
27
+ * Add rest to a tuplet.
28
+ * @param restLength - Rest length (e.g. "4n").
29
+ * @param options - Rest options.
30
+ * @returns - This tuplet builder object.
31
+ */
32
+ addRest: (restLength: NoteLength | NoteLengthStr, options?: RestOptions) => TupletBuilder;
33
+ };
34
+ /** Etension builder type. */
35
+ type ExtensionBuilder = {
36
+ /**
37
+ * Increase extension length by note length multiplied by number of notes.
38
+ * @param noteLength - Length of note (e.g. "2n").
39
+ * @param noteCount - Number of note lengths (default = 1).
40
+ * @returns - this extension builder object.
41
+ */
42
+ notes: (noteLength: NoteLength | NoteLengthStr, noteCount?: number) => ExtensionBuilder;
43
+ /**
44
+ * Increase length of extension length by given number of measures.
45
+ * @param measureCount - Number of measures.
46
+ * @returns - this extension builder object.
47
+ */
48
+ measures: (measureCount: number) => ExtensionBuilder;
49
+ /**
50
+ * Create as long extension line as possible.
51
+ * @returns - this extension builder object.
52
+ */
53
+ infinity: () => ExtensionBuilder;
54
+ /**
55
+ * Create an invisible extension.
56
+ * @returns - this extension builder object.
57
+ */
58
+ hide: () => ExtensionBuilder;
59
+ };
60
+ /**
61
+ * Document builder class.
62
+ * <pre>
63
+ * // Example
64
+ * let doc = new Score.DocumentBuilder()
65
+ * .addScoreConfiguration({ type: "staff", clef: "G", isOctavewDown: true })
66
+ * .setMeasuresPerRow(4)
67
+ * .addMeasure()
68
+ * .addNote(1, "C3", "4n")
69
+ * .addChord(1, ["C3", "E3", "G3"], "4n").addLabel("chord", "C")
70
+ * .addRest(1, "4n")
71
+ * // etc.
72
+ * .getDEocument();
73
+ * </pre>
74
+ */
8
75
  declare class DocumentBuilder {
9
76
  private readonly doc;
77
+ /**
78
+ * Create new document builder instance.
79
+ */
10
80
  constructor();
11
- setScoreConfiguration(staffPreset: StaffPreset): DocumentBuilder;
81
+ /**
82
+ * Use staff preset values to set score confguration. This call will request new score row.
83
+ * @param staffPreset - Staff preset (e.g. "treble").
84
+ */
85
+ setScoreConfiguration(staffPreset: StaffPreset | `${StaffPreset}`): DocumentBuilder;
86
+ /**
87
+ * Use staff preset values to set score confguration. This call will request new score row.
88
+ * @param config - Score configuration (e.g. { type: "staff", clef: "G", isOctavewDown: true }).
89
+ */
12
90
  setScoreConfiguration(config: ScoreConfiguration): DocumentBuilder;
13
91
  private getMeasure;
92
+ /**
93
+ * Get music document after finished building.
94
+ * @returns - Music document.
95
+ */
14
96
  getDocument(): MDocument;
97
+ /**
98
+ * Set header texts.
99
+ * @param title - Title of this docmument/musical piece.
100
+ * @param composer - Composer of this document/musical piece.
101
+ * @param arranger - Arranger of this document/musical piece.
102
+ * @returns - This document builder instance.
103
+ */
15
104
  setHeader(title?: string, composer?: string, arranger?: string): DocumentBuilder;
105
+ /**
106
+ * Automatically limit number of measures per score row.
107
+ * @param measuresPerRow - Number of measures per row. Must be integer >=1 or Infinity.
108
+ * @returns - This document builder instance.
109
+ */
16
110
  setMeasuresPerRow(measuresPerRow: number): DocumentBuilder;
111
+ /**
112
+ * Add new measure.
113
+ * @returns - This document builder instance.
114
+ */
17
115
  addMeasure(): DocumentBuilder;
18
- setKeySignature(tonic: string, scaleType: ScaleType): DocumentBuilder;
116
+ /**
117
+ * Set key signature for current measure and forward.
118
+ * @param tonic - Tonic note (e.g. "C").
119
+ * @param scaleType - Scale type (e.g. string "Major" or ScaleType.Major).
120
+ * @returns - This document builder instance.
121
+ */
122
+ setKeySignature(tonic: string, scaleType: ScaleType | `${ScaleType}`): DocumentBuilder;
123
+ /**
124
+ * Set key signature for current measure and forward.
125
+ * @param keySignature - KeySignature object instance.
126
+ * @returns - This document builder instance.
127
+ */
19
128
  setKeySignature(keySignature: KeySignature): DocumentBuilder;
129
+ /**
130
+ * Set key signature for current measure and forward.
131
+ * @param keySignature - Key signature string (e.g. "C Major").
132
+ * @returns - This document builder instance.
133
+ */
134
+ setKeySignature(keySignature: string): DocumentBuilder;
135
+ /**
136
+ * Set key signature for current measure and forward.
137
+ * @param scale - Scale object instance.
138
+ * @returns - This document builder instance.
139
+ */
20
140
  setKeySignature(scale: Scale): DocumentBuilder;
141
+ /**
142
+ * Set time signature for current measure and forward.
143
+ * @param timeSignature - TimeSignature object instance or string (e.g. "3/4").
144
+ * @returns - This document builder instance.
145
+ */
21
146
  setTimeSignature(timeSignature: TimeSignature | TimeSignatureString): DocumentBuilder;
22
- setTempo(beatsPerMinute: number, beatLength?: NoteLength, dotted?: boolean): DocumentBuilder;
23
- addNote(voiceId: number, note: Note | string, noteLength: NoteLength, options?: NoteOptions): DocumentBuilder;
24
- addChord(voiceId: number, notes: (Note | string)[], noteLength: NoteLength, options?: NoteOptions): DocumentBuilder;
25
- addRest(voiceId: number, restLength: NoteLength, options?: RestOptions): DocumentBuilder;
147
+ /**
148
+ * Set tempo.
149
+ * @param beatsPerMinute - Tempo beats per minute.
150
+ * @returns - This document builder instance.
151
+ */
152
+ setTempo(beatsPerMinute: number): DocumentBuilder;
153
+ /**
154
+ * Set tempo.
155
+ * @param beatsPerMinute - Tempo beats per minute.
156
+ * @param beatLength - Length of one beat.
157
+ * @returns - This document builder instance.
158
+ */
159
+ setTempo(beatsPerMinute: number, beatLength: NoteLength | NoteLengthStr): DocumentBuilder;
160
+ /**
161
+ * @deprecated - Use dotted beatLength instead (e.g. "4..").
162
+ * @param beatsPerMinute - Tempo beats per minute.
163
+ * @param beatLength - Length of one beat.
164
+ * @param dotted - Dot count of length of one beat.
165
+ * @returns - This document builder instance.
166
+ */
167
+ setTempo(beatsPerMinute: number, beatLength: NoteLength | NoteLengthStr, dotted: boolean | number): DocumentBuilder;
168
+ /**
169
+ * Add note o current measure.
170
+ * @param voiceId - Voice id to add note to.
171
+ * @param note - Note instance of Note or string (e.g. "D4").
172
+ * @param noteLength - Note length (e.g. "4n").
173
+ * @param options - Note options.
174
+ * @returns - This document builder instance.
175
+ */
176
+ addNote(voiceId: number, note: Note | string, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions): DocumentBuilder;
177
+ /**
178
+ * @param voiceId - Voice id to add chord to.
179
+ * @param notes - Array of notes, each instance of Note or string (e.g. "D4").
180
+ * @param noteLength - Note length (e.g. "4n").
181
+ * @param options - Note options.
182
+ * @returns - This document builder instance.
183
+ */
184
+ addChord(voiceId: number, notes: (Note | string)[], noteLength: NoteLength | NoteLengthStr, options?: NoteOptions): DocumentBuilder;
185
+ /**
186
+ *
187
+ * @param voiceId - Voice id to add rest to.
188
+ * @param restLength - Rest length (e.g. "4n").
189
+ * @param options - Rest options.
190
+ * @returns - This document builder instance.
191
+ */
192
+ addRest(voiceId: number, restLength: NoteLength | NoteLengthStr, options?: RestOptions): DocumentBuilder;
193
+ /**
194
+ * Usage:
195
+ * <pre>
196
+ * addTuplet(0, Theory.Tuplet.Triplet, notes => {
197
+ * notes.addNote("G3", Theory.NoteLength.Eighth);
198
+ * notes.addNote("B3", Theory.NoteLength.Eighth);
199
+ * notes.addNote("D4", Theory.NoteLength.Eighth);
200
+ * });
201
+ * </pre>
202
+ *
203
+ * @param voiceId - Voice id to add tuplet to.
204
+ * @param tupletRatio - You can also use Theory.Tuplet presets (e.g. Theory.Tuplet.Triplet).
205
+ * @param tupletBuilder - Tuplet builder function to build tuplet.
206
+ * @returns - This document builder instance.
207
+ */
208
+ addTuplet(voiceId: VoiceId, tupletRatio: TupletRatio & TupletOptions, tupletBuilder: (notes: TupletBuilder) => void): DocumentBuilder;
26
209
  private addFermataInternal;
27
- addFermata(fermata?: Fermata): DocumentBuilder;
28
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
29
- addFermataTo(staffTabOrGroups: StaffTabOrGroups, fermata?: Fermata): DocumentBuilder;
210
+ /**
211
+ * Add fermata to current measure.
212
+ * @param fermata - Fermata type (e.g. "atNote" or Fermata.AtrNote).
213
+ * @returns - This document builder instance.
214
+ */
215
+ addFermata(fermata?: Fermata | `${Fermata}`): DocumentBuilder;
216
+ /**
217
+ * Add Fermata to current measure to given staff/tab/group.
218
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
219
+ * @param fermata - Fermata type (e.g. "atNote" or Fermata.AtrNote).
220
+ * @returns - This document builder instance.
221
+ */
222
+ addFermataTo(staffTabOrGroups: StaffTabOrGroups, fermata?: Fermata | `${Fermata}`): DocumentBuilder;
30
223
  private addNavigationInternal;
31
- addNavigation(navigation: Navigation): DocumentBuilder;
32
- addNavigation(navigation: Navigation.EndRepeat, playCount: number): DocumentBuilder;
33
- addNavigation(navigation: Navigation.Ending, ...passages: number[]): DocumentBuilder;
34
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
35
- addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation): DocumentBuilder;
36
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
37
- addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation.EndRepeat, playCount: number): DocumentBuilder;
38
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
39
- addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation.Ending, ...passages: number[]): DocumentBuilder;
40
- private addLabelInternal;
41
- addLabel(label: Label, text: string): DocumentBuilder;
42
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
43
- addLabelTo(staffTabOrGroups: StaffTabOrGroups, label: Label, text: string): DocumentBuilder;
224
+ /**
225
+ * Add navigation element to current measure.
226
+ * @param navigation - Navigation element (e.g. "D.S. al Fine" or Navigation.DS_al_Fine).
227
+ * @returns - This document builder instance.
228
+ */
229
+ addNavigation(navigation: Navigation | `${Navigation}`): DocumentBuilder;
230
+ /**
231
+ * Add end repeat navigation element to current measure.
232
+ * @param navigation - End repeat navigation element ("endRepeat" or Navigation.EndRepeat).
233
+ * @param playCount - Number of times to play the ended repeat section.
234
+ * @returns - This document builder instance.
235
+ */
236
+ addNavigation(navigation: Navigation.EndRepeat | `${Navigation.EndRepeat}`, playCount: number): DocumentBuilder;
237
+ /**
238
+ * Add ending navigation element to current measure.
239
+ * @param navigation - Ending navigation element ("ending" or Navigation.Ending).
240
+ * @param passages - Passage numbers for measure marked by this ending is played.
241
+ * @returns - This document builder instance.
242
+ */
243
+ addNavigation(navigation: Navigation.Ending | `${Navigation.Ending}`, ...passages: number[]): DocumentBuilder;
244
+ /**
245
+ * Add navigation element to current measure to given staff/tab/group.
246
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
247
+ * @param navigation
248
+ * @returns - This document builder instance.
249
+ */
250
+ addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation | `${Navigation}`): DocumentBuilder;
251
+ /**
252
+ * Add end repeat navigation element to current measure to given staff/tab/group.
253
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
254
+ * @param navigation
255
+ * @param playCount
256
+ * @returns - This document builder instance.
257
+ */
258
+ addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation.EndRepeat | `${Navigation.EndRepeat}`, playCount: number): DocumentBuilder;
259
+ /**
260
+ * Add ending navigation element to current measure to given staff/tab/group.
261
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
262
+ * @param navigation
263
+ * @param passages
264
+ * @returns - This document builder instance.
265
+ */
266
+ addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation.Ending | `${Navigation.Ending}`, ...passages: number[]): DocumentBuilder;
44
267
  private addAnnotationInternal;
45
- addAnnotation(annotation: Annotation, text: string): DocumentBuilder;
46
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
47
- addAnnotationTo(staffTabOrGroups: StaffTabOrGroups, annotation: Annotation, text: string): DocumentBuilder;
48
- addConnective(connective: Connective.Tie, tieSpan?: number | TieType, notAnchor?: NoteAnchor): DocumentBuilder;
49
- addConnective(connective: Connective.Slur, slurSpan?: number, notAnchor?: NoteAnchor): DocumentBuilder;
50
- addConnective(connective: Connective.Slide, notAnchor?: NoteAnchor): DocumentBuilder;
51
- addExtension(extensionLength: NoteLength | number, extensionVisible?: boolean): DocumentBuilder;
52
268
  /**
53
- *
269
+ * Add annotation text to column of last added note/chord/rest in current measure.
270
+ * @param text - Known annotation text (e.g. "pp").
271
+ * @returns - This document builder instance.
272
+ */
273
+ addAnnotation(text: AnnotationText): DocumentBuilder;
274
+ /**
275
+ * Add annotation text to column of last added note/chord/rest in current measure.
276
+ * @param annotation - Annotation type (e.g. "tempo" or Annotation.Tempo).
277
+ * @param text - Annotation text (unrestricted).
278
+ * @returns - This document builder instance.
279
+ */
280
+ addAnnotation(annotation: Annotation | `${Annotation}`, text: string): DocumentBuilder;
281
+ /**
282
+ * Add annotation text to column of last added note/chord/rest in current measure to given staff/tab/group.
283
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
284
+ * @param text - Known annotation text (e.g. "pp").
285
+ * @returns - This document builder instance.
286
+ */
287
+ addAnnotationTo(staffTabOrGroups: StaffTabOrGroups, text: AnnotationText): DocumentBuilder;
288
+ /**
289
+ * Add annotation text to column of last added note/chord/rest in current measure to given staff/tab/group.
290
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
291
+ * @param annotation - Annotation type (e.g. "tempo" or Annotation.Tempo).
292
+ * @param text - Annotation text (unrestricted).
293
+ * @returns - This document builder instance.
294
+ */
295
+ addAnnotationTo(staffTabOrGroups: StaffTabOrGroups, annotation: Annotation | `${Annotation}`, text: string): DocumentBuilder;
296
+ private addLabelInternal;
297
+ /**
298
+ * Add label text to column of last added note/chord/rest in current measure.
299
+ * @param label - Label type (e.g. "chord" or Label.Chord).
300
+ * @param text - label text (e.g. "Am").
301
+ * @returns - This document builder instance.
302
+ */
303
+ addLabel(label: Label | `${Label}`, text: string): DocumentBuilder;
304
+ /**
305
+ * Add label text to column of last added note/chord/rest in current measure to given staff/tab/group.
306
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
307
+ * @param label - Label type (e.g. "chord" or Label.Chord).
308
+ * @param text - label text (e.g. "Am").
309
+ * @returns - This document builder instance.
310
+ */
311
+ addLabelTo(staffTabOrGroups: StaffTabOrGroups, label: Label | `${Label}`, text: string): DocumentBuilder;
312
+ /**
313
+ * Add tie starting from last added note/chord.
314
+ * @param connective - Connective type ("tie" or Connective.Tie).
315
+ * @param tieSpan - How many notes across this tie spans.
316
+ * @param notAnchor - Anchor point for note and this tie.
317
+ * @returns - This document builder instance.
318
+ */
319
+ addConnective(connective: Connective.Tie | `${Connective.Tie}`, tieSpan?: number | TieType | `${TieType}`, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
320
+ /**
321
+ * Add slur starting from last added note/chord.
322
+ * @param connective - Connective type ("slur" or Connective.Slur).
323
+ * @param slurSpan - How many notes across this slur spans.
324
+ * @param notAnchor - Anchor point for note and this slur.
325
+ * @returns - This document builder instance.
326
+ */
327
+ addConnective(connective: Connective.Slur | `${Connective.Slur}`, slurSpan?: number, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
328
+ /**
329
+ * Add slide starting from last added note/chord.
330
+ * @param connective - Connective type ("slide" or Connective.Slide).
331
+ * @param notAnchor - Anchor point for note and this slide.
332
+ * @returns - This document builder instance.
333
+ */
334
+ addConnective(connective: Connective.Slide | `${Connective.Slide}`, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
335
+ /**
336
+ * Add extension line to previously added annotation or label element.
337
+ * <pre>
338
+ * // Example
339
+ * addExtension(ext => ext.notes("1n", 2)) // length is 2 whole notes
340
+ * addExtension(ext => ext.measures(3).hide()) // length is 3 measures, hidden
341
+ * addExtension(ext => ext.measures(1).notes("8n")) // length is 1 measure + 1 eigth note
342
+ * addExtension(ext => ext.infinity()) // length is as long as possible
343
+ * </pre>
344
+ * @param extensionBuilder - Extension builder function used to build exstension.
345
+ * @returns - This document builder instance.
346
+ */
347
+ addExtension(extensionBuilder?: (ext: ExtensionBuilder) => void): DocumentBuilder;
348
+ /**
349
+ * Add staff group.
54
350
  * @param groupName - Name of staff group.
55
351
  * @param staffsTabsAndGroups - staff/tab index (0=top), staff/tab name, or staff group name. Single value or array.
56
352
  * @param verticalPosition - Vertical position, are elements added above, below or both.
57
- * @returns
353
+ * @returns - This document builder instance.
354
+ */
355
+ addStaffGroup(groupName: string, staffsTabsAndGroups: number | string | (number | string)[], verticalPosition?: VerticalPosition | `${VerticalPosition}`): DocumentBuilder;
356
+ /**
357
+ * Add song end. Adds certain bar line at the end of measure.
358
+ * @returns - This document builder instance.
58
359
  */
59
- addStaffGroup(groupName: string, staffsTabsAndGroups: number | string | (number | string)[], verticalPosition?: VerticalPosition): DocumentBuilder;
60
360
  endSong(): DocumentBuilder;
361
+ /**
362
+ * Add section end. Adds certain bar line at the end of measure.
363
+ * @returns - This document builder instance.
364
+ */
61
365
  endSection(): DocumentBuilder;
366
+ /**
367
+ * End current score row. Next measure will start new row.
368
+ * @returns - This document builder instance.
369
+ */
62
370
  endRow(): DocumentBuilder;
63
- completeRests(voiceId?: number): DocumentBuilder;
371
+ /**
372
+ * Add rests to fill current measure.
373
+ * @param voiceId - Voice id to add rests to. Single value, array or all if omitted.
374
+ * @returns - This document builder instance.
375
+ */
376
+ completeRests(voiceId?: VoiceId | VoiceId[]): DocumentBuilder;
377
+ /**
378
+ * Add notes of given scale in ascending order.
379
+ * @param scale - Scale.
380
+ * @param bottomNote - Scale starts from note >= bottom note.
381
+ * @param numOctaves - Number of octaves to add.
382
+ * @returns - This document builder instance.
383
+ */
64
384
  addScaleArpeggio(scale: Scale, bottomNote: string, numOctaves: number): DocumentBuilder;
65
385
  }
66
386
 
67
- export { Annotation, Connective, DocumentBuilder, Fermata, Label, MDocument, Navigation, NoteAnchor, NoteOptions, RestOptions, ScoreConfiguration, StaffPreset, StaffTabOrGroups, TieType, VerticalPosition };
387
+ export { Annotation, AnnotationText, Connective, DocumentBuilder, type ExtensionBuilder, Fermata, Label, MDocument, Navigation, NoteAnchor, NoteOptions, RestOptions, ScoreConfiguration, StaffPreset, StaffTabOrGroups, TieType, type TupletBuilder, TupletOptions, VerticalPosition, VoiceId };