mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
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:
Vendored
+6
-3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user