From ec49f4dc87388078ba65dfb999629e969fa47576 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 2 Aug 2017 01:30:21 +0200 Subject: [PATCH] sharp: fix incorrect versions type (#18352) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an optional extended description… --- types/sharp/index.d.ts | 27 ++++++++++++++++++++++++++- types/sharp/sharp-tests.ts | 6 ++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/types/sharp/index.d.ts b/types/sharp/index.d.ts index 36b9af1ef7..216d325819 100644 --- a/types/sharp/index.d.ts +++ b/types/sharp/index.d.ts @@ -51,7 +51,32 @@ declare namespace sharp { /** An EventEmitter that emits a change event when a task is either queued, waiting for libuv to provide a worker thread, complete */ const queue: NodeJS.EventEmitter; /** An Object containing the version numbers of libvips and its dependencies. */ - const versions: string[]; + const versions: { + vips: string; + cairo?: string; + croco?: string; + exif?: string; + expat?: string; + ffi?: string; + fontconfig?: string; + freetype?: string; + gdkpixbuf?: string; + gif?: string; + glib?: string; + gsf?: string; + harfbuzz?: string; + jpeg?: string; + lcms?: string; + orc?: string; + pango?: string; + pixman?: string; + png?: string; + svg?: string; + tiff?: string; + webp?: string; + xml?: string; + zlib?: string; + }; const bool: BoolEnum; interface SharpInstance extends Duplex { diff --git a/types/sharp/sharp-tests.ts b/types/sharp/sharp-tests.ts index 86d01066dc..c7cb47fba0 100644 --- a/types/sharp/sharp-tests.ts +++ b/types/sharp/sharp-tests.ts @@ -200,3 +200,9 @@ let simd: boolean = sharp.simd(); simd = sharp.simd(true); // attempts to enable the use of SIMD, returning true if available + +const vipsVersion: string = sharp.versions.vips; + +if (sharp.versions.cairo) { + const cairoVersion: string = sharp.versions.cairo; +}