[get-emoji] Add types

This commit is contained in:
Dimitri Benin 2018-12-16 12:36:33 +01:00
parent 39b514a4bb
commit 2433d05ab0
4 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,7 @@
import getEmoji, { emojiList } from 'get-emoji';
// $ExpectType string
getEmoji('rage');
// $ExpectType string[]
emojiList;

7
types/get-emoji/index.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
// Type definitions for get-emoji 2.0
// Project: https://github.com/conorhastings/get-emoji
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export default function getEmoji(emojiName: string): string;
export const emojiList: string[];

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",
"get-emoji-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }