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.
This commit is contained in:
Gerhard de Clercq 2017-12-17 10:42:07 +02:00 committed by GitHub
parent cf535e3783
commit 615b06ea0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

13
index.d.ts vendored
View File

@ -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<Response>;
export default class ImageResizer {
static createResizedImage(
uri: string, width: number, height: number,
format: "PNG" | "JPEG" | "WEBP", quality: number,
rotation?: number, outputPath?: string
): Promise<Response>;
}
}