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

Typescript type fixes + example code in .tsx #444

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

tasinet
Copy link

@tasinet tasinet commented Apr 19, 2020

A few small typescript bugfixes & improvements: (which got this ball rolling)

  • prop apiKey missing
  • playlistId was not string[]
  • onReady takes no args
  • on[Stuff] do take args
  • YouTubeState and on[Stuff] callbacks properly typed

A bigger one: A typescript version of the example.

I have named this ReactNativeYouTubeExample.typescript.tsx so that there is no confusion as to which one is in play, along with instructions at the top to rename before use. I took a few liberties but nothing major. Let me know if you want any changes.

Utility stuff:

  • The package.json inside example/ had out of date version references to 2.0.0, this includes that fix
  • packages for typescript in example package.json
  • tsconfig.json
    I'm not sure if this one could be leaner or if it makes much difference.

Tests

  • updated typescript tests
  • tested with real Android device, seems to work

TODO

  • There's a type to doublecheck - is quality in the quality callback a string? Or enum?
  • iOS Test with typescript example app?

@fend25
Copy link

fend25 commented May 12, 2020

@davidohayon669 could you please review and merge this PR? In TS project I have an annoying error in any way, whether there is apiKey or not, because propTypes require it when the TS types haven't it.

Also there is an already issue #452, we (users) really need it. Thank you.

@tasinet
Copy link
Author

tasinet commented Jun 20, 2020

@davidohayon669 Any thoughts or feedback on this? Looking forward to some kind of progress, if at possible. Feel free to reach out privately as well. Thanks!

@davidtom
Copy link

davidtom commented May 5, 2021

Any updates on this PR? Getting these type fixes in would really make my dev experience with this library much better.

@tasinet thanks for opening this by the way! And @davidohayon669 thanks for the library, been really nice to work with 😄

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.

3 participants