vanilla-js-wheel-zoom
vanilla-js-wheel-zoom copied to clipboard
not sure how to use with typescript
I've seen you have a index.d.ts which, to me, means that your library supports types for TS.
when using
import WZoom from 'vanilla-js-wheel-zoom'
const wzoom = WZoom.create(img, { maxScale: 10, speed: 5 })
the inferred type of wzoom is any
and when using
import WZoom from 'vanilla-js-wheel-zoom'
const wzoom: WZoom = WZoom.create(img, { maxScale: 10, speed: 5 })
I get the error : Cannot use namespace 'WZoom' as a type
with
import WZoom from 'vanilla-js-wheel-zoom'
const wzoom: InstanceType<typeof WZoom> = WZoom.create(img, { maxScale: 10, speed: 5 })
the inferred type of wzoom is still any
I am not sure what is the proper way to do this
Hi. If possible, please send me a PR. Unfortunately, I am unable to answer your question right now.