leongersen / noUiSlider

noUiSlider is a lightweight, ARIA-accessible JavaScript range slider with multi-touch and keyboard support. It is fully GPU animated: no reflows, so it is fast; even on older devices. It also fits wonderfully in responsive designs and has no dependencies.
https://refreshless.com/nouislider/
MIT License
5.64k stars 658 forks source link

type error in Range in latest version #1219

Open MMT-LD opened 1 year ago

MMT-LD commented 1 year ago

Hey!

i updated to 15.6.1 and since then i receive the below error.

Type '{ min: [number]; '10%': number[]; '50%': number[]; max: [number]; }' is not assignable to type 'Range'.
  Object literal may only specify known properties, and ''10%'' does not exist in type 'Range'.ts(2322)
nouislider.d.ts(112, 5): The expected type comes from property 'range' which is declared here on type 'Options'

Reverting to previous version fixes this issue for me.

i'm using 4.1.2 typescript. We can't upgrade this yet. Thought i would let you know.

leongersen commented 1 year ago

This type of template literal is supported from TypeScript 4.4 and was added as the type for the key in Range in #1218. I'm looking into what I can do to annotate this.