Skip to content

Commit

Permalink
feat: generate Typescript definitions (#7954)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjanblaszczyk authored and misteroneill committed Nov 23, 2022
1 parent b7080f7 commit 0545df5
Show file tree
Hide file tree
Showing 12 changed files with 214 additions and 164 deletions.
15 changes: 12 additions & 3 deletions package-lock.json

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

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "./dist/video.cjs.js",
"module": "./dist/video.es.js",
"style": "./dist/video-js.css",
"types": "./dist/types/video.d.ts",
"copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",
"license": "Apache-2.0",
"keywords": [
Expand All @@ -25,7 +26,7 @@
"postclean": "shx mkdir -p ./dist/lang ./test/dist",
"changelog": "conventional-changelog -p videojs -i CHANGELOG.md -s",
"build": "npm-run-all build-dev minify copy zip",
"build-dev": "npm-run-all clean lint-errors build:js build:css build:lang build:test",
"build-dev": "npm-run-all clean lint-errors build:js build:css build:lang build:test build:types",
"build:test": "npm-run-all build:test:*",
"build:test:a11y": "shx cp sandbox/descriptions.html.example sandbox/descriptions.test-a11y.html",
"build:test:browserify": "browserify test/require/browserify.js -o test/dist/browserify.js",
Expand All @@ -36,6 +37,7 @@
"build:js": "rollup -c",
"build:css": "npm-run-all build:css:*",
"build:css:cdn": "sass --load-path='./' --load-path='./node_modules/' --no-source-map src/css/vjs-cdn.scss dist/alt/video-js-cdn.css",
"build:types": "tsc",
"postbuild:css:cdn": "postcss --verbose --config postcss.config.js -d dist/alt dist/alt/video-js-cdn.css",
"build:css:default": "sass --load-path='./' --load-path='./node_modules/' --no-source-map src/css/vjs.scss dist/video-js.css",
"postbuild:css:default": "postcss --verbose --config postcss.config.js -d dist/ dist/video-js.css",
Expand All @@ -52,6 +54,7 @@
"watch": "npm-run-all -p watch:*",
"watch:lang": "chokidar --initial 'lang/**/!(zh-Hans|zh-Hant)*.json' -c 'npm run build:lang'",
"watch:rollup": "rollup -c -w --no-progress",
"watch:types": "tsc -w",
"watch:css": "npm-run-all -p build:css:default build:css:cdn watch:css:*",
"watch:css:default": "npm run build:css:default -- --watch",
"watch:css:cdn": "npm run build:css:cdn -- --watch",
Expand Down Expand Up @@ -103,6 +106,7 @@
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"@rollup/plugin-replace": "^2.4.1",
"@types/node": "^18.8.3",
"access-sniff": "^3.2.0",
"autoprefixer": "^10.2.5",
"bestzip": "^2.2.0",
Expand Down Expand Up @@ -156,6 +160,7 @@
"shx": "^0.3.2",
"sinon": "^11.1.1",
"tui-jsdoc-template": "^1.2.2",
"typescript": "^4.8.4",
"uglify-js": "^3.6.0",
"unified": "^7.0.2",
"videojs-generate-karma-config": "^8.0.1",
Expand Down
5 changes: 4 additions & 1 deletion src/js/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Component {

/**
* A callback that is called when a component is ready. Does not have any
* paramters and any callback value will be ignored.
* parameters and any callback value will be ignored.
*
* @callback Component~ReadyCallback
* @this Component
Expand Down Expand Up @@ -700,6 +700,9 @@ class Component {
* Different from event listeners in that if the ready event has already happened
* it will trigger the function immediately.
*
* @param {Component~ReadyCallback} fn
* Function that gets called when the `Component` is ready.
*
* @return {Component}
* Returns itself; method can be chained.
*/
Expand Down
Loading

0 comments on commit 0545df5

Please sign in to comment.