Closed illright closed 2 weeks ago
I too experience this same issue with the <video>
element and its buffered
property.
Same here. It's easy to work around it, the extra line is yet annoying. I created this REPL https://svelte.dev/repl/38429f4787f04e6ea4ebf2246becd289?version=3.57.0
This was fixed at some point.
Describe the bug
When you bind to the
buffered
property of an<audio>
element, for instance, the value that comes from this property has the typeArray<{ start: number; end: number; }>
. If you use that type on a bound variable, however,svelte-check
will report its incompatibility withTimeRanges
, which is what the type of this property should be.Opinion on these types
In my opinion, this conversion from `TimeRanges` to a custom type is unjustified. Yes, `TimeRanges` is ridiculous, but it's standardized. Learning to operate this new type (the documentation of which is buried deep within the tutorial) is an unpleasant experience by itself. In this regard, I really like the approach of the Remix web framework that goes to great lengths to ensure _transferability of knowledge_. This type conversion is one of the few examples where knowledge of Svelte is not tranferable, and in my opinion it trumps the convenience of writing a `for .. of` loop instead of an index-based one.Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-8p9wht?file=src/routes/index.svelte
Logs
System Info
Severity
annoyance