diff --git a/types/globjoin/globjoin-tests.ts b/types/globjoin/globjoin-tests.ts new file mode 100644 index 0000000000..b8f6e230bf --- /dev/null +++ b/types/globjoin/globjoin-tests.ts @@ -0,0 +1,5 @@ +import join = require('globjoin'); + +join(); // $ExpectType string +join('1', '2', '3'); // $ExpectType string +join('1', '2', ['a', 'b']); // $ExpectType string[] diff --git a/types/globjoin/index.d.ts b/types/globjoin/index.d.ts new file mode 100644 index 0000000000..aaf3a2fa64 --- /dev/null +++ b/types/globjoin/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for globjoin 0.1 +// Project: https://github.com/amobiz/globjoin +// Definitions by: Gareth Jones +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Joins paths and globs. + * + * Like Node's {@link https://nodejs.org/api/path.html#path_path_join_path1_path2 path.join()} + * that join all arguments together and normalize the resulting path, + * globjoin takes arbitrary number of paths and/or arrays of paths, + * join them together and take care of negative globs. + * + * @param globs + * + * @return the result glob, or array of globs if any of the paths/globs are array. + */ +declare function globjoin(...globs: string[]): string; +declare function globjoin(...globs: Array): string[]; + +export = globjoin; diff --git a/types/globjoin/tsconfig.json b/types/globjoin/tsconfig.json new file mode 100644 index 0000000000..c56b0cabf9 --- /dev/null +++ b/types/globjoin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "globjoin-tests.ts" + ] +} diff --git a/types/globjoin/tslint.json b/types/globjoin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/globjoin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }