-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SourceBuffer.appendBuffer() is missing overload for ArrayBufferView param in lib.d.ts #314
Comments
Why do we need this? |
From
I believe this is why the spec outlines the two separate overloads. |
TypeScript uses a structural type system; explicitly declaring inheritance is unnecessary. var videoSource: SourceBuffer;
// Does not error
videoSource.appendBuffer(new Uint8Array(null)); |
Note that there is not a subclass relationship between It's a coincidence right now that you can successfully pass an ArrayBufferView where an ArrayBuffer is expected. But, for example, if #310 is fixed, this will no longer be true. |
It's for that reason that As an aside, @lukehoban, why does Typescript even allow for that coincidence? |
Let's not get in to why TypeScript uses a structural type system in this thread, please. We can add the overload to |
@RyanCavanaugh I'm happy to submit a PR, but need more info on strategy:
|
We don't need to add any complicated process here with a new .d.ts, let's just add whatever changes are necessary to lib.d.ts and we can manage integrating that with the generated bits from the IE definitions. |
Sorry for the confusion. we can not accept pull requests to this. we need to update our script. I will take care of this. |
👍 thanks @mhegazy |
@mhegazy, @RyanCavanaugh this fix doesn't appear to have successfully made it into 1.1. The
it should contain
I'm guessing that you previously updated |
That is likely the case :( |
For some issue in my script the overload of "ArrayBufferView" shows up as "any". Will fix soon. |
Related PR #2827 |
According to the MediaSource Candidate Recommendation Spec, there are two
SourceBuffer.appendBuffer()
method overloads.MSDN only mentions the
ArrayBuffer
overload, even though this is later contradicted in the example code, further down on the same page:(
Uint8Array
indeed inherits fromArrayBufferView
, notArrayBuffer
).My tests show that Chrome 36 currently only works with
ArrayBufferView
(as per the MSDN example code).Anyway, long story short:
Here is the
lib.d.ts
change request, as supported by the spec, MSDN example code and Chrome 36:Existing:
Suggested:
The text was updated successfully, but these errors were encountered: