Merge pull request #31459 from BendingBender/skin-tone

[skin-tone] Add types
This commit is contained in:
Nathan Shively-Sanders
2018-12-17 09:10:25 -08:00
committed by GitHub
4 changed files with 51 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for skin-tone 1.0
// Project: https://github.com/sindresorhus/skin-tone#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = skinTone;
declare function skinTone(emoji: string, type: 0 | 1 | 2 | 3 | 4 | 5): string;
declare namespace skinTone {
const NONE: 0;
const WHITE: 1;
const CREAM_WHITE: 2;
const LIGHT_BROWN: 3;
const BROWN: 4;
const DARK_BROWN: 5;
}
+10
View File
@@ -0,0 +1,10 @@
import skinTone = require('skin-tone');
// $ExpectType string
skinTone('👍', 4);
skinTone('👍', skinTone.NONE);
skinTone('👍', skinTone.WHITE);
skinTone('👍', skinTone.CREAM_WHITE);
skinTone('👍', skinTone.LIGHT_BROWN);
skinTone('👍', skinTone.BROWN);
skinTone('👍', skinTone.DARK_BROWN);
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"skin-tone-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }