Skip to content

Commit

Permalink
chore(types): fix issues in exported types (#8333)
Browse files Browse the repository at this point in the history
  • Loading branch information
boris-petrov authored Sep 28, 2023
1 parent 473176f commit bad086d
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 24 deletions.
12 changes: 5 additions & 7 deletions src/js/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -1076,9 +1076,8 @@ class Component {
* @param {boolean} [skipListeners]
* Skip the componentresize event trigger
*
* @return {number|string}
* The width when getting, zero if there is no width. Can be a string
* postpixed with '%' or 'px'.
* @return {number|undefined}
* The width when getting, zero if there is no width
*/
width(num, skipListeners) {
return this.dimension('width', num, skipListeners);
Expand All @@ -1094,9 +1093,8 @@ class Component {
* @param {boolean} [skipListeners]
* Skip the componentresize event trigger
*
* @return {number|string}
* The width when getting, zero if there is no width. Can be a string
* postpixed with '%' or 'px'.
* @return {number|undefined}
* The height when getting, zero if there is no height
*/
height(num, skipListeners) {
return this.dimension('height', num, skipListeners);
Expand Down Expand Up @@ -1142,7 +1140,7 @@ class Component {
* @param {boolean} [skipListeners]
* Skip componentresize event trigger
*
* @return {number}
* @return {number|undefined}
* The dimension when getting or 0 if unset
*/
dimension(widthOrHeight, num, skipListeners) {
Expand Down
4 changes: 2 additions & 2 deletions src/js/event-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class EventTarget {
/**
* All event listeners should follow the following format.
*
* @callback EventTarget~EventListener
* @callback EventListener
* @this {EventTarget}
*
* @param {Event} event
Expand All @@ -185,7 +185,7 @@ class EventTarget {
* will have extra functionality. See that function for more information.
*
* @property EventTarget.prototype.allowedEvents_
* @private
* @protected
*/
EventTarget.prototype.allowedEvents_ = {};

Expand Down
16 changes: 8 additions & 8 deletions src/js/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const markPluginAsActive = (player, name) => {
* @param {Player} player
* A Video.js player instance.
*
* @param {Plugin~PluginEventHash} hash
* @param {PluginEventHash} hash
* A plugin event hash.
*
* @param {boolean} [before]
Expand Down Expand Up @@ -238,7 +238,7 @@ class Plugin {
* @param {Object} [hash={}]
* An object to be used as event an event hash.
*
* @return {Plugin~PluginEventHash}
* @return {PluginEventHash}
* An event hash object with provided properties mixed-in.
*/
getEventHash(hash = {}) {
Expand All @@ -257,7 +257,7 @@ class Plugin {
*
* @param {Object} [hash={}]
* Additional data hash to merge with a
* {@link Plugin~PluginEventHash|PluginEventHash}.
* {@link PluginEventHash|PluginEventHash}.
*
* @return {boolean}
* Whether or not default was prevented.
Expand Down Expand Up @@ -482,34 +482,34 @@ export default Plugin;
* Signals that a plugin is about to be set up on a player.
*
* @event Player#beforepluginsetup
* @type {Plugin~PluginEventHash}
* @type {PluginEventHash}
*/

/**
* Signals that a plugin is about to be set up on a player - by name. The name
* is the name of the plugin.
*
* @event Player#beforepluginsetup:$name
* @type {Plugin~PluginEventHash}
* @type {PluginEventHash}
*/

/**
* Signals that a plugin has just been set up on a player.
*
* @event Player#pluginsetup
* @type {Plugin~PluginEventHash}
* @type {PluginEventHash}
*/

/**
* Signals that a plugin has just been set up on a player - by name. The name
* is the name of the plugin.
*
* @event Player#pluginsetup:$name
* @type {Plugin~PluginEventHash}
* @type {PluginEventHash}
*/

/**
* @typedef {Object} Plugin~PluginEventHash
* @typedef {Object} PluginEventHash
*
* @property {string} instance
* For basic plugins, the return value of the plugin function. For
Expand Down
10 changes: 5 additions & 5 deletions src/js/tech/tech.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import * as Guid from '../utils/guid.js';
* * `var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'};`
* `var SourceString = 'http://example.com/some-video.mp4';`
*
* @typedef {Object|string} Tech~SourceObject
* @typedef {Object|string} SourceObject
*
* @property {string} src
* The url to the source
Expand Down Expand Up @@ -480,7 +480,7 @@ class Tech extends Component {
* > NOTE: This implementation is incomplete. It does not track the played `TimeRange`.
* It only checks whether the source has played at all or not.
*
* @return {TimeRange}
* @return { import('../utils/time').TimeRange }
* - A single time range if this video has played
* - An empty set of ranges if not.
*/
Expand Down Expand Up @@ -1280,7 +1280,7 @@ Tech.withSourceHandlers = function(_Tech) {
*
* TODO: Answer question: should 'probably' be prioritized over 'maybe'
*
* @param {Tech~SourceObject} source
* @param {SourceObject} source
* The source object
*
* @param {Object} options
Expand Down Expand Up @@ -1308,7 +1308,7 @@ Tech.withSourceHandlers = function(_Tech) {
/**
* Check if the tech can support the given source.
*
* @param {Tech~SourceObject} srcObj
* @param {SourceObject} srcObj
* The source object
*
* @param {Object} options
Expand Down Expand Up @@ -1371,7 +1371,7 @@ Tech.withSourceHandlers = function(_Tech) {
* and source handlers.
* Should never be called unless a source handler was found.
*
* @param {Tech~SourceObject} source
* @param {SourceObject} source
* A source object with src and type keys
*/
_Tech.prototype.setSource = function(source) {
Expand Down
2 changes: 1 addition & 1 deletion src/js/tracks/audio-track-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AudioTrackList extends TrackList {
/**
* Create an instance of this class.
*
* @param {AudioTrack[]} [tracks=[]]
* @param { import('./audio-track').default[] } [tracks=[]]
* A list of `AudioTrack` to instantiate the list with.
*/
constructor(tracks = []) {
Expand Down
3 changes: 3 additions & 0 deletions src/js/tracks/html-track-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ class HTMLTrackElement extends EventTarget {
}
}

/**
* @protected
*/
HTMLTrackElement.prototype.allowedEvents_ = {
load: 'load'
};
Expand Down
1 change: 1 addition & 0 deletions src/js/tracks/text-track.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ class TextTrack extends Track {

/**
* cuechange - One or more cues in the track have become active or stopped being active.
* @protected
*/
TextTrack.prototype.allowedEvents_ = {
cuechange: 'cuechange'
Expand Down
2 changes: 1 addition & 1 deletion src/js/tracks/track-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class TrackList extends EventTarget {
* Events that can be called with on + eventName. See {@link EventHandler}.
*
* @property {Object} TrackList#allowedEvents_
* @private
* @protected
*/
TrackList.prototype.allowedEvents_ = {
change: 'change',
Expand Down
3 changes: 3 additions & 0 deletions src/js/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* @file video.js
* @module videojs
*/
/**
* @typedef { string } version
*/
import {version} from '../../package.json';
import window from 'global/window';
import {
Expand Down

0 comments on commit bad086d

Please sign in to comment.