From e88a5272edae42666fd7121e84a774c7ce54e50b Mon Sep 17 00:00:00 2001 From: Paul Vick Date: Wed, 19 Feb 2014 22:05:35 -0800 Subject: [PATCH] Fixes for jake definitions * There were a couple of definitions that were missing type decorations that would infer "any" implicitly. * Exec had four constructors that the actual jake object doesn't seem to have. Exec objects are always created using createExec. * The methods implementing node's EventEmitter didn't match the actual EventEmitter signatures, so I updated them. --- jake/jake.d.ts | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/jake/jake.d.ts b/jake/jake.d.ts index 349e08e52..6995abc83 100644 --- a/jake/jake.d.ts +++ b/jake/jake.d.ts @@ -114,7 +114,7 @@ declare module jake{ */ breakOnError?:boolean; } - export function exec(cmds:string[], callback?:()=>void, opts?:ExecOptions); + export function exec(cmds:string[], callback?:()=>void, opts?:ExecOptions):void; /** @@ -125,10 +125,6 @@ declare module jake{ * @event error When a shell-command */ export interface Exec extends NodeEventEmitter { - constructor(cmds:string[], callback?:()=>void, opts?:ExecOptions); - constructor(cmds:string[], opts?:ExecOptions, callback?:()=>void); - constructor(cmds:string, callback?:()=>void, opts?:ExecOptions); - constructor(cmds:string, opts?:ExecOptions, callback?:()=>void); append(cmd:string): void; run(): void; } @@ -208,11 +204,9 @@ declare module jake{ removeAllListeners(event?: string): NodeEventEmitter; setMaxListeners(n: number): void; listeners(event: string): Function[]; - emit(event: string, arg1?: any, arg2?: any): boolean; + emit(event: string, ...args: any[]): boolean; } - - export class DirectoryTask{ /** * @param name The name of the directory to create. @@ -275,7 +269,6 @@ declare module jake{ exclude(file:FileFilter[]): void; exclude(...file:FileFilter[]): void; - /** * Populates the FileList from the include/exclude rules with a list of * actual files @@ -377,12 +370,12 @@ declare module jake{ constructor(name:string, packageFiles:string[]); } - export function addListener(event: string, listener: Function); - export function on(event: string, listener: Function); - export function once(event: string, listener: Function): void; - export function removeListener(event: string, listener: Function): void; - export function removeAllListener(event: string): void; + export function addListener(event: string, listener: Function): NodeEventEmitter; + export function on(event: string, listener: Function): NodeEventEmitter; + export function once(event: string, listener: Function): NodeEventEmitter; + export function removeListener(event: string, listener: Function): NodeEventEmitter; + export function removeAllListener(event: string): NodeEventEmitter; export function setMaxListeners(n: number): void; - export function listeners(event: string): { Function; }[]; - export function emit(event: string, arg1?: any, arg2?: any): void; + export function listeners(event: string): Function[]; + export function emit(event: string, ...args: any[]): boolean; }