From 3cceead6e0d735be723b61273374a4fa1fba47f1 Mon Sep 17 00:00:00 2001 From: James O'Cull Date: Tue, 29 Dec 2015 14:53:28 -0500 Subject: [PATCH] lwip toBuffer calls should callback with Buffer instead of Image --- lwip/lwip.d.ts | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/lwip/lwip.d.ts b/lwip/lwip.d.ts index 63d2c701b..0f40c63d2 100644 --- a/lwip/lwip.d.ts +++ b/lwip/lwip.d.ts @@ -12,6 +12,10 @@ declare module "lwip" { interface ImageCallback { (err: any, image: Image): void; } + + interface BufferCallback { + (err: any, buffer: Buffer): void; + } /** * Open an image @@ -386,7 +390,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "jpg", callback: ImageCallback): void; + toBuffer(format: "jpg", callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -396,7 +400,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "jpg", params: JpegBufferParams, callback: ImageCallback): void; + toBuffer(format: "jpg", params: JpegBufferParams, callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -405,7 +409,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "png", callback: ImageCallback): void; + toBuffer(format: "png", callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -415,7 +419,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "png", params: PngBufferParams, callback: ImageCallback): void; + toBuffer(format: "png", params: PngBufferParams, callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -424,7 +428,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "gif", callback: ImageCallback): void; + toBuffer(format: "gif", callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -434,7 +438,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "gif", params: GifBufferParams, callback: ImageCallback): void; + toBuffer(format: "gif", params: GifBufferParams, callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -443,7 +447,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: string, callback: ImageCallback): void; + toBuffer(format: string, callback: BufferCallback): void; /** * Get encoded binary image data as a NodeJS Buffer. @@ -453,7 +457,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: ImageCallback): void; + toBuffer(format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: BufferCallback): void; /** * Write encoded binary image data directly to a file. @@ -848,7 +852,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "jpg", callback: ImageCallback): void; + toBuffer(format: "jpg", callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -858,7 +862,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "jpg", params: JpegBufferParams, callback: ImageCallback): void; + toBuffer(format: "jpg", params: JpegBufferParams, callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -867,7 +871,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "png", callback: ImageCallback): void; + toBuffer(format: "png", callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -877,7 +881,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "png", params: PngBufferParams, callback: ImageCallback): void; + toBuffer(format: "png", params: PngBufferParams, callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -886,7 +890,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: "gif", callback: ImageCallback): void; + toBuffer(format: "gif", callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -896,7 +900,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: "gif", params: GifBufferParams, callback: ImageCallback): void; + toBuffer(format: "gif", params: GifBufferParams, callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -905,7 +909,7 @@ declare module "lwip" { * * @param format Encoding format. */ - toBuffer(format: string, callback: ImageCallback): void; + toBuffer(format: string, callback: BufferCallback): void; /** * Execute batch and obtain a Buffer object @@ -915,7 +919,7 @@ declare module "lwip" { * @param format Encoding format. * @param params Format-specific parameters. */ - toBuffer(format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: ImageCallback): void; + toBuffer(format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: BufferCallback): void; /** * Execute batch and write to file