[gray-percentage] new typings (#38661)

This commit is contained in:
Luís Rodrigues
2019-09-27 08:56:57 -07:00
committed by Ben Lichtman
parent a960c0bd92
commit 7b9dc4408e
4 changed files with 48 additions and 0 deletions
@@ -0,0 +1,12 @@
import grayPercentage = require('gray-percentage');
grayPercentage(1);
grayPercentage(1, 1);
grayPercentage(1, 'cool');
grayPercentage(1, 'slate');
grayPercentage(1, 'warm');
grayPercentage(1, 1, true);
function testReturnValue(value: string): void {}
testReturnValue(grayPercentage(1));
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for gray-percentage 2.0
// Project: https://github.com/KyleAMathews/gray-percentage
// Definitions by: Luis Rodrigues <https://github.com/goblindegook>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = grayPercentage;
declare function grayPercentage(
lightness: number,
hue?: number | 'cool' | 'slate' | 'warm',
darkBackground?: boolean,
): string;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"gray-percentage-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }