-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
refactor(types): Type enhancements #8968
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8968 +/- ##
==========================================
- Coverage 84.88% 84.31% -0.58%
==========================================
Files 120 120
Lines 8152 8154 +2
Branches 1964 1964
==========================================
- Hits 6920 6875 -45
- Misses 1232 1279 +47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -617,3 +620,7 @@ videojs.url = Url; | |||
videojs.Error = VjsErrors; | |||
|
|||
export default videojs; | |||
export { | |||
Player, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows adding to the Player interface in plugins:
declare module 'video.js' {
interface Player {
touchOverlay: TouchOverlay;
touchOverlayDirect: TouchOverlay;
mobileUi: {
(options?: MobileUiPluginOptions): void;
VERSION: string;
}
}
}
* The key/value store of options that will get passed to children of | ||
* the child. | ||
* | ||
* @param {number} [index=this.children_.length] | ||
* The index to attempt to add a child into. | ||
* | ||
* | ||
* @return {Component} | ||
* @return {T} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several changes for Typescript.
@template {xyz} T
. Replaces uses of T withClass.<xyz>
ComponentOptions
,SourceObject
,PlayerOptions
,MediaObject
~
namespacing, which is valid jsdoc, but which tsc fails to understandTextTrackCue
,TextTrackKind
definitions.Player
,PlayerOptions
andPlugin
fromvideo.js
.declare module 'video.js' { interface Player {
track
andreadyState
inHTMLTrackElement
, as tsc doesn't understand documentation for properties added withObject.defineProperties
. FixesHTMLTrackElement
class provided missing two properties as stated in MDN #8959