UNPKG

javascript-binary-converter

Version:

A utility package to quickly handle and convert various Javascript binary objects

15 lines (14 loc) 599 B
import { ImageCreationConfig } from "../sharedTypes"; import BlobConverter from "./BlobConverter"; declare type ToImageConfig = Required<Pick<ImageCreationConfig, 'maxSize'>> & { validateImage?: boolean; }; export default class FileConverter extends BlobConverter { constructor(original: File); /** * Convert a File object to an image, whose src is a Blob. * Optionally supply a config object with maxSize, refering to the maximal height or width(depending on the proportions). */ toImage(config?: ToImageConfig): Promise<HTMLImageElement>; } export {};