2018-03-26 16:04:04 +08:00
|
|
|
export interface ImageProcessorOptions {
|
|
|
|
|
dataUrl: string
|
|
|
|
|
width?: number
|
|
|
|
|
height?: number
|
|
|
|
|
quality: number
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ImageProcessorData {
|
|
|
|
|
dataUrl: string
|
|
|
|
|
blob: Blob
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-28 22:37:31 +08:00
|
|
|
export default function ImageProcessor(
|
2018-03-26 16:04:04 +08:00
|
|
|
options: ImageProcessorOptions,
|
|
|
|
|
callback?: (data: ImageProcessorData) => any): Promise<ImageProcessorData>
|