mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
grunt - fix grunt.file.expand errors (#29299)
- patterns can be a string or a string array - options can have a 'cwd' property
This commit is contained in:
committed by
Wesley Wigham
parent
1748f1af66
commit
eb7be7c32c
@@ -133,4 +133,9 @@ exports.exports = function(grunt: IGrunt) {
|
||||
let myTest = function (grunt: IGrunt) {
|
||||
grunt.file.expand(['*.ts']);
|
||||
grunt.file.expand('*.ts');
|
||||
|
||||
// 'cwd' in options, and string pattern
|
||||
grunt.file.expand({
|
||||
cwd: '.'
|
||||
}, '*.ts');
|
||||
}
|
||||
|
||||
8
types/grunt/index.d.ts
vendored
8
types/grunt/index.d.ts
vendored
@@ -446,7 +446,7 @@ declare namespace grunt {
|
||||
* grunt.file.setBase or the --base command-line option.
|
||||
*/
|
||||
expand(patterns: string | string[]): string[];
|
||||
expand(options: IFilesConfig, patterns: string[]): string[];
|
||||
expand(options: IFilesConfig, patterns: string | string[]): string[];
|
||||
|
||||
/**
|
||||
* Returns an array of src-dest file mapping objects.
|
||||
@@ -595,6 +595,12 @@ declare namespace grunt {
|
||||
// filter?: string
|
||||
// filter?: (src: string) => boolean
|
||||
filter?: any;
|
||||
|
||||
/**
|
||||
* Patterns will be matched relative to this path, and all returned filepaths will
|
||||
* also be relative to this path.
|
||||
*/
|
||||
cwd?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user