Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TypeScript definition #12

Merged
merged 3 commits into from Feb 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions 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;
4 changes: 4 additions & 0 deletions index.test-d.ts
@@ -0,0 +1,4 @@
import {expectType} from 'tsd';
import fixPath from '.';

expectType<void>(fixPath());
9 changes: 6 additions & 3 deletions package.json
Expand Up @@ -13,10 +13,11 @@
"node": ">=8"
},
"scripts": {
"test": "xo && ava"
"test": "xo && ava && tsd"
},
"files": [
"index.js"
"index.js",
"index.d.ts"
],
"keywords": [
"fix",
Expand All @@ -36,6 +37,8 @@
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.11.0",
"xo": "^0.24.0"
}
},
"types": "index.d.ts"
}