diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..df8b928 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,19 @@ +/** + * use typescript + * Fix the $PATH on macOS when run from a GUI app + * @example + * ``` + * import fixPath from 'fix-path'; + * + * console.log(process.env.PATH); + * //=> '/usr/bin' + * + * fixPath(); + * + * console.log(process.env.PATH); + * //=> '/usr/local/bin:/usr/bin' + * + * ``` + */ + +export default function fixPath(): void; \ No newline at end of file diff --git a/index.test-d.ts b/index.test-d.ts new file mode 100644 index 0000000..dbe17d3 --- /dev/null +++ b/index.test-d.ts @@ -0,0 +1,4 @@ +import {expectType} from 'tsd'; +import fixPath from '.'; + +expectType(fixPath()); diff --git a/package.json b/package.json index 9d0070d..2dd20ff 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,11 @@ "node": ">=8" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava && tsd" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "keywords": [ "fix", @@ -36,6 +37,8 @@ }, "devDependencies": { "ava": "^1.4.1", + "tsd": "^0.11.0", "xo": "^0.24.0" - } + }, + "types": "index.d.ts" }