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

wheelZoom option work but an error is detected #61

Open
matatti-sogilis opened this issue Apr 2, 2020 · 1 comment
Open

wheelZoom option work but an error is detected #61

matatti-sogilis opened this issue Apr 2, 2020 · 1 comment

Comments

@matatti-sogilis
Copy link
Contributor

matatti-sogilis commented Apr 2, 2020

Hi,

I'm using the option wheelZoom, it's working fine but I got the following error.

45:18 Argument of type '{ wheelZoom: boolean; }' is not assignable to parameter of type 'false | options'.
  Object literal may only specify known properties, but 'wheelZoom' does not exist in type 'options'. Did you mean to write 'doWheelZoom'?
    43 |       .size('400px', '400px')
    44 |       .viewbox(0, 0, 1200, 1920)
  > 45 |       .panZoom({ wheelZoom: false });

Looking into your source code, in file svg.panzoom.js.d.ts

interface options {
  doPanning?: boolean
  doPinchZoom?: boolean
  doWheelZoom?: boolean
  panMouse?: MouseButton
  oneFingerPan?: boolean
  margins?: boolean | marginOptions
  zoomFactor?: number
  zoomMin?: number
  zoomMax?: number
}

But in src/svg.panzoom.js :
const doWheelZoom = options.wheelZoom ?? true

Thanks,

@Fuzzyma
Copy link
Member

Fuzzyma commented Apr 3, 2020

The typings are wrong. Feel free to fix and create PR. You can even do that directly on github without even forking and cloning. Just edit the file directly in your browser :)

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