-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Typescript definitions for all exports #953
Comments
I don’t use Typescript, but I welcome any PRs that add definitions to the codebase in a clean way. |
I'm going to close this off as there seems to be no value in keeping it open. Like I said before, any PRs adding better TS support will be welcome. |
Hello there, I'm working on a PR that fixes this. I have one question: |
Hey @JuanM04. Awesome work on the PR. I'm just looking through it now.
As of react-player/src/ReactPlayer.js Lines 120 to 128 in d47aa03
|
types for custom players would be awesome too |
interface ReactPlayerCustomPlayer {
//static canPlay?():boolean,
//static canEnablePIP?():boolean,
//static loopOnEnded?:boolean,
//static forceLoad?:boolean,
load(url:string, isReady:boolean|undefined),
play():void,
pause():void,
stop():void,
seekTo(amount:number):void,
mute():void,
unmute():void,
setVolume(fraction:number):void,
setPlaybackRate?(rate:number):void,
setLoop?(loop:boolean):void,
getDuration():number|null,
getCurrentTime():number|null,
getSecondsLoaded():number|null,
enablePIP?():void,
disablePIP?():void,
} |
Manual merge of cookpete/react-player#1098 Fixes cookpete/react-player#953
Manual merge of cookpete/react-player#1098 Fixes cookpete/react-player#953
Current Behavior
Typescript definitions for the individual players (react-player/wistia, react-player/youtube, etc...) are missing.
e.g.,
As a result, I need to either
which isn't exactly great because now props such as
onBuffered
,onBufferEnded
,onEnablePIP
, etc... that WistiaPlayer really doesn't support noop and creates a confusing developer experience,OR
Expected Behavior
Expect that if I use any of the other exports (react-player/wistia, react-player/youtube, etc...) they're automatically typed and I don't need to create my own typings for them.
The text was updated successfully, but these errors were encountered: