From 615b06ea0e8239b580ec3c251cc0c12251367450 Mon Sep 17 00:00:00 2001 From: Gerhard de Clercq Date: Sun, 17 Dec 2017 10:42:07 +0200 Subject: [PATCH] Export under default in d.ts The current typings do not work at all as they do not expect the function to be under 'default' and this means that either ts fails or your code does not work. My proposal here works but it suggests that a class exists even though it doens't but I am not sure how to do it in another way. Even though this is technically wrong it is better than what is now used. --- index.d.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/index.d.ts b/index.d.ts index d17ad36..66269fc 100644 --- a/index.d.ts +++ b/index.d.ts @@ -5,9 +5,12 @@ declare module "react-native-image-resizer" { size?: number; name?: string; } - export function createResizedImage( - uri: string, width: number, height: number, - format: "PNG" | "JPEG" | "WEBP", quality: number, - rotation?: number, outputPath?: string - ): Promise; + + export default class ImageResizer { + static createResizedImage( + uri: string, width: number, height: number, + format: "PNG" | "JPEG" | "WEBP", quality: number, + rotation?: number, outputPath?: string + ): Promise; + } }