diff --git a/types/package-info/index.d.ts b/types/package-info/index.d.ts new file mode 100644 index 0000000000..d1030c9dae --- /dev/null +++ b/types/package-info/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for package-info 3.0 +// Project: https://github.com/AlessandroMinoccheri/package-info#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace info { + interface Package { + author: string; + description: string; + homepage: string; + license: string; + name: string; + version: string; + } +} + +declare function info(name: string): Promise; + +export = info; diff --git a/types/package-info/package-info-tests.ts b/types/package-info/package-info-tests.ts new file mode 100644 index 0000000000..41a3e9a36c --- /dev/null +++ b/types/package-info/package-info-tests.ts @@ -0,0 +1,10 @@ +import info = require('package-info'); + +info('package-info').then(data => { + data.author; // $ExpectType string + data.description; // $ExpectType string + data.homepage; // $ExpectType string + data.license; // $ExpectType string + data.name; // $ExpectType string + data.version; // $ExpectType string +}); diff --git a/types/package-info/tsconfig.json b/types/package-info/tsconfig.json new file mode 100644 index 0000000000..5525b695b6 --- /dev/null +++ b/types/package-info/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "package-info-tests.ts" + ] +} diff --git a/types/package-info/tslint.json b/types/package-info/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/package-info/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }