diff --git a/types/starwars-names/index.d.ts b/types/starwars-names/index.d.ts new file mode 100644 index 0000000000..54f4e17c3b --- /dev/null +++ b/types/starwars-names/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for starwars-names 1.6 +// Project: https://github.com/kentcdodds/starwars-names#readme +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace starwarsNames; +export const all: string[]; +export function random(): string; +export function random(number: number): string[]; diff --git a/types/starwars-names/starwars-names-tests.ts b/types/starwars-names/starwars-names-tests.ts new file mode 100644 index 0000000000..bb2f4dc232 --- /dev/null +++ b/types/starwars-names/starwars-names-tests.ts @@ -0,0 +1,5 @@ +import * as names from "starwars-names"; + +const allNames = names.all; +const randomName = names.random(); +const threeRandomNames = names.random(3); diff --git a/types/starwars-names/tsconfig.json b/types/starwars-names/tsconfig.json new file mode 100644 index 0000000000..009a9d6ef3 --- /dev/null +++ b/types/starwars-names/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", + "starwars-names-tests.ts" + ] +} diff --git a/types/starwars-names/tslint.json b/types/starwars-names/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/starwars-names/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }