From c693da26678828accdb6e02bbef2ee511dc35c9a Mon Sep 17 00:00:00 2001 From: DovidM Date: Thu, 14 Dec 2017 15:49:23 -0500 Subject: [PATCH] Added typing --- types/word-list-json/index.d.ts | 40 +++++++-------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/types/word-list-json/index.d.ts b/types/word-list-json/index.d.ts index 0dec6547e2..4c9ffb751f 100644 --- a/types/word-list-json/index.d.ts +++ b/types/word-list-json/index.d.ts @@ -1,39 +1,15 @@ // Type definitions for word-list-json 0.2 // Project: https://github.com/sindresorhus/word-list -// Definitions by: My Self +// Definitions by: Dovid Meiseles // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/*~ If this module is a UMD module that exposes a global variable 'myLib' when - *~ loaded outside a module loader environment, declare that global here. - *~ Otherwise, delete this declaration. - */ -export as namespace myLib; - -/*~ If this module has methods, declare them as functions like so. - */ -export function myMethod(a: string): string; -export function myOtherMethod(a: number): number; - /*~ You can declare types that are available via importing the module */ -export interface someType { - name: string; - length: number; - extras?: string[]; +interface Lengths { + [key: string]: number; } +export const words: string[]; +export const lengths: Lengths; -/*~ You can declare properties of the module using const, let, or var */ -export const myField: number; - -/*~ If there are types, properties, or methods inside dotted names - *~ of the module, declare them inside a 'namespace'. - */ -export namespace subProp { - /*~ For example, given this definition, someone could write: - *~ import { subProp } from 'yourModule'; - *~ subProp.foo(); - *~ or - *~ import * as yourMod from 'yourModule'; - *~ yourMod.subProp.foo(); - */ - export function foo(): void; -} \ No newline at end of file +export default interface Words { + words: typeof words & typeof lengths; +}