mirror of
https://github.com/videojs/video.js.git
synced 2025-01-02 06:32:07 +02:00
fix(types): use typeof for registerComponent and registerPlugin (#8451)
* use typeof for registerComponent|Plugin * separate out addChild changes
This commit is contained in:
parent
d1c3bd32b6
commit
2c36d2542a
@ -582,7 +582,6 @@ class Component {
|
||||
/**
|
||||
* Add a child `Component` inside the current `Component`.
|
||||
*
|
||||
*
|
||||
* @param {string|Component} child
|
||||
* The name or instance of a child to add.
|
||||
*
|
||||
@ -593,6 +592,7 @@ class Component {
|
||||
* @param {number} [index=this.children_.length]
|
||||
* The index to attempt to add a child into.
|
||||
*
|
||||
*
|
||||
* @return {Component}
|
||||
* The `Component` that gets added as a child. When using a string the
|
||||
* `Component` will get created by this process.
|
||||
|
@ -286,8 +286,8 @@ const DEFAULT_BREAKPOINTS = {
|
||||
*
|
||||
* After an instance has been created it can be accessed globally in three ways:
|
||||
* 1. By calling `videojs.getPlayer('example_video_1');`
|
||||
* 2. By calling `videojs('example_video_1');` (not recomended)
|
||||
* 2. By using it directly via `videojs.players.example_video_1;`
|
||||
* 2. By calling `videojs('example_video_1');` (not recommended)
|
||||
* 2. By using it directly via `videojs.players.example_video_1;`
|
||||
*
|
||||
* @extends Component
|
||||
* @global
|
||||
|
@ -320,10 +320,10 @@ videojs.getComponent = Component.getComponent;
|
||||
* @param {string} name
|
||||
* The class name of the component
|
||||
*
|
||||
* @param {Component} comp
|
||||
* @param {typeof Component} comp
|
||||
* The component class
|
||||
*
|
||||
* @return {Component}
|
||||
* @return {typeof Component}
|
||||
* The newly registered component
|
||||
*/
|
||||
videojs.registerComponent = (name, comp) => {
|
||||
@ -410,9 +410,11 @@ videojs.deregisterPlugin = Plugin.deregisterPlugin;
|
||||
*
|
||||
* @param {string} name
|
||||
* The plugin name
|
||||
*
|
||||
* @param {Plugin|Function} plugin
|
||||
*
|
||||
* @param {typeof Plugin|Function} plugin
|
||||
* The plugin sub-class or function
|
||||
*
|
||||
* @return {typeof Plugin|Function}
|
||||
*/
|
||||
videojs.plugin = (name, plugin) => {
|
||||
log.warn('videojs.plugin() is deprecated; use videojs.registerPlugin() instead');
|
||||
|
Loading…
Reference in New Issue
Block a user