1.0.4 • Published 6 months ago

@types/downscale v1.0.4

Weekly downloads
40
License
MIT
Repository
github
Last release
6 months ago

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.

1.0.2

8 months ago

1.0.4

6 months ago

1.0.3

7 months ago

1.0.1

3 years ago

1.0.0

4 years ago