added string unions for luminosity, hue, format

Hue can also be a number
This commit is contained in:
feitzi
2016-09-20 19:28:57 +02:00
parent 24c81fd722
commit def0bc91b3
2 changed files with 16 additions and 42 deletions
+8 -21
View File
@@ -3,26 +3,13 @@
// Definitions by: Mathias Feitzinger <https://github.com/feitzi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace RandomColor {
interface RandomColorStatic {
declare function randomColor(options?: RandomColorOptions): string;
() : string;
(options : randomColorOptions): string;
}
interface randomColorOptions {
hue? : string;
luminosity? : string;
count? : string | number;
seed?: string;
format?: string;
}
}
declare var randomColor: RandomColor.RandomColorStatic;
declare module 'randomcolor' {
export = randomColor;
}
interface RandomColorOptions {
hue? : number | "red" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "monochrome" | "random";
luminosity? : "bright" | "light" | "dark" | "random";
count? : number;
seed?: number | string;
format?: "hsvArray" | "hslArray" | "hsl" | "hsla" | "rgbArray"| "rgb"| "rgba"| "hex";
}
+8 -21
View File
@@ -3,26 +3,13 @@
// Definitions by: Mathias Feitzinger <https://github.com/feitzi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace RandomColor {
interface RandomColorStatic {
declare function randomColor(options?: RandomColorOptions): string;
() : string;
(options : randomColorOptions): string;
}
interface randomColorOptions {
hue? : string;
luminosity? : string;
count? : string | number;
seed?: string;
format?: string;
}
}
declare var randomColor: RandomColor.RandomColorStatic;
declare module 'randomcolor' {
export = randomColor;
}
interface RandomColorOptions {
hue? : number | "red" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "monochrome" | "random";
luminosity? : "bright" | "light" | "dark" | "random";
count? : number;
seed?: number | string;
format?: "hsvArray" | "hslArray" | "hsl" | "hsla" | "rgbArray"| "rgb"| "rgba"| "hex";
}