Skip to content

Commit 920752c

Browse files
authored
Merge pull request #27 from JoaquinBCh/feature/add-types-for-ts
feat/add types for typescript projects
2 parents 16fac27 + 3bd8e57 commit 920752c

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

lib/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
},
2727
"devDependencies": {
2828
"@babel/core": "^7.26.0",
29+
"rollup-plugin-dts": "^6.1.1",
2930
"@babel/preset-env": "^7.26.0",
3031
"@babel/preset-typescript": "^7.26.0",
3132
"@rollup/plugin-babel": "^6.0.4",

lib/rollup.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const typescript = require("@rollup/plugin-typescript")
66
const workerLoader = require("rollup-plugin-web-worker-loader")
77
const babel = require("@rollup/plugin-babel")
88
const terser = require("@rollup/plugin-terser")
9+
const dts = require("rollup-plugin-dts")
910
const sourceMaps = require("rollup-plugin-sourcemaps")
1011
const css = require("rollup-plugin-import-css")
1112
const pkg = require("./package.json")
@@ -64,4 +65,12 @@ module.exports = [
6465
],
6566
plugins: basePlugins,
6667
},
68+
{
69+
input: pkg.entry,
70+
output: {
71+
file: pkg.types,
72+
format: "es",
73+
},
74+
plugins: [dts.dts()],
75+
}
6776
]

package-lock.json

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/src/components/watch.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export default function Watch(props: { name: string }) {
5555
const handlePlayPause = () => {
5656
const playerInstance = player()
5757
if (!playerInstance) return
58-
5958
if (playerInstance.isPaused()) {
6059
playerInstance
6160
.togglePlayPause()

0 commit comments

Comments
 (0)