From 793e9f235f3eeab9e6ff366b13abd89689da42e3 Mon Sep 17 00:00:00 2001 From: Gavin Gregory Date: Thu, 26 Sep 2019 20:12:58 -0400 Subject: [PATCH] extended the OptimizedSvg interface to include path, and info width and height. (#38317) --- types/svgo/index.d.ts | 9 +++++++-- types/svgo/svgo-tests.ts | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/types/svgo/index.d.ts b/types/svgo/index.d.ts index 43eeff6654..f3d83ae944 100644 --- a/types/svgo/index.d.ts +++ b/types/svgo/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for svgo 1.2 +// Type definitions for svgo 1.3 // Project: https://github.com/svg/svgo // Definitions by: Bradley Ayers // Gilad Gray // Aankhen // Jan Karres +// Gavin Gregory // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -201,7 +202,11 @@ interface SvgInfo { interface OptimizedSvg { data: string; - info: object; + info: { + width: string; + height: string; + }; + path?: string; } declare class SVGO { diff --git a/types/svgo/svgo-tests.ts b/types/svgo/svgo-tests.ts index c06e6d61a5..84bdf1297d 100644 --- a/types/svgo/svgo-tests.ts +++ b/types/svgo/svgo-tests.ts @@ -27,5 +27,16 @@ const options: SVGO.Options = { svgo = new SVGO(options); // SVGO instance methods -svgo.optimize(``, { path: "filepath" }) - .then(result => result.data, error => error); +svgo + .optimize(``, { + path: 'filepath', + }) + .then( + result => { + result.data; + result.info.height; + result.info.width; + result.path; + }, + error => error, + );