chroma.js
chroma.js copied to clipboard
Property 'hue' does not exist on type 'Cubehelix'.
In a Vue / Typescript project, hue()
is not found on Cubehelix:
59:8 Property 'hue' does not exist on type 'Cubehelix'.
57 | .start(0)
58 | .rotations(1)
> 59 | .hue(3)
| ^
60 | .gamma(0.4)
61 | .lightness([0.6, 0.6])
62 | .scale()
Version: typescript 3.3.1, tslint 5.12.1
In node, no problem:
> chroma.cubehelix().start(0).rotations(1).hue(3).gamma(0.4).lightness([0.6, 0.6]).scale().colors(5)
[ '#ffab97', '#a4f96d', '#73f5ff', '#fca7ff', '#ffab97' ]
package.json:
"chroma-js": "^2.0.3",
"@types/chroma-js": "^1.4.1",
I think the hue()
function signature is just missing from @types/chroma-js
here though I didn't dig far.
After modifying @types/chroma-js/index.d.ts
, things appears to be compiling OK:
interface Cubehelix {
...
hue(h: number): Cubehelix;
...
}
I am pretty sure the issue should go to the people at DefinitelyTyped.