Skip to content

Commit

Permalink
Merge pull request #10 from shiwano/master
Browse files Browse the repository at this point in the history
Add TypeScript declaration file
  • Loading branch information
dastoori authored Aug 28, 2020
2 parents 12bcd26 + f54e986 commit c03cc90
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Generate unique and beautiful colors from any texts or numbers",
"author": "Rasool Dastoori",
"main": "dist/uniqolor.js",
"types": "src/index.d.ts",
"keywords": [
"uniqolor",
"uniqcolor",
Expand Down
21 changes: 21 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
declare module "uniqolor" {
interface Options {
format?: "rgb" | "hsl" | "hex";
saturation?: number | number[];
lightness?: number | number[];
differencePoint?: number;
}

interface Color {
color: string;
isLight: boolean;
}

interface Uniqolor {
(value: string | number, options?: Options): Color;
random: (options?: Options) => Color;
}

const uniqolor: Uniqolor;
export = uniqolor;
}

0 comments on commit c03cc90

Please sign in to comment.