From abb169542f9a92a406939f38367736bab596e92d Mon Sep 17 00:00:00 2001 From: Alex Varju Date: Tue, 24 Sep 2013 12:49:46 -0700 Subject: [PATCH] define interface for 'this' object when executing a task --- gruntjs/gruntjs.d.ts | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/gruntjs/gruntjs.d.ts b/gruntjs/gruntjs.d.ts index 68bc5475b..463721da9 100644 --- a/gruntjs/gruntjs.d.ts +++ b/gruntjs/gruntjs.d.ts @@ -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; \ No newline at end of file +declare var exports: (grunt: IGrunt) => void;