Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions package-lock.json

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

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"url": "https://github.com/jwplayer/jwplayer-react/issues"
},
"main": "./lib/jwplayer-react.js",
"types": "types/jwplayer-react.d.ts",
"files": [
"lib",
"types"
],
"scripts": {
"build": "webpack && npm run badges:build:passing || npm run badges:build:failing",
"ci": "npm ci; npm run build; npm run test; npm run lint; npm run badges:license",
Expand All @@ -34,6 +39,7 @@
"@babel/preset-env": "7.16.11",
"@babel/preset-react": "7.16.7",
"@testing-library/react": "12.1.4",
"@types/jwplayer": "^8.28.4",
"@typescript-eslint/eslint-plugin": "5.59.6",
"@typescript-eslint/parser": "5.59.6",
"@wojtekmaj/enzyme-adapter-react-17": "0.6.6",
Expand Down
5 changes: 2 additions & 3 deletions src/jwplayer-react.d.ts → types/jwplayer-react.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
declare module '@jwplayer/jwplayer-react' {
import React from 'react';
import jwplayer from './jwplayer';
import type { ComponentType, HTMLProps } from 'react';

/**
* Example: {"2500":"High","1000":"Medium"}
Expand Down Expand Up @@ -99,7 +98,7 @@ declare module '@jwplayer/jwplayer-react' {
config?: JWPlayerConfig;
}

const JWPlayerComponent = React.Component<JWPlayerProps & React.HTMLProps<'video'>>;
const JWPlayerComponent: ComponentType<JWPlayerProps & HTMLProps<'video'>>;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use HTMLProps<HTMLVideoElement> instead of HTMLProps<'video'>> ?
The latter will hardly pick all the relevant types for a video element

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amowu could you please update? Would be awesome to make this available

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


export default JWPlayerComponent;
}