[globjoin] create types (#38908)

This commit is contained in:
Gareth Jones 2019-10-09 12:16:01 +13:00 committed by Armando Aguirre
parent 7ea9422586
commit 9d8c69e5e0
4 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,5 @@
import join = require('globjoin');
join(); // $ExpectType string
join('1', '2', '3'); // $ExpectType string
join('1', '2', ['a', 'b']); // $ExpectType string[]

21
types/globjoin/index.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
// Type definitions for globjoin 0.1
// Project: https://github.com/amobiz/globjoin
// Definitions by: Gareth Jones <https://github.com/g-rath>
// 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 | string[]>): string[];
export = globjoin;

View File

@ -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"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }