diff --git a/types/vexflow/index.d.ts b/types/vexflow/index.d.ts index 3c3aa2365a..01c8d75381 100644 --- a/types/vexflow/index.d.ts +++ b/types/vexflow/index.d.ts @@ -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 // Sebastian Haas @@ -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; diff --git a/types/vexflow/vexflow-tests.ts b/types/vexflow/vexflow-tests.ts index 52a031ac1b..6a9187c7e5 100644 --- a/types/vexflow/vexflow-tests.ts +++ b/types/vexflow/vexflow-tests.ts @@ -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); \ No newline at end of file +Vex.Flow.Formatter.FormatAndDraw(ctx, tabstave, notes);