diff --git a/types/chroma-js/chroma-js-tests.ts b/types/chroma-js/chroma-js-tests.ts index 53a3e912b8..82cfb7274d 100644 --- a/types/chroma-js/chroma-js-tests.ts +++ b/types/chroma-js/chroma-js-tests.ts @@ -182,3 +182,8 @@ function test_scale() { chroma.scale('RdYlBu'); chroma.scale('RdYlBu').padding(0.15); } + +function test_types() { + const color: chroma.Color = chroma('orange'); + const scale: chroma.Scale = chroma.scale('RdYlBu'); +} diff --git a/types/chroma-js/index.d.ts b/types/chroma-js/index.d.ts index 1b679b816a..41f7a36785 100644 --- a/types/chroma-js/index.d.ts +++ b/types/chroma-js/index.d.ts @@ -7,7 +7,7 @@ /** * Chroma.js is a tiny library for all kinds of color conversions and color scales. */ -declare namespace Chroma { +declare namespace chroma { interface ColorSpaces { rgb: [number, number, number]; rgba: [number, number, number, number]; @@ -353,7 +353,7 @@ declare namespace Chroma { } } -declare var chroma: Chroma.ChromaStatic; +declare var chroma: chroma.ChromaStatic; export = chroma; export as namespace chroma;