mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #31314 from BendingBender/dir-glob
Add types for dir-glob
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import dirGlob = require('dir-glob');
|
||||
|
||||
dirGlob('index.js').then(files => {
|
||||
// ExpectType string[]
|
||||
files;
|
||||
});
|
||||
dirGlob(['index.js', 'test.js', 'fixtures']).then(files => {
|
||||
// ExpectType string[]
|
||||
files;
|
||||
});
|
||||
|
||||
dirGlob(['index.js', 'inner_folder'], { cwd: 'fixtures' });
|
||||
dirGlob(['lib/**', 'fixtures'], { files: ['test', 'unicorn'] });
|
||||
dirGlob(['lib/**', 'fixtures'], { extensions: ['js'] });
|
||||
|
||||
// ExpectType string[]
|
||||
dirGlob.sync('index.js');
|
||||
// ExpectType string[]
|
||||
dirGlob.sync(['index.js', 'test.js', 'fixtures']);
|
||||
|
||||
dirGlob.sync(['index.js', 'inner_folder'], { cwd: 'fixtures' });
|
||||
dirGlob.sync(['lib/**', 'fixtures'], { files: ['test', 'unicorn'] });
|
||||
dirGlob.sync(['lib/**', 'fixtures'], { extensions: ['js'] });
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for dir-glob 2.0
|
||||
// Project: https://github.com/kevva/dir-glob#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = dirGlob;
|
||||
|
||||
declare function dirGlob(input: string | string[], options?: dirGlob.Options): Promise<string[]>;
|
||||
|
||||
declare namespace dirGlob {
|
||||
function sync(input: string | string[], options?: Options): string[];
|
||||
|
||||
interface Options {
|
||||
extensions?: string[];
|
||||
files?: string[];
|
||||
cwd?: string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dir-glob-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user