From b20dd136f7ee69cb697a668c11e62b56f194241a Mon Sep 17 00:00:00 2001 From: Matt Magurany Date: Fri, 4 Sep 2015 17:22:09 -0400 Subject: [PATCH] Add oboe node() function overload that accepts a map of callbacks. --- oboe/oboe.d.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/oboe/oboe.d.ts b/oboe/oboe.d.ts index 6e6ed650b..63d51796b 100644 --- a/oboe/oboe.d.ts +++ b/oboe/oboe.d.ts @@ -10,10 +10,9 @@ declare module "oboe" { function oboe(url: string): oboe.Oboe; function oboe(options: oboe.Options): oboe.Oboe; - function oboe(stream: stream.Readable) : oboe.Oboe; + function oboe(stream: stream.Readable): oboe.Oboe; module oboe { - var drop: {}; interface Oboe { @@ -22,6 +21,7 @@ declare module "oboe" { fail(callback: (result: FailReason) => void): Oboe; node(pattern: string, callback: CallbackSignature): Oboe; + node(patterns: PatternMap): Oboe; on(event: string, pattern: string, callback: CallbackSignature): Oboe; on(eventPattern: string, callback: CallbackSignature): Oboe; @@ -33,14 +33,14 @@ declare module "oboe" { removeListener(event: string, pattern: string, callback: CallbackSignature): Oboe; start(callback: (status: number, headers: Object) => void): Oboe; - + abort():void; source: string; } interface CallbackSignature { - (node: any, pathOrHeaders: any, ancestors: Object[]): any; + (node: any, pathOrHeaders: any, ancestors: Object[]): any; } interface Options { @@ -58,8 +58,11 @@ declare module "oboe" { body?: string; jsonBody?: Object; } + + interface PatternMap { + [pattern: string]: CallbackSignature + } } export = oboe; } -