Merge pull request #22218 from DovidM/word-list-json

Created typings for word-list-json npm package
This commit is contained in:
Arthur Ozga
2017-12-22 18:01:05 -08:00
committed by GitHub
4 changed files with 49 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
// Type definitions for word-list-json 0.2
// Project: https://github.com/sindresorhus/word-list
// Definitions by: Dovid Meiseles <https://github.com/dovidm>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
interface Lengths {
[key: string]: number;
}
export const lengths: Lengths;
type wordsArray = string[];
interface Words extends wordsArray {
lengths: Lengths;
}
declare const words: Words;
export default words;
+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",
"word-list-json-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
@@ -0,0 +1,5 @@
import wordListJson from 'word-list-json';
wordListJson.lengths; // $ExpectType Lengths
wordListJson; // $ExpectType Words