1.0.4 • Published 6 months ago
@types/downscale v1.0.4
Installation
npm install --save @types/downscale
Summary
This package contains type definitions for downscale (https://github.com/ytiurin/downscale).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/downscale.
index.d.ts
// Type definitions for downscale 1.0
// Project: https://github.com/ytiurin/downscale
// Definitions by: Gabriel Soicher <https://github.com/Lunrtick>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
type ImageSource = File | HTMLImageElement | HTMLVideoElement | string;
interface DownscaleOptions {
imageType?: string | undefined;
quality?: number | undefined;
returnBlob?: boolean | undefined;
returnCanvas?: boolean | undefined;
sourceX?: number | undefined;
sourceY?: number | undefined;
}
/**
* Overloads that automatically type the return value based on the selected options
*/
declare function downscale(source: ImageSource, width: number, height: number, options?: DownscaleOptions & { returnBlob?: false | undefined; returnCanvas?: false | undefined; }): Promise<string>;
declare function downscale(source: ImageSource, width: number, height: number, options?: DownscaleOptions & { returnBlob: true; }): Promise<Blob>;
declare function downscale(source: ImageSource, width: number, height: number, options?: DownscaleOptions & { returnCanvas: true; }): Promise<HTMLCanvasElement>;
export = downscale;
export as namespace downscale;
Additional Details
- Last updated: Thu, 08 Jul 2021 09:08:53 GMT
- Dependencies: none
- Global values:
downscale
Credits
These definitions were written by Gabriel Soicher.