fix ts issues 2

This commit is contained in:
Clément Le Bihan
2023-09-05 15:29:35 +02:00
parent a81d3ee34d
commit b76d496034
3 changed files with 22 additions and 6 deletions
+4 -2
View File
@@ -103,9 +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<HTMLCanvasElement>('#' + OSMD_DIV_ID + ' canvas');
const osmdCanvas = document.querySelector<HTMLCanvasElement>(
'#' + OSMD_DIV_ID + ' canvas'
);
// this should never happen this is done to silent ts linter about maybe null
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