-
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
[WIP] Type enhancements #8968
base: main
Are you sure you want to change the base?
[WIP] Type enhancements #8968
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8968 +/- ##
=======================================
Coverage 83.72% 83.72%
=======================================
Files 120 120
Lines 8110 8110
Branches 1948 1948
=======================================
Hits 6790 6790
Misses 1320 1320 ☔ View full report in Codecov by Sentry. |
@@ -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
TextTrackCue
,TextTrackCue
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