-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
[8.14.1] Type errors #8753
Comments
The ready method comes from Component, which Player inherits from. |
I'm not sure, maybe overriding the type signature is possible. This is not that important if it's difficult to fix as users can cast the usage in the function so it's kind-of OK. The other problem with the return type is breaking all usages of |
yeah, these two lines should be removed. Not sure why they were re-added the last time that piece was touched: Lines 841 to 842 in 8729e31
|
I guess that is wrong, yes, because I don't see the code returning anything from |
Lines 28 to 34 in 8729e31
|
Looking in VSCode, when I hover over |
It's all very complicated because typescript understands a subset of jsdoc when generating the types, and also some typescript-specific syntax in jsdoc but which jsdoc itself doesn't understand, and breaks generating the API docs. Finding a balance that works for both is hard. If I remove the
|
This also doesn't work, the return type must be |
It looks like jsdoc is ok with using |
|
I'm really not the person to review JSDoc. 😄 But as for the |
Description
Thanks for the new release! However, I believe there is an issue in the new types:
component.d.ts
The return type of the
fn
parameter is not supposed to beComponent
but rathervoid
- I don't think we have to return values from the callback in theready
method, right?Also, when called on the
Player
, isn't thethis
going to be thePlayer
instance? As In that case thethis
argument is wrongly marked asComponent
:Reduced test case
N/A
Steps to reproduce
Install
video.js
and use TS.Errors
No response
What version of Video.js are you using?
8.14.1
Video.js plugins used.
No response
What browser(s) including version(s) does this occur with?
N/A
What OS(es) and version(s) does this occur with?
Linux
The text was updated successfully, but these errors were encountered: