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:
parent
cf535e3783
commit
615b06ea0e
|
@ -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>;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue