Merge pull request #15240 from thewarpaint/add-missing-file-resize-options-fields

[ng-file-upload] Add missing file resize options fields
This commit is contained in:
John Reilly
2017-03-18 15:20:40 +00:00
committed by GitHub
2 changed files with 10 additions and 5 deletions
+6 -3
View File
@@ -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 <https://github.com/johnnyreilly>
// Definitions by: John Reilly <https://github.com/johnnyreilly>,
// Eduardo Garcia <https://github.com/thewarpaint>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="angular" />
@@ -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;
}
+4 -2
View File
@@ -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);