Prechádzať zdrojové kódy

chore: update @types/vexflow to 3.0.0, remove any (requires npm install)

sschmid 4 rokov pred
rodič
commit
2bc5139350

+ 1 - 1
package.json

@@ -61,7 +61,7 @@
   },
   "homepage": "http://opensheetmusicdisplay.org",
   "dependencies": {
-    "@types/vexflow": "^1.2.36",
+    "@types/vexflow": "^3.0.0",
     "jszip": "3.4.0",
     "loglevel": "^1.6.8",
     "typescript-collections": "^1.3.3",

+ 2 - 3
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts

@@ -131,10 +131,9 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
 
     // Format the voices
     const allVoices: Vex.Flow.Voice[] = [];
-    // TODO: remove the any when the new DefinitelyTyped PR is through and update released
-    const formatter: Vex.Flow.Formatter = new (Vex.Flow as any).Formatter({
+    const formatter: Vex.Flow.Formatter = new Vex.Flow.Formatter({
       // maxIterations: 2,
-      softmaxFactor: this.rules.SoftmaxFactorVexFlow
+      softmaxFactor: this.rules.SoftmaxFactorVexFlow // this setting is only applied in Vexflow 3.x. also this needs @types/vexflow ^3.0.0
     });
 
     for (const measure of measures) {