diff --git a/types/word-list-json/index.d.ts b/types/word-list-json/index.d.ts new file mode 100644 index 0000000000..e221d3795f --- /dev/null +++ b/types/word-list-json/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for word-list-json 0.2 +// Project: https://github.com/sindresorhus/word-list +// Definitions by: Dovid Meiseles +// 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; diff --git a/types/word-list-json/tsconfig.json b/types/word-list-json/tsconfig.json new file mode 100644 index 0000000000..8f34d90409 --- /dev/null +++ b/types/word-list-json/tsconfig.json @@ -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" + ] +} diff --git a/types/word-list-json/tslint.json b/types/word-list-json/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/word-list-json/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/word-list-json/word-list-json-tests.ts b/types/word-list-json/word-list-json-tests.ts new file mode 100644 index 0000000000..d12edf731d --- /dev/null +++ b/types/word-list-json/word-list-json-tests.ts @@ -0,0 +1,5 @@ +import wordListJson from 'word-list-json'; + +wordListJson.lengths; // $ExpectType Lengths + +wordListJson; // $ExpectType Words