From 96420f5a0bde65bb90a73baa187528e41275d83f Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Wed, 26 Dec 2018 00:37:52 +0100 Subject: [PATCH] [npm-paths] Add types --- types/npm-paths/index.d.ts | 8 ++++++++ types/npm-paths/npm-paths-tests.ts | 5 +++++ types/npm-paths/tsconfig.json | 23 +++++++++++++++++++++++ types/npm-paths/tslint.json | 1 + 4 files changed, 37 insertions(+) create mode 100644 types/npm-paths/index.d.ts create mode 100644 types/npm-paths/npm-paths-tests.ts create mode 100644 types/npm-paths/tsconfig.json create mode 100644 types/npm-paths/tslint.json diff --git a/types/npm-paths/index.d.ts b/types/npm-paths/index.d.ts new file mode 100644 index 0000000000..67fc8c4772 --- /dev/null +++ b/types/npm-paths/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for npm-paths 2.0 +// Project: https://github.com/jonschlinkert/npm-paths +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = npmPaths; + +declare function npmPaths(cwd?: string | { cwd: string }): string[]; diff --git a/types/npm-paths/npm-paths-tests.ts b/types/npm-paths/npm-paths-tests.ts new file mode 100644 index 0000000000..b823783e57 --- /dev/null +++ b/types/npm-paths/npm-paths-tests.ts @@ -0,0 +1,5 @@ +import paths = require('npm-paths'); + +paths(); // $ExpectType string[] +paths('some/directory'); // $ExpectType string[] +paths({ cwd: 'some/directory' }); // $ExpectType string[] diff --git a/types/npm-paths/tsconfig.json b/types/npm-paths/tsconfig.json new file mode 100644 index 0000000000..86f00bbc85 --- /dev/null +++ b/types/npm-paths/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", + "npm-paths-tests.ts" + ] +} diff --git a/types/npm-paths/tslint.json b/types/npm-paths/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/npm-paths/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }