From 860b409ed936cf7e1dce27a6f9e000cae751e82f Mon Sep 17 00:00:00 2001 From: Adam <23192421+shenphen@users.noreply.github.com> Date: Thu, 22 Nov 2018 15:51:55 +0100 Subject: [PATCH 1/3] Update index.d.ts with replace function overload Change due to the documentation of cropperjs (https://www.npmjs.com/package/cropperjs#replaceurl-hassamesize). --- types/cropperjs/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/cropperjs/index.d.ts b/types/cropperjs/index.d.ts index 30556e11fc..6e48bdae49 100644 --- a/types/cropperjs/index.d.ts +++ b/types/cropperjs/index.d.ts @@ -428,6 +428,13 @@ declare class cropperjs { * @param url A new image url */ replace(url: string): void; + + /** + * Replace the image's src and rebuild the cropper. If the new image has the same size with the old one, then it will not rebuilt the cropper and only update the urls of all related images. This can be used for applying filters. + * @param url A new image url + * @param hasSameSize (Default: false) + */ + replace(url: string, hasSameSize: boolean): void; /** * Enable (unfreeze) the cropper. From aa0097e633b912dbf22a0ce94c574da8ef92c970 Mon Sep 17 00:00:00 2001 From: Adam <23192421+shenphen@users.noreply.github.com> Date: Thu, 29 Nov 2018 08:52:59 +0100 Subject: [PATCH 2/3] fix travis errors --- types/cropperjs/index.d.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/types/cropperjs/index.d.ts b/types/cropperjs/index.d.ts index 6e48bdae49..d7be9dbc39 100644 --- a/types/cropperjs/index.d.ts +++ b/types/cropperjs/index.d.ts @@ -426,15 +426,9 @@ declare class cropperjs { /** * Replace the image's src and rebuild the cropper. * @param url A new image url + * @param hasSameSize If the new image has the same size with the old one, then it will not rebuilt the cropper and only update the urls of all related images. */ - replace(url: string): void; - - /** - * Replace the image's src and rebuild the cropper. If the new image has the same size with the old one, then it will not rebuilt the cropper and only update the urls of all related images. This can be used for applying filters. - * @param url A new image url - * @param hasSameSize (Default: false) - */ - replace(url: string, hasSameSize: boolean): void; + replace(url: string, hasSameSize: boolean = false): void; /** * Enable (unfreeze) the cropper. From 0b111f9e2bbccd414a2c522b2d7ffba65bda199a Mon Sep 17 00:00:00 2001 From: Adam <23192421+shenphen@users.noreply.github.com> Date: Fri, 30 Nov 2018 08:14:29 +0100 Subject: [PATCH 3/3] Update index.d.ts --- types/cropperjs/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/cropperjs/index.d.ts b/types/cropperjs/index.d.ts index d7be9dbc39..d444c20705 100644 --- a/types/cropperjs/index.d.ts +++ b/types/cropperjs/index.d.ts @@ -426,9 +426,9 @@ declare class cropperjs { /** * Replace the image's src and rebuild the cropper. * @param url A new image url - * @param hasSameSize If the new image has the same size with the old one, then it will not rebuilt the cropper and only update the urls of all related images. + * @param hasSameSize If the new image has the same size with the old one, then it will not rebuilt the cropper and only update the urls of all related images. (Default: false) */ - replace(url: string, hasSameSize: boolean = false): void; + replace(url: string, hasSameSize?: boolean): void; /** * Enable (unfreeze) the cropper.