abcjs
abcjs copied to clipboard
Do elements in NoteTimingEvent have the right type?
Hi,
thanks for the excellent library!
I'm playing with highlighting current notes (with this: https://paulrosen.github.io/abcjs/audio/synthesized-sound.html#cursorcontrol-object) and noticed that TypeScript complains about the note type:

interface NoteTimingEvent contains elements?: Array<HTMLElement>, but it looks like what is really coming from event.elements is an object (or array?). For example changing the type to this elements?: Array<Array<HTMLElement>>; works, but I'm not sure why.
Did I misunderstand something?
Thank you!
I think you're right. I'll fix that in the next version, which I hope will be in a week or so. I think the problem goes upstream a little so I don't want to just change that one definition without understanding it.
Yeah, I have the feeling that the definition itself is right. All of the arrays in this case contain only one note. They probably shouldn't be an array.
If that helps 😄
Will be fixed in version 6.1.9