From 1e9567b281ca472686ac6905d53b3d853f34f4c1 Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Wed, 26 Dec 2018 00:49:49 +0100 Subject: [PATCH] [cwd] Add types --- types/cwd/cwd-tests.ts | 6 ++++++ types/cwd/index.d.ts | 9 +++++++++ types/cwd/tsconfig.json | 23 +++++++++++++++++++++++ types/cwd/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/cwd/cwd-tests.ts create mode 100644 types/cwd/index.d.ts create mode 100644 types/cwd/tsconfig.json create mode 100644 types/cwd/tslint.json diff --git a/types/cwd/cwd-tests.ts b/types/cwd/cwd-tests.ts new file mode 100644 index 0000000000..f1e6abc27b --- /dev/null +++ b/types/cwd/cwd-tests.ts @@ -0,0 +1,6 @@ +import cwd = require('cwd'); + +cwd(); // $ExpectType string +cwd('one/two.js'); // $ExpectType string +cwd('one', 'two.js'); // $ExpectType string +cwd(['one', 'two.js']); // $ExpectType string diff --git a/types/cwd/index.d.ts b/types/cwd/index.d.ts new file mode 100644 index 0000000000..3624944f7a --- /dev/null +++ b/types/cwd/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for cwd 0.10 +// Project: https://github.com/jonschlinkert/cwd +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = cwd; + +declare function cwd(pathSegments: string[]): string; +declare function cwd(...pathSegments: string[]): string; diff --git a/types/cwd/tsconfig.json b/types/cwd/tsconfig.json new file mode 100644 index 0000000000..65d5cac30e --- /dev/null +++ b/types/cwd/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", + "cwd-tests.ts" + ] +} diff --git a/types/cwd/tslint.json b/types/cwd/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cwd/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }