From fbed47f8cf462aa6436fe1877f0095f4c9812017 Mon Sep 17 00:00:00 2001 From: Eduardo Garcia Date: Sat, 18 Mar 2017 15:44:10 +0100 Subject: [PATCH 1/2] Add missing FileResizeOptions fields --- ng-file-upload/index.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ng-file-upload/index.d.ts b/ng-file-upload/index.d.ts index d9aadbd2d5..cc5a59b2bf 100644 --- a/ng-file-upload/index.d.ts +++ b/ng-file-upload/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Angular File Upload 11.1.1 +// Type definitions for Angular File Upload 12.2 // Project: https://github.com/danialfarid/ng-file-upload -// Definitions by: John Reilly +// Definitions by: John Reilly , +// Eduardo Garcia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -103,10 +104,12 @@ declare module 'angular' { interface FileResizeOptions { centerCrop?: boolean; height?: number; - ratio?: number; + pattern?: string; + ratio?: number | string; resizeIf?: ResizeIfFunction; restoreExif?: boolean; quality?: number; + type?: string; width?: number; } From 33f1fc02b72705132ddb57375858f7c47f34f895 Mon Sep 17 00:00:00 2001 From: Eduardo Garcia Date: Sat, 18 Mar 2017 15:44:29 +0100 Subject: [PATCH 2/2] Update tests with new FileResizeOptions fields --- ng-file-upload/ng-file-upload-tests.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ng-file-upload/ng-file-upload-tests.ts b/ng-file-upload/ng-file-upload-tests.ts index 08fbafdb6b..cc7f98d5bf 100644 --- a/ng-file-upload/ng-file-upload-tests.ts +++ b/ng-file-upload/ng-file-upload-tests.ts @@ -85,9 +85,11 @@ class UploadController { ratio: 0.9, centerCrop: true, restoreExif: true, - resizeIf: (width: number, height: number) => { + resizeIf: (width: number, height: number) => { return true; - } + }, + pattern: '.jpg', + type: 'image/jpeg' }) .then((resizedFile) => { console.log(resizedFile);