mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
[chroma-js] Renamed namespace so types visible.
Renamed namespace Chroma which contains all the types to chroma so it is merged with the exported variable chroma and the types are externally visible. Added corresponding test.
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user