From 0a1880476136b74a6bfd7577d6da851f06b06780 Mon Sep 17 00:00:00 2001 From: vectronic Date: Fri, 13 Nov 2020 15:10:29 +0000 Subject: [PATCH] fix: mistaken version of interface --- index.d.ts | 2 +- lib/encoder.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 4c3e680..8de7a1c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -28,5 +28,5 @@ declare module "@vingle/bmp-js" { height: number; }, fromRGBA?: boolean): Buffer; - export function decode(buf: Buffer, toRGBA?: boolean): Bitmap; + export function decode(buf: Buffer): Bitmap; } diff --git a/lib/encoder.js b/lib/encoder.js index bd65467..c589bcc 100644 --- a/lib/encoder.js +++ b/lib/encoder.js @@ -6,10 +6,10 @@ * */ -function BmpEncoder(imgData, fromRGBA){ +function BmpEncoder(imgData){ this.buffer = imgData.data; - this.fromRGBA = !!fromRGBA; + this.fromRGBA = !!imgData.fromRGBA; this.width = imgData.width; this.height = imgData.height; this.extraBytes = this.width%4;