mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-17 07:20:23 +00:00
Merge pull request #17817 from nearbydelta/master
Fix the definition of class Note in @Types/VexFlow to address Issue #17023
This commit is contained in:
Vendored
+3
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for VexFlow v1.2.83
|
||||
// Type definitions for VexFlow v1.2.84
|
||||
// Project: http://vexflow.com
|
||||
// Definitions by: Roman Quiring <https://github.com/rquiring>
|
||||
// Sebastian Haas <https://github.com/sebastianhaas/>
|
||||
@@ -187,6 +187,7 @@ declare namespace Vex {
|
||||
|
||||
class BarNote extends Note {
|
||||
static DEBUG : boolean;
|
||||
constructor();
|
||||
getType() : Barline.type;
|
||||
setType(type : Barline.type) : BarNote;
|
||||
getBoundingBox() : BoundingBox;
|
||||
@@ -618,7 +619,7 @@ declare namespace Vex {
|
||||
getTickMultiplier() : Fraction;
|
||||
applyTickMultiplier(numerator : number, denominator : number) : void;
|
||||
setDuration(duration : Fraction) : void;
|
||||
|
||||
|
||||
constructor(note_struct : {type? : string, dots? : number, duration : string});
|
||||
getPlayNote() : any;
|
||||
setPlayNote(note : any) : Note;
|
||||
|
||||
@@ -34,16 +34,20 @@ notes1[2].addModifier(0, new Vex.Flow.GraceNoteGroup([gracenote], true).beamNote
|
||||
// Color the chord
|
||||
notes1[3].setStyle({fillStyle: "blue", strokeStyle: "blue"});
|
||||
|
||||
// Add a bar
|
||||
var tickable1: Vex.Flow.Note[] = notes1;
|
||||
tickable1.push(new Vex.Flow.BarNote());
|
||||
|
||||
// Create a voice in 4/4 and add notes
|
||||
var voice1 = new Vex.Flow.Voice({
|
||||
num_beats: 4,
|
||||
beat_value: 4,
|
||||
resolution: Vex.Flow.RESOLUTION
|
||||
}).addTickables(notes1);
|
||||
}).addTickables(tickable1);
|
||||
|
||||
// Create a second voice with just one whole note
|
||||
var voice2 = new Vex.Flow.Voice(Vex.Flow.TIME4_4).
|
||||
addTickables([new Vex.Flow.StaveNote({keys: ["c/4"], duration: "w"})]);
|
||||
addTickables([new Vex.Flow.StaveNote({keys: ["c/4"], duration: "w"}), new Vex.Flow.BarNote()]);
|
||||
|
||||
// Format and justify the notes to 550 pixels
|
||||
var formatter = new Vex.Flow.Formatter().
|
||||
@@ -85,4 +89,4 @@ var notes = [
|
||||
];
|
||||
|
||||
// Format ad draw the notes
|
||||
Vex.Flow.Formatter.FormatAndDraw(ctx, tabstave, notes);
|
||||
Vex.Flow.Formatter.FormatAndDraw(ctx, tabstave, notes);
|
||||
|
||||
Reference in New Issue
Block a user