fixed ts type issue

This commit is contained in:
Clément Le Bihan
2023-09-05 15:08:56 +02:00
parent 85473ae492
commit a81d3ee34d
3 changed files with 14 additions and 6 deletions
+5 -1
View File
@@ -103,7 +103,11 @@ const PartitionView = (props: PartitionViewProps) => {
// console.log('timestamp cursor', _osmd.cursor.iterator.CurrentSourceTimestamp);
// console.log('timestamp cursor', _osmd.cursor.iterator.CurrentVoiceEntries);
// console.log('current measure index', _osmd.cursor.iterator.CurrentMeasureIndex);
const osmdCanvas = document.querySelector('#' + OSMD_DIV_ID + ' canvas');
const osmdCanvas = document.querySelector<HTMLCanvasElement>('#' + OSMD_DIV_ID + ' canvas');
if (!osmdCanvas) {
// this should never happen this is done to silent ts linter about maybe null
throw new Error('No canvas found');
}
// Ty https://github.com/jimutt/osmd-audio-player/blob/ec205a6e46ee50002c1fa8f5999389447bba7bbf/src/PlaybackEngine.ts#LL77C12-L77C63
props.onPartitionReady(
osmdCanvas.toDataURL(),