Skip to content

Commit

Permalink
fix(types): Add has|usingPlugin to typedef
Browse files Browse the repository at this point in the history
  • Loading branch information
mister-ben committed Jul 21, 2024
1 parent 62939ee commit 89234d0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 15 deletions.
10 changes: 0 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@
"rollup-plugin-multi-entry": "^2.0.2",
"rollup-plugin-node-resolve": "^4.2.4",
"rollup-plugin-progress": "^1.1.2",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-stub": "^1.2.0",
"rollup-plugin-svg": "^2.0.0",
"sass": "^1.34.0",
Expand Down
32 changes: 30 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import image from '@rollup/plugin-image';
import istanbul from 'rollup-plugin-istanbul';
import externalGlobals from 'rollup-plugin-external-globals';
import svg from 'rollup-plugin-svg';
import { excludeLines } from './build/rollup-ignore';
import excludeLines from './build/rollup-exclude-lines';

const excludeCoverage = [
'test/**',
Expand Down Expand Up @@ -145,7 +145,7 @@ export default cliargs => [
external: externals.browser,
plugins: [
excludeLines({
include: 'src/**',
include: 'src/js/**',
patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g]
}),
alias({
Expand Down Expand Up @@ -174,6 +174,10 @@ export default cliargs => [
},
external: externals.browser,
plugins: [
excludeLines({
include: 'src/js/**',
patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g]
}),
alias({
'video.js': path.resolve(__dirname, './src/js/video.js')
}),
Expand All @@ -198,6 +202,10 @@ export default cliargs => [
},
external: externals.test,
plugins: [
excludeLines({
include: 'src/js/**',
patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g]
}),
multiEntry({exports: false}),
alias({
'video.js': path.resolve(__dirname, './src/js/video.js')
Expand Down Expand Up @@ -233,6 +241,10 @@ export default cliargs => [
],
external: externals.module,
plugins: [
excludeLines({
include: 'src/js/**',
patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g]
}),
alias({
'video.js': path.resolve(__dirname, './src/js/video.js'),
'videojs-contrib-quality-levels': path.resolve(__dirname, './node_modules/videojs-contrib-quality-levels/dist/videojs-contrib-quality-levels.es.js'),
Expand Down Expand Up @@ -265,6 +277,10 @@ export default cliargs => [
external: externals.browser,
plugins: [
primedIgnore,
excludeLines({
include: 'src/js/**',
patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g]
}),
alias({
'video.js': path.resolve(__dirname, './src/js/video.js')
}),
Expand Down Expand Up @@ -297,6 +313,10 @@ export default cliargs => [
],
external: externals.module,
plugins: [
excludeLines({
include: 'src/js/**',
patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g]
}),
json(),
primedBabel,
svg(),
Expand All @@ -318,6 +338,10 @@ export default cliargs => [
external: externals.browser,
plugins: [
primedResolve,
excludeLines({
include: 'src/js/**',
patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g]
}),
json(),
primedExternalGlobals,
primedCjs,
Expand All @@ -342,6 +366,10 @@ export default cliargs => [
plugins: [
primedIgnore,
primedResolve,
excludeLines({
include: 'src/js/**',
patterns: [/\/\/\s*exclude\s*start[\s\S]*?\/\/\s*exclude\s*end/g]
}),
json(),
primedExternalGlobals,
primedCjs,
Expand Down
10 changes: 10 additions & 0 deletions src/js/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ class Component {
* @param {Function} fn
* The function to call with `EventTarget`s
*/
/* start-delete-from-build */
on(type, fn) {}
/* end-delete-from-build */

/**
* Removes an `event listener` for a specific event from an instance of `EventTarget`.
Expand All @@ -164,7 +166,9 @@ class Component {
* @param {Function} [fn]
* The function to remove. If not specified, all listeners managed by Video.js will be removed.
*/
/* start-delete-from-build */
off(type, fn) {}
/* end-delete-from-build */

/**
* This function will add an `event listener` that gets triggered only once. After the
Expand All @@ -177,7 +181,9 @@ class Component {
* @param {Function} fn
* The function to be called once for each event name.
*/
/* start-delete-from-build */
one(type, fn) {}
/* end-delete-from-build */

/**
* This function will add an `event listener` that gets triggered only once and is
Expand All @@ -191,7 +197,9 @@ class Component {
* @param {Function} fn
* The function to be called once for each event name.
*/
/* start-delete-from-build */
any(type, fn) {}
/* end-delete-from-build */

/**
* This function causes an event to happen. This will then cause any `event listeners`
Expand All @@ -212,7 +220,9 @@ class Component {
* @param {Object} [hash]
* Optionally extra argument to pass through to an event listener
*/
/* start-delete-from-build */
trigger(event, hash) {}
/* end-delete-from-build */

/**
* Dispose of the `Component` and all child components.
Expand Down
6 changes: 4 additions & 2 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -5339,11 +5339,11 @@ class Player extends Component {
* @return {boolean}
* Whether or not this player has the requested plugin available.
*/
// exclude start
/* start-delete-from-build */
hasPlugin(name) {
return false;
}
// exclude end
/* end-delete-from-build */

/**
* Reports whether or not a player is using a plugin by name.
Expand All @@ -5358,9 +5358,11 @@ class Player extends Component {
* @return {boolean}
* Whether or not this player is using the requested plugin.
*/
/* start-delete-from-build */
usingPlugin(name) {
return false;
}
/* end-delete-from-build */
}

/**
Expand Down

0 comments on commit 89234d0

Please sign in to comment.