From 6e9c836e20feda680acae39786b5c004a4d32fd4 Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Tue, 28 Aug 2018 12:48:20 -0700 Subject: [PATCH] adds typings for the 'env-paths' package --- types/env-paths/env-paths-tests.ts | 4 ++++ types/env-paths/index.d.ts | 18 ++++++++++++++++++ types/env-paths/tsconfig.json | 19 +++++++++++++++++++ types/env-paths/tslint.json | 3 +++ 4 files changed, 44 insertions(+) create mode 100644 types/env-paths/env-paths-tests.ts create mode 100644 types/env-paths/index.d.ts create mode 100644 types/env-paths/tsconfig.json create mode 100644 types/env-paths/tslint.json diff --git a/types/env-paths/env-paths-tests.ts b/types/env-paths/env-paths-tests.ts new file mode 100644 index 0000000000..b143fb47b5 --- /dev/null +++ b/types/env-paths/env-paths-tests.ts @@ -0,0 +1,4 @@ +import envPaths = require('env-paths'); + +// $ExpectType Paths +envPaths('./'); diff --git a/types/env-paths/index.d.ts b/types/env-paths/index.d.ts new file mode 100644 index 0000000000..c759f3875c --- /dev/null +++ b/types/env-paths/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for env-paths 1.0 +// Project: https://github.com/sindresorhus/env-paths +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = envPaths; + +declare function envPaths(name: string, opts?: { suffix: string; }): envPaths.Paths; + +declare namespace envPaths { + interface Paths { + readonly data: string; + readonly config: string; + readonly cache: string; + readonly log: string; + readonly temp: string; + } +} diff --git a/types/env-paths/tsconfig.json b/types/env-paths/tsconfig.json new file mode 100644 index 0000000000..62dcbca022 --- /dev/null +++ b/types/env-paths/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "env-paths-tests.ts" + ] +} diff --git a/types/env-paths/tslint.json b/types/env-paths/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/env-paths/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}