@types/image-blob-reduce
Advanced tools
Weekly downloads
Readme
npm install --save @types/image-blob-reduce
This package contains type definitions for image-blob-reduce (https://github.com/nodeca/image-blob-reduce#readme).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/image-blob-reduce.
// Type definitions for image-blob-reduce 4.1
// Project: https://github.com/nodeca/image-blob-reduce#readme
// Definitions by: Matthias Fischer <https://github.com/dotnetautor>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import type { Pica, PicaStatic } from 'pica';
interface InternalProperties {
image: HTMLImageElement;
image_url: string;
transform_width: number;
transform_height: number;
scale_factor: number;
out_canvas?: HTMLCanvasElement;
out_blob?: Blob;
}
type MethodNames = '_blob_to_image' | '_calculate_size' | '_transform' | '_create_blob' | '_cleanup';
declare namespace imageBlobReduce {
interface ImageBlobReduce {
init(): void;
use(plugin: (args: any[]) => any, ...args: any[]): ImageBlobReduce;
toBlob(blob: Blob, options?: ResizeOptions): Promise<Blob>;
toCanvas(blob: Blob, options?: ResizeOptions): Promise<HTMLCanvasElement>;
before(methodName: MethodNames, callback: (env: Env) => Promise<Env>): void;
after(methodName: MethodNames, callback: (env: Env) => Promise<Env>): void;
}
interface Options {
pica?: Pica;
}
interface Env extends InternalProperties {
blob: Blob;
opts: ResizeOptions;
}
interface ResizeOptions {
alpha?: boolean;
unsharpAmount?: number | undefined;
unsharpRadius?: number | undefined;
unsharpThreshold?: number | undefined;
cancelToken?: Promise<unknown> | undefined;
max?: number;
}
interface ImageBlobReduceStatic {
new (options?: Options): ImageBlobReduce;
(options?: Options): ImageBlobReduce;
pica: PicaStatic;
}
}
declare const imageBlobReduce: imageBlobReduce.ImageBlobReduceStatic;
export = imageBlobReduce;
These definitions were written by Matthias Fischer.
FAQs
TypeScript definitions for image-blob-reduce
The npm package @types/image-blob-reduce receives a total of 715 weekly downloads. As such, @types/image-blob-reduce popularity was classified as not popular.
We found that @types/image-blob-reduce demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.