Add types for expand-tilde closes jonschlinkert/expand-tilde#3

This commit is contained in:
Chris Arnesen
2018-11-21 13:11:29 +07:00
parent 28e745f92d
commit 12c172badf
4 changed files with 42 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
import expandTilde = require("expand-tilde");
expandTilde("~") // $ExpectType string
+16
View File
@@ -0,0 +1,16 @@
// Type definitions for expand-tilde 2.0
// Project: https://github.com/jonschlinkert/expand-tilde
// Definitions by: Chris Arnesen <https://github.com/carnesen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Bash-like tilde expansion for node.js.
* Expands a leading tilde (~) in a file path to the user home directory, or ~+ to the cwd.
*
* @param {string} filePath - a file path to expand
* @returns {string} the expanded file path
*/
declare function expandTilde(filePath: string): string;
export = expandTilde;
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"expand-tilde-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }