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 Error when declaring a jBox tooltip as type 'Mouse' #172

Closed
fredclausen opened this issue Jun 18, 2021 · 2 comments
Closed

Typescript Error when declaring a jBox tooltip as type 'Mouse' #172

fredclausen opened this issue Jun 18, 2021 · 2 comments

Comments

@fredclausen
Copy link

fredclausen commented Jun 18, 2021

Typescript gives the following error

Argument of type '"Mouse"' is not assignable to parameter of type 'keyof jBoxOptionsMap'.

When compiling a jBox tooltip that is declared like this

const freq_tooltip = new jBox("Mouse", {

Adding the following to the jBoxOptionsMap interface (declared in jBox.d.ts) appears to rectify the issue

declare interface jBoxOptionsMap {
  Tooltip: jBox.jBoxOptions;
  Modal: jBox.jBoxOptions;
  Confirm: jBox.jBoxConfirmOptions;
  Notice: jBox.jBoxNoticeOptions;
  Image: jBox.jBoxImageOptions;
  Mouse: jBox.jBoxOptions;
}

But I'm not versed enough in either typescript or the jBox code base to know if that is a valid fix or not.

@StephanWagner
Copy link
Owner

Should be fixed in version v1.3.3

@fredclausen
Copy link
Author

Thank you!

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

No branches or pull requests

2 participants