@types/downscale
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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 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: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by Gabriel Soicher.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/downscale

Weekly Downloads

1,202

Version

1.0.4

License

MIT

Unpacked Size

4.59 kB

Total Files

5

Last publish

Collaborators

  • types