Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TypeScript typings #29

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

amowu
Copy link
Contributor

@amowu amowu commented Mar 25, 2024

This PR will...

Add @jwplayer/jwplayer-react TypeScript types

Why is this Pull Request needed?

Cannot find module '@jwplayer/jwplayer-react' or its corresponding type declarations.

CleanShot 2024-03-25 at 16 10 20@2x

Are there any points in the code the reviewer needs to double check?

After npm publish, you can use tools like CodeSandbox to create a React TypeScript project to check whether import JWPlayer from '@jwplayer/jwplayer-react' will still display this error message.

Are there any Pull Requests open in other repos which need to be merged with this?

N/A

Addresses Issue(s):

#4

@jwplayer-robot
Copy link

Can one of the admins verify this patch?

Copy link

@bosworthco bosworthco left a comment

Choose a reason for hiding this comment

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

Legend

@@ -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'>>;

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

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
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

@vyktoremario vyktoremario left a comment

Choose a reason for hiding this comment

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

Left a comment

@bosworthco
Copy link

Minor update needed to type DidMountCallback = (DidMountCallbackArguments) => void;

See #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants