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

Fix "TS2304: Cannot find name 'ToastType'." error in TS definitions + make message optional when updating #7

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

Conversation

benhodgson87
Copy link

@benhodgson87 benhodgson87 commented Nov 13, 2018

screen shot 2018-11-13 at 11 27 26

The current Typescript definitions throw a TS2304 error, because the ToastType import being used here (imported from the react-toastify package) is an interface, not a type definition - https://github.com/fkhadra/react-toastify/blob/master/index.d.ts#L299.

The type definition that needs to be matched against is actually TypeOptions - https://github.com/fkhadra/react-toastify/blob/master/index.d.ts#L70 - however this is not exported.

Seeing as a load of other types are being manually defined in the react-toastify-redux definitions file (eg. pauseOnHover, hideProgressBar) I think it makes sense to just manually define the types locally, until the core package exports the necessary types.

I've also changed the message option to be optional on the update() method definition; it's not required in the core package, as you may only want to update another option such as type.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 15

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 14: 0.0%
Covered Lines: 65
Relevant Lines: 65

💛 - Coveralls

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.

2 participants