abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

Do elements in NoteTimingEvent have the right type?

Open regisfrias opened this issue 3 years ago • 2 comments

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:

Screenshot 2022-09-16 at 14 55 44

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!

regisfrias avatar Sep 16 '22 12:09 regisfrias

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.

paulrosen avatar Sep 18 '22 16:09 paulrosen

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 😄

regisfrias avatar Sep 19 '22 03:09 regisfrias

Will be fixed in version 6.1.9

paulrosen avatar Feb 11 '23 23:02 paulrosen