define interface for 'this' object when executing a task

This commit is contained in:
Alex Varju
2013-09-24 15:04:39 -07:00
parent 45fdce7894
commit abb169542f
+38 -1
View File
@@ -175,9 +175,46 @@ interface IGruntFileObject {
findup: any;
}
////////////////
// 'this' when executing within a task
// http://gruntjs.com/api/inside-tasks
////////////////
interface IGruntTaskThis {
async(): (err:any) => void;
requires(...taskNames: string[]): void;
requiresConfig(...props: string[]): void;
name: string;
nameArgs: string;
args: string[];
flags: any;
errorCount: number;
options(defaults?: Object): any;
}
////////////////
// 'this' when executing within a multitask
// http://gruntjs.com/api/inside-tasks
////////////////
interface IGruntMultiTaskThis extends IGruntTaskThis {
target: string;
files: IGruntFileArray[];
filesSrc: string[];
data: any;
}
////////////////
// Files array format
// http://gruntjs.com/configuring-tasks#files-array-format
////////////////
interface IGruntFileArray {
src: string[];
dest: string;
nonull?: boolean;
filter?: any;
}
////////////////
/// Globally called export function module.exports
////////////////
declare var exports: (grunt: IGrunt) => void;
declare var exports: (grunt: IGrunt) => void;