Skip to content

Commit 27a41ea

Browse files
committed
docs: update readme
1 parent 576c3bb commit 27a41ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ or
4949
### Main function ###
5050
```javascript
5151
// you should provide one of maxSizeMB, maxWidthOrHeight in the options
52-
const options = {
52+
const options: Options = {
5353
maxSizeMB: number, // (default: Number.POSITIVE_INFINITY)
5454
maxWidthOrHeight: number, // compressedFile will scale down by ratio to a point that width or height is smaller than maxWidthOrHeight (default: undefined)
5555
// but, automatically reduce the size to smaller than the maximum Canvas size supported by each browser.
@@ -64,7 +64,7 @@ const options = {
6464
initialQuality: number // optional, initial quality value between 0 and 1 (default: 1)
6565
}
6666

67-
imageCompression(file: File, options): Promise<File>
67+
imageCompression(file: File, options: Options): Promise<File>
6868
```
6969

7070
#### Caveat ####
@@ -79,7 +79,7 @@ imageCompression.getDataUrlFromFile(file: File): Promise<base64 encoded string>
7979
imageCompression.getFilefromDataUrl(dataUrl: string, filename: string, lastModified?: number): Promise<File>
8080
imageCompression.loadImage(url: string): Promise<HTMLImageElement>
8181
imageCompression.drawImageInCanvas(img: HTMLImageElement, fileType?: string): HTMLCanvasElement | OffscreenCanvas
82-
imageCompression.drawFileInCanvas(file: File): Promise<[ImageBitmap | HTMLImageElement, HTMLCanvasElement | OffscreenCanvas]>
82+
imageCompression.drawFileInCanvas(file: File, options?: Options): Promise<[ImageBitmap | HTMLImageElement, HTMLCanvasElement | OffscreenCanvas]>
8383
imageCompression.canvasToFile(canvas: HTMLCanvasElement | OffscreenCanvas, fileType: string, fileName: string, fileLastModified: number, quality?: number): Promise<File>
8484
imageCompression.getExifOrientation(file: File): Promise<number> // based on https://stackoverflow.com/a/32490603/10395024
8585
```

0 commit comments

Comments
 (0)